×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Who used the Component2::UpdateExternalFileReferences API function?

Who used the Component2::UpdateExternalFileReferences API function?

Who used the Component2::UpdateExternalFileReferences API function?

(OP)
I using C++ with COM, but I am happy with VB help too.
The description of this function in the API-help are nothing.
I how using it?
(I'm computer programmer not a CAD architect...)

Regards:
ZsZs.

RE: Who used the Component2::UpdateExternalFileReferences API function?

Never used, but I'll look into it.

batHonesty may be the best policy, but insanity is a better defense.bat
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: Who used the Component2::UpdateExternalFileReferences API function?

What do you need to accomplish?  Why are you interested in this call?

RE: Who used the Component2::UpdateExternalFileReferences API function?

(OP)
Thanks!
I wrote the API-forum of Solidwors, but no answer...

I like use the Pack And Go function from my application, but haven't Pack And Go API-function.
I need the to realize that copy the source assembly (with parts) BUT copy a another location.

May be the essential of this function the CopyDocument() API-function.

My experience of CopyDocument function:
1. Correct working IF the names of source files identical with the names of destination files. Not possible the rename of document.
2. If the root document contain only parts (not any assembly) and I change the name of destination files - working correctly too (copy and rename).
3. (It is difficult for my poor english knowledge...)
If I scan the document-tree, and walk form end (leaf-assembly) and I always copy+rename only the end of hierarchy (as I wrote above in the part 2) the copy+rename fully working with a big and difficult source doucument.

My big problem:
If a part referencing a another part (signed with "->" in the component-tree) the reference os part not copied and the document crashed.
I found the Component2::UpdateExternalFileReferences function in the API-help, but I don't understand the work of this function.
I need source and destination for the change, but this function contain only constant values without concrete file names. How change its?

A another possible solution for this problem:
EditSketch and any method to change the references?

Regards:
ZsZs.

RE: Who used the Component2::UpdateExternalFileReferences API function?

(OP)
I capture the Solidworks screen and I attach.
I like to change the path the external reference assembly file (in the red ellipse) to the correct value. (C:\TE3\...)

Have a any possibility?
I don't able to change in the Solidworks.

RE: Who used the Component2::UpdateExternalFileReferences API function?

(OP)
I found the solution: SldWorks::ReplaceReferencedDocument()
Thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources