Description
When using GetPoint.AddOptionInteger() with an option name that contains angle brackets (< and >), the option is not properly added to the GetPoint options list and does not appear in the command prompt.
Environment
-
RhinoCommon Version: 8.21.25188.17001
-
Rhino Version: 8.x
-
Platform: Windows
Steps to Reproduce
-
Create a GetPoint instance
-
Try to add an integer option with angle brackets in the name
-
Run the GetPoint.Get() method
-
Observe that the option does not appear in the command prompt
Code Example
using var gp = new GetPoint();
OptionInteger startIndex = new OptionInteger(0, true, 0);
// This fails - option doesn't appear
var idxStart = gp.AddOptionInteger("StarIndex<ZeroNo>", ref startIndex);
// This works fine
var idxStart2 = gp.AddOptionInteger("StarIndexZeroNo", ref startIndex);
gp.SetCommandPrompt("Click a point");
var result = gp.Get();
Expected Behavior
Option names containing various special characters should either:
-
Be properly supported and appear in the command prompt, OR
-
Throw a clear exception with documentation about supported character sets
Actual Behavior
Options with unsupported special characters silently fail to be added to the options list. No error or exception is thrown, making it difficult to debug.
Additional Notes
-
Only a limited set of special characters appear to be supported (underscore, hyphen, etc.)
-
Most common special characters (
<>,[],{},@,#,%, etc.) are silently rejected -
No documentation exists specifying which characters are allowed
-
This behavior affects all GetPoint.AddOption* methods
-
Silent failure makes debugging difficult - developers may not realize the option wasn’t added
Request
Please either:
-
Expand character support to include commonly used special characters, OR
-
Document the allowed character set clearly in the API documentation, AND
-
Throw descriptive exceptions for invalid option names instead of silently failing
Workaround
Use only supported characters in option names:
// Supported
var idxStart = gp.AddOptionInteger("StarIndex_ZeroNo", ref startIndex);
var idxStart = gp.AddOptionInteger("StarIndex-ZeroNo", ref startIndex);
// Not supported - will silently fail
var idxStart = gp.AddOptionInteger("StarIndex<ZeroNo>", ref startIndex);
Impact
This limitation forces developers to use less descriptive option names and creates debugging challenges due to silent failures. It also lacks documentation, leading to trial-and-error development.