VLA to VBA

VLA to VBA

Anonymous
Not applicable
326 Views
3 Replies
Message 1 of 4

VLA to VBA

Anonymous
Not applicable
Could someone please point me to the VBA analogues to the Visual Lisp expressions:

(setq XDAT (ssget "X" (list (cons 2 "XFILEDATA"))))

and

(setq XDAT (vlax-ldata-get (ssname XDAT 0) "XFILES" "Key Not found"))
0 Likes
327 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Dim oSS as AcadSeelctionSet

Set oSS = ThisDrawing.SelectionSets.Add("MySS")
Dim iCode(0) as Integer
Dim vData(0) as Variant
icode(0) = 0: vData(0) = "XFILEDATA"
oSS.Select acSelectionSetAll,,,iCode, vData


Note there is is no way (that I'm aware of) to access ldata in VBA. This is
one reason many people have advised not to use ldata.

HTH,
Jeff

wrote in message news:5419878@discussion.autodesk.com...
Could someone please point me to the VBA analogues to the Visual Lisp
expressions:

(setq XDAT (ssget "X" (list (cons 2 "XFILEDATA"))))

and

(setq XDAT (vlax-ldata-get (ssname XDAT 0) "XFILES" "Key Not found"))
0 Likes
Message 3 of 4

Anonymous
Not applicable
Have you walked into the LData snare that Autodesk
has laid ?

My advice is that you get rid of LData entirely,
and use xdictionaries/xrecords. If you don't
you will probably regret it sooner rather than
later.

In VBA or ActiveX, you can store data in xrecords,
but not in as LISP-friendly way as LData.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5419878@discussion.autodesk.com...
Could someone please point me to the VBA analogues to the Visual Lisp expressions:

(setq XDAT (ssget "X" (list (cons 2 "XFILEDATA"))))

and

(setq XDAT (vlax-ldata-get (ssname XDAT 0) "XFILES" "Key Not found"))
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thanks for everyones input and there would be one way to access LData in VBA which would be to use the command function to pass the lisp code and write the output to a USER variable, yeah a kludge I know but still...where there's a will.

I'll most probably convert it over to XData.

Thanks again.
0 Likes