Hi!
We have 3 files:
1. We draw the a body with dimension. (B.SLDPRT)
2. Creating a assy (A.SLDASM) and add the B.SLDPRT.
3. In the A.SLDASM we use the Insert/Component/NewPart menuitem tocreate the C.SLDPRT file
The C.SLDPRT referencing onto the B.SLDPRT dimension.
In the feature-tree at the C.SLDPRT have a "->" sign.
It's all ok.
I like to copy this structure with another name to the anotherpath. (I use C++ with COM.)
The CopyDocument function are correct without renaming.
BUT
If I use the CopyDocument function with only 1 assy, and under anypart AND I rename its also correct!
Accordingly I do this:
a.) At and of feature tree, I use the CopyDocument function tocopy+rename a another path a subtree, and
b.) in the above level at the feature tree (assy) I Use theReplaceComponent function that I change the old component to thenew.
This is correct: a files copied an renamed to a another path, andthe mates not crashed.
I have a big problem: the above document-strucure (a partreferencing any another part) this is not working correctly yet.
I found a function: Component2::UpdateExternalFileReferences
This seen to handling this problem, but I don't understand howworking it.
I expecting oldfile-newfile excange, but I don't know theUpdateExternalFileReferences constant parameters how do it.
I how use this function, that change the old filereference to a newreference?
The API help description are less like poor...
Thanks:
ZsZs.
SolidworksApi macros
We have 3 files:
1. We draw the a body with dimension. (B.SLDPRT)
2. Creating a assy (A.SLDASM) and add the B.SLDPRT.
3. In the A.SLDASM we use the Insert/Component/NewPart menuitem tocreate the C.SLDPRT file
The C.SLDPRT referencing onto the B.SLDPRT dimension.
In the feature-tree at the C.SLDPRT have a "->" sign.
It's all ok.
I like to copy this structure with another name to the anotherpath. (I use C++ with COM.)
The CopyDocument function are correct without renaming.
BUT
If I use the CopyDocument function with only 1 assy, and under anypart AND I rename its also correct!
Accordingly I do this:
a.) At and of feature tree, I use the CopyDocument function tocopy+rename a another path a subtree, and
b.) in the above level at the feature tree (assy) I Use theReplaceComponent function that I change the old component to thenew.
This is correct: a files copied an renamed to a another path, andthe mates not crashed.
I have a big problem: the above document-strucure (a partreferencing any another part) this is not working correctly yet.
I found a function: Component2::UpdateExternalFileReferences
This seen to handling this problem, but I don't understand howworking it.
I expecting oldfile-newfile excange, but I don't know theUpdateExternalFileReferences constant parameters how do it.
I how use this function, that change the old filereference to a newreference?
The API help description are less like poor...
Thanks:
ZsZs.
SolidworksApi macros