VB API code to copy assembly along with all its dependetns and all their drawings
- October 29, 2018
- 2 replies
- 2816 views
Hello, the solution to this problem would be of very high use.
Is there a VB API code to copy assembly along with it's dependent parts and assembly drawing to new name ?
Following things I have already tried:
1) Copied assembly model and it's dependent parts with IpfcModel.CopyAndRetrieve (see code in attachment). But the problem is that, although assembly and all it's dependent parts get copied, the newly copied assembly does not contain newly copied dependent parts in it's model tree.
2) To facilitate copy of models along with model drawings, I set config option "rename_drawings_with_object" to "both". It works totally fine - after copying just a model, drawing also gets copied to the same name as model along with dependency. But, the limitation is : only the drawing whose name is same as that of model gets copied.
Solutions not preferable for me are:
1) After copying assembly and its parts, run the code to replace all old parts in new assembly with new parts (e.g. using IpfcComponentFeat.CreateReplaceOp )
2) After copying assembly, drawings and its parts, run the code to replace old models with new models in drawing.
In short, what I want is a smart procedure to copy assembly along with all its dependents and drawings.

