TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: whdjr on October 03, 2005, 01:04:11 PM
-
I have a list of AttributeReferences (call it ListA) and reference AttributeReference (call it RefAtt).
How would I use 'vla-item' to return the AttributeReference from ListA that matched the same 'tagstring' with the RefAtt?
Or is there another function I should be using?
-
vla-item is used on collections, not lists.
IF, and that's a big IF, ListA is a true list of AttributeReference objects and RefAtt is an AttributeReference object then perhaps this ...
(setq result
(
(lambda ( / tagstring )
(setq tagstring
(strcase
(vla-get-tagstring
RefAtt
)
)
)
(vl-remove-if-not
'(lambda (attributeReference)
(eq tagstring
(strcase
(vla-get-tagstring
attributeReference
)
)
)
)
ListA
)
)
)
)
Coded blind, so may need massaging.
-
Thanks MP,
I knew I could do it with vl-remove-if-not but thought I could do it better with vla-item. I'll try to implement your code and see what I get.
Thanks, :-)
-
You may find some useful code in this routine.
http://www.theswamp.org/forum/index.php?topic=6741.msg83413#msg83413