;;; CADALYST 07/08 http://www.cadalyst.com/code
;;; Tip 2304: Q.lsp Query an Object (c) 2008 Ron Perez

;;; Copyright© 2008 Ron Perez (ronperez@gmail.com)
;;;
;;;List all nested objects layer\entity type info
(defun dxf (x ename /)
(cdr (assoc x (entget ename)))
)

(defun c:qf (/ x z msg plt lyr)
(vl-load-com)
(if (setq x (nentsel))
(progn
(setq lyr (tblobjname "layer" (dxf 8 (car x))))
(if (= (dxf 290 lyr) 0)
(setq plt "NO")
(setq plt "Yes")
)
(setq msg (strcat
"\n[ "
(dxf 0 (car x))
" ]\n Layer: "
(dxf 8 (car x))
"\n Color: "
(itoa (dxf 62 lyr))
"\n Linetype: "
(dxf 6 lyr)
"\n Plottable: "
plt
"\n"
"\n"
)
)
(if (nth 3 x)
(progn
(setq msg (foreach z (nth 3 x)
(setq lyr (tblobjname "layer" (dxf 8 z)))
(if (= (dxf 290 lyr) 0)
(setq plt "NO")
(setq plt "Yes")
)
(setq msg
(strcat "[ "
(if (vlax-property-available-p
(vlax-ename->vla-object z)
'Path
)
(strcat "XREF - " (dxf 2 z))
(strcat "INSERT - " (dxf 2 z))
)
" ]\n Layer: "
(dxf 8 z)
"\n Color: "
(itoa (dxf 62 lyr))
"\n Linetype: "
(dxf 6 lyr)
"\n Plottable: "
plt
"\n"
"\n"
msg
)
)
)
)
)
)
(alert msg)
(princ msg)
)
(princ "\nNothing selected...")
)
(princ)
)
(c:qf)

Advertisements