File Handling for Geometrically Identical Parts, Batch Clone to Property Value

Hello,


Suppose I have 500 red parts, and 500 blue parts, and any given red part = a blue twin. I've created a property during the creation of the red parts that gives the equivelant part number in the blue twin. Now that I have created, scaled, and detailed the red parts and drawings, I want to clone them.

I want to run a macro to open the drawings, rename the reference model configurations "default",  pull the configuration level property blue twin value, rename (clone) the red drawing to the blue twin value, rename the referenced part the blue twin value, close. I'll end up with a folder full of red parts and drawings and a folder of cloned blue twins parts and drawings.

I've spent all mornign trying to create a macro to do this.


here is the threads I've been referenceing:

https://forum.solidworks.com/message/266358#266358

https://forum.solidworks.com/message/266816#266816

https://forum.solidworks.com/thread/46022

https://forum.solidworks.com/message/431789#431789

Thanks in advance if anyone has ideas on how this might work. I've used pack and go for smaller quantities, but it becomes easy to make errors in this situation almost no matterwhat I do-- if I do this process manually.

SolidworksApi macros