<?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 with Multiple Attribute References in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062815#M8334</link>
    <description>Right now 'bt.Add(acBlkTblRec)' is inside 'using (ScalledPline){ }'</description>
    <pubDate>Tue, 27 Jun 2023 06:54:02 GMT</pubDate>
    <dc:creator>shubhamraut221195</dc:creator>
    <dc:date>2023-06-27T06:54:02Z</dc:date>
    <item>
      <title>Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12061484#M8331</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I tried to create a block composed of a polyline and multiple attributes.&lt;/P&gt;&lt;P&gt;Here is the part of the program. Please note that "&lt;STRONG&gt;ScalledPline&lt;/STRONG&gt;" is the polyline on which I will create the block, and "&lt;STRONG&gt;_nameofbl&lt;/STRONG&gt;" is the name of the block. The variables "&lt;STRONG&gt;insertPoint&lt;/STRONG&gt; (point3d), &lt;STRONG&gt;_lstofposition&lt;/STRONG&gt; (List&amp;lt;Pointe3d&amp;gt;), &lt;STRONG&gt;_lstoftextstring&lt;/STRONG&gt; (List&amp;lt;string&amp;gt;), &lt;STRONG&gt;_lstofrotation&lt;/STRONG&gt; (List&amp;lt;double&amp;gt;)" are used to store data related to the attributes (texts, positions, rotations).&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// ScalledPline (polyline), insertPoint(point3d), _lstOfPosition (List&amp;lt;Point3d&amp;gt;), _lstOfTextString (List&amp;lt;string&amp;gt;)
            //_nameOfBl (string), _lstOfRotation (List&amp;lt;double&amp;gt;),  insertPoint : given


            // Get the current database and start a transaction
            Database db = Application.DocumentManager.MdiActiveDocument.Database;

            using (Transaction acTrans = db.TransactionManager.StartTransaction())
            {
                // Open the Block table for read
                BlockTable bt;
                bt = acTrans.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;

                ObjectId blkRecId = ObjectId.Null;

                if (!bt.Has(_nameOfBl))
                {
                    using (BlockTableRecord acBlkTblRec = new BlockTableRecord())
                    {
                        acBlkTblRec.Name = _nameOfBl;

                        // Set the insertion point for the block
                        acBlkTblRec.Origin = insertPoint;

                        // Add pline with attribute onto block
                        using (ScalledPline)
                        {
                            acBlkTblRec.AppendEntity(ScalledPline);

                            // Add an attribute definition to the block
                            for (int i = 0; i &amp;lt; _lstOfDBText.Count; i++)
                            {
                                using (AttributeDefinition acAttDef = new AttributeDefinition())
                                {
                                    acAttDef.Position = _lstOfPosition[i];
                                    acAttDef.Prompt = "Txt N°" + (i + 1).ToString();
                                    acAttDef.Tag = "Txt " + (i + 1).ToString();
                                    acAttDef.TextString = _lstOfTextString[i];
                                    acAttDef.Rotation = _lstOfRotation[i];

                                    acAttDef.Height = 1;
                                    acAttDef.Justify = AttachmentPoint.MiddleCenter;
                                    acBlkTblRec.AppendEntity(acAttDef);
                                }
                            }

                            bt.UpgradeOpen();
                            bt.Add(acBlkTblRec); // error in this line
                            acTrans.AddNewlyCreatedDBObject(acBlkTblRec, true);

                        }

                        blkRecId = acBlkTblRec.Id;
                    }
                }
                else
                {
                    blkRecId = bt[_nameOfBl];
                }

                //========== 3 - Insert the block into the current space
                if (blkRecId != ObjectId.Null)
                {
                    BlockTableRecord acBlkTblRec;
                    acBlkTblRec = acTrans.GetObject(blkRecId, OpenMode.ForRead) as BlockTableRecord;

                    // Create and insert the new block reference
                    using (BlockReference acBlkRef = new BlockReference(insertPoint, blkRecId))
                    {
                        BlockTableRecord acCurSpaceBlkTblRec;
                        acCurSpaceBlkTblRec = acTrans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord;

                        acCurSpaceBlkTblRec.AppendEntity(acBlkRef);
                        acTrans.AddNewlyCreatedDBObject(acBlkRef, true);

                        // Verify block table record has attribute definitions associated with it
                        if (acBlkTblRec.HasAttributeDefinitions)
                        {
                            // Add attributes from the block table record
                            foreach (ObjectId objID in acBlkTblRec)
                            {
                                DBObject dbObj = acTrans.GetObject(objID, OpenMode.ForRead) as DBObject;

                                if (dbObj is AttributeDefinition)
                                {
                                    AttributeDefinition acAtt = dbObj as AttributeDefinition;

                                    if (!acAtt.Constant)
                                    {
                                        using (AttributeReference acAttRef = new AttributeReference())
                                        {
                                            acAttRef.SetAttributeFromBlock(acAtt, acBlkRef.BlockTransform);
                                            acAttRef.Position = acAtt.Position.TransformBy(acBlkRef.BlockTransform);

                                            acAttRef.TextString = acAtt.TextString;

                                            acBlkRef.AttributeCollection.AppendAttribute(acAttRef);

                                            acTrans.AddNewlyCreatedDBObject(acAttRef, true);
                                        }
                                    }
                                }
                            }
                        }


                    }
                }


                // Save the new object to the database
                acTrans.Commit();


            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I encountered an issue with a function I'm using : Unhandled Access Violation Reading&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 16:53:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12061484#M8331</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2023-06-26T16:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062618#M8332</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The main issue I see is about ScalledPline.&lt;/P&gt;
&lt;P&gt;The polyline should be created within the transaction (acTrans), appended to the block definition and added to the transaction.&lt;/P&gt;
&lt;P&gt;To be able to find and correct errors in your code, you should split it into several methods which can be tested separately.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;A 'GetOrCreateBlockDefinition' which checks if the BlockTable contains a bloc definition named as '&lt;STRONG&gt;_nameofbl&lt;/STRONG&gt;' and, if it does, return the block definition ObjectId; else, create the block definition, add it to the block table create the polyline and append it to the block definition, create the attributes, add them to the block definition and finally return the ObjectId of this new block definition.&lt;/P&gt;
&lt;P&gt;And another 'InsertBlockReference' method, which calls 'GetOrCreateBlockDefinition' to get the ObjectId of the block definition, and inserts a new block reference.&lt;/P&gt;
&lt;P&gt;This way, you could first test and debug the 'GetOrCreateBlockDefinition' method until it works before trying to insert the block programmatically.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 05:12:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062618#M8332</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-06-27T05:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062813#M8333</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4114680"&gt;@youssefGC&lt;/a&gt;&amp;nbsp;&amp;nbsp;In your code write '&lt;STRONG&gt;bt.Add(acBlkTblRec)'&lt;/STRONG&gt;&amp;nbsp;before '&lt;STRONG&gt;using (ScalledPline){ }'&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 06:53:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062813#M8333</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-27T06:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062815#M8334</link>
      <description>Right now 'bt.Add(acBlkTblRec)' is inside 'using (ScalledPline){ }'</description>
      <pubDate>Tue, 27 Jun 2023 06:54:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062815#M8334</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-27T06:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062831#M8335</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;, When I created new BlockTableRecord and added it to BlockTable &amp;amp; then went for creating polyline , it worked. In code shared by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4114680"&gt;@youssefGC&lt;/a&gt;&amp;nbsp;, he is adding&amp;nbsp;BlockTableRecord inside '&lt;STRONG&gt;using (ScalledPline){&amp;nbsp; }&lt;/STRONG&gt;'. I'm not able to understand how &lt;STRONG&gt;using(){&amp;nbsp; }&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;works in AutoCAD.NET.&amp;nbsp;I know about &lt;STRONG&gt;'using(Transaction ....){}'&amp;nbsp;&lt;/STRONG&gt;but apart from that I'm not able to understand how&amp;nbsp;&lt;STRONG&gt;'using(){}'&amp;nbsp;&lt;/STRONG&gt;works. Can you please give a hint?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 07:02:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12062831#M8335</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-27T07:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12063009#M8336</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13931204"&gt;@shubhamraut221195&lt;/a&gt;&amp;nbsp; a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;I'm not able to understand how &lt;STRONG&gt;using(){&amp;nbsp; }&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;works in AutoCAD.NET.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The using statement is not specific to AutoCAD .NET API. It is used to ensure ensures the correct use of an &lt;A class="no-loc" href="https://learn.microsoft.com/en-us/dotnet/api/system.idisposable" data-linktype="absolute-path" target="_blank"&gt;IDisposable&lt;/A&gt; instance (see &lt;A href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using" target="_blank" rel="noopener"&gt;this topic&lt;/A&gt;).&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;using (someDisposableInstance)
{
    // do your stuff with someDisposableInstance
}&lt;/LI-CODE&gt;
&lt;P&gt;is equivalent to:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;try
{
    // do your stuff with someDisposableInstance
}
finally
{
    someDisposableInstance.Dispose();
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 08:18:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12063009#M8336</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-06-27T08:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12063032#M8337</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;Ok. So why can't we add BlockTableRecord to BlockTable inside using(Polyline.....){&amp;nbsp; }? Is it because polyline which is part of&amp;nbsp;BlockTableRecord which is not disposed yet?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 08:31:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12063032#M8337</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-27T08:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12063078#M8338</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13931204"&gt;@shubhamraut221195&lt;/a&gt;&amp;nbsp; a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;So why can't we add BlockTableRecord to BlockTable inside using(Polyline.....){&amp;nbsp; }? Is it because polyline which is part of&amp;nbsp;BlockTableRecord which is not disposed yet?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The problem is not adding the BlockTableRecord to the BlockTable inside using(Polyline.....) statement.&lt;/P&gt;
&lt;P&gt;The problem is adding a polyline (and AttributeDefinitions) to the BlockTableRecord &lt;STRONG&gt;before&lt;/STRONG&gt; having added the BlockTableRecord to the BlockTable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically, the process should be like below (no need to use a using statement for the Polyline because it is always added to the Transaction):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;using(Transaction)
{
    Create blockTableRecord
    Add BlockTableRecord to BlockTable
    Add BlockTableRecord to Transaction

    Create polyline
    Add Polyline to BlockTableRecord
    Add Polyline to Transaction

    For each AttributeDefinition
        Create AttributeDefinition
        Add AttributeDefinition to BlockTableRecord
        Add AttributeDefinition to Transaction

    Commit Transaction
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 11:07:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12063078#M8338</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-06-27T11:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12072811#M8339</link>
      <description>&lt;P&gt;Thank you for your reply &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;,&lt;BR /&gt;Yes, indeed, I have examined the code by subdividing it into several methods. In fact,&lt;BR /&gt;The problem lies with the "ScalledPline" element, which needs to be added to the "acTrans" transaction before being added as a block.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;                bt.UpgradeOpen();
                bt.Add(ScalledPline); 
                acTrans.AddNewlyCreatedDBObject(ScalledPline, true);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2023 21:24:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12072811#M8339</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2023-06-30T21:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12072818#M8340</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Yes, but the source of the problem is that I am adding "ScalledPline" to a block before it is added to the transaction.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Jun 2023 21:29:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12072818#M8340</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2023-06-30T21:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12073173#M8341</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4114680"&gt;@youssefGC&lt;/a&gt;&amp;nbsp; a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;Thank you for your reply &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;,&lt;BR /&gt;Yes, indeed, I have examined the code by subdividing it into several methods. In fact,&lt;BR /&gt;The problem lies with the "ScalledPline" element, which needs to be added to the "acTrans" transaction before being added as a block.&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;                bt.UpgradeOpen();
                bt.Add(ScalledPline); 
                acTrans.AddNewlyCreatedDBObject(ScalledPline, true);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In this snippet, you add the polyline to the block table which does not make sense (you can only add new BlockTableRecord instances to the block table).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We do not know where the ScalledPline comes from, how it have been created.&lt;/P&gt;
&lt;P&gt;Typically, it should be created inside the same transaction the new block definition (BlockTableRecord) is created and appended to this block definition and the transaction as described in the pseudo code of &lt;A href="https://forums.autodesk.com/t5/net/block-with-multiple-attribute-references/m-p/12063078/highlight/true#M77595" target="_blank" rel="noopener"&gt;this reply&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2023 04:58:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12073173#M8341</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-07-01T04:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12073386#M8342</link>
      <description>&lt;P&gt;Sorry, I didn't explain the origin of "scalledPline" properly. In fact, in my main program, "scalledPline" is a polyline resulting from a Jig. Then, I want to create a block using this polyline.&lt;/P&gt;&lt;P&gt;Finally, I want to save the original polyline, as well as create a block (based on the polyline, of course), and insert it in another location.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2023 09:26:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12073386#M8342</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2023-07-01T09:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Block with Multiple Attribute References</title>
      <link>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12073669#M8343</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4114680"&gt;@youssefGC&lt;/a&gt;&amp;nbsp; a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;Sorry, I didn't explain the origin of "scalledPline" properly. In fact, in my main program, "scalledPline" is a polyline resulting from a Jig. Then, I want to create a block using this polyline.&lt;/P&gt;
&lt;P&gt;Finally, I want to save the original polyline, as well as create a block (based on the polyline, of course), and insert it in another location.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The same polyline cannot be added to several BlockTableRecords (the model space and a block definition).&lt;/P&gt;
&lt;P&gt;You could add the polyline to the model space after the Jig and pass its ObjectId to the method where you create the block definition. In this method, you can use DeepCloneObjects to copy the polyline into the newly created block definition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pseudo code:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;using(Transaction)
{
    Create blockTableRecord
    Add BlockTableRecord to BlockTable
    Add BlockTableRecord to Transaction

    DeepClone the polyline

    For each AttributeDefinition
        Create AttributeDefinition
        Add AttributeDefinition to BlockTableRecord
        Add AttributeDefinition to Transaction

    Commit Transaction
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2023 15:13:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/block-with-multiple-attribute-references/m-p/12073669#M8343</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-07-01T15:13:26Z</dc:date>
    </item>
  </channel>
</rss>

