Accessing SW API in VB6 without loading SW?

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

Reply to
John Dewbert
Loading thread data ...

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-

Reply to
Heikki Leivo

I guess it makes sense... :-)

Thanks!

John.

"Heikki Leivo" a écrit dans le message de news:%UAqc.1939$ snipped-for-privacy@reader1.news.jippii.net...

Reply to
John Dewbert

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

Reply to
Juan C Perez

If you just want some file properties, or the preview, you can you dsofile.exe

Evan

de

Reply to
Evan T. Basalik

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.