How to get user input words in NestedEntityOptions

How to get user input words in NestedEntityOptions

swaywood
Collaborator Collaborator
502 Views
3 Replies
Message 1 of 4

How to get user input words in NestedEntityOptions

swaywood
Collaborator
Collaborator

Hi,

 

I know PromptSelectionOptions class has UnknownInput Event.

But I want to get user input words in PromptNestedEntityOptions.

 

Thanks

swaywood

0 Likes
Accepted solutions (1)
503 Views
3 Replies
Replies (3)
Message 2 of 4

ActivistInvestor
Mentor
Mentor

Why don't you use keywords ?

 

 

var options = new PromptNestedEntityOptions("\nPick nested entity");
options.Keywords.Add("First");
options.Keywords.Add("Second");

@swaywood wrote:

Hi,

 

I know PromptSelectionOptions class has UnknownInput Event.

But I want to get user input words in PromptNestedEntityOptions.

 

Thanks

swaywood


 

0 Likes
Message 3 of 4

swaywood
Collaborator
Collaborator

@ActivistInvestor

 

I want to let the user get a nested text or user enter a text.

Keywords need one more step.

 

Just like getdist, user can get a dist by pick 2 pts, or user enter a value.

 

In my case is getting a dbtext.textstring in stead of getdist.

 

Maybe the api does not contain this.

0 Likes
Message 4 of 4

ActivistInvestor
Mentor
Mentor
Accepted solution

GetEntity and GetNestedEntity don't support arbitrary input.

 

You can use GetSelection() to select a single nested entity like so:

 

   public static void PickNestedExample()
   {
      Document doc = Application.DocumentManager.MdiActiveDocument;
      Editor ed = doc.Editor;

      PromptSelectionOptions pso = new PromptSelectionOptions();
      pso.SingleOnly = true;
      pso.SinglePickInSpace = true;
      pso.AllowSubSelections = true;
      pso.PrepareOptionalDetails = true;

      PromptSelectionResult result = ed.GetSelection(pso);

      if(result.Status == PromptStatus.OK)
      {
         ObjectId id = result.Value[0].ObjectId;
         ed.WriteMessage($"\nSelected: {id.ObjectClass.Name}[0x{id.Handle.Value:X}]");
      }
   }



 


@swaywood wrote:

@ActivistInvestor

 

I want to let the user get a nested text or user enter a text.

Keywords need one more step.

 

Just like getdist, user can get a dist by pick 2 pts, or user enter a value.

 

In my case is getting a dbtext.textstring in stead of getdist.

 

Maybe the api does not contain this.


 

0 Likes