Cannot Pan/Rotate when calling GetPoint() or GetString() in modeless palette
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
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.
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.
Here's a code example (note we were experimenting with document locking, but that didn't seem to change anything):
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"));
}
}