×
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

SW2006 VBA List External References question

SW2006 VBA List External References question

SW2006 VBA List External References question

(OP)
I'm working on a VBA application within Solidworks (SW 2006 sp 4.1) and am running into a problem.
 
I need to be able to find and list all of the assembly and part file references within an assembly programmatically.  Once I have a list of them I'll be able to manipulate the list as needed.  The problem is that in an assembly file, using the SldWorks.ModelDocExtension.ListExternalFileReferencesCount method (or SldWorks.ModelDoc2.ListExternalFileReferencesCount2) returns a 0; and using the ListExternalFileReferences method to collect the reference info yields nothing.  However, if I view the 'Find References' pull-down from within SW, it lists all of the references within that assembly.
 
If I create a part A  part file, and a part B part file; then insert part B into part A and save part A as a part file and use those methods, they do return a count >0.  However, as soon as I create an assembly of the part A part file (with part B inserted), I again get a 0 count using those methods.
 
Are there other methods that need to be used on an assembly?
 
Thanks,

Dan

RE: SW2006 VBA List External References question

Look at the component object.  I have used this for other applications.

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