File Controller
Interchange with external 3D and CAD file formats.
Handles import and export of geometry between cadwork and third-party formats (3DC, STEP, SAT, Rhino, BTL, BXF, DXF, DSTV, FBX, OBJ, STL, GLB, WebGL, variants, ...). Concerned only with neutral-format data exchange — BIM-specific (IFC) workflows live in bim_controller, and shop-drawing 2D exports live in shop_drawing_controller.
clear_errors() -> None
Clears all errors.
export_3d_file(element_id_list: list[ElementId], file_path: str) -> bool
Exports a 3D file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
Examples:
1 2 | |
1 2 3 4 5 | |
Returns:
| Type | Description |
|---|---|
bool
|
True on successful export, false otherwise. |
export_3dc_file(element_id_list: list[ElementId], file_path: str) -> None
Exports a 3D file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
Examples:
1 2 | |
1 2 3 | |
export_btl_file_for_nesting(file_path: str) -> None
Exports a BTL file for nesting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The output file path. |
required |
Examples:
1 | |
1 2 | |
export_dstv_file(file_path: str) -> bool
Exports active elements in the scene to a DSTV (.stp) file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The output file path. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True on successful export, false otherwise. |
export_dxf_file(file_path: str, dxf_layer_format_type: dxf_layer_format_type, dxf_export_version: dxf_export_version) -> bool
Exports visible elements in the scene to a DXF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The output file path. |
required |
dxf_layer_format_type
|
dxf_layer_format_type
|
The format type of how to organize layers. |
required |
dxf_export_version
|
dxf_export_version
|
The dxf version to use for the export. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True on successful export, false otherwise. |
export_fbx_file(element_id_list: list[ElementId], file_path: str, fbx_format: int) -> None
Exports a FBX file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
fbx_format
|
int
|
The FBX format. Available values :
|
required |
Examples:
1 2 | |
1 2 3 4 | |
1 2 3 | |
export_glb_file(element_id_list: list[ElementId], file_path: str) -> None
Exports a GLB File.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
Examples:
1 2 | |
1 2 3 | |
export_obj_file(element_id_list: list[ElementId], file_path: str) -> None
Exports a OBJ file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
Examples:
1 2 | |
1 2 3 | |
export_rhino_file(element_id_list: list[ElementId], file_path: str, version: int, use_default_assignment: bool, write_standard_attributes: bool) -> None
Exports a 3dm rhino file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
version
|
int
|
The rhino version :
|
required |
use_default_assignment
|
bool
|
True if default assignment is used. False if no attributes are exported. |
required |
write_standard_attributes
|
bool
|
True if exported with standard attribute, false otherwise. |
required |
Examples:
1 2 | |
1 2 3 4 5 6 | |
export_rhino_file_with_options(element_id_list: list[ElementId], file_path: str, version: int, use_default_assignment: bool, write_standard_attributes: bool, rhino_options: None) -> None
Exports elements to a rhino 3dm file based on the export options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
version
|
int
|
The rhino version :
|
required |
use_default_assignment
|
bool
|
True if default assignment is used. False if no attributes are exported. |
required |
write_standard_attributes
|
bool
|
True if exported with standard attribute, false otherwise. |
required |
rhino_options
|
None
|
The Rhino export option. |
required |
Examples:
1 2 | |
1 2 3 4 5 6 7 | |
export_sat_file(element_id_list: list[ElementId], file_path: str, scale_factor: float, binary: bool, version: int) -> None
Exports a SAT File.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
scale_factor
|
float
|
The file scale factor. |
required |
binary
|
bool
|
Whether to write the SAT file in binary or a human readable format. |
required |
version
|
int
|
The ACIS version to use :
|
required |
Examples:
1 2 | |
1 2 3 4 5 6 | |
export_sat_file_cut_drillings(element_id_list: list[ElementId], file_path: str, scale_factor: float, binary: bool, version: int) -> None
Exports a SAT File with extruded drillings (cut drilling holes into bodies).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
scale_factor
|
float
|
The file scale factor. |
required |
binary
|
bool
|
Whether to write the SAT file in binary or a human readable format. |
required |
version
|
int
|
The ACIS version to use :
|
required |
export_step_file(element_id_list: list[ElementId], file_path: str, scale_factor: float, version: int, text_mode: bool) -> None
Exports a STEP file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
scale_factor
|
float
|
The file scale factor. |
required |
version
|
int
|
The file export version : - 214 = STEP AP214 - 203 = STEP AP203 (default value) |
required |
text_mode
|
bool
|
Use text mode. PARAMETER UNUSED |
required |
Examples:
1 2 | |
1 2 3 4 5 6 | |
export_step_file_cut_drillings(element_id_list: list[ElementId], file_path: str, scale_factor: float, version: int, text_mode: bool, imperial_units: bool) -> None
Exports a STEP file with extruded drillings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
scale_factor
|
float
|
The file scale factor. |
required |
version
|
int
|
The file export version : - 214 = STEP AP214 - 203 = STEP AP203 (default value) |
required |
text_mode
|
bool
|
Use text mode. PARAMETER UNUSED |
required |
imperial_units
|
bool
|
Use imperial units. |
required |
Examples:
1 2 | |
1 2 3 4 5 6 7 | |
export_step_file_extrude_drillings(element_id_list: list[ElementId], file_path: str, scale_factor: float, version: int, text_mode: bool, imperial_units: bool) -> None
Exports a STEP file with extruded drillings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
scale_factor
|
float
|
The file scale factor. |
required |
version
|
int
|
The file export version : - 214 = STEP AP214 - 203 = STEP AP203 (default value) |
required |
text_mode
|
bool
|
Use text mode. PARAMETER UNUSED |
required |
imperial_units
|
bool
|
Use imperial units. |
required |
Examples:
1 2 | |
1 2 3 4 5 6 7 | |
export_stl_file(element_id_list: list[ElementId], file_path: str) -> None
Exports an STL file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
Examples:
1 2 | |
1 2 3 | |
export_webgl(element_id_list: list[ElementId], file_path: str) -> bool
Exports a WebGL file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
file_path
|
str
|
The output file path. |
required |
Examples:
1 2 | |
1 2 3 4 5 | |
Returns:
| Type | Description |
|---|---|
bool
|
True on successful export, false otherwise. |
get_blum_export_path() -> str
Gets the path of the Blum export.
Returns:
| Type | Description |
|---|---|
str
|
The path of the Blum export. |
get_import_3dc_options() -> import_3dc_options
import_3dc_file(file_path: str) -> list[ElementId]
Imports a 3DC file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
import_3dc_file_with_glide(file_path: str) -> list[ElementId]
Imports a 3DC file with glide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
import_3dc_file_with_options(file_path: str, import_3dc_options: import_3dc_options) -> list[ElementId]
Imports a 3d or a 3dc file depending on the import options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
import_3dc_options
|
import_3dc_options
|
The 3dc import options. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
import_3dz_file(file_path: str) -> None
Imports a 3DZ file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
import_btl_file(file_path: str) -> None
Imports a BTL file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
import_btl_file_for_nesting(file_path: str) -> None
Imports a BTL file for nesting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
import_bxf_file(file_path: str, insert_position: point_3d) -> list[ElementId]
Imports a BXF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The import file path. |
required |
insert_position
|
point_3d
|
The position where the imported elements will be inserted. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The list of IDs of the imported elements. |
import_element_light(file_path: str, insert_position: point_3d) -> int
Imports a light element from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The import file path. |
required |
insert_position
|
point_3d
|
The position where the imported light element will be inserted. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The ID of the imported light element. |
import_rhino_file(file_path: str, without_dialog: bool) -> list[ElementId]
Imports a Rhino file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
without_dialog
|
bool
|
Import without dialog? |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
import_sat_file(file_path: str, scale_factor: float, binary: bool) -> list[ElementId]
Imports an SAT file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
scale_factor
|
float
|
The scale factor. |
required |
binary
|
bool
|
Is the import file binary. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
import_sat_file_silently(file_path: str, scale_factor: float, binary: bool) -> list[ElementId]
Imports a SAT File without messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
scale_factor
|
float
|
The scale factor. |
required |
binary
|
bool
|
Is the import file binary. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
import_step_file(file_path: str, scale_factor: float) -> list[ElementId]
Imports a STEP file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
scale_factor
|
float
|
The file scale factor. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
import_step_file_with_message_option(file_path: str, scale_factor: float, hide_message: bool) -> list[ElementId]
Imports a STEP file with message option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The input file path. |
required |
scale_factor
|
float
|
The file scale factor. |
required |
hide_message
|
bool
|
Hide message. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
import_variant_file(file_path: str, insert_position: point_3d) -> list[ElementId]
Imports a variant (.val-File).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The import file path. |
required |
insert_position
|
point_3d
|
The position where the imported variant elements will be inserted. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The imported list of element id. |
load_webgl_preset_file(file_path: str) -> None
Loads a preset file for the WebGl export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The preset file path. |
required |
set_blum_export_path(path: str) -> None
Sets the path of the Blum export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The new path for the Blum export. |
required |
set_webgl_hierarchy(stage: int, attribute: display_attribute) -> None
Sets the WebGL hierarchy based on the given stage and attribute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stage
|
int
|
The hierarchy stage to set. |
required |
attribute
|
display_attribute
|
The display attribute to use for the hierarchy. |
required |
upload_to_bim_team_and_create_share_link(element_id_list: list[ElementId]) -> bim_team_upload_result
Exports the elements to BIMteam and creates a share link.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element id to export. |
required |
Returns:
| Type | Description |
|---|---|
bim_team_upload_result
|
The result object with a result code and a share link. If the code is not ok (0), the share link string is empty. |