.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Saving in other versions in VB.net 2005

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
344 Views, 2 Replies

Saving in other versions in VB.net 2005

I'm not able to save in different versions of Autocad:

the folliwing code:
myDB.SaveAs(myPFR.StringResult, DwgVersion.Current)
works perfect for AutoCAD 2008, but if I try any of the other enum strings like "DwgVersion.AC1014" or "DwgVersion.AC1800" I get an error.

Looking in the online help I foun the list of enum types in ObjectArx, that has a lot of codes, but these values are not the same that I get in VB.Net.

Is there something special to do? Actualy I need to export in AutoCAD 2000-2004.dwg and AutoCAD 2000-2004.dxf
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

wrote

>> I get an error.

Please don't just say "i get an error".

What error are you getting?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 3 of 3
Anonymous
in reply to: Anonymous

Sorry, I apologize, but i wrote the post in a hurry after searching in thee discussion group and on the web for a while!

what follows is a snippet of the program that saves the drawing, and it works perfect with "DwgVersion.Current"

Private Sub SalvaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalvaMenuItem.Click
Dim myDB As DatabaseServices.Database
Dim myDWG As ApplicationServices.Document

' Connect to current Active Drawing
myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument
myDB = myDWG.Database

Dim myEd As EditorInput.Editor
Dim myPFR As EditorInput.PromptFileNameResult
Dim myPSO As New EditorInput.PromptSaveFileOptions("Select a file:")
myEd = myDWG.Editor

' Save File dialog setup
With myPSO
.InitialDirectory = My.Computer.FileSystem.CurrentDirectory
.Filter = "AutoCAD DWG Files|*.dwg"
End With

' Show Save Dialog
myPFR = myEd.GetFileNameForSave(myPSO)


'this line of code works!
'myDB.SaveAs(myDWG.Name, DwgVersion.Current) <---- works fine


'THIS IS THE LINE THAT BRINGS THE FOLLOWING ERROR: eInvalidDwgVersion
myDB.SaveAs(myPFR.StringResult, DwgVersion.AC1008) <---- ERROR: eInvalidDwgVersion



End Sub


as you can see I'm not doing nothing special, just used one of the string that VS 2005 gives me in an AutoCad manged program.

As I said in my previous post I'm in the need to save my current document in different versions (used by other software) AutoCAD 2000-2004.dwg and AutoCAD 2000-2004.dxf.
Acutally if you can tell me how to translate the online guide AcApDocument::SaveFormat Enum in the strings returned in VisualStudio it would be great.

Thanks in advance
René

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost