Attribute Extration

Discussion in 'AutoCAD' started by RicardoCuan, Nov 3, 2004.

  1. RicardoCuan

    RicardoCuan Guest

    As I make to extract a listing of blocks with an attribute I specify of a drawing from VBA?


    Message was edited by: RicardoCuan
     
    RicardoCuan, Nov 3, 2004
    #1
  2. RicardoCuan

    MP Guest

    something like : ?
    Dim SelectionSetOfBlockReferences as acadSelectionSet
    'populate selection set with desired blocks

    Dim oBlkRef as acadBlockReference
    Dim vAtts as Variant
    Dim lngIdx as Long

    For Each oBlkRef in SelectionSetOfBlockReferences
    if oBLkRef.HasAttributes then
    Debug.Print "Attribs for " & oblkref.name
    vatts = oBLkRef.GetAttributes
    For lngIdx = 0 to Ubound(vAtts)
    'if you're looking for specific tag, you can test here
    Debug.print "Tag: " & vAtts(lngIdx).Tagstring
    Debug.print "Value: " & vAtts(lngIdx).Textstring
    next lngIdx
    End if
    Next oBlkRef

    hope that was what you were asking
    Mark
     
    MP, Nov 3, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.