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.