alias_api.export_by_layer
- alias_api.export_by_layer(target_dirname: str, base_filename: str, file_type: alias_api.AlFileType, layer_list: collections.abc.Sequence[alias_api.AlLayer], overwrite: bool = False) int
Export each layer to a new file.
This function will modify the pick list, ensure to save the state of the pick list before calling this function if it is desired to restore it after this operation.
This is an alternative function to exportByLayerSequentially that is optimized for when there are many dag nodes, since it will only traverse the DAG once, whereas exportByLayerSequentially will traverse the DAG once per layer. The downside of this function is that it requires more memory since it will keep track of the nodes per layer.
This function requires Alias >= 2022.2
- Parameters
target_dirname (str) – The output directory to save new layer files to.
base_filename (str) – The base filename for the newly saved layer files. The layer name will be appended for each file.
file_type (AlFileType) – The file type that the new layer files will be saved as.
layer_list (list<AlLayer>) – The layers to export.
overwrite (bool) – True will overwrite any existing files, False will not save a the layer file it if a file already exists with the same name.
- Raises
AliasCompatibilityException – if currently running version of Alias < 2022.2
AliasPythonException – if errors were reported during export