AcadExternalReference

Discussion in 'AutoCAD' started by Mike Daugird, Feb 17, 2004.

  1. Mike Daugird

    Mike Daugird Guest

    I have a routine as follows
    Dim ObjXRef As AcadExternalReference

    For Each ObjXRef In ThisDrawing.ModelSpace.getxre
    PT1 = ObjXRef.InsertionPoint
    StrTemp = StrTemp & "MSPACE" & ObjXRef.Layer & ObjXRef.Name & ";" & PT1(0) & ";" & PT1(1) &
    ";"
    Next ObjXRef
    this is to make a ; delimited file of the xrefs in model space and the insertion point,(z is at zero
    for the drawing in this company)

    I get a type mismatch error.
    What is the trick. I do this all the time for a selection set and block refrences.

    do I have to dim ObjXRef as an AcadEntity and then check the type to see if it is an xref?
    Is there a better way?
    PS I know there are xrefs..
     
    Mike Daugird, Feb 17, 2004
    #1
  2. Mike Daugird

    Matt W Guest

    Try this instead...

    Public Sub Test ()
    Dim objEnt As AcadEntity
    Dim ObjXRef As AcadExternalReference
    Dim PT1 As Variant

    For Each objEnt In ThisDrawing.ModelSpace
    If TypeOf objEnt Is AcadExternalReference Then
    Set ObjXRef = objEnt
    PT1 = ObjXRef.InsertionPoint
    Debug.Print "MSPACE" & ObjXRef.Layer & ObjXRef.Name & ";" &
    PT1(0) & ";" & PT1(1) & ";"
    End If
    Next objEnt
    End Sub
     
    Matt W, Feb 18, 2004
    #2
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.
Similar Threads
Loading...