Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Export model obj and rename argument #5444

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/hfss.py
Original file line number Diff line number Diff line change
Expand Up @@ -6132,7 +6132,7 @@
from ansys.aedt.core.visualization.advanced.hdm_plot import HDMPlotter

hdm = HDMPlotter()
files = self.post.export_model_obj(export_as_single_objects=True, air_objects=False)
files = self.post.export_model_obj(export_as_multiple_objects=True, air_objects=False)

Check warning on line 6135 in src/ansys/aedt/core/hfss.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/hfss.py#L6135

Added line #L6135 was not covered by tests
for file in files:
hdm.add_cad_model(file[0], file[1], file[2], self.modeler.model_units)
hdm.add_hdm_bundle_from_file(file_name)
Expand Down
12 changes: 6 additions & 6 deletions src/ansys/aedt/core/visualization/post/post_common_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2202,8 +2202,8 @@
return False
return solution_data

@pyaedt_function_handler(obj_list="assignment")
def export_model_obj(self, assignment=None, export_path=None, export_as_single_objects=False, air_objects=False):
@pyaedt_function_handler(obj_list="assignment", export_as_single_objects="export_as_multiple_objects")
def export_model_obj(self, assignment=None, export_path=None, export_as_multiple_objects=False, air_objects=False):

Check warning on line 2206 in src/ansys/aedt/core/visualization/post/post_common_3d.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/visualization/post/post_common_3d.py#L2205-L2206

Added lines #L2205 - L2206 were not covered by tests
"""Export the model.

Parameters
Expand All @@ -2213,9 +2213,9 @@
case export every model object except 3D ones and vacuum and air objects.
export_path : str, optional
Full path of the exported OBJ file.
export_as_single_objects : bool, optional
Whether to export the model as single object. The default is ``False``, in which
case is exported asa list of objects for each object.
export_as_multiple_objects : bool, optional
Whether to export the model as multiple objects or not. Default is ``False``
in which case the model is exported as single object.
air_objects : bool, optional
Whether to export air and vacuum objects. The default is ``False``.

Expand Down Expand Up @@ -2244,7 +2244,7 @@
and self._app.modeler[i].material_name.lower() != "air"
)
]
if not export_as_single_objects:
if export_as_multiple_objects:

Check warning on line 2247 in src/ansys/aedt/core/visualization/post/post_common_3d.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/visualization/post/post_common_3d.py#L2247

Added line #L2247 was not covered by tests
files_exported = []
for el in assignment:
fname = os.path.join(export_path, f"{el}.obj")
Expand Down
Loading