mgrigoriev
Guest
|
Posted:
Wed Dec 15, 2004 10:25 pm Post subject:
Get block attributes from a block inside an xref |
|
|
Hi,
I am picking an entity with GetSubEntity. This entity is part of a block that is inside an xref. The block has attributes. How can I get these attributes?
Here's what I do:
objUtil.GetSubEntity Object, basePnt, varMatrix, varData, strPrmt
Set objOwner = ThisDrawing.ObjectIdToObject(Object.OwnerID)
I can't get attributes from objOwner.
Thanks,
Mike
|
|
Alfred NESWADBA
Guest
|
Posted:
Thu Dec 16, 2004 1:26 pm Post subject:
Re: Get block attributes from a block inside an xref |
|
|
In article <11125235.1103131567909.JavaMail.jive@jiveforum1.autodesk.com>, nospam@address.withheld says...
| Quote: | Hi,
I am picking an entity with GetSubEntity. This entity is part of a block that is inside an xref. The block has attributes. How can I get these attributes?
Here's what I do:
objUtil.GetSubEntity Object, basePnt, varMatrix, varData, strPrmt
Set objOwner = ThisDrawing.ObjectIdToObject(Object.OwnerID)
I can't get attributes from objOwner.
Thanks,
Mike
hi mike, |
the ownerid of an object within an xref is the xref itself, so you have to go through the nested-elements in contextdata of 'GetSubEntity'
Public Sub test()
Dim tEnt As AcadEntity
Dim tPnt As Variant
Dim tMat As Variant
Dim tCont As Variant
On Error Resume Next
Call ThisDrawing.Utility.GetSubEntity(tEnt, tPnt, tMat, tCont, "Select Block in XRef: ")
If (Not (tEnt Is Nothing)) Then
If TypeOf ThisDrawing.ObjectIdToObject(tCont(0)) Is AcadBlockReference Then
Dim tBlRef As AcadBlockReference
Set tBlRef = ThisDrawing.ObjectIdToObject(tCont(0))
If tBlRef.HasAttributes Then
Dim tAtts As Variant
'here we are
tAtts = ThisDrawing.ObjectIdToObject(tCont(0)).GetAttributes
End If
End If
End If
On Error GoTo 0
End Sub
- alfred - |
|