Error Messages when 'sweep_along_path' and 'sweep_around_axis' are passed more than one assignment
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
PyAEDT 'sweep_along_path' and 'sweep_around_axis' create 3D object(s) correctly but return below errors when passed a list of sweep objects (more than one object to be swept at a time)
Errors originate from the 'update_object' method called at end of 'sweep_along_path' and 'sweep_around_axis' when it is passed a list of assignments.
Steps To Reproduce
These errors are produced:
When the below is run:
from ansys.aedt.core import Maxwell3d
M3D = Maxwell3d()
linear_path=M3D.modeler.create_polyline(points=[[0,0,0],[0,100,0]],name="line")
circle1 = M3D.modeler.create_circle(orientation='Z', origin=[5,0,0],radius=2, num_sides=8,name="circle1")
circle2 = M3D.modeler.create_circle(orientation='Z', origin=[15,0,0],radius=2, num_sides=8,name="circle2")
M3D.modeler.sweep_along_path(assignment=[circle1,circle2] ,sweep_object=linear_path)
##### M3D.modeler.sweep_around_axis(assignment=[circle1,circle2] ,axis='Z')
M3D.modeler.fit_all()
M3D.release_desktop(close_projects=False,close_desktop=False)
This can be corrected by replacing:
return self.update_object(assignment)
with:
if isinstance(assignment, list):
updated_obj = []
for sel_obj in assignment:
updated_obj.append(self.update_object(sel_obj))
return updated_obj
else:
return self.update_object(assignment)
in two affected methods 'sweep_along_path' and 'sweep_around_axis'
Alternatively we can modify 'update_object' to handle lists and update the following for consistency "thicken_sheet' and "sweep_along_vector"
Which Operating System are you using?
Windows
Which Python version are you using?
3.11
Installed packages
annotated-types==0.7.0
ansys-aedt-toolkits-antenna==0.3.2
ansys-aedt-toolkits-common==0.6.3
ansys-pythonnet==3.1.0rc3
attrs==23.2.0
blinker==1.8.2
build==1.2.2.post1
certifi==2024.8.30
cffi==1.16.0
charset-normalizer==3.4.0
click==8.1.7
click-plugins==1.1.1
cligj==0.7.2
clr-loader==0.2.6
colorama==0.4.6
contourpy==1.3.0
cycler==0.12.1
defusedxml==0.7.1
docutils==0.21.2
et_xmlfile==2.0.0
fast_simplification==0.1.7
fiona==1.10.1
Flask==3.0.3
fonttools==4.50.0
fpdf2==2.7.8
geopandas==0.14.4
idna==3.10
imageio==2.36.0
importlib_metadata==8.5.0
itsdangerous==2.2.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
Jinja2==3.1.4
joblib==1.4.2
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
keyring==25.5.0
kiwisolver==1.4.7
markdown-it-py==3.0.0
MarkupSafe==3.0.2
matplotlib==3.9.2
mdurl==0.1.2
meshio==5.3.5
more-itertools==10.5.0
networkx==3.3
nh3==0.2.18
numpy==1.26.4
openpyxl==3.1.5
osmnx==1.9.4
packaging==24.1
pandas==2.2.3
pillow==10.2.0
pkginfo==1.10.0
platformdirs==4.3.6
plumbum==1.8.2
pooch==1.8.2
psutil==5.9.8
pyaedt==0.11.1
pycparser==2.21
pydantic==2.9.2
pydantic_core==2.23.4
pyedb==0.31.0
Pygments==2.18.0
pyparsing==3.2.0
pyproj==3.7.0
pyproject_hooks==1.2.0
pyqtgraph==0.13.7
PySide6==6.7.3
PySide6_Addons==6.7.3
PySide6_Essentials==6.7.3
python-dateutil==2.9.0.post0
pytz==2024.2
pyvista==0.44.1
pyvistaqt==0.11.1
pywin32==306
pywin32-ctypes==0.2.3
PyYAML==6.0.2
QDarkStyle==3.2.3
QtPy==2.4.1
readme_renderer==44.0
referencing==0.34.0
requests==2.32.3
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.9.3
rpds-py==0.18.0
rpyc==6.0.0
Rtree==1.3.0
scikit-learn==1.5.2
scikit-rf==1.3.0
scipy==1.14.1
scooby==0.10.0
shapely==2.0.6
shiboken6==6.7.3
six==1.16.0
SRTM.py==0.3.7
threadpoolctl==3.5.0
toml==0.10.2
twine==5.1.1
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.2.3
utm==0.7.0
vtk==9.3.1
Werkzeug==3.0.6
zipp==3.20.2