Hi,
Just add the options in the PromptPointOptions parameters and then, you can loop while prompt result status is Keyword and check for the prompt result StringResult value.
// set message and keywords
var ppo = new PromptPointOptions(
"\nSpecify cloud starting point or [Arc length/Second option/Third option]: ", // message
"Arc Second Third"); // keywords
Point3d lastPoint;
// loop while PromptResult.Status is Keyword
while (true)
{
var ppr = ed.GetPoint(ppo);
// user choosed an option
if (ppr.Status == PromptStatus.Keyword)
{
switch (ppr.StringResult)
{
case "Arc":
var pdo = new PromptDistanceOptions("\nSpecify arc length: ");
pdo.AllowNegative = false;
pdo.AllowZero = false;
pdo.DefaultValue = arcDist;
var pdr = ed.GetDistance(pdo);
if (pdr.Status == PromptStatus.OK)
arcDist = pdr.Value;
break;
case "Second":
// do what you have to do with "Second" option here
break;
case "Third":
// do what you have to do with "Third" option here
break;
}
}
// user specified a point
else if (ppr.Status == PromptStatus.OK)
{
lastPoint = ppr.Value;
break; // exit the loop
}
// user cancelled
else
{
return;
}
}
VB conversion
' set message and keywords
Dim ppo As PromptPointOptions =
New PromptPointOptions(vbLf & "Specify cloud starting point or [Arc length/ Second option/Third option]: ", "Arc Second Third")
Dim lastPoint As Point3d
' loop while PromptResult.Status is Keyword
While True
Dim ppr As PromptPointResult = ed.GetPoint(ppo)
If ppr.Status = PromptStatus.Keyword Then 'user choosed an option
Select Case ppr.StringResult
Case "Arc"
Dim pdo As PromptDistanceOptions = New PromptDistanceOptions(vbLf & "Specify arc length: ")
pdo.AllowNegative = False
pdo.AllowZero = False
pdo.DefaultValue = arcDist
Dim pdr As PromptDoubleResult = ed.GetDistance(pdo)
If pdr.Status = PromptStatus.OK Then
arcDist = pdr.Value
End If
Exit Select
Case "Second"
' do what you have to do with "Second" option here
Exit Select
Case "Third"
' do what you have to do with "Third" option here
Exit Select
End Select
ElseIf ppr.Status = PromptStatus.OK Then 'user specified a point
lastPoint = ppr.Value
Exit While 'exit the loop
Else 'user cancelled
Return
End If
End While