Skip to content

Commit f1bf010

Browse files
chris-hawkins-usajonahrbRobPasMue
authored
FMD export (#377)
Co-authored-by: jonahrb <[email protected]> Co-authored-by: Roberto Pastor Muela <[email protected]>
1 parent dea02b9 commit f1bf010

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/ansys/geometry/core/designer/design.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class DesignFileFormat(Enum):
5252
SCDOCX = "SCDOCX", None
5353
PARASOLID_TEXT = "PARASOLID_TEXT", PartExportFormat.PARTEXPORTFORMAT_PARASOLID_TEXT
5454
PARASOLID_BIN = "PARASOLID_BIN", PartExportFormat.PARTEXPORTFORMAT_PARASOLID_BINARY
55+
FMD = "FMD", PartExportFormat.PARTEXPORTFORMAT_FMD
5556
INVALID = "INVALID", None
5657

5758

@@ -184,9 +185,11 @@ def download(
184185
if format is DesignFileFormat.SCDOCX:
185186
response = self._commands_stub.DownloadFile(Empty())
186187
received_bytes += response.data
187-
elif (format is DesignFileFormat.PARASOLID_TEXT) or (
188-
format is DesignFileFormat.PARASOLID_BIN
189-
):
188+
elif format in [
189+
DesignFileFormat.PARASOLID_TEXT,
190+
DesignFileFormat.PARASOLID_BIN,
191+
DesignFileFormat.FMD,
192+
]:
190193
response = self._design_stub.Export(ExportRequest(format=format.value[1]))
191194
received_bytes += response.data
192195
else:

tests/integration/test_design.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,13 +787,18 @@ def test_download_file(modeler: Modeler, tmp_path_factory: pytest.TempPathFactor
787787
file_save = tmp_path_factory.mktemp("scdoc_files_save") / "cylinder.scdocx"
788788
design.save(file_location=file_save)
789789

790-
# Check for parasolid exports
790+
# Check for other exports
791791
binary_parasolid_file = tmp_path_factory.mktemp("scdoc_files_download") / "cylinder.x_b"
792792
text_parasolid_file = tmp_path_factory.mktemp("scdoc_files_download") / "cylinder.x_t"
793+
fmd_file = tmp_path_factory.mktemp("scdoc_files_download") / "cylinder.fmd"
794+
793795
design.download(binary_parasolid_file, format=DesignFileFormat.PARASOLID_BIN)
794796
design.download(text_parasolid_file, format=DesignFileFormat.PARASOLID_TEXT)
797+
design.download(fmd_file, format=DesignFileFormat.FMD)
798+
795799
assert binary_parasolid_file.exists()
796800
assert text_parasolid_file.exists()
801+
assert fmd_file.exists()
797802

798803

799804
def test_slot_extrusion(modeler: Modeler):

0 commit comments

Comments
 (0)