Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm having issues with JigPromptStringOptions within a Jig.
Using the following code I'm unable to get a PromptStatus.Cancel when the user presses Escape.
Due to this I'm not able to differentiate between a Escape/Enter/Space key.
Is there anyway for me to know when a user presses the escape key here?
Private Function promptRadius(prompts As JigPrompts) As SamplerStatus
Dim retVal As SamplerStatus = SamplerStatus.NoChange
Try
' Must use a string acquire so that we can get the string user input.
' Use the "handlespointmonitor" to save the current point.
Dim jppo As New JigPromptStringOptions With {.AppendKeywordsToMessage = False}
If isDiameter Then
jppo.Message = vbLf & "Specify the diameter or "
Else
jppo.Message = vbLf & "Specify the radius or "
jppo.Keywords.Add("Diameter")
End If
jppo.Keywords.Add("Feet")
jppo.Keywords.Add("Chains")
jppo.Message += jppo.Keywords.GetDisplayString(True)
jppo.UserInputControls = UserInputControls.Accept3dCoordinates
If radius > 0.0 Then
Dim dist As Double = radius
If isDiameter Then dist *= 2.0
jppo.UserInputControls = UserInputControls.Accept3dCoordinates Or UserInputControls.NullResponseAccepted
jppo.Message += " <" & Autodesk.AutoCAD.Runtime.Converter.DistanceToString(dist) & ">"
End If
Dim pr As PromptResult = prompts.AcquireString(jppo)
Select Case pr.Status
Case PromptStatus.OK
retVal = SamplerStatus.OK
Case PromptStatus.Keyword
retVal = SamplerStatus.OK
Case PromptStatus.None
If radius > 0 Then retVal = SamplerStatus.OK
Case PromptStatus.Cancel
retVal = SamplerStatus.Cancel
Case Else
Stop
End Select
Catch ex As Exception
ReportError(ex)
End Try
Return retVal
End Function
Solved! Go to Solution.