我試圖從.NET調用內置的AutoCad Electrical LISP命令"c:wd_insym2"
。 我最近安裝了AutoCad 2016,它現在有Editor.Command和Editor.CommandAsync函數,但是我可以找到的所有幫助/論壇帖子都指向使用它調用LINE,CIRCLE等AutoCad命令。 我想調用一個lisp命令,如:從AutoCAD .NET調用LISP命令Editor.CommandAsync
(c:wd_insym2 "HPB11.dwg" (list 0 0) 1.0 nil)
它在0, 0
處插入一個按鈕符號。
下面是我得到了什麼(我一直在使用CommandAsync因爲我有麻煩了發出這個命令之前同步使用Application.Invoke:AutoCad Command Rejected "Undo" when using Application.Invoke()
<CommandMethod("SendCmdAsync", CommandFlags.Modal)>
Async Sub SendCmdAsync()
Dim doc As Document = DocumentManager.MdiActiveDocument
Dim ed As Editor = doc.Editor
Dim cmd As String = "(c:wd_insym2 " & ControlChars.Quote & "HPB11.dwg" & ControlChars.Quote & " (list 0 0) nil nil)"
ed.WriteMessage(vbNewLine & "Trying to execute: <" & cmd & ">" & vbNewLine)
Await ed.CommandAsync(cmd)
ed.WriteMessage(vbNewLine & "Done.")
End Sub
當我運行它,它說:「LISP命令不可用」
是我在做什麼可能的,如果是這樣,我在做什麼錯