diff --git a/src/ansys/sherlock/core/project.py b/src/ansys/sherlock/core/project.py index 9e640d3fc..9e712931b 100644 --- a/src/ansys/sherlock/core/project.py +++ b/src/ansys/sherlock/core/project.py @@ -87,6 +87,9 @@ def import_odb_archive( ims_stackup=False, project=None, cca_name=None, + polyline_simplification=False, + polyline_tolerance=0.1, + polyline_tolerance_units="mm", ): """Import an ODB++ archive file. @@ -110,6 +113,12 @@ def import_odb_archive( cca_name : str, optional Name of the CCA name. The default is ``None``, in which case the name of the ODB++ archive file is used for the CCA name. + polyline_simplification: bool, optional + Whether to enable polyline simplification + polyline_tolerance: float, optional + Polyline simplification tolerance + polyline_tolerance_units: str, optional + Polyline simplification tolerance units Returns ------- @@ -124,7 +133,10 @@ def import_odb_archive( True, True, ims_stackup=True, project="Tutorial", - cca_name="Card") + cca_name="Card", + polyline_simplification=True, + polyline_tolerance=0.1, + polyline_tolerance_units="mm") """ try: if archive_file == "": @@ -151,6 +163,9 @@ def import_odb_archive( imsStackup=ims_stackup, project=project, ccaName=cca_name, + polylineSimplification=polyline_simplification, + polylineTolerance=polyline_tolerance, + polylineToleranceUnits=polyline_tolerance_units, ) response = self.stub.importODBArchive(request) @@ -166,7 +181,15 @@ def import_odb_archive( raise e def import_ipc2581_archive( - self, archive_file, include_other_layers, guess_part_properties, project=None, cca_name=None + self, + archive_file, + include_other_layers, + guess_part_properties, + project=None, + cca_name=None, + polyline_simplification=False, + polyline_tolerance=0.1, + polyline_tolerance_units="mm", ): """Import an IPC-2581 archive file. @@ -184,6 +207,12 @@ def import_ipc2581_archive( cca_name : str, optional Name of the CCA. The default is ``None``, in which case the name of the IPC-2581 archive file is used for the CCA name. + polyline_simplification: bool, optional + Whether to enable polyline simplification + polyline_tolerance: float, optional + Polyline simplification tolerance + polyline_tolerance_units: str, optional + Polyline simplification tolerance units Returns ------- @@ -196,7 +225,10 @@ def import_ipc2581_archive( >>> sherlock = launch_sherlock() >>> sherlock.project.import_ipc2581_archive("Tutorial.zip", True, True, project="Tutorial", - cca_name="Card") + cca_name="Card", + polyline_simplification=True, + polyline_tolerance=0.1, + polyline_tolerance_units="mm") """ try: if archive_file == "": @@ -220,6 +252,9 @@ def import_ipc2581_archive( guessPartProperties=guess_part_properties, project=project, ccaName=cca_name, + polylineSimplification=polyline_simplification, + polylineTolerance=polyline_tolerance, + polylineToleranceUnits=polyline_tolerance_units, ) response = self.stub.importIPC2581Archive(request)