<?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: Attach Property Set in a Object in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/attach-property-set-in-a-object/m-p/11530743#M11089</link>
    <description>&lt;P&gt;Pretty obvious... Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="seabrahenrique_0-1667563753199.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1136101i3AA0CC2C49738626/image-size/medium?v=v2&amp;amp;px=400" role="button" title="seabrahenrique_0-1667563753199.png" alt="seabrahenrique_0-1667563753199.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2022 12:10:18 GMT</pubDate>
    <dc:creator>seabrahenrique</dc:creator>
    <dc:date>2022-11-04T12:10:18Z</dc:date>
    <item>
      <title>Attach Property Set in a Object</title>
      <link>https://forums.autodesk.com/t5/net-forum/attach-property-set-in-a-object/m-p/11529683#M11087</link>
      <description>&lt;P&gt;Hello guys.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to write a code to Civil 3D that can add a property set to DBObjects in my Document, and until now i have this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    [CommandMethod("ADDPP")]
    public static void AddPropertySet()
    {

        Database acDBase = Application.DocumentManager.MdiActiveDocument.Database;

        using (var propDic = new DictionaryPropertySetDefinitions(acDBase))
        {
            using (Transaction trans = acDBase.TransactionManager.StartTransaction())
            {
                var propSetDef = new PropertySetDefinition();
                var PropDef = new PropertyDefinition();

                PropDef.Name = "name";
                PropDef.DefaultData = "value";

                propSetDef.Definitions.Add(PropDef);
                propDic.AddNewRecord("test", propSetDef);
                trans.AddNewlyCreatedDBObject(propSetDef, true);

                BlockTable bTb = trans.GetObject(acDBase.BlockTableId, OpenMode.ForWrite) as BlockTable;
                BlockTableRecord bTbR = trans.GetObject(bTb["a"], OpenMode.ForWrite) as BlockTableRecord;

                PropertyDataServices.AddPropertySet(bTbR, propSetDef.ObjectId);

                trans.Commit();
            }
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code add a PropertySetDefinition in my drawing an also add a Property inside that... But &lt;STRONG&gt;the problem is when i try to attach the PPset in my Object, here:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;                BlockTable bTb = trans.GetObject(acDBase.BlockTableId, OpenMode.ForWrite) as BlockTable;
                BlockTableRecord bTbR = trans.GetObject(bTb["a"], OpenMode.ForWrite) as BlockTableRecord;

                PropertyDataServices.AddPropertySet(bTbR, propSetDef.ObjectId);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no compile error, but when i check my drawing and my named "a" block, i can't see the property set added here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="seabrahenrique_0-1667517929782.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1135895iD18706C5D93AC14E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="seabrahenrique_0-1667517929782.png" alt="seabrahenrique_0-1667517929782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know where i wrong... Is there something like a "synchronize" to the propertys appears in my block?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 23:33:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attach-property-set-in-a-object/m-p/11529683#M11087</guid>
      <dc:creator>seabrahenrique</dc:creator>
      <dc:date>2022-11-03T23:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Property Set in a Object</title>
      <link>https://forums.autodesk.com/t5/net-forum/attach-property-set-in-a-object/m-p/11530672#M11088</link>
      <description>&lt;P&gt;I am sure you do know that BlockTableRecord is block definition and is not "visible". WHat you see in the MOdelSpace/Layout PaperSpace are BlockReferences. So, you need to attach PropertySet Data to BlockReferences.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 11:36:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attach-property-set-in-a-object/m-p/11530672#M11088</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-11-04T11:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Property Set in a Object</title>
      <link>https://forums.autodesk.com/t5/net-forum/attach-property-set-in-a-object/m-p/11530743#M11089</link>
      <description>&lt;P&gt;Pretty obvious... Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="seabrahenrique_0-1667563753199.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1136101i3AA0CC2C49738626/image-size/medium?v=v2&amp;amp;px=400" role="button" title="seabrahenrique_0-1667563753199.png" alt="seabrahenrique_0-1667563753199.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 12:10:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attach-property-set-in-a-object/m-p/11530743#M11089</guid>
      <dc:creator>seabrahenrique</dc:creator>
      <dc:date>2022-11-04T12:10:18Z</dc:date>
    </item>
  </channel>
</rss>

