intgrating vb with solidworks

Discussion in 'SolidWorks' started by fawkes.pheonix, Feb 22, 2006.

  1. hi i was just wondering if any of you know about a guide that can tell
    me how to integrate vb with solidworks coz the tutrial they put in the
    software isn't very helpful

    thanks
     
    fawkes.pheonix, Feb 22, 2006
    #1
  2. fawkes.pheonix

    That70sTick Guest

    How well do you know VB? I found SW macros made little sense until I
    stepped back and did some straight VB programming. VBA and VB6 are
    most similar to SW macros (which are VBA).

    After that, the most important concept is how other programs (Excel,
    SW) "plug into" VB. The programs need to be added as project as
    references, then objects created that access the applications and
    various documents and other entities.

    For example, to get access to SW in a VB program, you first need to
    include the "SW 200x Type Library" under "Project --> References" (in
    VBA environment). Then, access the SW application by creating an
    object, i.e.:
    Dim swApp as object 'defines an object that carries the SW application
    Set swApp = CreateObject("SldWorks.Application") 'hooks up SW to your
    swApp object variable

    More advanced users prefer "Dim swApp as SldWorks.SldWorks". This is
    called "early binding". It's a way of being more specific with your
    object variables. It has many advantages.

    <http://www.esoxrepublic.com/devtools> has a project for creating a VB
    addin. Might be a bit advanced.
     
    That70sTick, Feb 22, 2006
    #2
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.