<?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: SendStringToExecute method problem in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/sendstringtoexecute-method-problem/m-p/8399725#M24308</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DIMLAYER is a system variable, you should use the Application.SetSystemVariable() method insted.&lt;/P&gt;
&lt;PRE&gt;Application.SetSystemVariable("DIMLAYER", "0");&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With SendStringtoExecute, as the command line is a string and the last command options (the layer name) is a string which may contain spaces, you have to validate the option with a newline character.&lt;/P&gt;
&lt;PRE&gt;doc.SendStringToExecute("_.DIMLAYER 0\n", false, false, true);&lt;/PRE&gt;
&lt;P&gt;With Editor.Command, you do not need to validate the layer name option with "".&lt;/P&gt;
&lt;PRE&gt;ed.Command("_.DIMLAYER", "0");&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 20:33:53 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2018-11-13T20:33:53Z</dc:date>
    <item>
      <title>SendStringToExecute method problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendstringtoexecute-method-problem/m-p/8399670#M24307</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run a DIMLAYER command on AutoCAD. After I put a layer name it does not execute.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I run this line:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Application.DocumentManager.MdiActiveDocument.SendStringToExecute("._DIMLAYER 0 ", True, False, False)&lt;/PRE&gt;&lt;P&gt;but I end up with this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/569124i587D87EAFF2A378A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Also, I tried to use Editor.command method, bet all i get is einvalidInput error.&lt;/P&gt;&lt;PRE&gt;Application.DocumentManager.MdiActiveDocument.Editor.Command("DIMLAYER", "0", "")&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Nov 2018 19:45:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendstringtoexecute-method-problem/m-p/8399670#M24307</guid>
      <dc:creator>Yonas89</dc:creator>
      <dc:date>2018-11-13T19:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: SendStringToExecute method problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendstringtoexecute-method-problem/m-p/8399725#M24308</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DIMLAYER is a system variable, you should use the Application.SetSystemVariable() method insted.&lt;/P&gt;
&lt;PRE&gt;Application.SetSystemVariable("DIMLAYER", "0");&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With SendStringtoExecute, as the command line is a string and the last command options (the layer name) is a string which may contain spaces, you have to validate the option with a newline character.&lt;/P&gt;
&lt;PRE&gt;doc.SendStringToExecute("_.DIMLAYER 0\n", false, false, true);&lt;/PRE&gt;
&lt;P&gt;With Editor.Command, you do not need to validate the layer name option with "".&lt;/P&gt;
&lt;PRE&gt;ed.Command("_.DIMLAYER", "0");&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 20:33:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendstringtoexecute-method-problem/m-p/8399725#M24308</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-11-13T20:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: SendStringToExecute method problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendstringtoexecute-method-problem/m-p/8400052#M24309</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;, thanks a lot for your reply. This was killing me... "\n" in sendStringtoExecute method did not help as I was still seeing "0\n" in the command line.&amp;nbsp; Ed.command method also still gives me einvalid input error. However using application.setsystemvariable method has worked!. Thank you so much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 22:59:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendstringtoexecute-method-problem/m-p/8400052#M24309</guid>
      <dc:creator>Yonas89</dc:creator>
      <dc:date>2018-11-13T22:59:32Z</dc:date>
    </item>
  </channel>
</rss>

