XREF Overlay or Attach?

Discussion in 'AutoCAD' started by Kevin Grigsby, Jan 16, 2004.

  1. I am trying to figure out a way, via VBA, to determine if an XREF block is
    an Overlay or an Attachment?

    Thanks,
    Kevin Grigsby
     
    Kevin Grigsby, Jan 16, 2004
    #1
  2. Here you go Kevin, outta the help file:

    The IsXRef property works with the IsLayout property. If both properties
    are FALSE, then the block is a simple block. If the IsXRef property is
    TRUE, then the block is an external reference. If the IsLayout property
    is TRUE, then the block contains all the geometry associated with a
    layout.

    Dim tempBlock As AcadBlock
    Dim msg As String
    msg = vbCrLf & vbCrLf
    ThisDrawing.Application.ZoomAll
    For Each tempBlock In ThisDrawing.Blocks
    If Not (tempBlock.IsLayout) And Not (tempBlock.IsXRef) Then
    ' Block is simple
    msg = msg & tempBlock.name & ": Simple"
    ElseIf tempBlock.IsXRef Then
    ' Block is an external reference
    msg = msg & tempBlock.name & ": External Reference
    If tempBlock.IsLayout Then
    ' Block also contains layout geometry
    msg = msg & tempBlock.name & " and Contains Layout Geometry"
    End If
    ElseIf tempBlock.IsLayout Then
    ' Block contains layout geometry
    msg = msg & tempBlock.name & ": Contains Layout Geometry"
    End If
    msg = msg & vbCrLf ' Move to next line
    Next

    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jan 16, 2004
    #2
  3. I'm not sure you read the question right Mike. I think Kevin wants to know if
    there is a way to tell whether an XREF is attached versus overlaid.

    The short answer is no (at least not in vanilla VBA). The better answer is that
    you can do it with an add-in. Frank Oquendo's vbExtender will allow you to do
    it if you can get your hands on it. I'm not sure if it is still available for
    download from Frank's site www.AcadX.com. Tony Tanzillo's AcadX
    (www.caddzone.com) most likely offers similar functionality.
     
    Chuck Gabriel, Jan 16, 2004
    #3
  4. I know all that stuff Mike. I was looking more specifically to find out if
    there is a way to determine of the specific block/xref is an OVERLAY or
    ATTACH type.

    Kevin
     
    Kevin Grigsby, Jan 16, 2004
    #4
  5. Oops! You're right Chuck, I didn't pay attention.
    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jan 16, 2004
    #5
  6. Bobby C. Jones, Jan 16, 2004
    #6
  7. Sorry Kev, I didn't *really* read it:(

    Chuck's suggestion of VBExtender is good providing you're using 2002 or
    less [I can get you a copy if you want it]. I don't believe it was
    updated for 2004.

    Only way I know of is to go thru lisp - DXF code 70 for a block. If the
    value is:

    4 = This block is an external reference (attachment)
    8 = This block is an xref overlay

    There are other values for 70 as well and the values can be combined.

    Mike

    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jan 16, 2004
    #7
  8. Bobby,

    Thanks, that works for me.

    Take it easy,
    Kev
     
    Kevin Grigsby, Jan 16, 2004
    #8
  9. I'm glad that worked out for you Kevin! I'm also glad that you weren't
    "apposed", sheesh!, to VLAX :)
     
    Bobby C. Jones, Jan 16, 2004
    #9
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.