Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Repalce DocumentReference

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
-pezi-
104 Views, 2 Replies

Repalce DocumentReference

I want do make replace dataFile in allDocumentReferences() something as

 

Ptr<DocumentReferences> refs = activeDoc->allDocumentReferences();
for (size_t i = 0; i < refs->count(); i++)
{
   Ptr<DocumentReference> docRef = refs->item(i);
   Ptr<DataFile> refDataFile = docRef->dataFile();
   Ptr<DataFile> copyRefDataFile = docRef->dataFile()->copy(folder);
   copyRefDataFile->name("Prefix_" + to_string(i));
   refDataFile = copyRefDataFile;
}

 

I know that this way isn't possible. My question is: there any way how this does it?

2 REPLIES 2
Message 2 of 3
BrianEkins
in reply to: -pezi-

Does Fusion support this in the user interface.  All I could find was a way to switch which version of a design you're referencing.  Not switch to a completely different design.  Even if it can be done through the UI, the API doesn't support it.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 3
-pezi-
in reply to: BrianEkins

Thank you for your response. I came to the same conclusions, I just wanted to make sure I didn't miss some way to do it using the API.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report