OGP99
OGP99

Reputation: 169

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.

Upvotes: 0

Views: 231

Answers (2)

OGP99
OGP99

Reputation: 169

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.

Upvotes: 0

gileCAD
gileCAD

Reputation: 2493

ldata stands for 'LISP data'. The data are stored in special kind of dictionaries which can only be accessed by LISP. You should use standard named dictionaries and xrecords if you want the data to be accessible from both .NET and AutoLISP. Have a look at the dictionary handling LISP functions (namedobjdict, dictadd, dictsearch, ...) from this page.

Upvotes: 1

Related Questions