.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Getting Saving Settings.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi there,
@The moment i am trying to get the saveAs settings that were used when the user hits the save/saveAs button in autocad.
My addin needs to store the current document with these settings. i dont want to use some pop-up dialog.
The .currentVersion property saves the document with the applicationversions standard saveprofile.
I need some kind of property that reflects the users saveAs settings.
Is there any way getting those information via the .net api without doing the interop stuff?
thank you
Solved! Go to Solution.
Re: Getting Saving Settings.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
If you mean the current format for save, then, for example:
[CommandMethod("DefForSave")]
public static void DefForSave()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
object acadObject = Application.AcadApplication;
object preferences = acadObject.GetType().InvokeMember("Preferences",
BindingFlags.GetProperty, null, acadObject, null);
object prefOpenSave = preferences.GetType().InvokeMember("OpenSave",
BindingFlags.GetProperty, null, preferences, null);
object dwgversion = prefOpenSave.GetType().InvokeMember("SaveAsType",
BindingFlags.GetProperty, null, prefOpenSave, null);
ed.WriteMessage("\nDefault Format For Save= {0}", dwgversion);
}
Re: Getting Saving Settings.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank you very much for your quick answer Alexander,
i am getting an integer value.
unfortuntley i cannot just use this value within the saveAs method of my document.
i get the following values
DWG2010: 48
DWG2007: 36
DWG2000: 12
is there any mapping-Table ? do i have to map it myself?
Re: Getting Saving Settings.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
MiDu75 wrote:
Thank you very much for your quick answer Alexander,
i am getting an integer value.
unfortuntley i cannot just use this value within the saveAs method of my document.
i get the following values
DWG2010: 48
DWG2007: 36
DWG2000: 12
is there any mapping-Table ? do i have to map it myself?
But you can use this value with AcadDocument.SaveAs method:
object adoc = doc.AcadDocument;
object [] parms = new object[2];
parms[0] = doc.Name; parms[1] = dwgversion;
adoc.GetType().InvokeMember("SaveAs", BindingFlags.InvokeMethod, null, adoc, parms);
Re: Getting Saving Settings.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Good morning Alexander.
Your suggestions where just perfect. Exactly what i was looking for. Thank you very much.
Is there any documentation about the invokemembers and its parameters for ACAD2012/13?
For the rest of this thread it can be closed. 5-Stars-Rating. ![]()
Re: Getting Saving Settings.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
InvokeMember is a method of type System.Type (part of Reflection)
AcadDocument, AcadPreferences, etc. are classes from AutoCAD ActiveX API



