<?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 : Merge layers in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/6975519#M32140</link>
    <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your quick answer!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems I was thinking way to complicated!&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;The editor.Command() is a really nice option. This is what I came up with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VB.NET&lt;/P&gt;&lt;PRE&gt;   Public Sub Mergelayers(layertomerge As String, mergetolayer As String)

        Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
        ed.Command("LAYMRG", "n", layertomerge, "", "n", mergetolayer, "y")

    End Sub&lt;/PRE&gt;</description>
    <pubDate>Mon, 27 Mar 2017 13:16:43 GMT</pubDate>
    <dc:creator>R.Gerritsen4967</dc:creator>
    <dc:date>2017-03-27T13:16:43Z</dc:date>
    <item>
      <title>Merge layers</title>
      <link>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/6975258#M32138</link>
      <description>&lt;P&gt;I need to merge some layers in a drawing,&amp;nbsp; so I can write a .NET program to first move all objects from one layer to another and then delete the first layer. But I'm not sure if this is the right way to approach this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the layer properties manager in AutoCAD there is a command 'Merge selected layer(s) to...'. This command does exactly what I need without me thinking about all the possible checks that need to be performed to avoid crashing AutoCAD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried to find some merge property of the layertablerecord or something in the layertable, but I can't find anything usefull.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to use this command using VB.NET?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:33:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/6975258#M32138</guid>
      <dc:creator>R.Gerritsen4967</dc:creator>
      <dc:date>2017-03-27T11:33:08Z</dc:date>
    </item>
    <item>
      <title>Re : Merge layers</title>
      <link>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/6975372#M32139</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can call AutoCAD commands from .NET using Document.SendStringToExecute() method (which runs asynchronously) or, since AutoCAD 2015, Editor.Command() which runs synchronously (for prior version &lt;A href="https://forums.autodesk.com/t5/net/problem-calling-acedcmd/m-p/4752787/highlight/true#M38687" target="_blank"&gt;Tony Tanzillo shared a wrapper for the non public RunCommand() method&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, moving entities from one layer to another should do the trick, just check the layers aren't locked and iterate all the block table records from block table in case some entity on the source layer owns to a block definition.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 12:27:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/6975372#M32139</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-03-27T12:27:52Z</dc:date>
    </item>
    <item>
      <title>Re : Merge layers</title>
      <link>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/6975519#M32140</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your quick answer!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems I was thinking way to complicated!&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;The editor.Command() is a really nice option. This is what I came up with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VB.NET&lt;/P&gt;&lt;PRE&gt;   Public Sub Mergelayers(layertomerge As String, mergetolayer As String)

        Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
        ed.Command("LAYMRG", "n", layertomerge, "", "n", mergetolayer, "y")

    End Sub&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 13:16:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/6975519#M32140</guid>
      <dc:creator>R.Gerritsen4967</dc:creator>
      <dc:date>2017-03-27T13:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Re : Merge layers</title>
      <link>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/8604202#M32141</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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know if this is the only way to merge layers via .net? I am not of fan of the command line output while merging layers, and no system variables; i.e. cmdecho, etc will suppress them. I would like to do it pragmatically&amp;nbsp;if possible. The reason is while merging, the command line may pause on the question "Merge Layers?" Y/N and the user may think that they have to press a key and I don't want to confuse them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 00:50:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/merge-layers/m-p/8604202#M32141</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2019-02-19T00:50:31Z</dc:date>
    </item>
  </channel>
</rss>

