<?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: Issue with Block Attributes. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2721751#M64695</link>
    <description>&lt;P&gt;A little more information this appears to be tied in with constant attributes as this code appears to be making constant attributes editable so im definatley doing somehting wrong here&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2010 12:02:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-07-20T12:02:55Z</dc:date>
    <item>
      <title>Issue with Block Attributes.</title>
      <link>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2720625#M64694</link>
      <description>&lt;P&gt;I have some code which is inserting a block with attributes and setting the TextString property as the block is inserted. (This works appart from this issue)&lt;/P&gt;&lt;PRE&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt; attColl &lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt; AttributeCollection = newBlockReference.AttributeCollection&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt; entID &lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt; ObjectId&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt; ent &lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt; Entity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;For&lt;/FONT&gt; &lt;FONT color="#0000ff"&gt;Each&lt;/FONT&gt; entID &lt;FONT color="#0000ff"&gt;In&lt;/FONT&gt; newBlockDef&lt;/P&gt;&lt;P&gt;ent = entID.GetObject(OpenMode.ForRead)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;If&lt;/FONT&gt; &lt;FONT color="#0000ff"&gt;TypeOf&lt;/FONT&gt; ent &lt;FONT color="#0000ff"&gt;Is&lt;/FONT&gt; AttributeDefinition &lt;FONT color="#0000ff"&gt;Then&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt; attDef &lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt; AttributeDefinition = &lt;FONT color="#0000ff"&gt;CType&lt;/FONT&gt;(ent, AttributeDefinition)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;	Dim&lt;/FONT&gt; attRef &lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt; &lt;FONT color="#0000ff"&gt;New&lt;/FONT&gt; AttributeReference&lt;/P&gt;&lt;P&gt;	attRef.SetAttributeFromBlock(attDef, newBlockReference.BlockTransform)&lt;/P&gt;&lt;P&gt;	attColl.AppendAttribute(attRef)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;	attRef.TextString = "SOMETHING"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;	currentTransaction.AddNewlyCreatedDBObject(attRef, &lt;FONT color="#0000ff"&gt;True&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;End&lt;/FONT&gt; &lt;FONT color="#0000ff"&gt;If&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Next&lt;/FONT&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the block is inserted and the attributes are set using this code, double clicking on the block in the drawing and examining the attributes in the "Enhanced Attribute Editor" the prompt values for the attributes are all mixed up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The block definition has multiple attributes with prompt text entered against them in the block definition.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;Tag: DEVICE, PROMPT:"Enter Device Reference", VALUE:"AMMETER"&lt;/P&gt;&lt;P&gt;Tag: PART#, PROMPT: "Enter Actual Part #", VALUE:"E242-75A"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the insert using the above code the Prompt might appear like this:&lt;/P&gt;&lt;P&gt;Tag: DEVICE, PROMPT:"Default Mounting Location", VALUE:"AMMETER"&lt;/P&gt;&lt;P&gt;Tag: PART#, PROMPT: "Enter Device Reference", VALUE:"E242-75A"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears as though the prompt text is being set as the prompt text from the previous attribute whenever it is empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI if the block is inserted manually using the AutoCAD insert command the attribute definitions are correct so i have to assume im doing something wrong here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2010 13:05:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2720625#M64694</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-19T13:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Block Attributes.</title>
      <link>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2721751#M64695</link>
      <description>&lt;P&gt;A little more information this appears to be tied in with constant attributes as this code appears to be making constant attributes editable so im definatley doing somehting wrong here&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2010 12:02:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2721751#M64695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-20T12:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Block Attributes.</title>
      <link>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2721777#M64696</link>
      <description>&lt;P&gt;Don't create an AttributeReference for constant attribute definitions.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2010 12:32:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2721777#M64696</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-20T12:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Block Attributes.</title>
      <link>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2721781#M64697</link>
      <description>&lt;P&gt;I just figured that out and have resolved this issue. The problem i had was that i was checking the IsConstant attribute of the AttributeReference (as you say) rather than the Constant attribute of the AttributeDefinition before deciding how to process it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Spent hours going round with this one for it to be so simple!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem solved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2010 12:35:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/issue-with-block-attributes/m-p/2721781#M64697</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-20T12:35:56Z</dc:date>
    </item>
  </channel>
</rss>

