Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
ForrestJudd
268 Views, 2 Replies

Replace Imported Component

I have an existing Inventor Assembly references a STEP file as a Reference Model. I would like to rename the step file to something else and replace the reference via the API.

 

If this was an Inventor document reference it would be straightforward - I can use the Replace method on the ComponentOccurrence(s) that reference the document and be done. However, if it is a referenced STEP file, it appears that ComponentOccurrence.Replace, when provided the name of a STEP file, will convert the STEP file - it doesn't continue to reference the STEP file.

 

I know I can add a new STEP file reference using the AssemblyDocument.ComponentDefinition.ImportedComponents.Add method, but I don't want to add a new one - I want to replace an existing one. Am I missing something or is what I need to do not possible?