I have a plugin that works fine from Acad 2010 up to 2015 (recompiling with the appropriate libraries of course
However, when running in 2015 (also recompiled with the 2015 librarires), it give an Invalid Input error when using
ActiveDocument.SendCommand(Chr(27)
Before somebody asks, yes, I am in a drawing...
Any idea ?
Please post the code for the Activedocument.send string, sounds like a minor API change but the code is needed to resolve.
Dim oApp As Object = Application.AcadApplication
oApp.ActiveDocument.SendCommand(Chr(27) & Chr(27))
this works with 2010 up to 2014 (included)...
2015 was modifed and this command isn't avaliable, here is a link to the doc that explains it.
Here's the sample from that page in vb.net
Public Sub InsertBlockSync()
Dim doc = Application.DocumentManager.MdiActiveDocument
Dim ed = doc.Editor
' Our insertion point is hardcoded at 10,10
ed.Command("_.INSERT", "TEST", "10,10", 1, 1, 0)
ed.WriteMessage(vbLf & "We have inserted our block.")
End Sub
If this does solve it post more of the code, as there may be alternatives to was your try to accomplish.
Quote from this blog
"For VBA – which has now been updated to VBA 7.1 and is still available as a separate download – I don’t think anything has changed: it still has the AcadDocument.SendCommand() method, which seems to work with partial commands (I’ll update this post if I hear anything different on that front)."
Well, as far as I can see from this blog, it still exists and actually, I use it to start other commands and it works. Only the chr(27) doesn't
I also tested in VBA, not even talking about .NET and same
ThisDrawing.SendCommand chr(27) works from autoCAD 2010 up to 2014, gives the input error in 2015.
Also, the purpose of sending chr(27) is to simulate hitting the ESC key. How would you do it with Editor.Command....?
Sorry, I assumed you were using .net as the forum is for .net users. You may have better luck in the Visual Basic Customization.
http://forums.autodesk.com/t5/visual-basic-customization/bd-p/33
To answer your last question, you would use Editor.SelectImplied() is one method, but with .net the are lost of solution just search the forums for "AutoCad esc using .net site:forums.autodesk.com"
result: Autocad 2015
change chr(27) to ( "exit" & vbCr)
AcadApp.Application.ActiveDocument.SendCommand("_DIM" & vbCr & "UPDATE" & vbCr & "P" & vbCr & vbCr & "exit" & vbCr)