Sw document manager internalsID

Hy all,

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

1 Like

If you are going down the route of opening the assembly document eventually, you might as well use Assembly::ReplaceComponents2. The only downside to this method is that the new component document and the old one must have different names. The method only works on top-level components.

Renaming references is truly a pain in the ass with the SOLIDWORKS API.