Code Red => VB(A) => Topic started by: Refri on April 13, 2017, 08:03:59 AM
Title: How do replace an attribute in a table?
Post by: Refri on April 13, 2017, 08:03:59 AM
How do replace an attribute in a table? There is a table. It contains a block with an attribute. It is necessary through VBA in the first line of the table to change the attribute "ATR" value "DD25" to "HH38". I'm trying to get a block and change the attribute, but it changes it for everyone.
Set block = ThisDrawing.Blocks For Each item In block str = item.EntityName 'Get t attributes If item.EntityName = "AcDbAttributeDefinition" Then if item.TextString ="DD25" then item.TextString="HH38" End If End If Next item
Title: Re: How do replace an attribute in a table?
Post by: DEVITG on April 18, 2017, 05:26:40 PM
Hi, I know almost nothing about VBA , but what you have to change ia at BLOCKREFERENCE , not at the BLOCKCOLLECTION . I do Lisp. If you look for BLOCKCOLLECTION , of course all will be changed . Hope it help
Title: Re: How do replace an attribute in a table?
Post by: Refri on April 19, 2017, 02:28:00 AM
Problem is that these blocks do not exist in the BLOCKREFERENCE. If there is an example of a lisp - give
Title: Re: How do replace an attribute in a table?
Post by: roy_043 on April 19, 2017, 09:01:59 AM