<?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 Calling AutoCAD Commands Programmatically in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/5565160#M40725</link>
    <description>&lt;P&gt;I have two short methods which are both meant to call AutoCAD's UNDO command and pass in different parameters. They are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// Method to mark the current position of the AutoCAD program&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;public static void MarkPosition()&lt;BR /&gt;{&lt;BR /&gt;doc.SendStringToExecute("_UNDO ", true, false, false);&lt;BR /&gt;doc.SendStringToExecute("_M ", true, false, false);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// Method to step AutoCAD back&amp;nbsp;to the marked position&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;public static void BigUndo()&lt;BR /&gt;{&lt;BR /&gt;doc.SendStringToExecute("_UNDO ", true, false, false);&lt;BR /&gt;doc.SendStringToExecute("_B ", true, false, false);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I call&amp;nbsp;them they do not run like I expect them to. I suspect that I am doing this completely wrong but do not know what the right approach is&lt;/P&gt;</description>
    <pubDate>Tue, 31 Mar 2015 14:41:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-31T14:41:13Z</dc:date>
    <item>
      <title>Calling AutoCAD Commands Programmatically</title>
      <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/5565160#M40725</link>
      <description>&lt;P&gt;I have two short methods which are both meant to call AutoCAD's UNDO command and pass in different parameters. They are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// Method to mark the current position of the AutoCAD program&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;public static void MarkPosition()&lt;BR /&gt;{&lt;BR /&gt;doc.SendStringToExecute("_UNDO ", true, false, false);&lt;BR /&gt;doc.SendStringToExecute("_M ", true, false, false);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// Method to step AutoCAD back&amp;nbsp;to the marked position&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;public static void BigUndo()&lt;BR /&gt;{&lt;BR /&gt;doc.SendStringToExecute("_UNDO ", true, false, false);&lt;BR /&gt;doc.SendStringToExecute("_B ", true, false, false);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I call&amp;nbsp;them they do not run like I expect them to. I suspect that I am doing this completely wrong but do not know what the right approach is&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 14:41:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/5565160#M40725</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-31T14:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calling AutoCAD Commands Programmatically</title>
      <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/6453811#M40726</link>
      <description>&lt;P&gt;I know you can't inject a command while another command in running. i.e. You can't inject the _M option until after the _UNDO command is finished.&lt;/P&gt;&lt;P&gt;I have seen where people have used a string builder and assemble them together but I have never been able to get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or you could do what I did. I needed to insert Surface Texture Symbols, but was unable to inject the L (library) option so I had to recreate the entire functionality. (As an added benefit, this allowed the code to be repeatable - something the current Surface Texture object can not do (it defaults back to the default symbols))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry I can't give a more direct answer, hopefully someone will see this and get some idea of what to look for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2016 07:56:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/6453811#M40726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-22T07:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calling AutoCAD Commands Programmatically</title>
      <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/6453865#M40727</link>
      <description>What do you mean 'they do not run as expected'?&lt;BR /&gt;Are they executed at the wrong time, are they lost altogether?&lt;BR /&gt;And what's the purpose? Executing an UNDO and se t a Mark or just set the mark?&lt;BR /&gt;Have you tried just to combine the commands like "_UNDO _M "? And eventually postpone the single UNDO action if you also need to actually undo something at the same time...</description>
      <pubDate>Fri, 22 Jul 2016 08:36:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/6453865#M40727</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-22T08:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calling AutoCAD Commands Programmatically</title>
      <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/6456645#M40728</link>
      <description>&lt;P&gt;I would recommend an awesome library called [AutoCAD Code Pack](&lt;A href="https://github.com/luanshixia/AutoCADCodePack" target="_blank"&gt;https://github.com/luanshixia/AutoCADCodePack&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this library, you can save a lot of code you would write directly with AutoCAD .NET API. To run a command (say "re"), you just say&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interaction.Command("re");&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2016 22:51:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-programmatically/m-p/6456645#M40728</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-24T22:51:28Z</dc:date>
    </item>
  </channel>
</rss>

