From 36922016f71c6f9e532826f637adc418765408a8 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Thu, 7 Aug 2025 12:11:51 +0200 Subject: [PATCH] fix(tutorials): fix data_arrays.rst tutorial for 25R2 and older --- .../tutorials/data_structures/data_arrays.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/tutorials/data_structures/data_arrays.rst b/doc/source/user_guide/tutorials/data_structures/data_arrays.rst index 0f4cdd134a3..0bd05bed3b5 100644 --- a/doc/source/user_guide/tutorials/data_structures/data_arrays.rst +++ b/doc/source/user_guide/tutorials/data_structures/data_arrays.rst @@ -224,8 +224,14 @@ You can also create a |Field|, |StringField| or |PropertyField| from scratch bas # Set the data values my_property_field.data = [12, 25] # Set the location - my_property_field.location = dpf.locations.modal - # Set the element IDs + # For DPF 26R1 and above, directly set the location of the PropertyField + from ansys.dpf.core.check_version import meets_version + if meets_version(dpf.SERVER.version, "11.0"): + my_property_field.location = dpf.locations.modal + # For DPF older than 26R1, you must set the location with a Scoping + else: + my_property_field.scoping = dpf.Scoping(location=dpf.locations.modal) + # Set the mode IDs my_property_field.scoping.ids = [1, 2] # Print the property field print(my_property_field)