getting component names using SolidWorks API

Mar 23, 2006 3 Replies

I am using Solidworks API in VC++ 6.0. How can I get the parts' names in an assembly file? I could find there are some functions like "getComponents"... but not sure whether they are the correct ones I should use.



Thanks!



There is an example in the API help that shows exactly how to do this.

I use VB not C++, so you will have to translate, but here is the The following shoud do it:

  1. use GetComponents
  2. cycle through each component in the groups of components
3, use component2.name2 or component.getpathname
  1. if you want to "work" the the modeldoc object of the component, then you can use component2.getmodeldoc or activatedoc or opendoc

"yung" wrote in news:1143078825.987544.71970 @t31g2000cwb.googlegroups.com:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required