Message 1 of 4
Exploding blocks
Not applicable
06-26-2007
04:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am having a problem that is really starting to irritate me. I am trying to explode a block reference and get the objects in the block back in an array. Here is a very simple version of what I am trying to do:
Public Sub Test()
Dim ent As AcadEntity
Dim block As AcadBlockReference
Dim blockObjects As Variant
For Each ent In ThisDrawing.ModelSpace
If ent.ObjectName = "AcDbBlockReference" Then
Set block = ent
Set blockObjects = block.Explode()
End If
Next
End Sub
But it fails on this line :
Set blockObjects = block.Explode()
I get a Runtime Error '13' : Type Mismatch
I thought explode was supposed to return an array of variants, but maybe I'm mistake. Any help would be greatly appreciated.
Thanks in advance
Public Sub Test()
Dim ent As AcadEntity
Dim block As AcadBlockReference
Dim blockObjects As Variant
For Each ent In ThisDrawing.ModelSpace
If ent.ObjectName = "AcDbBlockReference" Then
Set block = ent
Set blockObjects = block.Explode()
End If
Next
End Sub
But it fails on this line :
Set blockObjects = block.Explode()
I get a Runtime Error '13' : Type Mismatch
I thought explode was supposed to return an array of variants, but maybe I'm mistake. Any help would be greatly appreciated.
Thanks in advance