Message 1 of 1
Depth of selected xref??

Not applicable
03-08-2004
12:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This "simple" little program is starting to drive me up the wall.
I've got this little program (see code below) that allows the user to select an xref and then unloads it.
The problem is, if the selected xref is attached to an xref that is attached to an xref, it unloads the parent xref and not the selected child.
Is there an easy way of determining how deep an xref is??
--------------------------------------------------------------------------------
Public Sub PickXref()
Dim Entity As AcadEntity
Dim Point As Variant
Dim BLK As AcadExternalReference
On Error Resume Next
Do
ThisDrawing.Utility.GetEntity Entity, Point, "Select Xref: "
If Err.Number <> 0 Then
ThisDrawing.SendCommand "_vbaunload" & vbCr & """PickXref.dvb""" & vbCr
Exit Do
Else
If TypeOf Entity Is AcadExternalReference Then
Set BLK = Entity
ThisDrawing.Blocks.Item(BLK.Name).Unload
End If
End If
Loop
End Sub
--------------------------------------------------------------------------------
--
Matt W
There are 3 kinds of people:
Those who can count, and those who can't.