Aug 4, 2003 #1 M mattis Usenet Archive Joined Jul 7, 2003 Messages 14 Reaction score 0 How do I find out which xrefs are nested and which ones aren't? I want a list of xref names that are on the top level (not the lower level stuff).
How do I find out which xrefs are nested and which ones aren't? I want a list of xref names that are on the top level (not the lower level stuff).
Aug 4, 2003 #2 M mattis Usenet Archive Joined Jul 7, 2003 Messages 14 Reaction score 0 There's no way to do this with tblsearch or tblnext?
Aug 4, 2003 #3 R Rudy Tovar Usenet Archive Joined Jul 8, 2003 Messages 631 Reaction score 0 You can (ssget "x" <filters>) then return the names, and 'tblsearch' all the components. Just so you know, you'll have to create a reoccurring loop to get the nested 'insert'.
You can (ssget "x" <filters>) then return the names, and 'tblsearch' all the components. Just so you know, you'll have to create a reoccurring loop to get the nested 'insert'.
Aug 4, 2003 #4 J Jeff Mishler Usenet Archive Joined Jul 3, 2003 Messages 987 Reaction score 0 This was posted over a year ago and I find it quite handy, Jeff ;;; Stephan Koster 2002, posted to adesk customization ;;; newsgroup on 4/21/2002 (defun XrefTree (/ nested_p build_retlist firstLevelXrefs name nested-xrefs nestList xrefDBase retList i ) (defun nested_p (blockname / tn tmp) (and (setq tn (tblobjname "block" blockname)) (setq tmp (entget tn)) (setq tmp (cdr (assoc 330 tmp))) (setq tmp (entget tmp)) (not (member '(102 . "{BLKREFS") tmp)) ) ) ;;; (defun build_retlist(name / next) (setq retList (cons (cons i name) retList)) (and (setq next (cdr (assoc name nestList))) (setq i (1+ i)) (foreach z next (build_retlist z)) (setq i (1- i)) ) ) ;;; (vlax-for x (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (if (= (vla-get-isXref x) :vlax-true) (progn (setq name (vla-get-Name x)) (or (nested_p name) (setq firstLevelXrefs (cons name firstLevelXrefs)) ) (setq nested-xrefs (list name)) (setq xrefDBase (vl-catch-all-apply 'vla-get-xrefdatabase (list x))) (or (vl-catch-all-error-p xrefDBase) (vlax-for xx (vla-get-Blocks xrefDBase) (if (= (vla-get-isXref xx) :vlax-true) (setq nested-xrefs (cons (vla-get-Name xx) nested-xrefs)) ) ) ) (if (cdr nested-xrefs) (setq nestList (cons (reverse nested-xrefs) nestList)) ) ) ) ) (foreach x firstLevelXrefs (setq i 0) (build_retlist x) ) (reverse retList) ) ;;; (defun c:XrefTree (foreach x (XrefTree) (repeat (* 2 (car x)) (princ " ")) (princ (cdr x)) (princ "\n") ) (princ) ) mattis said: How do I find out which xrefs are nested and which ones aren't? I want a Click to expand... list of xref names that are on the top level (not the lower level stuff).
This was posted over a year ago and I find it quite handy, Jeff ;;; Stephan Koster 2002, posted to adesk customization ;;; newsgroup on 4/21/2002 (defun XrefTree (/ nested_p build_retlist firstLevelXrefs name nested-xrefs nestList xrefDBase retList i ) (defun nested_p (blockname / tn tmp) (and (setq tn (tblobjname "block" blockname)) (setq tmp (entget tn)) (setq tmp (cdr (assoc 330 tmp))) (setq tmp (entget tmp)) (not (member '(102 . "{BLKREFS") tmp)) ) ) ;;; (defun build_retlist(name / next) (setq retList (cons (cons i name) retList)) (and (setq next (cdr (assoc name nestList))) (setq i (1+ i)) (foreach z next (build_retlist z)) (setq i (1- i)) ) ) ;;; (vlax-for x (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (if (= (vla-get-isXref x) :vlax-true) (progn (setq name (vla-get-Name x)) (or (nested_p name) (setq firstLevelXrefs (cons name firstLevelXrefs)) ) (setq nested-xrefs (list name)) (setq xrefDBase (vl-catch-all-apply 'vla-get-xrefdatabase (list x))) (or (vl-catch-all-error-p xrefDBase) (vlax-for xx (vla-get-Blocks xrefDBase) (if (= (vla-get-isXref xx) :vlax-true) (setq nested-xrefs (cons (vla-get-Name xx) nested-xrefs)) ) ) ) (if (cdr nested-xrefs) (setq nestList (cons (reverse nested-xrefs) nestList)) ) ) ) ) (foreach x firstLevelXrefs (setq i 0) (build_retlist x) ) (reverse retList) ) ;;; (defun c:XrefTree (foreach x (XrefTree) (repeat (* 2 (car x)) (princ " ")) (princ (cdr x)) (princ "\n") ) (princ) ) mattis said: How do I find out which xrefs are nested and which ones aren't? I want a Click to expand... list of xref names that are on the top level (not the lower level stuff).
Aug 5, 2003 #5 M mattis Usenet Archive Joined Jul 7, 2003 Messages 14 Reaction score 0 Wow! Works nice! I wish I could understand that vla and vlax stuff. Thanks Jeff!