win32com problem: more than one instance

Thomas Rademacher thomas.rademacher at
Fri Aug 31 14:20:22 CEST 2007


I start my script simultaneously in any dos-shells several
times. But I get every time the same solidworks instance.
I see in the proccess (task) manager only one solidworks.exe
Therefore I get for all simultaneous conversions the same output file.

I tested the same code with excel ( and her I get many
instances of excel in proccess (task) manager.
How can I get many instances of solidworks?

Is it a problem of python?
Or is it a problem of the Solidworks-COM-Implemention and I get the
same problem with an C++ client implementation?

Thanks for your help, Thomas
   import pythoncom

   sldworks = gencache.EnsureModule('{83A33D31-27C5-11CE-
BFD4-00400513BB57}', 0x0, 13, 0)
   sw = sldworks.ISldWorks(DispatchEx('SldWorks.Application'))
   swmodel, errors, warnings = sw.OpenDoc6(sourceName,
constants.swDocPART, constants.swOpenDocOptions_Silent, "")
   activeDoc = sw.ActiveDoc
   retval, errors, warnings = swmodel.SaveAs4(targetName,
constants.swSaveAsCurrentVersion ,
constants.swOpenDocOptions_Silent )


   import pythoncom

   myExcel = win32com.client.DispatchEx('Excel.Application')
   myExcel.Visible = 1
   Excel = myExcel.Workbooks.Open(excelfile, 0, False, 2)
   Excel.Saved = 1
   del myExcel
   del Excel


More information about the Python-list mailing list