<?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: Passing point to command and getting results programmatically using c# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8709140#M22886</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to call the command(e.g. LABCOOR or LABLAT) programmatically using:&lt;/P&gt;
&lt;PRE&gt;doc.SendStringToExecute("LABLAT\n", false, false, false);

or 

ed.Command("LABLAT");

or any other way.&lt;/PRE&gt;
&lt;P&gt;Running this command requires user to pick a point. Is there a way to automate point selection?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Assuming the point is (20, 10,0)&lt;/P&gt;
&lt;PRE&gt;doc.SendStringToExecute("LABLAT 20,10,0\n", false, false, false); 
//or
ed.Command("LABLAT", new Point3d(20.0, 10.0, 0.0));&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;And other question: is there a way to get results of a command programmatically as well?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A command cannot return a value but you can store some value in a member of your class.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2019 22:09:33 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2019-04-04T22:09:33Z</dc:date>
    <item>
      <title>Passing point to command and getting results programmatically using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8707748#M22885</link>
      <description>&lt;P&gt;Dear all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to call the command(e.g. LABCOOR or LABLAT) programmatically using:&lt;/P&gt;
&lt;PRE&gt;doc.SendStringToExecute("LABLAT\n", false, false, false);

or 

ed.Command("LABLAT");

or any other way.&lt;/PRE&gt;
&lt;P&gt;Running this command requires user to pick a point. Is there a way to automate point selection?&lt;/P&gt;
&lt;P&gt;And other question: is there a way to get results of a command programmatically as well?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that correct approach at all?&lt;/P&gt;
&lt;P&gt;My problem in general: get lat/long values of a point to handle them later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 14:31:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8707748#M22885</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-04T14:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Passing point to command and getting results programmatically using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8709140#M22886</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to call the command(e.g. LABCOOR or LABLAT) programmatically using:&lt;/P&gt;
&lt;PRE&gt;doc.SendStringToExecute("LABLAT\n", false, false, false);

or 

ed.Command("LABLAT");

or any other way.&lt;/PRE&gt;
&lt;P&gt;Running this command requires user to pick a point. Is there a way to automate point selection?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Assuming the point is (20, 10,0)&lt;/P&gt;
&lt;PRE&gt;doc.SendStringToExecute("LABLAT 20,10,0\n", false, false, false); 
//or
ed.Command("LABLAT", new Point3d(20.0, 10.0, 0.0));&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;And other question: is there a way to get results of a command programmatically as well?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A command cannot return a value but you can store some value in a member of your class.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 22:09:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8709140#M22886</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-04-04T22:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Passing point to command and getting results programmatically using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8709349#M22887</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Assuming the point is (20, 10,0)&lt;/P&gt;
&lt;PRE&gt;doc.SendStringToExecute("LABLAT 20,10,0\n", false, false, false); 
//or
ed.Command("LABLAT", new Point3d(20.0, 10.0, 0.0));&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;And other question: is there a way to get results of a command programmatically as well?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A command cannot return a value but you can store some value in a member of your class.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks for your reply!&lt;BR /&gt;So, that means that I could pass point coordinates to a command. But how do I get it's results? I mean not on the plot, but programmatically?&lt;BR /&gt;I guess I could look for newly added elements and get text values there, but I feel that there should be a better way to do it.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 01:35:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8709349#M22887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-05T01:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Passing point to command and getting results programmatically using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8709561#M22888</link>
      <description>&lt;P&gt;A method decored with the CommandMethod attribute cannot have arguments and cannot return a value.&lt;/P&gt;
&lt;P&gt;So you have to use a work around with some side effect to "get the command results".&lt;/P&gt;
&lt;P&gt;As said before, you can have some member (field or property) in the class where the command is defined and set their values from the command method.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 06:10:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/passing-point-to-command-and-getting-results-programmatically/m-p/8709561#M22888</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-04-05T06:10:15Z</dc:date>
    </item>
  </channel>
</rss>

