<?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: Error when escaping GetPoint in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/error-when-escaping-getpoint/m-p/11826091#M9544</link>
    <description>&lt;P&gt;Do you have to use the COM API for a particular reason? The following is a quick snippet for prompting the user for a point using the managed API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim aDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim ed As Editor = aDoc.Editor
Dim opt As New PromptPointOptions(vbCrLf &amp;amp; "Select Part Origin: ")
Dim res As PromptPointResult = ed.GetPoint(opt)
If res.Status &amp;lt;&amp;gt; PromptStatus.OK Then Exit Sub
Dim selPoint As Point3d = res.Value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After selecting the point you can check the 'status' of the PromptPointResult.&amp;nbsp; If the status is okay you can then get the point using the result value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2023 14:18:46 GMT</pubDate>
    <dc:creator>hippe013</dc:creator>
    <dc:date>2023-03-16T14:18:46Z</dc:date>
    <item>
      <title>Error when escaping GetPoint</title>
      <link>https://forums.autodesk.com/t5/net-forum/error-when-escaping-getpoint/m-p/11826037#M9543</link>
      <description>&lt;P&gt;I am using the GetPoint function to prompt the user to select a point on screen.&amp;nbsp; However if the user changes their mind &amp;amp; presses escape, my code throws an exception.&amp;nbsp; I know I can use a Try/Catch to handle it, but I was wondering if there was a better way, as Try/Catch is not very elegant.&amp;nbsp; The pertinent code is below....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;            Dim origin As Double() = CType(acadDoc.Utility.GetPoint(, "Select part origin: "), Double())
            xOrigin = origin(0)
            yOrigin = origin(1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW ... I am using the COM/Interop API &amp;amp; VB.Net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 14:07:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/error-when-escaping-getpoint/m-p/11826037#M9543</guid>
      <dc:creator>NickBrege</dc:creator>
      <dc:date>2023-03-16T14:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error when escaping GetPoint</title>
      <link>https://forums.autodesk.com/t5/net-forum/error-when-escaping-getpoint/m-p/11826091#M9544</link>
      <description>&lt;P&gt;Do you have to use the COM API for a particular reason? The following is a quick snippet for prompting the user for a point using the managed API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim aDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim ed As Editor = aDoc.Editor
Dim opt As New PromptPointOptions(vbCrLf &amp;amp; "Select Part Origin: ")
Dim res As PromptPointResult = ed.GetPoint(opt)
If res.Status &amp;lt;&amp;gt; PromptStatus.OK Then Exit Sub
Dim selPoint As Point3d = res.Value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After selecting the point you can check the 'status' of the PromptPointResult.&amp;nbsp; If the status is okay you can then get the point using the result value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 14:18:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/error-when-escaping-getpoint/m-p/11826091#M9544</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2023-03-16T14:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error when escaping GetPoint</title>
      <link>https://forums.autodesk.com/t5/net-forum/error-when-escaping-getpoint/m-p/11826336#M9545</link>
      <description>&lt;P&gt;Addition to what&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;&amp;nbsp;said:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is what the COM API was designed: press ESC with AcadUtility.GetXxxxx() method raises exception. It is your responsibility to handle it. So, yes, you need to "Try...Catch..." it. If you are doing .NET API add-in, then there is no reason to use this COM API method at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 15:37:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/error-when-escaping-getpoint/m-p/11826336#M9545</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-03-16T15:37:45Z</dc:date>
    </item>
  </channel>
</rss>

