GetCancel
GetBaseClassConstructors
public GetCancel()
Properties
Methods
AcceptColor
If you want to allow the user to be able to type in a color r,g,b or name during GetPoint.Get(), GetObject::GetObjects(), etc., then call AcceptColor(true) before calling GetPoint()/GetObject(). If the user chooses to type in a color, then the result code GetResult.Color is returned and you can use RhinoGet.Color() to get the value of the color. If the get accepts points, then the user will not be able to type in r,g,b colors but will be able to type color names.
AcceptCustomMessage
AcceptEnterWhenDone
There are instances of RhinoGet that prompt with "Press Enter when Done." yet do not call AcceptNothing(). On the Mac, these instances need an additional call to AcceptEnterWhenDone() so the GetPointOptions dialog can correctly enable the Done button.
AcceptNothing
If you want to allow the user to be able to press enter in order to skip selecting a something in GetPoint.Get(), GetObject::GetObjects(), etc., then call AcceptNothing( true ) beforehand.
public void AcceptNothing()
AcceptNumber
If you want to allow the user to be able to type in a number during GetPoint.Get(), GetObject::GetObjects(), etc., then call AcceptNumber() beforehand. If the user chooses to type in a number, then the result code GetResult.Number is returned and you can use RhinoGet.Number() to get the value of the number. If you are using GetPoint and you want "0" to return (0,0,0) instead of the number zero, then set acceptZero = false.
AcceptPoint
If you want to allow the user to be able to type in a point then call AcceptPoint(true) before calling GetPoint()/GetObject(). If the user chooses to type in a number, then the result code GetResult.Point is returned and you can use RhinoGet.Point() to get the value of the point.
AcceptString
If you want to allow the user to be able to type in a string during GetPoint.Get(), GetObject::GetObjects(), etc., then call AcceptString(true) before calling GetPoint()/GetObject(). If the user chooses to type in a string, then the result code GetResult.String is returned and you can use RhinoGet.String() to get the value of the string.
AcceptUndo
If you want to allow the user to have an 'undo' option in GetPoint.Get(), GetObject.GetObjects(), etc., then call AcceptUndo(true) beforehand.
AddOption
Adds a command line option.
public int AddOption()
optionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes).
optionValue,
The localized value visualized after an equality sign.
hiddenOption
If true, the option is not displayed on the command line and the full option name must be typed in order to activate the option.
Returns: option index value (>0) or 0 if option cannot be added.
AddOption
Adds a command line option.
public int AddOption()
optionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes).
optionValue
The localized value visualized after an equality sign.
Returns: option index value (>0) or 0 if option cannot be added.
AddOption
Adds a command line option.
public int AddOption()
optionName
Must only consist of letters and numbers (no characters list periods, spaces, or dashes).
Returns: option index value (>0) or 0 if option cannot be added.
AddOption
Adds a command line option.
public int AddOption()
englishOption,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes).
englishOptionValue,
The option value in English, visualized after an equality sign.
hiddenOption
If true, the option is not displayed on the command line and the full option name must be typed in order to activate the option.
Returns: Option index value (>0) or 0 if option cannot be added.
AddOption
Adds a command line option.
Returns: Option index value (>0) or 0 if option cannot be added.
AddOption
Adds a command line option.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionColor
Add a command line option to get colors and automatically save the value.
public int AddOptionColor()
optionName,
option description.
ref OptionColor
colorValue,
The current color value.
prompt
option prompt shown if the user selects this option
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionColor
Add a command line option to get colors and automatically save the value.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionColor
Add a command line option to get colors and automatically save the value.
public int AddOptionColor()
englishName,
option description
ref OptionColor
colorValue,
The current color value.
prompt
The command prompt will show this during picking.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionColor
Add a command line option to get colors and automatically save the value.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionDouble
Adds a command line option to get numbers and automatically saves the value.
public int AddOptionDouble()
optionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionDouble
numberValue,
The current number value.
prompt
option prompt shown if the user selects this option. If null or empty, then the option name is used as the get number prompt.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionDouble
Adds a command line option to get numbers and automatically save the value.
public int AddOptionDouble()
optionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionDouble
numberValue
The current number value.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionDouble
Adds a command line option to get numbers and automatically save the value.
public int AddOptionDouble()
englishName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionDouble
numberValue,
Current value.
prompt
option prompt shown if the user selects this option. If null or empty, then the option name is used as the get number prompt.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionDouble
Adds a command line option to get numbers and automatically save the value.
public int AddOptionDouble()
englishName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionDouble
numberValue
The current number value.
Returns: Option index value (>0) or 0 if option cannot be added.
AddOptionEnumList<T>
Adds a choice of enumerated values as list option. Allows to include only some enumerated values.
[CLSCompliant(false)]
public int AddOptionEnumList<T>()
optionName,
The name of the option
T
defaultValue,
The default value
T[]
include
An array of enumerated values to use. This argument can also be null; in this case, the whole enumerated is used.
Returns: Option index
Exceptions:
| ArgumentException | Gets thrown if defaultValue provided is not an enumerated type. |
AddOptionEnumList<T>
Adds a choice of enumerated values as list option
Returns: Option index
Exceptions:
| ArgumentException | Gets thrown if defaultValue provided is not an enumerated type. |
AddOptionEnumList<T>
Adds a choice of enumerated values as list option. Allows to include only some enumerated values.
[CLSCompliant(false)]
public int AddOptionEnumList<T>()
englishOptionName,
The name of the option
T
defaultValue,
The default value
T[]
include
An array of enumerated values to use. This argument can also be null; in this case, the whole enumerated is used.
Returns: Option index
Exceptions:
| ArgumentException | Gets thrown if defaultValue provided is not an enumerated type. |
AddOptionEnumList<T>
Adds a choice of enumerated values as list option
Returns: Option index
Exceptions:
| ArgumentException | Gets thrown if defaultValue provided is not an enumerated type. |
AddOptionEnumSelectionList<T>
Adds a list of enumerated values as option list. Use enumSelection[go.Option.CurrentListOptionIndex] to retrieve selection.
[CLSCompliant(false)]
public int AddOptionEnumSelectionList<T>()
optionName,
The name of the option
enumSelection,
The enumerated values to use.
listCurrentIndex
Zero based index of current option.
Returns: Option index
AddOptionEnumSelectionList<T>
Adds a list of enumerated values as option list. Use enumSelection[go.Option.CurrentListOptionIndex] to retrieve selection.
AddOptionInteger
Adds a command line option to get integers and automatically save the value.
public int AddOptionInteger()
optionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionInteger
intValue,
The current integer value.
prompt
option prompt shown if the user selects this option. If null or empty, then the option name is used as the get number prompt.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionInteger
Adds a command line option to get integers and automatically save the value.
public int AddOptionInteger()
optionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionInteger
intValue
The current integer value.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionInteger
Adds a command line option to get integers and automatically save the value.
public int AddOptionInteger()
englishName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionInteger
intValue,
The current integer value.
prompt
option prompt shown if the user selects this option. If null or empty, then the option name is used as the get number prompt.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionInteger
Adds a command line option to get integers and automatically save the value.
public int AddOptionInteger()
englishName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionInteger
intValue
The current integer value.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionList
Adds a command line list option.
public int AddOptionList()
optionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
listValues,
The string values.
listCurrentIndex
Zero based index of current option.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionList
Adds a command line list option.
public int AddOptionList()
englishOptionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
listValues,
The string values.
listCurrentIndex
Zero based index of current option.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionString
Add a command line option to get a string and automatically save the value.
public int AddOptionString()
optionName,
The option description.
ref OptionString
stringValue,
The current string value.
prompt
Command prompt to be shown if the picks this option.
Returns: The option index value (>0) or 0 if option cannot be added.
AddOptionString
Add a command line option to get a string and automatically save the value.
public int AddOptionString()
Returns: The option index value (>0) or 0 if option cannot be added.
AddOptionString
Add a command line option to get a string and automatically save the value.
public int AddOptionString()
englishName,
The option description.
ref OptionString
stringValue,
The current string value.
prompt
Command prompt to be shown if the picks this option.
Returns: The option index value (>0) or 0 if option cannot be added.
AddOptionString
Add a command line option to get a string and automatically save the value.
Returns: The option index value (>0) or 0 if option cannot be added.
AddOptionToggle
Adds a command line option to toggle a setting.
public int AddOptionToggle()
optionName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionToggle
toggleValue
The current toggle value.
Returns: option index value (>0) or 0 if option cannot be added.
AddOptionToggle
Adds a command line option to toggle a setting.
public int AddOptionToggle()
englishName,
Must only consist of letters and numbers (no characters list periods, spaces, or dashes)
ref OptionToggle
toggleValue
The current toggle value.
Returns: option index value (>0) or 0 if option cannot be added.
ClearCommandOptions
Clear all command options.
public void ClearCommandOptions()
ClearDefault
Clears any defaults set using SetDefaultPoint, SetDefaultNumber, SetDefaultString, or SetCommandPromptDefault.
public void ClearDefault()
Returns: The color chosen by the user.
CommandResult
Helper method for getting command result value from getter results.
Returns: The converted command result.
CustomMessage
Dispose
public void Dispose()
Dispose
EnableTransparentCommands
Control the availability of transparent commands during the get.
public void EnableTransparentCommands()
enable
If true, then transparent commands can be run during the get. If false, then transparent commands cannot be run during the get.
Remarks: Some Rhino commands are "transparent" and can be run inside of other commands. Examples of transparent commands include the view manipulation commands like ZoomExtents, Top, etc., and the selection commands like SelAll, SelPoint, etc. By default transparent commands can be run during any get. If you want to disable this feature, then call EnableTransparentCommands(false) before calling GetString, GetPoint, GetObject, etc.
GetSelectedEnumValue<T>
Returns the selected enumerated value. Use this in combination with GetBaseClass.AddOptionEnumList<T>(string, T).
This must be called directly after having called a Get method, and having obtained a GetResult.Option value.
Exceptions:
| ArgumentException | Gets thrown if type T is not an enumerated type. |
| IndexOutOfRangeException | If 0 >= CurrentListOptionIndex or CurrentListOptionIndex > N where N is the number of enumerated values. |
GetSelectedEnumValueFromSelectionList<T>
Returns the selected enumerated value by looking at the list of values from which to select. Use this in combination with AddOptionEnumSelectionList.
Exceptions:
| ArgumentException | Gets thrown if type T is not an enumerated type. |
| IndexOutOfRangeException | If 0 >= CurrentListOptionIndex or CurrentListOptionIndex > N where N is the number of enumerated values. |
GotDefault
Returns true if user pressed Enter to accept a default point, number, or string set using SetDefaultPoint, SetDefaultNumber, or SetDefaultString.
Returns: true if the result if the default point, number or string set. Otherwise, false.
Line2d
Returns two points defining the location in the view window of the 2d line selected in GetPoint::Get2dLine().
(0,0) = upper left corner of window.
Returns: An array with two 2D points.
Number
Gets a number if GetPoint.Get(), GetObject.GetObjects(), etc., returns GetResult.Number.
Returns: The number chosen by the user.
OptionIndex
PickRectangle
If the get was a GetObjects() and the mouse was used to select the objects, then the returned rectangle has left < right and top < bottom. This rectangle is the Windows GDI screen coordinates of the picking rectangle. RhinoViewport.GetPickXform( pick_rect, pick_xform ) will calculate the picking transformation that was used. In all other cases, left=right=top=bottom=0;
Returns: The picking rectangle; or 0 in the specified cases.
Returns: The point chosen by the user.
Point2d
Returns location in view of point in selected in GetPoint::Get() or GetPoint::Get2dPoint(). (0,0) = upper left corner of window.
Returns: The location.
Rectangle2d
Returns the location in the view of the 2d rectangle selected in GetPoint::Get2dRectangle(). rect.left < rect.right and rect.top < rect.bottom (0,0) = upper left corner of window.
Returns: The rectangle.
Returns: The result of the last Get*() call.
SetCommandPrompt
Sets prompt message that appears in the command prompt window.
SetCommandPromptDefault
Sets message that describes what default value will be used if the user presses enter. This description appears in angle brackets <> in the command prompt window. You do not need to provide a default value description unless you explicitly enable AcceptNothing.
Remarks: If you have a simple default point, number, or string, it is easier to use SetDefaultPoint, SetDefaultNumber, or SetDefaultString. SetCommandPromptDefault and AcceptNothing can be used for providing more advanced UI behavior.
Example:ON_3dPoint default_center = new ON_3dPoint(2,3,4); GetPoint gp = new GetPoint(); gp.SetCommandPrompt( "Center point" ); gp.SetCommandPromptDefault( "(2,3,4)" ); gp.AcceptNothing(true); gp.GetPoint(); if ( gp.Result() == GetResult.Nothing ) point = default_center;
SetDefaultColor
Sets a color as default value that will be returned if the user presses ENTER key during the get.
Remarks: Calling SetDefaultColor will automatically handle setting the command prompt default and reacting to the user pressing ENTER. If the user presses ENTER to accept the default color, GetResult.Color is returned and RhinoGet.GotDefault() will return true. Calling SetDefaultColor will clear any previous calls to SetDefaultString or SetDefaultPoint.
SetDefaultInteger
Sets a number as default value that will be returned if the user presses ENTER key during the get.
Remarks: Calling SetDefaultInteger will automatically handle setting the command prompt default and reacting to the user pressing ENTER. If the user presses ENTER to accept the default integer, GetResult.Number is returned and CRhinoGet.GotDefault() will return true. Calling SetDefaultNumber will clear any previous calls to SetDefaultString or SetDefaultPoint.
SetDefaultNumber
Sets a number as default value that will be returned if the user presses ENTER key during the get.
Remarks: Calling SetDefaultNumber will automatically handle setting the command prompt default and reacting to the user pressing ENTER. If the user presses ENTER to accept the default number, GetResult.Number is returned and RhinoGet.GotDefault() will return true. Calling SetDefaultNumber will clear any previous calls to SetDefaultString or SetDefaultPoint.
SetDefaultPoint
Sets a point as default value that will be returned if the user presses the ENTER key during the get.
Remarks: Calling SetDefaultPoint will automatically handle setting the command prompt default and reacting to the user pressing ENTER. If the user presses enter to accept the default point, GetResult.Point is returned and RhinoGet.GotDefault() will return true. Calling SetDefaultPoint will clear any previous calls to SetDefaultString or SetDefaultNumber.
SetDefaultString
Sets a string as default value that will be returned if the user presses ENTER key during the get.
Remarks: Calling SetDefaultString will automatically handle setting the command prompt default and reacting to the user pressing ENTER. If the user presses ENTER to accept the default string, GetResult.String is returned and RhinoGet.GotDefault() will return true. Calling SetDefaultString will clear any previous calls to SetDefaultNumber or SetDefaultPoint.
SetOptionVaries
Sets a command line option value to print "Varies" instead of the regular value.
SetWaitDuration
Sets the wait duration (in milliseconds) of the getter. If the duration passes without the user making a decision, the GetResult.Timeout code is returned.
StringResult
Gets a string if GetPoint.Get(), GetObject.GetObjects(), etc., returns GetResult.String.
Returns: The string chosen by the user.
Vector
Gets a direction if Get*() returns GetResult.Point (Set by some digitizers, but in general it's (0,0,0).
Returns: The vector chosen by the user.
View
Gets a view the user clicked in during GetPoint.Get(), GetObject.GetObjects(), etc.
Returns: The view chosen by the user.
Awaits a particular task to finish.
Returns: A result enumeration.
Awaits a particular task to finish.
Returns: A result enumeration.