Test for an XRef

Discussion in 'AutoCAD' started by Mr. B, Apr 19, 2004.

  1. Mr. B

    Mr. B Guest

    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
     
    Mr. B, Apr 19, 2004
    #1
  2. Mr. B

    bob.at Guest

    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.
     
    bob.at, Apr 19, 2004
    #2
  3. Mr. B

    Paul Turvill Guest

    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.
    ___
     
    Paul Turvill, Apr 19, 2004
    #3
  4. Mr. B

    Mr. B Guest

    Thank you Bob...

    Bruce
     
    Mr. B, Apr 20, 2004
    #4
  5. Mr. B

    Mr. B Guest

    Thanks for the correction!

    Bruce
     
    Mr. B, Apr 20, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.