<?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: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12525311#M5797</link>
    <description>&lt;P&gt;Yes you could do that, but it involves some work, and to provide the full functionality of the SELECTSIMILAR command would be non-trivial (actually, I always felt that select similar functionality should have been better-integrated, and be available at any select objects prompt, but that's another story...).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also just instruct the user to do it in-advance by right-clicking (or using the SELECTSIMILAR command),&amp;nbsp; and then starting your command and specifying the &lt;STRONG&gt;P&lt;/STRONG&gt;revious selection set in response to the Select Objects: prompt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jan 2024 21:45:25 GMT</pubDate>
    <dc:creator>ActivistInvestor</dc:creator>
    <dc:date>2024-01-28T21:45:25Z</dc:date>
    <item>
      <title>TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12519563#M5789</link>
      <description>&lt;LI-CODE lang="general"&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

namespace Block_Replace
{
    public class Replace_objects
    {
        [CommandMethod("ReplaceObjects")]
        public void ReplaceObjects()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor editor = doc.Editor;
            PromptSelectionResult selectionResult = editor.GetSelection();

            if (selectionResult.Status != PromptStatus.OK)
            {
                editor.WriteMessage("No objects selected.");
                return;
            }

            SelectionSet selectionSet = selectionResult.Value;

            using (Transaction trans = db.TransactionManager.StartTransaction())
            {
                // Prompt user to select dynamic block reference
                PromptEntityOptions promptOptions = new PromptEntityOptions("\nSelect dynamic block reference: ");
                promptOptions.SetRejectMessage("Invalid selection. Please select a dynamic block reference.");
                promptOptions.AddAllowedClass(typeof(BlockReference), true);
                PromptEntityResult promptResult = editor.GetEntity(promptOptions);

                if (promptResult.Status != PromptStatus.OK)
                {
                    editor.WriteMessage("No dynamic block reference selected.");
                    return;
                }

                BlockReference dynamicBlockReference = trans.GetObject(promptResult.ObjectId, OpenMode.ForRead) as BlockReference;

                foreach (ObjectId objectId in selectionSet.GetObjectIds())
                {
                    Entity selectedEntity = trans.GetObject(objectId, OpenMode.ForRead) as Entity;

                    if (selectedEntity == null)
                        continue;

                    // Create a new block reference at the same position
                    BlockReference newBlockRef = dynamicBlockReference.Clone() as BlockReference;
                    newBlockRef.Position = selectedEntity.GeometricExtents.MinPoint;

                    // Add the new block reference to the model space
                    BlockTableRecord ms = trans.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForWrite) as BlockTableRecord;
                    ms.AppendEntity(newBlockRef);
                    trans.AddNewlyCreatedDBObject(newBlockRef, true);
                }

                trans.Commit();
            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nesara_r_0-1706177615891.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1318161i363864453AEA7CF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nesara_r_0-1706177615891.png" alt="nesara_r_0-1706177615891.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ABOVE BLOCK NEED TO BE REPLACED BY OTHER BLOCK&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nesara_r_1-1706177634069.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1318162i648AC714BA70A2E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nesara_r_1-1706177634069.png" alt="nesara_r_1-1706177634069.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nesara_r_2-1706177760671.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1318164i086F7FF207A7FC40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nesara_r_2-1706177760671.png" alt="nesara_r_2-1706177760671.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THE BLOCK GOT PASTE BUT IT IS LOOSING ITS DYNMIC&amp;nbsp; PROPERTIES I WANT TO RETAIN THOSE DAINAMIC PROPERTIES AFTER REPLACING ALSO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I TRIED TO REPLACE THOSE BLOCKS BY THE ABOVE BLOCK&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 10:16:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12519563#M5789</guid>
      <dc:creator>nesara_r</dc:creator>
      <dc:date>2024-01-25T10:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12520164#M5790</link>
      <description>&lt;P&gt;You cannot use Clone() to do this.&amp;nbsp;&lt;SPAN&gt;You have to use the &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Database_DeepCloneObjects_ObjectIdCollection_ObjectId_IdMapping__MarshalAsUnmanagedType_U1__bool" target="_blank" rel="noopener"&gt;DeepCloneObjectsl&lt;/A&gt;() method. Alternately, you can use the ActiveX &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-B036C50B-F504-486F-8179-85655206916E" target="_blank" rel="noopener"&gt;Copy()&lt;/A&gt; method.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 15:28:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12520164#M5790</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-01-25T15:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12520968#M5791</link>
      <description>&lt;P&gt;It seems to me that you might not fully understand how dynamic block works, or you would not call Clone() to create a dynamic BlockReference instance, which is most likely an anonymous block. While you can use DeepCloneObjects() for your purpose, it would not help you to know how dynamic block reference is created and how the dynamic properties are set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case, after user picks a dynamic blockreference to "copy", your code should do these:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Retrieve the dynamic blockreference's dynamic properties into collection, such as Dictionary&amp;lt;string, object&amp;gt;;&lt;/P&gt;
&lt;P&gt;2. When looping through the selection set (in order to decide the insertion point of "copied" block reference), you create a NEW BlockReference instance of the dynamic block, then you set its dynamic properties use the retrieved property name/value pair in the Dictionary. When the dynamic properties are set, AutoCAD would automatically change the newly inserted BlockReference's block definition to an anonymous block definition, if necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code would look like (not tested):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

namespace Block_Replace
{
    public class Replace_objects
    {
        [CommandMethod("ReplaceObjects")]
        public void ReplaceObjects()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor editor = doc.Editor;
            PromptSelectionResult selectionResult = editor.GetSelection();

            if (selectionResult.Status != PromptStatus.OK)
            {
                editor.WriteMessage("No objects selected.");
                return;
            }

            SelectionSet selectionSet = selectionResult.Value;

            using (Transaction trans = db.TransactionManager.StartTransaction())
            {
                // Prompt user to select dynamic block reference
                PromptEntityOptions promptOptions = new PromptEntityOptions("\nSelect dynamic block reference: ");
                promptOptions.SetRejectMessage("Invalid selection. Please select a dynamic block reference.");
                promptOptions.AddAllowedClass(typeof(BlockReference), true);
                PromptEntityResult promptResult = editor.GetEntity(promptOptions);

                if (promptResult.Status != PromptStatus.OK)
                {
                    editor.WriteMessage("No dynamic block reference selected.");
                    return;
                }

                BlockReference dynamicBlockReference = trans.GetObject(promptResult.ObjectId, OpenMode.ForRead) as BlockReference;
                
                // Retrieve dynamic properties from the block reference
                Dictionary&amp;lt;string, object&amp;gt; props=GetDynamicProperties(dynamicBlockReference)
                ObjectId blockDefinitionId=dynamicBlockReference.DynamicBlockTableRecord;

                foreach (ObjectId objectId in selectionSet.GetObjectIds())
                {
                    Entity selectedEntity = trans.GetObject(objectId, OpenMode.ForRead) as Entity;

                    if (selectedEntity == null)
                        continue;

                    // Create a new block reference at the same position
                    ////BlockReference newBlockRef = dynamicBlockReference.Clone() as BlockReference;
                    ////newBlockRef.Position = selectedEntity.GeometricExtents.MinPoint;

                    // Create new dynamic block reference
                    var newBlockRef = new BlockReference(selectedEntity.GeometricExtents.MinPoint, blockDefinitionId)

                    // Add the new block reference to the model space
                    BlockTableRecord ms = trans.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForWrite) as BlockTableRecord;
                    ms.AppendEntity(newBlockRef);
                    trans.AddNewlyCreatedDBObject(newBlockRef, true);

                    // if the block definition has attributes defined,
                    // you would want to add AttributeReferences accordingly here
                    ... ...

                    // set dynamic properties of the new block reference
                    foreach (DynamicBlockReferenceProperty prop in newBlockRef.DynamicBlockReferencePropertyCollection)
                    {
                       var propName=prop.PropertyName;
                       var propValue=props[propName];
                       prop.Value = propValue;
                    }
                }

                trans.Commit();
            }
        }

        private Dictionary&amp;lt;string, object&amp;gt; GetDynamicProperties(BlockReference blkRef)
        {
            var dict= new Dictionary&amp;lt;string, object&amp;gt;();
            foreach (DynamicBlockReferenceProperty prop in blkRef.DynamicBlockReferencePropertyCollection)
            {
                dict.Add(prop.PropertyName, prop.Value);
            }
            return dict;
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 22:23:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12520968#M5791</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2024-01-25T22:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12521300#M5792</link>
      <description>&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 04:27:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12521300#M5792</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-01-26T04:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12521334#M5793</link>
      <description>&lt;P&gt;If you want to create copies of objects, whether they are Dynamic block references or anything else, then you use the API methods that are provided to copy them, which are the ones I mentioned previously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That is what they are there for, there is no need for you to reinvent those methods.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use those APIs, then you do not have to also deal with all of the other potential issues related to copying Dynamic blocks, such as attributes; fields in attributes; and so forth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See &lt;A href="https://forums.autodesk.com/t5/net/dynamic-block-not-placing-at-user-selected-point-but-offset-from/m-p/12008576/highlight/true#M77281" target="_blank" rel="noopener"&gt;this post&lt;/A&gt; for an example use of&amp;nbsp; DeepCloneObjects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 04:30:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12521334#M5793</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-01-26T04:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12522003#M5794</link>
      <description>&lt;P&gt;thankyou for advice after going through your solution i used it in my project now it is&amp;nbsp; working&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 13:43:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12522003#M5794</guid>
      <dc:creator>nesara_r</dc:creator>
      <dc:date>2024-01-26T13:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12522397#M5795</link>
      <description>&lt;P&gt;Great. The example I pointed to was courtesy of&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;, for the record.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 17:08:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12522397#M5795</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-01-26T17:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12524512#M5796</link>
      <description>&lt;P&gt;can i give select similar option to the user while selecting the objects in the same code above&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2024 07:15:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12524512#M5796</guid>
      <dc:creator>nesara_r</dc:creator>
      <dc:date>2024-01-28T07:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12525311#M5797</link>
      <description>&lt;P&gt;Yes you could do that, but it involves some work, and to provide the full functionality of the SELECTSIMILAR command would be non-trivial (actually, I always felt that select similar functionality should have been better-integrated, and be available at any select objects prompt, but that's another story...).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also just instruct the user to do it in-advance by right-clicking (or using the SELECTSIMILAR command),&amp;nbsp; and then starting your command and specifying the &lt;STRONG&gt;P&lt;/STRONG&gt;revious selection set in response to the Select Objects: prompt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2024 21:45:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12525311#M5797</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-01-28T21:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12525660#M5798</link>
      <description>&lt;P&gt;i tried using select similar in first place and then run my command but when i run my command the objects selected previously is getting deselected.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 04:25:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12525660#M5798</guid>
      <dc:creator>nesara_r</dc:creator>
      <dc:date>2024-01-29T04:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12525686#M5799</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14356947"&gt;@nesara_r&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;i tried using select similar in first place and then run my command but when i run my command the objects selected previously is getting deselected.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to use the CommandFlags.UsePickSet flag in your CommandMethod:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;[CommandMethod("ReplaceObjects", CommandFlags.UsePickSet)]
public void ReplaceObjects()
{
   ....
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 04:53:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12525686#M5799</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-01-29T04:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12535877#M5800</link>
      <description>&lt;LI-CODE lang="general"&gt;    // Get the newly created block reference
    var newBlockRefId = mapping[dynamicBlockId].Value;
    var newBlockRef = (BlockReference)trans.GetObject(newBlockRefId, OpenMode.ForWrite);

    // Set the position of the new block reference to the position of the selected entity
    newBlockRef.Position = selectedEntity.GeometricExtents.MinPoint;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 06:39:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12535877#M5800</guid>
      <dc:creator>nesara_r</dc:creator>
      <dc:date>2024-02-02T06:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: TRYING TO REPLACE DAINAMIC BLOCK IN PLACE OF OBJECTS</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12535891#M5801</link>
      <description>&lt;LI-CODE lang="general"&gt;    // Get the newly created block reference
    var newBlockRefId = mapping[dynamicBlockId].Value;
    var newBlockRef = (BlockReference)trans.GetObject(newBlockRefId, OpenMode.ForWrite);

    // Set the position of the new block reference to the position of the selected entity
    newBlockRef.Position = selectedEntity.GeometricExtents.MinPoint;&lt;/LI-CODE&gt;&lt;P&gt;i want to get coordinates of OBJECT I select and need to paste the new block reference there&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 06:52:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-replace-dainamic-block-in-place-of-objects/m-p/12535891#M5801</guid>
      <dc:creator>nesara_r</dc:creator>
      <dc:date>2024-02-02T06:52:55Z</dc:date>
    </item>
  </channel>
</rss>

