Is the idea that you have an INTersection you can Osnap to at all Block insertion points? If so, can the Lines be made part of the Block definition, rather than be independent objects? That would mean you don't need to find all Block references or insertions, but need only to get into each Block definition, once, and add the Lines. That will also save memory, and the X's will go with the Blocks when you Move them, etc. Since within the BEDIT command the insertion point is always 0,0, it's also quite easy to draw the Lines in the right place. Try this:
(defun C:BXIP ; = Blocks: add X at all Insertion Points
(/ blk)
(while (setq blk (tblnext "block" (not blk)))
(if (not (assoc 1 blk)); not an Xref [no file path]
(command "_.bedit" (cdr (assoc 2 blk))
"_.line" "_non" "-1.5,-1.5" "_non" "1.5,1.5" ""
"_.line" "_non" "-1.5,1.5" "_non" "1.5,-1.5" ""
"_.bclose" "_save"
); command
); if
); while
(prin1)
)
It draws the Lines on the current Layer, and assumes your drawing unit is a millimeter and that your 3 mm is the total length of each Line [not from the X intersection to the ends], but all those things can be adjusted.
You could also use Points, and NODe Osnap, which would simplify it a little, because it would mean drawing only one thing in each edited Block definition. It would also mean [with appropriate PDMODE setting] the added things would not change the appearance of the Blocks.
Kent Cooper, AIA