- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need a function that I can supply with a list of vla objects and a specific number stored in xdata group 1070, and it will return a list of just the vla objects with that specific number stored. For example a list of 5 objects: who have numbers 1, 3, 2, 3, and 5 stored to them respectively, I would say specInstnce is 3, it would return a list containing just objects 2 and 4. I have also supplied the function that I am using that takes an object's ename or vla-object and returns the value that is stored in 1070.
(defun getxdata (obj)
(cond
((= 'VLA-object (type obj))
(cdr
(assoc 1070
(cdr
(car
(cdr
(assoc -3
(entget (vlax-vla-object->ename obj) (list oneline:app))
)
)
)
)
)
)
)
((= 'ENAME (type obj))
(cdr (assoc 1070 (cdr (car (cdr (assoc -3 (entget obj (list oneline:app))))))))
)
)
)
(defun getspecificowners (vlaObjects specInstnce)
(mapcar '(lambda (x) (if (= (getxdata x) specInstnce))) vlaObjects)
)
The first function here works fine, but it is probably not very well written. The second function here does not work at all and I don't think I'm anywhere close with the code currently written.
Thanks in advance.
Solved! Go to Solution.