<?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: how to use a Block Properties Table of a a Dynamic Block using .NET API? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11217889#M50679</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6969722"&gt;@ehsan_bahrani&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any idea why this happens??&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What AutoCAD version are you using? This method is in acmgd.dll&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="изображение.png" style="width: 487px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1076693i24B3F797F4DD6AF6/image-size/large?v=v2&amp;amp;px=999" role="button" title="изображение.png" alt="изображение.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jun 2022 21:00:21 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2022-06-06T21:00:21Z</dc:date>
    <item>
      <title>how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3798548#M50667</link>
      <description>&lt;P&gt;Hello,experts&lt;BR /&gt;I have a&amp;nbsp; question,It's about "Block Properties Table",I want to use a Block Properties Table to manage a Dynamic&lt;BR /&gt;Block.&lt;/P&gt;&lt;P&gt;I&amp;nbsp; have defiened a Dynamic Block a&amp;nbsp;and its Block Properties Table in Autocad2010,this is the screenshot of the&lt;BR /&gt;Block Properties Table(a1:d1=100,d2=200;a2:d1=100,d2=400;a3:d1=100,d2=600.)&lt;BR /&gt;Now I want to insert the Dynamic Block using .NET API.after I input a command,the block of a2(d1=100,d2=400)&lt;BR /&gt;is inserted.&lt;BR /&gt;I have&amp;nbsp; the code about it from Help,but the code is not complete,Can you help me finish the code which can achieve my goal?&lt;BR /&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;this is the Dynamic Block&lt;/P&gt;&lt;P&gt;&lt;IMG align="center" alt="1.png" src="https://forums.autodesk.com/t5/image/serverpage/image-id/48379iE3F5034E37207C35/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" title="1.png" /&gt;&lt;/P&gt;&lt;P&gt;this is the &amp;nbsp;the screenshot of the Block Properties Table&lt;/P&gt;&lt;P&gt;&lt;IMG align="center" alt="2.png" src="https://forums.autodesk.com/t5/image/serverpage/image-id/48380iE3CBED5F054EFFA1/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" title="2.png" /&gt;&lt;/P&gt;&lt;P&gt;the result:&lt;/P&gt;&lt;P&gt;&lt;IMG align="center" alt="3.png" src="https://forums.autodesk.com/t5/image/serverpage/image-id/48381i604A687B2D0E1D5B/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" title="3.png" /&gt;&lt;/P&gt;&lt;P&gt;the&amp;nbsp;code about it from Help:&lt;/P&gt;&lt;P&gt;[CommandMethod("readBlockTable")]&lt;/P&gt;&lt;P&gt;static public void CmdReadBlockTable()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; Editor ed = Application.DocumentManager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MdiActiveDocument.Editor;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // select a block reference&lt;/P&gt;&lt;P&gt;&amp;nbsp; PromptEntityOptions peo = new PromptEntityOptions(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Select a dynamic block reference: ");&lt;/P&gt;&lt;P&gt;&amp;nbsp; peo.SetRejectMessage("Only block reference");&lt;/P&gt;&lt;P&gt;&amp;nbsp; peo.AddAllowedClass(typeof(BlockReference), false);&lt;/P&gt;&lt;P&gt;&amp;nbsp; PromptEntityResult per = ed.GetEntity(peo);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (per.Status != PromptStatus.OK) return;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ObjectId blockRefId = per.ObjectId;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // get the database and start a transaction&lt;/P&gt;&lt;P&gt;&amp;nbsp; Database db = Application.DocumentManager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MdiActiveDocument.Database;&lt;/P&gt;&lt;P&gt;&amp;nbsp; using (Transaction trans = db.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransactionManager.StartTransaction())&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // open the dynamic block reference&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BlockReference blockRef = trans.GetObject(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; blockRefId, OpenMode.ForRead) as BlockReference;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!blockRef.IsDynamicBlock) return;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the dynamic block table definition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BlockTableRecord blockDef = trans.GetObject(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; blockRef.DynamicBlockTableRecord,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OpenMode.ForRead) as BlockTableRecord;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // open the extension dictionary&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (blockDef.ExtensionDictionary.IsNull) return;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBDictionary extDic = trans.GetObject(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; blockDef.ExtensionDictionary, OpenMode.ForRead)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as DBDictionary;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // open the ENHANCEDBLOCK dictionary&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Autodesk.AutoCAD.Internal.DatabaseServices.EvalGraph graph =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trans.GetObject(extDic.GetAt("ACAD_ENHANCEDBLOCK"),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OpenMode.ForRead) as EvalGraph;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int[] nodeIds = graph.GetAllNodes();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (uint nodeId in nodeIds)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // open the node ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBObject node = graph.GetNode(nodeId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OpenMode.ForRead, trans);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // check is if the correct type&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!(node is BlockPropertiesTable)) continue;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // convert the object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BlockPropertiesTable table =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; node as BlockPropertiesTable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ok, we have the data, let's show it...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the number of columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int columns = table.Columns.Count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int currentRow = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BlockPropertiesTableRow row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in table.Rows)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentRow++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 12:52:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3798548#M50667</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-07T12:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3798671#M50668</link>
      <description>&lt;P&gt;I've done minimum tests with provided dwg-file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using System;
