My question to all:
Is there a way that I can create a master assembly that contains multiple subassemblies and parts as a generic assembly or template; and do a save as or ilogic rule that will save a copy to a different file location and different name? Once saved it will update all assembly, sub-assembly, and part number information so that the new copy can be modified (height, length, width, ect.) without interfering with the Master assembly (template) or future renamed copies. I would like my master assembly to contain created parts and content center parts if possible.
I am using Windows 10, 64-bit operating system, Autodesk Inventor Professional 2019
Look at the iLogic Design Copy tool and/or CopyDesign in Vault.
Just a thought:
While looping through each oRefDoc As Document In AllReferencedDocuments of your main assembly, check the oRefDoc.AllReferencedDocuments.Count. (Likely only needed for AssemblyDocuments). If more than zero, loop through them too (perhaps using a recursive Sub routine), saving them off in the new location, and new name. Then the parent document (assembly or sub assembly), then do the Replace process.
I believe you will need to climb as far down through the layers as possible, checking the Count, and when the Count is zero, then proceed to save them out, and replace them. Then as each lower loop finishes, it will climb back up through the layers until it finishes. This way, each new part file exists in the new location(s), with their new names, before the new assembly(s) that should contain them is created in the new location(s), with its new name. Understand?
This should work faster than iterating through each ComponentOccurrence, because there may be several instances of each ComponentOccurrence. Although, if you were to loop through the ComponentOccurrences, you could just check to see if the file already exists in its intended new location, before processing it again. Replacing them later is easiest when done with the ComponentOccurrence object, rather than dealing with references.
Wesley Crihfield
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.