TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: T.Willey on July 11, 2006, 07:19:38 PM
-
I'm trying to help someone on the Adesk Ng. What it looks like he is wanting to do, is add entity code data to a dictionary object as xrecords. I posted one routine that I use to do this, but he said that it error'ed, and when I tested it with entity code, it did. Enough back ground I hope.
My question is, Can you input a list into an Xrecord? My first thought is no, but would like input from people with more experience than I have in this area. If needs be, I can post the code that I shared.
Thanks in advance for any/all help.
-
Here is a quick code that I can up with to see if that was the problem, and right now it seems to work, but I haven't the time to test if correctly. I will get back at this tomorrow, but here is the code if anyone wants to see it. It can be written better, but I just wanted to get something working.
(defun MakeVariant (Lst)
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray
vlax-vbVariant
(cons 0 (1- (length Datalist)))
)
(mapcar
'(lambda (x)
(if (equal (type x) 'LIST)
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray
vlax-vbVariant
(cons 0 (1- (length x)))
)
x
)
)
x
)
)
Lst
)
)
)
)
I know it should be recursive, but when I tried it first it didn't work, I think I can do it now, but don't have the time. :-)
-
nevermind...... (where is the remove button.... )
-
Luis, they are trying to use ActiveX and, as Tim discovered, you must convert all lists to variants.
Tim, I don't think you would need to make it recursive for this application since an Entity list will never be nested beyond the point/vector types.
Oops, Luis withdrew his response......but I'll leave this for Tim anyway.
-
(where is the remove button.... )
Good question, LE! We used to have a delete, didn't we?
-
(where is the remove button.... )
Good question, LE! We used to have a delete, didn't we?
Yes.... :-(
It may be part of the update for the site.... BTW, I had previously the option to "Remove the topic" available on this one (that I did not started), very strange.
-
Luis, they are trying to use ActiveX and, as Tim discovered, you must convert all lists to variants.
Tim, I don't think you would need to make it recursive for this application since an Entity list will never be nested beyond the point/vector types.
Oops, Luis withdrew his response......but I'll leave this for Tim anyway.
Sorry;
I was out of the scope... that's why..... :-(
-
Tim, I don't think you would need to make it recursive for this application since an Entity list will never be nested beyond the point/vector types.
Wondering aloud <<but I took a sleeping pill about 1/2 hour ago, so I could be daffy in the head>> what about xdata?
Having said that, without the benefit of understanding the application I fnd the notion of storing entity data in xrecords a bit superfluous. I can only guess that the application is performing some kind of roll-back activities.
-
Well, I don't have Autocad here to check but I was under the impression Xrecord data types were only allowed up to ~369 . Xdata starts at 1000 so that would preclude them from being in the Xrecord. Or am I not recalling correctly?
-
That makes sense Jeff, surely more than my last couple posts.
:ugly:
-
I have no idea what the OP on the Adesk Ng wanted help for. I was only trying to find an answer to the problem, since I didn't know the answer, and I wanted to.
I can only guess that the application is performing some kind of roll-back activities.
This is my guess also.
Well, I don't have Autocad here to check but I was under the impression Xrecord data types were only allowed up to ~369 . Xdata starts at 1000 so that would preclude them from being in the Xrecord. Or am I not recalling correctly?
I think you are right Jeff.
-
Sorry Tim, didn't mean to sound so negative. Terse Post + Under The Influence.
-
Sorry Tim, didn't mean to sound so negative. Terse Post + Under The Influence.
No problem at all Michael. I didn't take it that way.