GetPoint.AddOptionInteger fails when option name contains angle brackets

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

  1. Create a GetPoint instance

  2. Try to add an integer option with angle brackets in the name

  3. Run the GetPoint.Get() method

  4. 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:

  1. Be properly supported and appear in the command prompt, OR

  2. 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:

  1. Expand character support to include commonly used special characters, OR

  2. Document the allowed character set clearly in the API documentation, AND

  3. 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.

Hi @yangf85,

I appreciate your detailed post. However, the complexities ot he Rhino’s command line parser will only allow for a limited character set for command line options. For best results, use alphabetic characters. If you need something fancier, then you’ll want to create a dialog box or some other UI.

– Dale

RH-89300 is fixed in Rhino 8 Service Release 24

1 Like