Jump to content

VB.net / edit inserted dynamic block's attribute textstring and parameter's value


mrl989

Recommended Posts

i can use VB.net to edit normal inserted block reference's attribute textstring but it's not working for dynamic block, pls help.

Best regard.

Link to comment
Share on other sites

Public Sub UpdateAtt(ByVal tr As Transaction, ByVal objID As ObjectId)        
           Dim br As BlockReference = DirectCast(tr.GetObject(objID, OpenMode.ForWrite), BlockReference)
           Dim btr As BlockTableRecord = DirectCast(tr.GetObject(br.DynamicBlockTableRecord, OpenMode.ForWrite), BlockTableRecord)
     
           For Each attID As ObjectId In btr
               Dim ent As DBObject = tr.GetObject(attID, OpenMode.ForWrite)
               If TypeOf ent Is AttributeDefinition Then
                   Dim AttDef As AttributeDefinition = ent
                   If AttDef.Tag = "SH" Then AttDef.TextString = "111"                    
               End If
           Next

End Sub

If br is not dynamic block, br's attribute can edit by br's attribute collection, but it's not working for dynamic block, so i think this work can do by attribute definition but it's not working too, thanks for read...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...