Opening multiple prompts simultaneously

Opening multiple prompts simultaneously

Anonymous
Not applicable
358 Views
1 Reply
Message 1 of 2

Opening multiple prompts simultaneously

Anonymous
Not applicable

Hi all - I'm looking for a way to prompt a user for an arbitrarily long sequence of selection sets, only stopping when they type in a particular command. This seems like it would require both a StringResult and a SelectionResult object to be open at the same time, which I'm not sure is possible. Any advice would be much appreciated 🙂

Tyler

0 Likes
359 Views
1 Reply
Reply (1)
Message 2 of 2

norman.yuan
Mentor
Mentor

No sure I understand you correctly, but here it goes:

 

You place the call to EditorGetSelection()  in a Loop, with each round selecting is done, you can as user to continue or not, something like

 

var selectedEnts=new List<ObjectId>();

while(true)

{

    var opt=new PromptSelectionOption(...);

    var filter = new SelectionFilter(...)

    var res = ed.GetSelection(filter, opt);

    if (res.Status == PromptStatus.OK)

    {

        selectedEnts.AddRange(res.Value.GetOjectIds());

        var kOpt=new PromptKeywordOption(...);

        kOpt.Keywords.Add(...);

        var kRes=ed.HetKeyword(kOpt);

        if (kRes.Status == PromptStatus.OK)

        {

           '' based on user's keyword input, decide to do another round selection or not

        }

        else

        {

            break;

        }

    }

    else

    {

        break;

    }

}

 

Instead of getting user input after each round selection with Editor.GetKeyword(), you probably can use PromptSelectionOption.Keyword and handle its KeywordInput/UnknownInput events to decide whether you want to do another round selection or not.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes