Inv_kaos wrote:
Hey, I thought this would be easy to find but am having a lot of trouble. I have a lot of drawings that I want to do a quick save in the files current version (AutoCAD 2007), rather that have it default to AutoCAD 2010. So I thought I could make a button or keyboard short cut to do the quick save. The save part is fine but for the life of me I can't find a way to specify the save format i.e. release 2007..
I am currently using the ThisDrawing.Save and ThisDrawing.SaveAs commands.
Anyone done this before or can give me a better solution?
Hi see in Api help for TranslatorAddIn Interface
create a ini file with your options. ver 2007 and layer etc..
Export to DWG (Copy from Api help)
This sample uses the DWG Translator Addin to publish to DWG.
Public Sub PublishDWG()
' Get the DWG translator Add-In.
Dim DWGAddIn As TranslatorAddIn
Set DWGAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC2-122E-11D5-8E91-0010B541CD80}")
'Set a reference to the active document (the document to be published).
Dim oDocument As Document
Set oDocument = ThisApplication.ActiveDocument
Dim oContext As TranslationContext
Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = kFileBrowseIOMechanism
' Create a NameValueMap object
Dim oOptions As NameValueMap
Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
Dim oDataMedium As DataMedium
Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
' Check whether the translator has 'SaveCopyAs' options
If DWGAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
Dim strIniFile As String
strIniFile = "C:\tempDWGOut.ini"
' Create the name-value that specifies the ini file to use.
oOptions.Value("Export_Acad_IniFile") = strIniFile
End If
'Set the destination file name
oDataMedium.FileName = "c:\tempdwgout.dwg"
'Publish document.
Call DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
End Sub
Ren