<?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 and typed values in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9156768#M20763</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to send Autocad commands through C#, and so far I've been using the "acedCmd" system (I'm stuck with Autocad 2013, so I can't use the Editor.Command() method). I would like to call the MOVE command on an object that just has been created. The beginning works, I can select the object:&lt;/P&gt;&lt;PRE&gt;lastRes = acApp.DocumentManager.MdiActiveDocument.Editor.SelectLast();
rb = new ResultBuffer();
rb.Add(new TypedValue(5005, "_.MOVE"));
rb.Add(new TypedValue(5006, lastRes.Value[0].ObjectId));
(...)
acedCmd(rb.UnmanagedObject);&lt;/PRE&gt;&lt;P&gt;What I can't figure out is the (...) part, where I guess I need to programmatically emulate an "Enter" keypress (so Autocad asks for the move base point) and then provide autocad with the displacement point (using a 5002 typeValue I guess?).&lt;/P&gt;&lt;P&gt;How can it be done?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2019 09:18:54 GMT</pubDate>
    <dc:creator>jptallano</dc:creator>
    <dc:date>2019-11-20T09:18:54Z</dc:date>
    <item>
      <title>Calling Autocad commands and typed values</title>
      <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9156768#M20763</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to send Autocad commands through C#, and so far I've been using the "acedCmd" system (I'm stuck with Autocad 2013, so I can't use the Editor.Command() method). I would like to call the MOVE command on an object that just has been created. The beginning works, I can select the object:&lt;/P&gt;&lt;PRE&gt;lastRes = acApp.DocumentManager.MdiActiveDocument.Editor.SelectLast();
rb = new ResultBuffer();
rb.Add(new TypedValue(5005, "_.MOVE"));
rb.Add(new TypedValue(5006, lastRes.Value[0].ObjectId));
(...)
acedCmd(rb.UnmanagedObject);&lt;/PRE&gt;&lt;P&gt;What I can't figure out is the (...) part, where I guess I need to programmatically emulate an "Enter" keypress (so Autocad asks for the move base point) and then provide autocad with the displacement point (using a 5002 typeValue I guess?).&lt;/P&gt;&lt;P&gt;How can it be done?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 09:18:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9156768#M20763</guid>
      <dc:creator>jptallano</dc:creator>
      <dc:date>2019-11-20T09:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Autocad commands and typed values</title>
      <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9156881#M20764</link>
      <description>&lt;P&gt;Editor.Command for previous version of AutoCAD: &lt;A href="https://forums.autodesk.com/t5/net/send-command-executes-after-exiting-command-method/m-p/3882952#M34731" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/net/send-command-executes-after-exiting-command-method/m-p/3882952#M34731&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.: Instead of _MOVE command you can use Entity.TransformBy method:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-D4348E23-7ECB-48F6-90B7-FB7EF42DFA8D-htm.html" target="_blank" rel="noopener"&gt;https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-D4348E23-7ECB-48F6-90B7-FB7EF42DFA8D-htm.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-9E9D7A74-4FE7-4E57-B9CB-BA4712B364ED-htm.html" target="_blank"&gt;https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-NET/files/GUID-9E9D7A74-4FE7-4E57-B9CB-BA4712B364ED-htm.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 10:10:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9156881#M20764</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2019-11-20T10:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Autocad commands and typed values</title>
      <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9156999#M20765</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 11:01:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9156999#M20765</guid>
      <dc:creator>jptallano</dc:creator>
      <dc:date>2019-11-20T11:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Autocad commands and typed values</title>
      <link>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9158060#M20766</link>
      <description>&lt;P&gt;In general, you should be looking to non-command call ways of doing things.&amp;nbsp; These are available for all the basic operations such as move, rotate, etc.&amp;nbsp; There are very few which require an actual command call.&amp;nbsp; Coincidentally it's also a good way of learning how things work and how to implement more complicated operations.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 19:32:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/calling-autocad-commands-and-typed-values/m-p/9158060#M20766</guid>
      <dc:creator>dgorsman</dc:creator>
      <dc:date>2019-11-20T19:32:33Z</dc:date>
    </item>
  </channel>
</rss>

