Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

SW2006 VBA List External References question

Status
Not open for further replies.

dbrew0

Mechanical
Jul 20, 2006
4
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

 
Replies continue below

Recommended for you

Look at the component object. I have used this for other applications.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor