It is currently Wed Jun 19, 2013 10:31 pm

All times are UTC





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Save back in AutoCAD
PostPosted: Fri Nov 05, 2010 2:50 am 
Offline
MCAD Expert
User avatar

Joined: 31 Oct 2007
Posts: 1002
Country: Australia
State: Non US/CAN Resident
CAD System: Inventor
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?

_________________
Stew
"Oompa Loompas of science" - Sheldon Cooper
I thought I was wrong once but I was mistaken


Share on FacebookShare on TwitterShare on DiggShare on DeliciousShare on TumblrShare on Google+
Top
 Profile  
 
 Post subject: Re: Save back in AutoCAD
PostPosted: Fri Nov 05, 2010 5:47 am 
Offline
MCAD Contributer

Joined: 27 May 2006
Posts: 67
Country: Denmark
State: Non US/CAN Resident
CAD System: Inventor
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
POWERED_BY