diff --git a/doc/changelog.d/6678.fixed.md b/doc/changelog.d/6678.fixed.md new file mode 100644 index 00000000000..6d749e5a72e --- /dev/null +++ b/doc/changelog.d/6678.fixed.md @@ -0,0 +1 @@ +Added property file unit to import_3d model diff --git a/src/ansys/aedt/core/application/analysis_3d.py b/src/ansys/aedt/core/application/analysis_3d.py index 7519db69e7d..ab55af2cd05 100644 --- a/src/ansys/aedt/core/application/analysis_3d.py +++ b/src/ansys/aedt/core/application/analysis_3d.py @@ -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. @@ -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. Returns ------- @@ -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( diff --git a/src/ansys/aedt/core/modeler/cad/primitives.py b/src/ansys/aedt/core/modeler/cad/primitives.py index 1cb434a23c0..aa665db430d 100644 --- a/src/ansys/aedt/core/modeler/cad/primitives.py +++ b/src/ansys/aedt/core/modeler/cad/primitives.py @@ -4911,6 +4911,7 @@ def import_3d_cad( reduce_error=0, merge_planar_faces=True, merge_angle=0.02, + input_file_unit="Auto", ): """Import a CAD model. @@ -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 ------- @@ -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), @@ -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()