.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Saving a drawing that is open but not active
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Any trick to using dwgDB.saveas on a drawing database that the user has open but NOT current on his screen?
For example, the user has DWG1 open and DWG2 open and currently active, my program modifies DWG1 (inactive) and when the program tries to run...
dwg1DB.SaveAs(filename, true, DwgVersion.Current, dwg1DB.SecurityParameters)
it errors with an elock violation, even though I lock the document with dwg1DOC.LockDocument before I try to save and unlock it after.
The same code runs fine on the current document so at this time I just ended making the other document current just to save it then switch back to previously current document.
What am I missing to save a document that is open but not current?
Re: Saving a drawing that is open but not active
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
As I understand it, since the Document is already open in the Editor, you'd either have to have the Editor save the Document via SendStringToExecute(), or consider an extension method via the AcadDocument.Save() method.
Here are a couple of example threads:
Implementing a "Quick SaveAs" command in AutoCAD using .NET
"First tell the truth, then give your opinion" - Prager
"One who is offended by truth, has no place among those who seek wisdom" - RenderMan
Re: Saving a drawing that is open but not active
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks!
AcadDocument.save() works great regardless of whether the document is current or not.
Re: Saving a drawing that is open but not active
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
CommCorp wrote:Thanks!
AcadDocument.save() works great regardless of whether the document is current or not.
You're welcome; I'm happy to help.
"First tell the truth, then give your opinion" - Prager
"One who is offended by truth, has no place among those who seek wisdom" - RenderMan
