Test for an XRef

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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. ___

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Thanks for the correction!
Bruce
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
With Deft Fingers, snipped-for-privacy@utanet.at (bob.at) wrote:

Thank you Bob...
Bruce
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.