Getting the path from the inported file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm creating a script to Export the visible faces to the same path that I've imported the first file.
I’m using this code.
"
def get_imported_file_path():
# Get the active design
app = adsk.core.Application.get()
design = adsk.fusion.Design.cast(app.activeProduct)
# Get the root component
root_comp = design.rootComponent
# Get the first occurrence in the root component
#first_occurrence = root_comp.occurrences.item(0)
# Get the import component of the first occurrence
#import_comp = adsk.fusion.ImportComponent.cast(first_occurrence.component)
# Get the full path of the imported file
#import_path = import_comp.importedFileName
# Notify the user of the imported file path
return root_comp.name
"
Has I've not saved any model I get "not saved".
The objective is exporting a SAT file back to the same location on the PC of the original file.
Is there any other Way?