I’m try to massively replace components of a series of assemblies, i try the 2 methods that i found on the docmgr api help:
Replace Method (ISwDMComponent6)
ReplaceReference Method (ISwDMDocument) (ex from codestack,net thanks to @artem)
The Replace Method needs de instance number of the part whitin assembly, its slow because have to traverse every assembly (only first level) and then replace each component with the same name.
The ReplaceReference its more faster, no iterations, no traversing, only one change “in this assembly, this reference for this other”
The problem with this method is when we open the assemblies for rebuild, SW always say:
“The internalID is not maching…”
Simply press “use this comp anyway” and it works, but, theres no other method or way to open directly and reconstruct by default without say to solidworks “dont show this message again”?
Thanks in advance