auto lisp comman .net

auto lisp comman .net

cihanbaki2147
Contributor Contributor
478 Views
4 Replies
Message 1 of 5

auto lisp comman .net

cihanbaki2147
Contributor
Contributor

how  to  atulisp  command  run  autocad.net  ?

0 Likes
479 Views
4 Replies
Replies (4)
Message 2 of 5

_gile
Consultant
Consultant

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.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 5

antonio.leonardo
Advocate
Advocate

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

exam-483-programming-in-c.png

0 Likes
Message 4 of 5

_gile
Consultant
Consultant

@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.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 5 of 5

antonio.leonardo
Advocate
Advocate

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

exam-483-programming-in-c.png

0 Likes