After opening an iges file the active document has an empty pathname because the active document has not yet been saved.
How can I ask the pathname of the iges file opened in the active document?
Get the Imported feature and call GetImportedFileName
thank you for your hint, but now I am not able to locate the right feature.
The documentation says that GetImportedFileName() applies to the features of type "Imported".
After opening the iges file I tried asking all the features of the active document and all the features of every component of the document but I don't find a feature of type "Imported".
How can I find the right feature?
Loop through all the features and call GetTypeName2. You should find one called "Imported". Directly after the origin, presumably.
That's assuming you have imported a Part file.If it is an assembly, you will have to pick a component part and find the features in that.
I'm running my test program with a simple iges file containing only one solid body imported in a new SolidWorks Part file.
While looping recursively through all the features of the document I get this tree of all the feature types:
Running the test before and after importing the iges file, the only difference is the last feature (BaseBody)
Looks like BaseBody is the feature to use GetImportedFileName on then.
Unfortunately the feature type is "BaseBody" and the GetImportedFileName returns an empty string.
Anyway, thanks for the hints
Retrieving data ...