GetSelection - keywords do not stop selection

GetSelection - keywords do not stop selection

JamesMaeding
Advisor Advisor
805 Views
2 Replies
Message 1 of 3

GetSelection - keywords do not stop selection

JamesMaeding
Advisor
Advisor

I read in several places how to implement keywords with ed.GetSelection, ad you simply hook to the KeywordInput event like:

 

options.KeywordInput += delegate (object sender, SelectionTextInputEventArgs e) {
                    keyWord = e.Input;
                };

 

 

thing is, that does not end the GetSelection method, it keeps asking you to select stuff.

I want the keyword to end the selction process. Is there a simple way to do that?

 

btw, I am calling GetSelection like: ed.GetSelection(options, ssFilter);

I don't think the filter changes things though.

thx


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
806 Views
2 Replies
Replies (2)
Message 2 of 3

JamesMaeding
Advisor
Advisor

I see now:

https://www.theswamp.org/index.php?topic=45555.msg507161#msg507161

 

keywords in GetSelection are not meant to act like regular keywords in other functions.

They are meant to be used inside the command, to change its behavior.

Kean had suggested doing a sendcommand or similar I think, to get out, but no one tried.

 

In my case, I wanted the user to select items, or open a settings dialog like:

Select Objects or [Settings]:

 

but I can do that by catching an enter:

Select Objects or Enter for Settings:

That only works for one option though, so not great.

 

An escape is different (result.value is cancel, not error) and kills the command so you don't get in a perpetual loop.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 3 of 3

Virupaksha_aithal
Autodesk Support
Autodesk Support

Hi,

 

does the blog http://adndevblog.typepad.com/autocad/2013/12/how-to-exit-editorgetselection-on-keyword-selection.ht... helps? Blog uses exception throwing to exit the keyword selection loop. 

 

 



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network