Hi,
You can use the Document.SendStringtoExecute() method but you have to keep in mind it runs asynchrously.
Another way (which works synchronously is using Application.Invoke(). You'll find some code snippets in this thread.
Hi @cihanbaki2147,
Just by completing the @_gile answer:
Document.Editor.Command() by Autodesk.AutoCAD.EditorInput namespace is another approach to executing commands by In-Process plugins and AcadApplication.ActiveDocument.SendCommand ("('CMD_NAME') command) to send lisps by C # encoding. NET.
Att,
Antonio Leonardo
@antonio.leonardo wrote:
Hi @cihanbaki2147,
Just by completing the @_gile answer:
Document.Editor.Command() by Autodesk.AutoCAD.EditorInput namespace is another approach to executing commands by In-Process plugins
As far as I know, you cannot call an AutoLISP defined command (or any other kind of LISP function) with Editor.Command() which only accepts native commands and .NET or ObjectARX custom commands.
Yes @_gile, you're wrigth. Thanks.
@cihanbaki2147, sorry for answer. Please, considering only an out-of-process approach as AcadApplication.ActiveDocument.SendCommand (<write your AutoLisp here...>) as a way to Out-of-process plugin.
Att,
Antonio Leonardo