Error: attribute 'FieldsFactory' of 'namespace#' object is read-only
Hi,
I am referring to a previous post on this forum which explained how we can convert a field to scalar values.
rot_mat_f = dpf.FieldsFactory.CreateScalarField(1)
I am trying to use the same syntax in my code, but I am getting an error that says
attribute 'FieldsFactory' of 'namespace#' object is read-only
Please help me resolve this error. I am unable to find any details on "FieldsFactory" either in DPF documentation, scripting in mechanical document or within ANSYS scripting console.
Answers
-
Hi @Ashish , which version of WB are you using? I tested your command line and in 2023R2 on my computer I don't get an error:
0 -
@Pernelle Marone-Hitz I tried it on 2022r2 and it worked but I intend to use it on 2021r1 where it doesn't seem to work. Is there a compatibility limitation? Also, is there any documentation for FieldsFactory?
0 -
@Ashish Indeed this is a compatibility limitation, and that operator seems to be missing from the Mechanical doc. It is present in the PyDPF doc, though: https://dpf.docs.pyansys.com/version/dev/api/ansys.dpf.core.fields_factory.html
I've asked the DPF developers to add this to the documentation.0