Select Xref to Unload (incomplete code)

Discussion in 'AutoCAD' started by Matt W, Feb 17, 2004.

  1. Matt W

    Matt W Guest

    Okay... I think I'm suffering from the 4:00 fade....
    What am I missing here??

    What I want to do is select an xref and unload it. It's gotta be something simple, but I'm not seeing it.
    Here's what I've got so far...
    Thanks in advance!

    Public Sub Main()
    Dim Entity As AcadEntity
    Dim Point As Variant

    ThisDrawing.Utility.GetEntity Entity, Point, "Select Xref: "

    If TypeOf Entity Is AcadExternalReference Then
    ' What do I need here?!?
    ' I'm drawing a blank....!!

    ' Entity.Unload '(This doesn't work)

    End If
    End Sub
     
    Matt W, Feb 17, 2004
    #1
  2. Matt W

    Graeme Guest

    I think this works

    Public Sub Main()
    Dim Entity As AcadEntity
    Dim Point As Variant
    Dim BLK As AcadExternalReference


    ThisDrawing.Utility.GetEntity Entity, Point, "Select Xref: "

    If TypeOf Entity Is AcadExternalReference Then
    Set BLK = Entity

    ThisDrawing.Blocks.Item(BLK.Name).Unload

    End If
    End Sub
    Okay... I think I'm suffering from the 4:00 fade....
    What am I missing here??

    What I want to do is select an xref and unload it. It's gotta be something simple, but I'm not seeing it.
    Here's what I've got so far...
    Thanks in advance!

    Public Sub Main()
    Dim Entity As AcadEntity
    Dim Point As Variant

    ThisDrawing.Utility.GetEntity Entity, Point, "Select Xref: "

    If TypeOf Entity Is AcadExternalReference Then
    ' What do I need here?!?
    ' I'm drawing a blank....!!

    ' Entity.Unload '(This doesn't work)

    End If
    End Sub
     
    Graeme, Feb 17, 2004
    #2
  3. Matt W

    Matt W Guest

    Auuuuuuggghhhhh!!
    I was so close, yet so far.

    I had this at one point...
    Set BLK = Entity

    and I had this at one point...
    ThisDrawing.Blocks.Item(BLK.Name).Unload

    but I never had them together!!!


    Thanks, Graeme!!

    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.

    I think this works

    Public Sub Main()
    Dim Entity As AcadEntity
    Dim Point As Variant
    Dim BLK As AcadExternalReference


    ThisDrawing.Utility.GetEntity Entity, Point, "Select Xref: "

    If TypeOf Entity Is AcadExternalReference Then
    Set BLK = Entity

    ThisDrawing.Blocks.Item(BLK.Name).Unload

    End If
    End Sub
    Okay... I think I'm suffering from the 4:00 fade....
    What am I missing here??

    What I want to do is select an xref and unload it. It's gotta be something simple, but I'm not seeing it.
    Here's what I've got so far...
    Thanks in advance!

    Public Sub Main()
    Dim Entity As AcadEntity
    Dim Point As Variant

    ThisDrawing.Utility.GetEntity Entity, Point, "Select Xref: "

    If TypeOf Entity Is AcadExternalReference Then
    ' What do I need here?!?
    ' I'm drawing a blank....!!

    ' Entity.Unload '(This doesn't work)

    End If
    End Sub
     
    Matt W, Feb 18, 2004
    #3
  4. Matt W

    Graeme Guest

    Glad to have been able to help. This is the first time I've been able to contribute to the vba group as opposed to being helped, so thank you Matt.

    Graeme
    Auuuuuuggghhhhh!!
    I was so close, yet so far.

    I had this at one point...
    Set BLK = Entity

    and I had this at one point...
    ThisDrawing.Blocks.Item(BLK.Name).Unload

    but I never had them together!!!


    Thanks, Graeme!!

    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.

    I think this works

    Public Sub Main()
    Dim Entity As AcadEntity
    Dim Point As Variant
    Dim BLK As AcadExternalReference


    ThisDrawing.Utility.GetEntity Entity, Point, "Select Xref: "

    If TypeOf Entity Is AcadExternalReference Then
    Set BLK = Entity

    ThisDrawing.Blocks.Item(BLK.Name).Unload

    End If
    End Sub
    Okay... I think I'm suffering from the 4:00 fade....
    What am I missing here??

    What I want to do is select an xref and unload it. It's gotta be something simple, but I'm not seeing it.
    Here's what I've got so far...
    Thanks in advance!

    Public Sub Main()
    Dim Entity As AcadEntity
    Dim Point As Variant

    ThisDrawing.Utility.GetEntity Entity, Point, "Select Xref: "

    If TypeOf Entity Is AcadExternalReference Then
    ' What do I need here?!?
    ' I'm drawing a blank....!!

    ' Entity.Unload '(This doesn't work)

    End If
    End Sub
     
    Graeme, Feb 18, 2004
    #4
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.