- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I have a serious problem with saving drawings that are modified using "sendstringtoexecute".
When my code only does the "sendstringtoexecute" commands, everything is fine, and AutoCad's manual closure of open drawings works.
'------------------------------------------
Dim p As Document
p = oApp.DocumentManager.Open("C:\Users\konta\Documents\dd.dwg", False)
p.SendStringToExecute("_-overkill" & vbCr & "_all" & vbCr & vbCr & vbCr, True, False, False)
p.SendStringToExecute("_Point" & vbCr & "1,1,0" & vbCr, True, False, False)
p.SendStringToExecute("_qsave" & vbCr, True, False, False)
'-----------------------------------------------------------
However, if he tries to add any form of closing the drawing to the source code, the drawings are closed but remain unchanged, which I made a few lines above, even if one of the "sendstringtoexecute" commands was "qsave". To close drawings, I tried to use:
1.
p.CloseAndDiscard
2.
Dim drawAcad As AcadDocument
drawAcad = p.GetAcadDocument
drawAcad.Close()
PS.
To avoid "COM Exception", or "Drawing is Busy" when closing drawings I have set comandsFlagon Sesion. As below
<CommandMethod("BMCzyszczenie", CommandFlags.Session)>
What can I do to save in drawings changes made with "sendstringto execute"
Thanks you in advance
Michal Wojcicki
Solved! Go to Solution.