Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have code to change attribute tag text value. It is working fine.
But i want to change another tag in the same block attribute.
that is , if i change 1st tag then 2nd tag also should be updated automatically.
Is there any way to do that??
using (tr)
{
BlockTableRecord btr =(BlockTableRecord)tr.GetObject(btrId,OpenMode.ForRead);
foreach (ObjectId entId in btr)
{
Entity ent =tr.GetObject(entId, OpenMode.ForRead)as Entity;
if (ent != null)
{
BlockReference br = ent as BlockReference;
if (br != null)
{
BlockTableRecord bd =(BlockTableRecord)tr.GetObject(br.BlockTableRecord,OpenMode.ForRead);
if (bd.Name.ToUpper() == blockName)
{
foreach (ObjectId arId in br.AttributeCollection)
{
DBObject obj =tr.GetObject(arId,OpenMode.ForRead);
AttributeReference ar =obj as AttributeReference;
if (ar != null)
{
if (ar.Tag.ToUpper() == attbName)
{
//if (ar.TextString == "A") then i need to change another Tag
ar.UpgradeOpen();
ar.TextString = "B";
ar.DowngradeOpen();
}
//if (ar.TextString == "A") then i need to change another Tag
How i could do this while on another tag? Any suggestions
Solved! Go to Solution.