<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Attribute Default Value vs (Actual) Value in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961684#M21604</link>
    <description>&lt;P&gt;I found a solution to my problem here:&amp;nbsp;&lt;A title="attributereference-textstring-problem" href="https://forums.autodesk.com/t5/net/attributereference-textstring-problem/td-p/2267646" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/net/attributereference-textstring-problem/td-p/2267646&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code is returning the correct TextString values. I will adjust my code accordingly. Thanks.&lt;/P&gt;&lt;PRE&gt;        public void TestAttributeReference()
        {
            Database db = HostApplicationServices.WorkingDatabase;
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            using (Transaction trans = db.TransactionManager.StartTransaction())
            {
                BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForWrite);
                BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt["TITLE_BLOCK_B"], OpenMode.ForRead);
                foreach (ObjectId oid in btr.GetBlockReferenceIds(true, false))
                {
                    BlockReference titleBlock = trans.GetObject(oid, OpenMode.ForRead) as BlockReference;
                    if (titleBlock == null) continue;
                    foreach (ObjectId attOid in titleBlock.AttributeCollection)
                    {
                        AttributeReference ar = (AttributeReference)trans.GetObject(attOid, OpenMode.ForWrite);
                        ed.WriteMessage(String.Format("{0} = {1}\n", ar.Tag, ar.TextString));
                        // ...
                    }
                }
                // trans.Commit();
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2019 18:34:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-12T18:34:51Z</dc:date>
    <item>
      <title>Attribute Default Value vs (Actual) Value</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961303#M21601</link>
      <description>&lt;P&gt;I am unable to display an Attribute Definition Value. My code always returns the &lt;U&gt;Default Value&lt;/U&gt;, but I need to display the actual value. What am I doing wrong? (See code snippet in the Attachment)&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Joe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 15:29:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961303#M21601</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-12T15:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Default Value vs (Actual) Value</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961381#M21602</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First these lines are useless:&lt;/P&gt;
&lt;PRE&gt;attRef.Position = attDef.Position.TransformBy(blockRef.BlockTransform);
attRef.TextString = attDef.TextString;
attRef.Tag = attDef.Tag;
&lt;/PRE&gt;
&lt;P&gt;because this one already does all this:&lt;/P&gt;
&lt;PRE&gt;attRef.SetAttributeFromBlock(attDef, blockRef.BlockTransform);&lt;/PRE&gt;
&lt;P&gt;Now, about your question, I do not understand what you expect because the AttributeDefinition.TextString value is the default value.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 16:00:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961381#M21602</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-08-12T16:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Default Value vs (Actual) Value</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961434#M21603</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;. This image shows what I am looking for:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TitleBlockAttributeValues.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/666207iA718AA89DC892BD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="TitleBlockAttributeValues.PNG" alt="TitleBlockAttributeValues.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 16:23:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961434#M21603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-12T16:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Default Value vs (Actual) Value</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961684#M21604</link>
      <description>&lt;P&gt;I found a solution to my problem here:&amp;nbsp;&lt;A title="attributereference-textstring-problem" href="https://forums.autodesk.com/t5/net/attributereference-textstring-problem/td-p/2267646" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/net/attributereference-textstring-problem/td-p/2267646&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code is returning the correct TextString values. I will adjust my code accordingly. Thanks.&lt;/P&gt;&lt;PRE&gt;        public void TestAttributeReference()
        {
            Database db = HostApplicationServices.WorkingDatabase;
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            using (Transaction trans = db.TransactionManager.StartTransaction())
            {
                BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForWrite);
                BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt["TITLE_BLOCK_B"], OpenMode.ForRead);
                foreach (ObjectId oid in btr.GetBlockReferenceIds(true, false))
                {
                    BlockReference titleBlock = trans.GetObject(oid, OpenMode.ForRead) as BlockReference;
                    if (titleBlock == null) continue;
                    foreach (ObjectId attOid in titleBlock.AttributeCollection)
                    {
                        AttributeReference ar = (AttributeReference)trans.GetObject(attOid, OpenMode.ForWrite);
                        ed.WriteMessage(String.Format("{0} = {1}\n", ar.Tag, ar.TextString));
                        // ...
                    }
                }
                // trans.Commit();
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 18:34:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-default-value-vs-actual-value/m-p/8961684#M21604</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-12T18:34:51Z</dc:date>
    </item>
  </channel>
</rss>

