Automatic by API "SaveAs" vs. "Export"

All topics about specific development with COM interface, LIP language, API in VB, ...

Moderators: remi77, Daniel, jacs

Holzknoten
Master Corporal
Master Corporal
Posts: 43
Joined: Fri Apr 29, 2011 7:16 am
TopSolid Module: TopSolid'Wood
TopSolid Version: 6.17
Location: Hannover
Contact:

Automatic by API "SaveAs" vs. "Export"

Unread post by Holzknoten » Sun Feb 23, 2014 10:35 am

Hi TopSolid users and supporter,

i want to automaticly export my files in mutiple formats (dwg/dxf/pdf/jpg)

For that i use the following code of the API-help-file.

Code: Select all

IDocument.Export(Path, InterfaceProvider, Ask)
or

Code: Select all

IDocument.SaveAs(Name, Ask)
My working steps in VB with SaveAs for a Designfile (.top) and Draftfile (.dft)

Code: Select all

...
IDocument.SaveAs("C:\test.dwg", True)
IDocument.SaveAs("C:\test.dxf", True)
IDocument.SaveAs("C:\test.jpg", True)
My working steps in VB with Export for a Designfile (.top) and Draftfile (.dft)

Code: Select all

...
IDocument.Export("C:\test.dwg", "dwg", True)
IDocument.Export("C:\test.dxf", "dxf", True)
IDocument.Export("C:\test.jpg", "jpg", True)
My working steps in VB with Export for a Draftfile (.dft) only. Why not for a Designfile (.top)?

Code: Select all

...
IDocument.Export("C:\test.pdf", "pdf", True)
But what is about the Ask of...
IDocument.Export(Path, InterfaceProvider, Ask)
The API-help-file says:
Ask user for confirmation before saving modified referenced files (optional, default = False).
When i use True or False it doesn't matter.

Where can i change the options of dwg?
Image
The API-help-file says:
IApplication.SetExportOption(Extension, Name, Value)
AutoCAD (dxf, dwg) :
format : "dxf", "dwg", "binary dxf".
unit : "mm", "cm", "m", "km", "µm", "ft", "in", "mil", "mile", "µin".
version : "2.5", "2.6", "9", "10", "11", "12", "13", "14", "2000".
Example i used before Export-function:

Code: Select all

App.SetExportOption("dxf", "unit", "mm")
App.SetExportOption("dxf", "format", "dwg")
App.SetExportOption("dxf", "version", "2000")
The DWG-file is everytime saved in the highest version(2013)

Any experience about that?
Attachments
options.PNG
options.PNG (2.26 KiB) Viewed 3382 times
by Holzknoten

Holzknoten
Master Corporal
Master Corporal
Posts: 43
Joined: Fri Apr 29, 2011 7:16 am
TopSolid Module: TopSolid'Wood
TopSolid Version: 6.17
Location: Hannover
Contact:

Unread post by Holzknoten » Wed Jul 23, 2014 5:12 pm

the solution is to use the lip-file for save command.

inside there is a command with some parameters like ....
- DWG or DXF
- version

works perfect for an automatic command for a list of files.
by Holzknoten

Post Reply