I can`t export a model to a single file if it contains an another linked model.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am writing a Python plugin for printing that prints highlighted parts. To do this, I need to export them in the format "STL" in one file. Export occurs normally if the project has no linked models, or linked model is in the project root. But if there is an linked model in the project, in which there is also an linked model (the second level of nesting of linked models), then the API output the errors.
For export, when the associated model is at the root, I had to create a temporary occurrence at the project root and copy the selected components in this occurrence. And break the connection of the copied models. This is done because the export function does not work differently! After export, I delete this occurrence. But this method does not work when there is another related in the associated model. As shown in the figures:
Example of error:
"File" ....../MakerBotPlugin.py ", line 170, in exportToDisk
occurence.deleteMe ()
File "C: / ...... /AppData / Local / Autodesk / webdeploy / production / ...... / Api / Python / packages \ adsk \ fusion.py", line 18955, in deleteMe
return _fusion.Occurrence_deleteMe (self)
RuntimeError: 5: MoveFace1 / Compute Failed // //).
Try adjusting the values or changing the input geometry."
Part of the export code in the attachment. Does anyone know - is there any way to export models, regardless of their linked state and nesting level?