Accessing SW API in VB6 without loading SW?

Discussion in 'SolidWorks' started by John Dewbert, May 17, 2004.

  1. John Dewbert

    John Dewbert Guest

    Hello to all,

    I would like to know if there is a way to use SW API in VB6 without loading
    SolidWorks.

    For example, the following code works:

    -=-=-=-

    Const FileName = "F:\Assemblage_AB.SLDASM"
    Set swApp = CreateObject("SldWorks.Application")
    swApp.Visible (True)
    swApp.UserControl (True)
    Dependances = swApp.GetDocumentDependencies(Fichier, False, True)

    -=-=-=-

    However, it needs to load SW. Is there a way to avoid this?

    It tried to remove the line with the CreateObject and use:
    Dependances = SldWorks.GetDocumentDependencies(Fichier, False, True, False)

    However, I got an error.

    Thank you for your help.

    John H. Dewbert
     
    John Dewbert, May 17, 2004
    #1
  2. John Dewbert

    Heikki Leivo Guest

    False)

    Well, if you don't Set the SldWorks variable to anything, it will equal to
    Nothing. Nothing cannot do Anything, it is just like calling a dead man and
    expecting him to pick up the phone. You have to summon SolidWorks from death
    by creating an instance of it before calling any functions.

    -h-
     
    Heikki Leivo, May 19, 2004
    #2
  3. John Dewbert

    John Dewbert Guest

    I guess it makes sense... :)

    Thanks!

    John.

     
    John Dewbert, May 19, 2004
    #3
  4. John Dewbert

    Juan C Perez Guest

    The first thing that you need to do is to load from the project
    refrence the TLB file that is located on the solidworks folder, that's
    load all the API and the intellisense to help with your programming.

    After that you can do wherever you did, if don't do that you gonna
    have an error.

    Remember, Project / Reference. sldworks.TLB
     
    Juan C Perez, Jun 4, 2004
    #4
  5. If you just want some file properties, or the preview, you can you
    dsofile.exe

    Evan
     
    Evan T. Basalik, Jun 9, 2004
    #5
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.