- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, Guys
I am tying to piece together a piece of lisp code that will look at all the xrefs in a drawing and find what layer they are inserted on and then print the xref name and the layer at the command line. I found this example for listing the paths Example of Listing Paths. It that does something similar to what I want. I have tried for a couple of hours to re write to give the layer name with on luck below is my code so far. If some one could get it working that would be appreciated so long since I did lisp I have forgotten most things.
(defun c:xreflayers ()
(vl-load-com)
(vlax-for item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
(if (= (vla-get-isxref item) :vlax-true)
(setq oLayer(vla-item(vla-get-layers(vla-get-activedocument (vlax-get-acad-object)))));; oxref layer
(setq layerName (cdr (assoc 8 (entget oLayer))))
)
(princ (strcat "\nXref name: "(vla-get-name item)" --- Layer: " layername)
)
)
(princ)
)
Justin Ralston
http://c3dxtreme.blogspot.com/
Solved! Go to Solution.