How to get subentities of blockref object by vba?

How to get subentities of blockref object by vba?

Anonymous
Not applicable
287 Views
2 Replies
Message 1 of 3

How to get subentities of blockref object by vba?

Anonymous
Not applicable
if entry is a blockref object , what is the property or method used to get
its subentities?
0 Likes
288 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Dim oTempAcObj as AcadObject
For each oTempAcObj in yourblockrefobject
'do something
Next

"¤ý·ç»Ê" wrote in message
news:f0a8039.-1@WebX.maYIadrTaRb...
> if entry is a blockref object , what is the property or method used to get
> its subentities?
>
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
If you want it's attributes, use the GetAttributes and/or
GetConstantAttributes methods. To get at the lines/arcs/circles/etc. that
make up the geometry of the block you must iterate the blockref's block
definition. Here's a quick sample:

Public Sub Block_BlockRef_Sample()
Dim oBlkRef As AcadBlockReference
Dim aPnt() As Double
Dim oEnt As AcadEntity

ThisDrawing.Utility.GetEntity oBlkRef, aPnt, "Select a block: "

For Each oEnt In ThisDrawing.Blocks(oBlkRef.Name)
With oEnt
.Layer = "0"
.Color = acByLayer
End With
Next oEnt
ThisDrawing.Regen
End Sub

Just remember that changing the block definition will change ALL block
references...
--
Bobby C. Jones
http://www.acadx.com
0 Likes