<?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 Cannot Pan/Rotate when calling GetPoint() or GetString() in modeless palette in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/cannot-pan-rotate-when-calling-getpoint-or-getstring-in-modeless/m-p/12643938#M5018</link>
    <description>&lt;P&gt;I'm trying to call a prompt to get a point while in a modeless palette. I'm currently using document.Editor.GetPoint(). Getting the point works just fine, however, I am unable to pan/rotate. When I click the middle mouse and drag, it just says "Invalid Point" and presents the prompt again.&lt;BR /&gt;&lt;BR /&gt;Curious as to what was going on, I tried using GetString() instead trying to middle click pan or rotate would just quit out of the command. Pulling it up in the debug, I saw that the string that was being accepted was "'_.3DPAN2". Meaning the pan input is being read, but the actual pan command isn't getting processed.&lt;BR /&gt;&lt;BR /&gt;What I've gathered is that somehow, when calling the prompt this way, AutoCAD isn't accepting the transparent commands. I've seen in other threads that a solution I can use is to wrap the code needing the prompt in a command, but that will require some re-architecting and my team wanted to see if there was another way to achieve this first.&lt;BR /&gt;&lt;BR /&gt;Here's a code example (note we were experimenting with document locking, but that didn't seem to change anything):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private void SaveThumbnail_Click(object sender, RoutedEventArgs e)
{
    Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
    PromptResult result;
    using (doc.LockDocument(DocumentLockMode.Read, "MYCOMMANDNAME", "MYCOMMANDNAME", false))
    {
         result = doc.Editor.GetString(new PromptStringOptions("Get String"));
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2024 19:00:40 GMT</pubDate>
    <dc:creator>william.delaughter</dc:creator>
    <dc:date>2024-03-15T19:00:40Z</dc:date>
    <item>
      <title>Cannot Pan/Rotate when calling GetPoint() or GetString() in modeless palette</title>
      <link>https://forums.autodesk.com/t5/net-forum/cannot-pan-rotate-when-calling-getpoint-or-getstring-in-modeless/m-p/12643938#M5018</link>
      <description>&lt;P&gt;I'm trying to call a prompt to get a point while in a modeless palette. I'm currently using document.Editor.GetPoint(). Getting the point works just fine, however, I am unable to pan/rotate. When I click the middle mouse and drag, it just says "Invalid Point" and presents the prompt again.&lt;BR /&gt;&lt;BR /&gt;Curious as to what was going on, I tried using GetString() instead trying to middle click pan or rotate would just quit out of the command. Pulling it up in the debug, I saw that the string that was being accepted was "'_.3DPAN2". Meaning the pan input is being read, but the actual pan command isn't getting processed.&lt;BR /&gt;&lt;BR /&gt;What I've gathered is that somehow, when calling the prompt this way, AutoCAD isn't accepting the transparent commands. I've seen in other threads that a solution I can use is to wrap the code needing the prompt in a command, but that will require some re-architecting and my team wanted to see if there was another way to achieve this first.&lt;BR /&gt;&lt;BR /&gt;Here's a code example (note we were experimenting with document locking, but that didn't seem to change anything):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private void SaveThumbnail_Click(object sender, RoutedEventArgs e)
{
    Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
    PromptResult result;
    using (doc.LockDocument(DocumentLockMode.Read, "MYCOMMANDNAME", "MYCOMMANDNAME", false))
    {
         result = doc.Editor.GetString(new PromptStringOptions("Get String"));
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 19:00:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cannot-pan-rotate-when-calling-getpoint-or-getstring-in-modeless/m-p/12643938#M5018</guid>
      <dc:creator>william.delaughter</dc:creator>
      <dc:date>2024-03-15T19:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Pan/Rotate when calling GetPoint() or GetString() in modeless palette</title>
      <link>https://forums.autodesk.com/t5/net-forum/cannot-pan-rotate-when-calling-getpoint-or-getstring-in-modeless/m-p/12644561#M5019</link>
      <description>&lt;P&gt;Perhaps this might allow transparent pans/zooms:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;private async void SaveThumbnail_Click2(object sender, RoutedEventArgs e)
{
   var docmgr = Application.DocumentManager;
   Document doc = docmgr.MdiActiveDocument;
   PromptResult result;
   await docmgr.ExecuteInCommandContextAsync(o =&amp;gt; 
   {
      result = doc.Editor.GetString("\nGetString: ");
      return Task.CompletedTask; 
   }, null);
   doc.Editor.WriteMessage($"\nResult: {result.StringResult}");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 23:19:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cannot-pan-rotate-when-calling-getpoint-or-getstring-in-modeless/m-p/12644561#M5019</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-03-16T23:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Pan/Rotate when calling GetPoint() or GetString() in modeless palette</title>
      <link>https://forums.autodesk.com/t5/net-forum/cannot-pan-rotate-when-calling-getpoint-or-getstring-in-modeless/m-p/12644572#M5020</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt; Nice trick!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 06:30:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cannot-pan-rotate-when-calling-getpoint-or-getstring-in-modeless/m-p/12644572#M5020</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-03-16T06:30:09Z</dc:date>
    </item>
  </channel>
</rss>

