Message 1 of 35
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I currently have a need for simply knowing if an xref is nested. Looking through my toolbox functions I have code for determining that based on user selection of a nested object (nentsel) but that doesn't fit my current requirements. Hard to believe those functions were written some 23 years ago! Wow.
Anyway, it's been a long time since I've written much code so I'm a wee bit rusty. Is testing for and/or using DXF code 102 enough for a nested determination? Seems to work in my limited testing.
; determine if the specified block name is a nested xref
; Arguments:
; [document] vla-object, document object
; [name] string, xref name
; Return: T or nil
(defun nestedXref-p (document name / object)
(and
(setq object (vla-item (vla-get-blocks document) name))
(= :vlax-true (vla-get-isxref object))
(not (assoc 102 (entget (vlax-vla-object->ename object))))
)
)
Solved! Go to Solution.