API: how can I eliminate dialogues to run my program in batch without interaction

Hello,

I want to get in a batch program the dependencies from an assembly with the method GetDependencies():

docName = "J:\\Company\\rade\\sld_dev\\myAss.SLDASM" swApp = win32com.client.Dispatch("SldWorks.Application") swMod = swApp.OpenDoc(docName, 2) dependencies = swMod.GetDependencies(1,1) swApp.CloseDoc(docName) swApp.ExitApp()

This works fine with assemblies was construct in my current SolidWorks

2005 installation. But when I open assemblies from an older installation, I get the dialogue "The following documents will be converted when saved" (in german: "Die folgenden Dokumente werden beim Speichern konvertiert werden.") and I must respond to this dialogue. How can I eliminate this dialogue to run my program in batch without interaction?

When I want to get the dependencies from an assembly with missing/ nonconforming files I get a dialogue "Internal ID of document does not match the internal ID saved with the referencing document. Select yes to except or no to browse for replacement model" and I must also respond to this dialogue. How can I eliminate this dialogue to run my program in batch without interaction?

Thanks for your answer, Thomas

Reply to
thomas.rademacher
Loading thread data ...

You should note that according to API documentation, OpenDoc method is obsolete, and you should use OpenDoc6 instead. By using that method, you can use swOpenDocOptions_Silent setting to suppress all dialogs. Calling the method is a bit trickier since you have to declare variables for errors and warnings.

Hope this helps, peek at the API help for further details and examples! There is an example for opening document silently.

-h-

Reply to
Heikki Leivo

It seems to me that when I did some batch conversions around the beginning of the year the silent option didn't catch everything.

Thomas, can you run a SW conversion on the files first? I think that will run silently for the most part.

TOP

Reply to
TOP

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.