Closed clguenthe closed 1 month ago
FYI: I was able to track this issue back to the changes in this PR: https://github.com/ansys/pyaedt/commit/e44a1cd9fc06cf830fe1329cb6392215d47cb390 -> before that, the emissivity value was set and transferred to AEDT directly when it was set, since the update_material flag was True.
Hi @clguenthe, thanks for point out the issue. I think this was solved during the summer by @Samuelopez-ansys as I'm not able to reproduce the issue. Running mat = icepak.materials.add_surface_material("test", 10)
even without update creates the material properly.
But I agree that the info message is confusing, especially considering we don't need to manually update the material to see the correct properties. So I created the mentioned PR.
Before submitting the issue
Description of the bug
The following code will create a SurfaceMaterial in pyaedt and AEDT, but the emissivity value will be only visible inside pyaedt and is not transferred correctly to AEDT:
AEDT:
There is a log message
PyAEDT INFO: Material has been added. Edit it to update in Desktop.
but it is unclear what "edit" refers to in this case (since my material definition is already complete, I don't want to edit it any further), and it is also not mentioned in the documentation of this method that any further step is required to update the material definition inside AEDT.An explicit call to SurfaceMaterial.update() also does not update the emissivity:
AEDT:
The underlying problem seems to be that the
SurfaceMaterial.update()
method usesself._get_args()
to determine the arguments to be passed toself.odefinition_manager.EditSurfaceMaterial(self.name, args)
, which does not yield the emissivity:As a workaround, I can set the emissivity manually through the property setter. This works and the emissivity value is updated in AEDT. Furthermore, since the property setter explicitly calls
self._update_props("surface_emissivity", value)
it makes thesurface_emissivity
appear in the list of arguments returned by_get_args()
:Steps To Reproduce
see above.
Which Operating System are you using?
Windows
Which Python version are you using?
3.8
Installed packages
ansys-pythonnet==3.1.0rc3 attrs==23.2.0 cffi==1.16.0 clr-loader==0.2.6 defusedxml==0.7.1 fonttools==4.50.0 fpdf2==2.7.8 jsonschema==4.21.1 jsonschema-specifications==2023.12.1 pillow==10.2.0 plumbum==1.8.2 psutil==5.9.8 pyaedt==0.8.2 pycparser==2.21 pyedb==0.5.2 pytomlpp==1.0.13 pywin32==306 referencing==0.34.0 rpds-py==0.18.0 rpyc==6.0.0