Search code examples
c#autocadautocad-pluginautolisp

Is there a .NET API version for AutoLisp's vlax-ldata-put?


Is there a way to model AutoLisp's vlax-ldata-put? I'd like to store data in an AutoCad drawing's Named Object Dictionary using the .Net API (C#), and access that data via AutoLisp's vlax-ldata-get.


Solution

  • The way that I solved this is to create a lisp function

    (defun C:PutData ( object / )
        (vlax-ldata-put object)
    ); end
    

    which can then be called using Application.Invoke(resultBuffer), with the result buffer containing the object's data. Since I have lisp code that I'm working with, this works to pass data from C# to the lisp, at least until I can fully implement C# and used named object dictionaries and/or xrecords.