TheSwamp

Code Red => .NET => Topic started by: jtoverka on May 07, 2022, 10:34:15 AM

Title: Lisp Equivalent to AddCommand
Post by: jtoverka on May 07, 2022, 10:34:15 AM
Hello All,

Is there an equivalent to Autodesk.AutoCAD.Internal.Utils.AddCommand for AutoLISP functions?
The reason I want to directly register LISP functions instead of the LispFunction attribute is I am using an IronPython module to load Python scripts into AutoCAD. It would be nice to create Lisp functions from Python. Right now I don't know how to use .NET attibutes in Python as decorators, so I am adding python functions as commands directly.
Title: Re: Lisp Equivalent to AddCommand
Post by: It's Alive! on May 08, 2022, 05:53:29 AM
I see a RegisterLispCommand in the same space, I have no idea how to use it.
Possibly use AddCommand first? I don’t see an analog for acedGetArgs(), maybe you can call GetLispSymbol, SetLispSymbol to pass arguments
I don’t know if it’s possible to do via p/invoke, i.e. acedDefun and listen for AcRx::kInvkSubrMsg
Title: Re: Lisp Equivalent to AddCommand
Post by: jtoverka on May 08, 2022, 02:14:36 PM
Maybe I'll create Lisp/Python wrappers using GetLispSymbol, SetLispSymbol.