using System.Collections.Generic;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Internal.DatabaseServices;
using AcAp = Autodesk.AutoCAD.ApplicationServices;
using AcDb = Autodesk.AutoCAD.DatabaseServices;
using AcGe = Autodesk.AutoCAD.Geometry;
using AcEd = Autodesk.AutoCAD.EditorInput;
using AcId = Autodesk.AutoCAD.Internal.DatabaseServices;

[assembly: CommandClass(typeof(Rivilis.BPTTest))]

#pragma warning disable 618

namespace Rivilis
{

  public class BPTTest
  {
    [CommandMethod("InsBlockWithBPT")]
    public static void InsBlockWithBPT()
    {
      AcAp.Document doc = AcAp.Application.DocumentManager.MdiActiveDocument;
      AcEd.Editor ed = doc.Editor;
      AcDb.Database db = doc.Database;
      AcEd.PromptResult rs = ed.GetString("\nEnter block name: ");
      if (rs.Status != PromptStatus.OK) return;
      AcDb.ObjectId idBTR = AcDb.ObjectId.Null, idBref;
      using (AcDb.BlockTable bt = db.BlockTableId.Open(OpenMode.ForRead) as AcDb.BlockTable) {
        if (bt != null) idBTR = bt[rs.StringResult];
      }
      if (idBTR.IsNull) {
        ed.WriteMessage("\nDatabase has not block \"{0}\"", rs.StringResult);
        return;
      }
      AcEd.PromptPointResult rsp = ed.GetPoint("\nEnter position: ");
      if (rsp.Status != PromptStatus.OK) return;

      using (AcDb.Transaction tr = doc.TransactionManager.StartTransaction()) {
        AcDb.BlockTableRecord btr = 
          tr.GetObject(idBTR, OpenMode.ForRead) as AcDb.BlockTableRecord;
        AcDb.BlockTableRecord btrSpace = 
          tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as AcDb.BlockTableRecord;
        if (btr != null &amp;amp;&amp;amp; btrSpace != null) {
          AcDb.BlockReference brf =
            new AcDb.BlockReference(rsp.Value.TransformBy(ed.CurrentUserCoordinateSystem), idBTR);
          idBref = btrSpace.AppendEntity(brf);
          tr.AddNewlyCreatedDBObject(brf, true);
          if (brf.IsDynamicBlock) {
            AcDb.BlockTableRecord btrDyn =
              tr.GetObject(brf.DynamicBlockTableRecord, OpenMode.ForRead) as AcDb.BlockTableRecord;
            if (btrDyn != null &amp;amp;&amp;amp; !btrDyn.ExtensionDictionary.IsNull) {
              AcDb.DBDictionary extDic = 
                tr.GetObject(btrDyn.ExtensionDictionary, OpenMode.ForRead) as AcDb.DBDictionary;
              if (extDic != null) {
                AcId.EvalGraph graph =
                  tr.GetObject(extDic.GetAt("ACAD_ENHANCEDBLOCK"), OpenMode.ForRead) as AcId.EvalGraph;
                int[] nodeIds = graph.GetAllNodes();
                foreach (uint nodeId in nodeIds) {
                  DBObject node = graph.GetNode(nodeId, OpenMode.ForRead, tr);
                  if (!(node is BlockPropertiesTable)) continue;
                  AcDb.BlockPropertiesTable bpt = node as AcDb.BlockPropertiesTable;
                  int currentRow = SelectRowNumber(ref bpt);
                  AcDb.BlockPropertiesTableRow row = bpt.Rows[currentRow];
                  List&amp;lt;string&amp;gt; nameProps = new List&amp;lt;string&amp;gt;();
                  for (int i = 0; i &amp;lt; bpt.Columns.Count; i++) {
                    nameProps.Add(bpt.Columns[i].Parameter.Name);
                  }
                  AcDb.DynamicBlockReferencePropertyCollection dynPropsCol =
                    brf.DynamicBlockReferencePropertyCollection;
                  foreach (AcDb.DynamicBlockReferenceProperty dynProp in dynPropsCol) {
                    int i = nameProps.FindIndex(delegate(string s) { return s == dynProp.PropertyName; });
                    if (i &amp;gt;= 0 &amp;amp;&amp;amp; i &amp;lt; nameProps.Count) {
                      try { 
                        dynProp.Value = row[i].AsArray()[0].Value;
                      } catch {
                        ed.WriteMessage("\nCan not set to {0} value={1}", 
                          dynProp.PropertyName, row[i].AsArray()[0].Value);
                      }
                    }
                  }
                }
              }
            }
          } else {
            ed.WriteMessage("\nBlock \"{0}\" is not dynamic", rs.StringResult);
          }
        }
        tr.Commit();
      }
    }

