getting component names using SolidWorks API

Discussion in 'SolidWorks' started by yung, Mar 23, 2006.

  1. yung

    yung Guest

    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!
     
    yung, Mar 23, 2006
    #1
  2. yung

    TOP Guest

    There is an example in the API help that shows exactly how to do this.
     
    TOP, Mar 23, 2006
    #2
  3. 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
    4. if you want to "work" the the modeldoc object of the component, then you
    can use component2.getmodeldoc or activatedoc or opendoc
     
    Tony Lissington, Mar 23, 2006
    #3
  4. yung

    yung Guest

    thank you!
     
    yung, Mar 27, 2006
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.