From 9ecf5ce05ca85c2957c31a4c503768f8b70333d8 Mon Sep 17 00:00:00 2001 From: Dr-Hawal-R <124583603+Dr-Hawal-R@users.noreply.github.com> Date: Tue, 23 Sep 2025 14:46:00 +0200 Subject: [PATCH 1/3] added property file unit to import_3d model --- src/ansys/aedt/core/application/analysis_3d.py | 4 ++++ src/ansys/aedt/core/modeler/cad/primitives.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ansys/aedt/core/application/analysis_3d.py b/src/ansys/aedt/core/application/analysis_3d.py index 7519db69e7d..04db7c65bb0 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..3e6eec2bb09 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,7 +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 ------- bool @@ -4973,7 +4975,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 +4989,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() From 9e9145c6fa866eb09427fd042db1755475322dcc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 12:49:00 +0000 Subject: [PATCH 2/3] CHORE: Auto fixes from pre-commit hooks --- src/ansys/aedt/core/application/analysis_3d.py | 4 ++-- src/ansys/aedt/core/modeler/cad/primitives.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ansys/aedt/core/application/analysis_3d.py b/src/ansys/aedt/core/application/analysis_3d.py index 04db7c65bb0..ab55af2cd05 100644 --- a/src/ansys/aedt/core/application/analysis_3d.py +++ b/src/ansys/aedt/core/application/analysis_3d.py @@ -533,7 +533,7 @@ def import_3d_cad( reduce_percentage=0, reduce_error=0, merge_planar_faces=True, - input_file_unit="Auto" + input_file_unit="Auto", ): """Import a CAD model. @@ -598,7 +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 + 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 3e6eec2bb09..aa665db430d 100644 --- a/src/ansys/aedt/core/modeler/cad/primitives.py +++ b/src/ansys/aedt/core/modeler/cad/primitives.py @@ -4911,7 +4911,7 @@ def import_3d_cad( reduce_error=0, merge_planar_faces=True, merge_angle=0.02, - input_file_unit = "Auto" + input_file_unit="Auto", ): """Import a CAD model. @@ -4952,6 +4952,7 @@ def import_3d_cad( 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 ------- bool From 633ba19a5795bdc6cbce6a3f6eee9059b9203dcc Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 23 Sep 2025 12:51:41 +0000 Subject: [PATCH 3/3] chore: adding changelog file 6678.fixed.md [dependabot-skip] --- doc/changelog.d/6678.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/6678.fixed.md 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