reproduce eattedit behavior vba

Discussion in 'AutoCAD' started by yannickg, Aug 23, 2005.

  1. yannickg

    yannickg Guest

    Hi,

    when you double-click a block's attribute under autocad 2005 the
    enhanced attribute editor window appears with the attribute you
    double-clicked already selected. I want to produce a similar effect
    for a vba project.

    I already use a selection set to click my objects but if it's a block
    with attributes I want to get that attributes value directly.

    Anybody know how to do it ?

    TIA!

    here's my code so far :
    UserForm1.hide
    Set ssetObj = ThisDrawing.SelectionSets.Add("TitreManuel121")
    ssetObj.SelectOnScreen
    For i = 0 To ssetObj.Count - 1
    Set entObj = ssetObj.Item(i)
    objType = entObj.ObjectName
    If objType = "AcDbText" Then
    Set entTxt = ssetObj.Item(i)
    txtRev.Text = entTxt.TextString
    ElseIf objType = "AcDbMText" Then
    Set entMTxt = ssetObj.Item(i)
    txtRev.Text = entMTxt.TextString
    ElseIf objType = "AcDbBlockReference" Then '<-- for blocks
    Set entBR = ssetObj.Item(i)
    varAttribs = entBR.GetAttributes '<-- currently I only loop
    through atts
    upAtt = UBound(varAttribs)
    For ii = 0 To upAtt
    testvar = varAttribs(ii).Handle
    Next ii
    End If
    Next i
    ssetObj.Delete
    UserForm1.Show 1
     
    yannickg, Aug 23, 2005
    #1
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.