Test for an XRef

Apr 19, 2004 4 Replies

Does anyone know if you can Test (via Lisp) in a drawing to see if it has an Xref or not?



I've a program I wrote which opens selected DWG files... I clean them up, etc. What I want to do is IF the drawing has an Xref (ie a Border in Paperspace), to set TileMode to 1... if no Xref... leave it as Model Space.



But I can't see how to do this... any thought?



Regards,



Bruce


Step with (tblnext "BLOCK" T) and (tblnext "BLOCK") through the block table an check the value of dxf code 70: if it is >=4 it is some kind of xref.

More correctly, you should do a bitwise evaluation of code 70. If the "4" bit is set, the block is an XRef:

(if (= (logand (cdr (assoc 70 dat)) 4) 4) (alert "This is an XREF") (alert "This is a normal Block") )

Code 70 may be greater than 4, even though the 4 bit is not set; individual bit values currently in use go as high as 64. See the Customization Guide section of HELP. ___

Thanks for the correction!

Bruce

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required