<?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: Block Attribute value in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8222499#M24943</link>
    <description>&lt;P&gt;What have you tried so far?&amp;nbsp; There are several examples in this forum&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/change-block-attribute/m-p/2996912#M23313" target="_blank"&gt;https://forums.autodesk.com/t5/net/change-block-attribute/m-p/2996912#M23313&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 13:23:05 GMT</pubDate>
    <dc:creator>fieldguy</dc:creator>
    <dc:date>2018-08-24T13:23:05Z</dc:date>
    <item>
      <title>Block Attribute value</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8221741#M24942</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want to put the data in the block inside the block into a variable and use it in mathematical operations.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 07:21:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8221741#M24942</guid>
      <dc:creator>cihanbaki2147</dc:creator>
      <dc:date>2018-08-24T07:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Block Attribute value</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8222499#M24943</link>
      <description>&lt;P&gt;What have you tried so far?&amp;nbsp; There are several examples in this forum&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/change-block-attribute/m-p/2996912#M23313" target="_blank"&gt;https://forums.autodesk.com/t5/net/change-block-attribute/m-p/2996912#M23313&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 13:23:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8222499#M24943</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2018-08-24T13:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Block Attribute value</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8222903#M24944</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;You could share the c # code.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 15:34:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8222903#M24944</guid>
      <dc:creator>cihanbaki2147</dc:creator>
      <dc:date>2018-08-24T15:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Block Attribute value</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8223272#M24945</link>
      <description>&lt;P&gt;You could convert it yourself and learn something along the way?&lt;/P&gt;&lt;P&gt;&lt;A href="http://converter.telerik.com/" target="_blank"&gt;http://converter.telerik.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 17:55:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8223272#M24945</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2018-08-24T17:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Block Attribute value</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8238008#M24946</link>
      <description>&lt;P&gt;Read Attributes...&lt;/P&gt;&lt;PRE&gt;//using acApp = Autodesk.AutoCAD.ApplicationServices.Application;
private void GetAttributeValues()
{
    Document doc = acApp.DocumentManager.MdiActiveDocument;
    Database db = doc.Database;
    Editor ed = doc.Editor;

    TypedValue[] acTypValAr = new TypedValue[1];
    acTypValAr.SetValue(new TypedValue((int)DxfCode.Start, "INSERT"), 0);
    SelectionFilter acSelFtr = new SelectionFilter(acTypValAr);

    using (Transaction acTrans = db.TransactionManager.StartTransaction())
    {
        PromptSelectionResult acSSPrompt;

        acSSPrompt = ed.SelectAll(acSelFtr);

        if (acSSPrompt.Status == PromptStatus.OK)
        {
            SelectionSet acSSet = acSSPrompt.Value;
            foreach (SelectedObject acSSObj in acSSet)
            {
                if (acSSObj != null)
                {
                    BlockReference br = (BlockReference)acTrans.GetObject(acSSObj.ObjectId, OpenMode.ForRead);
                    if (br != null)
                    {
                        AttributeCollection attCol = br.AttributeCollection;
                        foreach (ObjectId attId in attCol)
                        {
                            AttributeReference attRef = (AttributeReference)acTrans.GetObject(attId, OpenMode.ForRead);
                            ed.WriteMessage("Attribute Tag: " + attRef.Tag + "   |   Attribute Text: " + attRef.TextString + "\n");
                        }
                    }
                }
            }
        }
        acTrans.Commit();
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For dynamic blocks properties...&lt;/P&gt;&lt;PRE&gt;            SelectionSet acSSet = acSSPrompt.Value;
            foreach (SelectedObject acSSObj in acSSet)
            {
                if (acSSObj != null)
                {
                    BlockReference br = (BlockReference)acTrans.GetObject(acSSObj.ObjectId, OpenMode.ForRead);
                    if (br != null &amp;amp;&amp;amp; br.IsDynamicBlock)
                    {
                        DynamicBlockReferencePropertyCollection pc = br.DynamicBlockReferencePropertyCollection;
                        foreach (DynamicBlockReferenceProperty prop in pc)
                        {
                            ed.WriteMessage("Property name: " + prop.PropertyName + "   |   Property value: " + prop.Value + "\n");
                        }
                    }
                }
            }&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Aug 2018 13:56:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-attribute-value/m-p/8238008#M24946</guid>
      <dc:creator>stefan.hofer</dc:creator>
      <dc:date>2018-08-31T13:56:05Z</dc:date>
    </item>
  </channel>
</rss>

