Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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/2231.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add option to write body facets to explicit export methods
16 changes: 12 additions & 4 deletions src/ansys/geometry/core/designer/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,18 @@ def __build_export_file_location(self, location: Path | str | None, ext: str) ->
"""
return (Path(location) if location else Path.cwd()) / f"{self.name}.{ext}"

def export_to_scdocx(self, location: Path | str | None = None) -> Path:
def export_to_scdocx(
self, location: Path | str | None = None, write_body_facets: bool = False
) -> Path:
"""Export the design to an scdocx file.

Parameters
----------
location : ~pathlib.Path | str, optional
Location on disk to save the file to. If None, the file will be saved
in the current working directory.
write_body_facets : bool, default: False
Option to write body facets into the saved file. SCDOCX and DISCO only, 26R1 and later.

Returns
-------
Expand All @@ -444,19 +448,23 @@ def export_to_scdocx(self, location: Path | str | None = None) -> Path:
file_location = self.__build_export_file_location(location, "scdocx")

# Export the design to an scdocx file
self.download(file_location, DesignFileFormat.SCDOCX)
self.download(file_location, DesignFileFormat.SCDOCX, write_body_facets)

# Return the file location
return file_location

def export_to_disco(self, location: Path | str | None = None) -> Path:
def export_to_disco(
self, location: Path | str | None = None, write_body_facets: bool = False
) -> Path:
"""Export the design to an dsco file.

Parameters
----------
location : ~pathlib.Path | str, optional
Location on disk to save the file to. If None, the file will be saved
in the current working directory.
write_body_facets : bool, default: False
Option to write body facets into the saved file. SCDOCX and DISCO only, 26R1 and later.

Returns
-------
Expand All @@ -467,7 +475,7 @@ def export_to_disco(self, location: Path | str | None = None) -> Path:
file_location = self.__build_export_file_location(location, "dsco")

# Export the design to an dsco file
self.download(file_location, DesignFileFormat.DISCO)
self.download(file_location, DesignFileFormat.DISCO, write_body_facets)

# Return the file location
return file_location
Expand Down
Loading