    public static int SelectRowNumber(ref BlockPropertiesTable bpt)
    {
      AcEd.Editor ed = AcAp.Application.DocumentManager.MdiActiveDocument.Editor;
      int columns = bpt.Columns.Count;
      int rows = bpt.Rows.Count;
      int currentRow = 0, currentColumn = 0;
      ed.WriteMessage("\n");
      for (currentColumn = 0; currentColumn &amp;lt; columns; currentColumn++) {
        ed.WriteMessage("{0}; ", bpt.Columns[currentColumn].Parameter.Name);
      }
      foreach (BlockPropertiesTableRow row in bpt.Rows) {
        ed.WriteMessage("\n[{0}]:\t", currentRow);
        for (currentColumn = 0; currentColumn &amp;lt; columns; currentColumn++) {
          TypedValue[] columnValue = row[currentColumn].AsArray();
          foreach (TypedValue tpVal in columnValue) {
            ed.WriteMessage("{0}; ", tpVal.Value);
          }
          ed.WriteMessage("|");
        }
        currentRow++;
      }

      AcEd.PromptIntegerResult res;
      string.Format("0-{0}", rows - 1);

      while ((res = ed.GetInteger(string.Format("\nSelect row number (0-{0}): ", rows - 1))).Status == PromptStatus.OK) {
        if (res.Value &amp;gt;= 0 &amp;amp;&amp;amp; res.Value &amp;lt;= rows) return res.Value;
      }
      return -1;
    }
  }
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 15:02:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3798671#M50668</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-03-07T15:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799176#M50669</link>
      <description>&lt;P&gt;Dynamic block uses the extension dictionary ACAD_ENHANCEDBLOCK in DynamicBlockTableRecord to store all dynamic block definitions (grips, visibility values,...), and DynamicBlockReferencePropertyCollection in BlockReference to stores instances of those dynamic definitions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your Block Properties Table with three defined columns (user1, d1, d2) is stored in ACAD_ENHANCEDBLOCK, and the option of this Block Properties Table is stored in DynamicBlockReferencePropertyCollection. So to change the display of this dynamic block, you just set DynamicBlockReferenceProperty.Value of a found DynamicBlockReferenceProperty.Name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Block Properties Table inside the dynamic block uses the first column (user1) as a key field to identify the presentation of this block, so just use the code snippet to update its dynamic attribute: if PropertyName == "user1" then Value = "a3"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using (Transaction trans = db.TransactionManager.StartTransaction())
{
    // open the dynamic block reference
    BlockReference blockRef = trans.GetObject(blockRefId, OpenMode.ForRead) as BlockReference;
    if (!blockRef.IsDynamicBlock) return;
    DynamicBlockReferencePropertyCollection properties = blockRef.DynamicBlockReferencePropertyCollection;
    for (int i = 0; i &amp;lt; properties.Count; i++)
    {
        DynamicBlockReferenceProperty property = properties[i];
        if (property.PropertyName == "user1")
        {
            property.Value = "a3"; // Change your option here

            // Need code to update the dynamic block after updating a property from block properties table

            break;
        }
    }
    trans.Commit();
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This above code does change the value of a block properties table but does not update the block display itself. Even I run REGEN or close it and open again. So we need the API to update dynamic block geometry entities after changing its custom attributes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Khoa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 20:24:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799176#M50669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-07T20:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799290#M50670</link>
      <description>&lt;P&gt;Hi, Khoa!&lt;/P&gt;
&lt;P&gt;Did you looked to my code? You can see that my code set not only "user1" parameter but also "d1" and "d2" to the correspondent with Block Properties Table values.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 22:25:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799290#M50670</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-03-07T22:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799312#M50671</link>
      <description>&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I came up with my answer before your post and only had chance to post after the lunch. I did not see carefully your code and even tried to run it. Anyway, I just gave the idea of the difference between ACAD_ENHANCEDBLOCK and DynamicBlockReferencePropertyCollection. No need to lookup ACAD_ENHANCEDBLOCK extension dictionary unless we want to change the dynamic block definition. Just to use DynamicBlockReferencePropertyCollection if we want to change dynamic block custom attributes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Khoa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 22:39:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799312#M50671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-07T22:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799321#M50672</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;...Just to use DynamicBlockReferencePropertyCollection if we want to change dynamic block custom attributes... &lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. But you have to know not only "user1" value, but also values of "d1" and "d2". And those values are in BlockPropertiesTable.&lt;/P&gt;
&lt;P&gt;P.S.: This topic has a &lt;A href="https://forums.autodesk.com/t5/Autodesk-ObjectARX/how-to-use-a-Block-Properties-Table-of-a-a-Dynamic-Block-in/td-p/3795143" target="_blank"&gt;"history"&lt;/A&gt; in ObjectARX board.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 22:49:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799321#M50672</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-03-07T22:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799326#M50673</link>
      <description>&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are right, I assume the user knows the value to pass. The code is just for demonstration. I don't track ObjectARX forum so I did not know your answer was also there as the poster repeated twice. It's good to know the same resource over there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Khoa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 22:59:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799326#M50673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-07T22:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799386#M50674</link>
      <description>&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;you are very great!&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2013 00:44:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799386#M50674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-08T00:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799388#M50675</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2013 00:46:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/3799388#M50675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-08T00:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/10580467#M50676</link>
      <description>&lt;P&gt;how about visibility and visibility states and its visible or not entities? how and where can access their data?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Aug 2021 06:06:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/10580467#M50676</guid>
      <dc:creator>ehsan_bahrani</dc:creator>
      <dc:date>2021-08-28T06:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/10580975#M50677</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6969722"&gt;@ehsan_bahrani&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;how about visibility and visibility states and its visible or not entities? how and where can access their data?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/autocad/2012/05/accessing-visible-entities-in-a-dynamic-block.html" target="_blank"&gt;https://adndevblog.typepad.com/autocad/2012/05/accessing-visible-entities-in-a-dynamic-block.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Aug 2021 12:35:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/10580975#M50677</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2021-08-28T12:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11216875#M50678</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get list of Lookup entries in dynamic block and modify those value but I'm getting this error because of this line:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;DBObject node = graph.GetNode(nodeId, OpenMode.ForRead, tr);&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ehsanbahrani_0-1654516046335.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1076490iB0374A3732AC6403/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ehsanbahrani_0-1654516046335.png" alt="ehsanbahrani_0-1654516046335.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;any idea why this happens??&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 11:54:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11216875#M50678</guid>
      <dc:creator>ehsan_bahrani</dc:creator>
      <dc:date>2022-06-06T11:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11217889#M50679</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6969722"&gt;@ehsan_bahrani&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any idea why this happens??&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What AutoCAD version are you using? This method is in acmgd.dll&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="изображение.png" style="width: 487px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1076693i24B3F797F4DD6AF6/image-size/large?v=v2&amp;amp;px=999" role="button" title="изображение.png" alt="изображение.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 21:00:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11217889#M50679</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2022-06-06T21:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11238875#M50680</link>
      <description>thanks for your respond&lt;BR /&gt;i'm using autocad 2015 dlls for coding.</description>
      <pubDate>Thu, 16 Jun 2022 08:11:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11238875#M50680</guid>
      <dc:creator>ehsan_bahrani</dc:creator>
      <dc:date>2022-06-16T08:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11238973#M50681</link>
      <description>&lt;P&gt;AutoCAD 2015 also has this method.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 09:11:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11238973#M50681</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2022-06-16T09:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a Block Properties Table of a a Dynamic Block using .NET API?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11931412#M50682</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thank you for your example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, these lines need reviewing&lt;/P&gt;&lt;PRE&gt;for (currentColumn = 0; currentColumn &amp;lt; columns; currentColumn++) {
        ed.WriteMessage("{0}; ", &lt;STRONG&gt;bpt.Columns[currentColumn].Parameter&lt;/STRONG&gt;.Name);
      }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I've found that accessing the bpt.Columns[currentColumn].&lt;STRONG&gt;Parameter&amp;nbsp;&lt;/STRONG&gt; without "Using .... End using" to manually dispose that iParameter object&amp;nbsp; may lead to error&amp;nbsp;&lt;/P&gt;&lt;P&gt;"System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' "&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;That error does not happen immediately, but after a period of implementation.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2023 10:58:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-a-block-properties-table-of-a-a-dynamic-block-using/m-p/11931412#M50682</guid>
      <dc:creator>ntclmain</dc:creator>
      <dc:date>2023-04-30T10:58:07Z</dc:date>
    </item>
  </channel>
</rss>

