Skip to content
Open
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
1 change: 1 addition & 0 deletions doc/changelog.d/6678.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added property file unit to import_3d model
4 changes: 4 additions & 0 deletions src/ansys/aedt/core/application/analysis_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ def import_3d_cad(
reduce_percentage=0,
reduce_error=0,
merge_planar_faces=True,
input_file_unit="Auto",
):
"""Import a CAD model.

Expand Down Expand Up @@ -570,6 +571,8 @@ def import_3d_cad(
Error percentage during STL reduction operation. The default is ``0``.
merge_planar_faces : bool, optional
Whether to merge planar faces during import. The default is ``True``.
input_file_unit: str, optional
Uinit for the stl file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here: Unit

You could also explain what "Auto" options does


Returns
-------
Expand All @@ -595,6 +598,7 @@ def import_3d_cad(
reduce_percentage=reduce_percentage,
reduce_error=reduce_error,
merge_planar_faces=merge_planar_faces,
input_file_unit=input_file_unit,
)

@pyaedt_function_handler(
Expand Down
5 changes: 4 additions & 1 deletion src/ansys/aedt/core/modeler/cad/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -4911,6 +4911,7 @@ def import_3d_cad(
reduce_error=0,
merge_planar_faces=True,
merge_angle=0.02,
input_file_unit="Auto",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here: Unit

You could also explain what "Auto" options does

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also rename the variable as simply : "units" It is more pythonic.

):
"""Import a CAD model.

Expand Down Expand Up @@ -4949,6 +4950,8 @@ def import_3d_cad(
Stl automatic planar face merge during import. Default is ``True``.
merge_angle : float, optional
Stl import angle in radians for which faces will be considered planar. Default is ``2e-2``.
input_file_unit: str, optional
Uinit for the stl file.

Returns
-------
Expand All @@ -4973,7 +4976,6 @@ def import_3d_cad(
vArg1.append("ImportFreeSurfaces:="), vArg1.append(import_free_surfaces)
vArg1.append("GroupByAssembly:="), vArg1.append(group_by_assembly)
vArg1.append("CreateGroup:="), vArg1.append(create_group)
vArg1.append("STLFileUnit:="), vArg1.append("Auto")
(
vArg1.append("MergeFacesAngle:="),
vArg1.append(merge_angle if input_file.endswith(".stl") and merge_planar_faces else -1),
Expand All @@ -4988,6 +4990,7 @@ def import_3d_cad(
vArg1.append("ImportMaterialNames:="), vArg1.append(import_materials)
vArg1.append("SeparateDisjointLumps:="), vArg1.append(separate_disjoints_lumped_object)
vArg1.append("SourceFile:="), vArg1.append(input_file)
vArg1.append("STLFileUnit:="), vArg1.append(input_file_unit)
self.oeditor.Import(vArg1)
if refresh_all_ids:
self.refresh_all_ids()
Expand Down
Loading