API performance problems

I have developed an application in Visual Basic 6.0 which performs various tasks on SolidWorks files via the API.

The main tasks being: 1) BoM analysis 2) Configuration specific custom property reading and writing 3) Opening / closing and saving of files

The functions are encapsulated in a dll file, which are then in turn called from various VB applications

I am experiencing problems with performance of the API outside of SolidWorks, i.e. the same function will run as a SolidWorks Macro in a second, but may take 20 or more seconds to perform the same task in a VB 6.0 application.

Whilst 20 seconds may not seem excessive for an assembly, my application traverses all assemblies recursively to generate complete BoMs of all assemblies, some of which may be quite complicated. If it takes 20 seconds to analyse each assembly, the performance hit can be very noticeable.

Is this normal or am I missing something?

Do you have any suggestions or guidelines for speeding up the execution of such tasks?

Any help would be much appreciated. Brian

Reply to
Owenreagh
Loading thread data ...

Sounds normal to me. The way I understand, with VB6, you're going out-of-process to perform in-process intensive operations. With the macro, you stay in-process. I think the best way to do it is with an add-in .dll (also in-process). Someone else, please correct me if I'm missing something.

Kent

Reply to
KCS Company

I was afraid someone was going to say that

I did some testing and changed my app to a full in-process dll and it runs 30 times faster

The reason I had it as an out-of-process exe was because the main app handles several different CAD applications. If it is handeling a Solidworks file, it uses my Solidworks DLL function library and if it is handeling an Inventor file, it uses my Inventor DLL function library, ProE etc

I don't seem to get the same performance hit with Inventor as I can use the Inventor Apprentice API for slow tasks, pity there isn't a similar API for SolidWorks

I am going to have to rethink the implemtation a bit.

Reply to
owenreagh

Some things that might help.

Reply to
That70sTick

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.