ansys/pyaedt

Warning generated when setting the name of a 3D object in HFSS to the current name

Closed this issue · 0 comments

Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

Description of the bug

This applies to the Object3d in ansys.aedt.core.modeler.cad.object_3d.py
If I set the name of the object to the current name of the object, the following warning is triggered:
" is already used in current design"

It seems the problem is in the @name.setter function:
if obj_name not in self._primitives.object_names:
if obj_name != self._m_name:

Those 2 lines might work better if the order was swapped.

This isn't critical since it is only a warning, but it would be nice to remove the warning.

Steps To Reproduce

create a 3d object in HFSS by creating a box or whatever:
my_3d_object = modeler.create_box(position, dimensions_list, name="Something")

Then set the name to the current name:
my_3d_object.name = "Something"

The warning will trigger because the new name value is checked to be a member of the current list of HFSS names before it is checked to the same name already set for the object.

Which Operating System are you using?

Windows

Which Python version are you using?

3.8

Installed packages

aiohttp==3.8.3
aiosignal==1.2.0
altgraph==0.17.3
annotated-types==0.7.0
ansys-pythonnet==3.1.0rc3
appdirs==1.4.4
async-timeout==4.0.2
attrs==24.2.0
cachetools==5.3.0
cffi==1.17.0
charset-normalizer==2.1.1
clr-loader==0.2.6
contourpy==1.0.5
cycler==0.11.0
defusedxml==0.7.1
et-xmlfile==1.1.0
fonttools==4.37.3
fpdf2==2.7.9
frozenlist==1.3.1
idna==3.4
imageio==2.22.0
importlib_metadata==8.4.0
importlib_resources==6.4.4
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
kiwisolver==1.4.4
matplotlib==3.6.0
multidict==6.0.2
numpy==1.23.3
openpyxl==3.0.10
packaging==24.1
pandas==1.5.1
pefile==2023.2.7
pillow==10.4.0
pkgutil_resolve_name==1.3.10
plumbum==1.8.3
psutil==6.0.0
py2exe==0.13.0.0
pyaedt==0.10.0
pycparser==2.22
pydantic==2.8.2
pydantic_core==2.20.1
pyedb==0.25.0
pyinstaller==6.10.0
pyinstaller-hooks-contrib==2024.8
pyparsing==3.0.9
python-dateutil==2.8.2
pythonnet==3.0.1
pytomlpp==1.0.13
pytz==2022.2.1
pyvista==0.36.1
pywin32==306
pywin32-ctypes==0.2.3
referencing==0.35.1
rpds-py==0.20.0
rpyc==6.0.0
Rtree==1.3.0
scikit-rf==1.2.0
scipy==1.10.1
scooby==0.6.0
six==1.16.0
toml==0.10.2
typing_extensions==4.12.2
vtk==9.1.0
wslink==1.8.2
yarl==1.8.1
zipp==3.20.1