Results 1 to 3 of 3

Thread: Get block attributes from a block inside an xref

  1. #1
    mgrigoriev Guest

    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

  2. #2
    Alfred NESWADBA Guest
    In article <11125235.1103131567909.JavaMail.jive@jiveforum1.a utodesk.com>, nospam@address.withheld says...
    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)).GetAttribut es
    End If
    End If
    End If
    On Error GoTo 0
    End Sub

    - alfred -

  3. #3
    mgrigoriev Guest
    Alfred, you are a genius. Thanks a lot, man.

Similar Threads

  1. Redefine Block Attributes with VBA
    By Sean in forum VBA
    Replies: 1
    Last Post: 10-23-2005, 10:02 PM
  2. Replies: 1
    Last Post: 06-18-2005, 09:10 AM
  3. Fixed scale for attributes inside an attribute block?
    By elina.hyvamaki in forum Customization
    Replies: 9
    Last Post: 03-17-2005, 03:39 PM
  4. Block attributes by formula?
    By DAVEF in forum Customization
    Replies: 1
    Last Post: 03-15-2005, 05:07 PM
  5. Flatten Block Attributes?
    By David Kozina in forum Customization
    Replies: 3
    Last Post: 01-28-2005, 10:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum