Change Attribute.Tagstring

Discussion in 'AutoCAD' started by mblewis, Nov 19, 2004.

  1. mblewis

    mblewis Guest

    below is procedure i was hoping would change attribute tagstrings. NOT textstring, Tagstring.

    don't let database code confuse my problem that Attribute.Tagstring is not changing in drawing.

    suggestions, please, on correct code to change Attribute.Tagstring?
    variables not declared in Procedure are declared at Module level.

    Public Sub Stdz_Mal_Tags()
    Set objBlkRef = objEnt
    If objBlkRef.HasAttributes Then
    With rstNormTBlks
    .Index = "Border"
    .MoveFirst
    .Seek "=", objBlkRef.Name
    If .NoMatch = False Then
    Set rstMalTags = dbsDatabase1.OpenRecordset("Malform_tagname", dbOpenTable, dbReadOnly)
    Dim varAttribs As Variant, idx%
    varAttribs = objBlkRef.GetAttributes
    For idx% = LBound(varAttribs) To UBound(varAttribs)
    With rstMalTags
    .Index = "Malform_tag"
    .MoveFirst
    .Seek "=", varAttribs(idx%).TagString
    If .NoMatch = False Then
    varAttribs(idx%).TagString = UCase(!Norm_tag)
    End If
    End With
    Next idx%
    End If
    End With
    End If
    End Sub

    btw, is there better way to post code?

    marklewis
     
    mblewis, Nov 19, 2004
    #1
  2. mblewis

    VBA Guest

    You must assign each set of attributes in the variant array to an Attribute
    object [one at a time] and assign the value to the TagString property of the
    Attribute object.


    dbsDatabase1.OpenRecordset("Malform_tagname", dbOpenTable, dbReadOnly)
     
    VBA, Nov 19, 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.