RhinoGet
Base class for GetObject, GetPoint, GetSphere, etc. You will never directly create a RhinoGet but you will use its member functions after calling GetObject::GetObjects(), GetPoint::GetPoint(), and so on. Provides tools to set command prompt, set command options, and specify if the "get" can optionally accept numbers, nothing (pressing enter), and undo.
Properties
Methods
Gets a rectangle in view window coordinates.
Parameters:
| solidPen (bool) | If true, a solid pen is used for drawing while the user selects a rectangle. If false, a dotted pen is used for drawing while the user selects a rectangle. |
| rectangle (out Rectangle) | user selected rectangle in window coordinates. |
| rectView (out RhinoView) | view that the user selected the window in. |
Returns: Success or Cancel.
public static Result GetAngle(string commandPrompt, Point3d basePoint, Point3d referencePoint, double defaultAngleRadians, out double angleRadians)
Allows user to interactively pick an angle
public static Result GetBool(string prompt, bool acceptNothing, string offPrompt, string onPrompt, ref bool boolValue)
Easy to use Boolean getter.
Parameters:
| prompt (string) | Command prompt. |
| acceptNothing (bool) | If true, the user can press enter. |
| offPrompt (string) | The 'false/off' message. |
| onPrompt (string) | The 'true/on' message. |
| boolValue (ref bool) | Default Boolean value set to this and returned here. |
Returns: The getter result based on user choice.
Commands.Result.Success - got value.
Commands.Result.Nothing - user pressed enter.
Commands.Result.Cancel - user canceled value getting.
public static Result GetBox(out Box box, GetBoxMode mode, Point3d basePoint, string prompt1, string prompt2, string prompt3)
Asks the user to select a Box in the viewport.
Parameters:
| box (out Box) | If the result is Success, this parameter will be filled out. |
| mode (GetBoxMode) | A particular "get box" mode, or GetBoxMode.All. |
| basePoint (Point3d) | Optional base point. Supply Point3d.Unset if you don't want to use this. |
| prompt1 (string) | Optional first prompt. Supply null to use the default prompt. |
| prompt2 (string) | Optional second prompt. Supply null to use the default prompt. |
| prompt3 (string) | Optional third prompt. Supply null to use the default prompt. |
Returns: Commands.Result.Success if successful.
Asks the user to select a Box in the viewport.
Parameters:
| box (out Box) | If the result is Success, this parameter will be filled out. |
Returns: Commands.Result.Success if successful.
public static Result GetBoxWithCounts(int xMin, ref int xCount, int yMin, ref int yCount, int zMin, ref int zCount, out Point3d[] corners)
Gets a 3d box with prompts for counts in X, Y and Z directions.
Parameters:
| xMin (int) | Minimum value allowed for count in the x direction. |
| xCount (ref int) | Count in the x direction. |
| yMin (int) | Minimum value allowed for count in the y direction. |
| yCount (ref int) | Count in the y direction. |
| zMin (int) | Minimum value allowed for count in the z direction. |
| zCount (ref int) | Count in the z direction. |
| corners (out Point3d[]) | corners of the bottom rectangle in counter-clockwise order, followed by top rectangle. |
Returns: Commands.Result.Success if successful.
Easy to use color getter.
Remarks: If you need options or more advanced user interface, then use GetColor class.
Parameters:
| prompt (string) | Command prompt. |
| acceptNothing (bool) | If true, the user can press enter. |
| color (ref Color) | Color value returned here. also used as default color. |
Returns:
Commands.Result.Success - got color.
Commands.Result.Nothing - user pressed enter.
Commands.Result.Cancel - user cancel color getting.
Allows the user to interactively pick a distance
public static string GetFileName(GetFileNameMode mode, string defaultName, string title, object parent, BitmapFileTypes fileTypes)
Parameters:
| mode (GetFileNameMode) | |
| defaultName (string) | |
| title (string) | |
| parent (object) | |
| fileTypes (RhinoGet.BitmapFileTypes) |
public static string GetFileName(GetFileNameMode mode, string defaultName, string title, object parent)
Parameters:
| mode (GetFileNameMode) | |
| defaultName (string) | |
| title (string) | |
| parent (object) |
Parameters:
| mode (GetFileNameMode) | |
| defaultName (string) |
Parameters:
| grip (out GripObject) | |
| prompt (string) |
Parameters:
| grips (out GripObject[]) | |
| prompt (string) |
Parameters:
| helix (out NurbsCurve) |
public static Result GetInteger(string prompt, bool acceptNothing, ref int outputNumber, int lowerLimit, int upperLimit)
Easy to use number getter.
Parameters:
| prompt (string) | The command prompt. |
| acceptNothing (bool) | If true, the user can press enter. |
| outputNumber (ref int) | default number is set to this value and number value returned here. |
| lowerLimit (int) | The minimum allowed value. |
| upperLimit (int) | The maximum allowed value. |
Returns: Commands.Result.Success - got number Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel number getting.
Easy to use number getter.
Parameters:
| prompt (string) | command prompt. |
| acceptNothing (bool) | if true, the user can press enter. |
| outputNumber (ref int) | default number is set to this value and number value returned here. |
Returns: Commands.Result.Success - got number Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel number getting.
public static Result GetInterpolatedCurveOnSurface(Surface surface, out Curve curve, out ObjRef surfaceObjRef, out Point2d[] surfaceParameters)
Interactively picks the points of a curve interpolated through a surface. This is the getter behind the Rhino InterpCrvOnSrf command.
Parameters:
| surface (Surface) | The surface to draw on, or null to have the user pick one. |
| curve (out Curve) | The resulting curve, or null when the result is not Success. |
| surfaceObjRef (out ObjRef) | The face the user picked, or null when a surface was supplied or nothing was picked. |
| surfaceParameters (out Point2d[]) | The picked points in the parameter space of the surface. |
Returns: The command result. UnknownCommand means the user chose the Edit option, which the InterpCrvOnSrf command answers by restarting in edit mode.
Interactively picks the points of a curve interpolated through a surface. This is the getter behind the Rhino InterpCrvOnSrf command.
Parameters:
| dimension (out LinearDimension) |
public static Result GetMeshParameters(RhinoDoc doc, ref MeshingParameters parameters, ref int uiStyle)
Asks the user to specify meshing parameters.
Parameters:
| doc (RhinoDoc) | The active document |
| parameters (ref MeshingParameters) | The initial meshing parameters. If successful, the updated meshing parameters are returned here. |
| uiStyle (ref int) | The user interface style, where: 0 = simple dialog, 1 = details dialog, 2 = script or batch mode. |
Returns: Commands.Result.Success if successful.
public static Result GetMultipleObjects(string prompt, bool acceptNothing, GetObjectGeometryFilter filter, out ObjRef[] rhObjects)
Easy to use object getter for getting multiple objects.
Remarks: If you need options or more advanced user interface, then use GetObject class.
Parameters:
| prompt (string) | command prompt. |
| acceptNothing (bool) | if true, the user can press enter. |
| filter (GetObjectGeometryFilter) | geometry filter to use when getting objects. |
| rhObjects (out ObjRef[]) | result of the get. may be null. |
Returns: Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.
[CLSCompliant(false)]
public static Result GetMultipleObjects(string prompt, bool acceptNothing, ObjectType filter, out ObjRef[] rhObjects)
Easy to use object getter for getting multiple objects.
Remarks: If you need options or more advanced user interface, then use GetObject class.
Parameters:
| prompt (string) | command prompt. |
| acceptNothing (bool) | if true, the user can press enter. |
| filter (ObjectType) | geometry filter to use when getting objects. |
| rhObjects (out ObjRef[]) | result of the get. may be null. |
Returns: Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.
public static Result GetNumber(string prompt, bool acceptNothing, ref double outputNumber, double lowerLimit, double upperLimit)
Easy to use number getter.
Parameters:
| prompt (string) | The command prompt. |
| acceptNothing (bool) | If true, the user can press Enter. |
| outputNumber (ref double) | Default number is set to this value and the return number value is assigned to this variable during the call. |
| lowerLimit (double) | The minimum allowed value. |
| upperLimit (double) | The maximum allowed value. |
Returns:
Commands.Result.Success - got number.
Commands.Result.Nothing - user pressed enter.
Commands.Result.Cancel - user cancel number getting.
Easy to use number getter.
Parameters:
| prompt (string) | command prompt. |
| acceptNothing (bool) | if true, the user can press enter. |
| outputNumber (ref double) | default number is set to this value and number value returned here. |
Returns: Commands.Result.Success - got number Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel number getting.
public static Result GetOneObject(string prompt, bool acceptNothing, GetObjectGeometryFilter filter, out ObjRef objref)
Easy to use object getter.
Remarks: If you need options or more advanced user interface, then use GetObject class.
Parameters:
| prompt (string) | command prompt. |
| acceptNothing (bool) | if true, the user can press enter. |
| filter (GetObjectGeometryFilter) | geometry filter to use when getting objects. |
| objref (out ObjRef) | result of the get. may be null. |
Returns: Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.
[CLSCompliant(false)]
public static Result GetOneObject(string prompt, bool acceptNothing, ObjectType filter, out ObjRef rhObject)
Easy to use object getter.
Remarks: If you need options or more advanced user interface, then use GetObject class.
Parameters:
| prompt (string) | command prompt. |
| acceptNothing (bool) | if true, the user can press enter. |
| filter (ObjectType) | geometry filter to use when getting objects. |
| rhObject (out ObjRef) | result of the get. may be null. |
Returns: Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.
Gets an oriented infinite plane.
Parameters:
| plane (out Plane) | The plane result. |
Returns:
Commands.Result.Success - got plane.
Commands.Result.Nothing - user pressed enter.
Commands.Result.Cancel - user cancel number getting.
Gets a point coordinate from the document.
Remarks: If you need options or more advanced user interface, then use GetPoint class.
Parameters:
| prompt (string) | Prompt to display in command line during the operation. |
| acceptNothing (bool) | if true, the user can press enter. |
| point (out Point3d) | point value returned here. |
Returns: Commands.Result.Success - got point Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel point getting.
public static Result GetPointOnMesh(Guid meshObjectId, string prompt, bool acceptNothing, out Point3d point)
obsoleteUse method that requires document
Gets a point constrained to an existing mesh in the document.
public static Result GetPointOnMesh(MeshObject meshObject, string prompt, bool acceptNothing, out Point3d point)
obsoleteUse version that takes a document.
Gets a point constrained to an existing mesh in the document.
Parameters:
| meshObject (MeshObject) | An mesh object in the document. |
| prompt (string) | Text prompt. |
| acceptNothing (bool) | true if nothing else should be accepted. |
| point (out Point3d) | A point value will be assigned to this out parameter during this call. |
Returns: The command result based on user choice.
public static Result GetPointOnMesh(RhinoDoc doc, Guid meshObjectId, string prompt, bool acceptNothing, out Point3d point)
Gets a point constrained to an existing mesh in the document.
Parameters:
| doc (RhinoDoc) | Document containing mesh object. |
| meshObjectId (Guid) | An ID of a mesh in the document. |
| prompt (string) | Text prompt. |
| acceptNothing (bool) | true if nothing else should be accepted. |
| point (out Point3d) | A point value will be assigned to this out parameter during this call. |
Returns: A command result based on user choice.
public static Result GetPointOnMesh(RhinoDoc doc, MeshObject meshObject, string prompt, bool acceptNothing, out Point3d point)
Gets a point constrained to an existing mesh in the document.
Parameters:
| doc (RhinoDoc) | The Rhino document |
| meshObject (MeshObject) | An mesh object in the document. |
| prompt (string) | Text prompt. |
| acceptNothing (bool) | true if nothing else should be accepted. |
| point (out Point3d) | A point value will be assigned to this out parameter during this call. |
Returns: The command result based on user choice.
Parameters:
| polyline (out Polyline) |
Parameters:
| settings (ref ViewCaptureSettings) |
public static Result GetRectangle(GetBoxMode mode, Point3d firstPoint, IEnumerable<string> prompts, out Point3d[] corners)
Gets a 3d rectangle made up of four points.
Parameters:
| mode (GetBoxMode) | A get box mode. |
| firstPoint (Point3d) | The first corner used. Pass Point3d.Unset if you do not want to set this. |
| prompts (IEnumerable<string>) | Optional prompts to display while getting points. May be null. |
| corners (out Point3d[]) | Corners of the rectangle in counter-clockwise order will be assigned to this out parameter during this call. |
Returns: Commands.Result.Success if successful.
Gets a 3d rectangle.
Parameters:
| corners (out Point3d[]) | corners of the rectangle in counter-clockwise order. |
Returns: Commands.Result.Success if successful.
Gets a 3d rectangle.
public static Result GetRectangleWithCounts(int xMin, ref int xCount, int yMin, ref int yCount, out Point3d[] corners)
Gets a 3d rectangle with prompts for counts in X and Y directions.
Parameters:
| xMin (int) | Minimum value allowed for count in the x direction. |
| xCount (ref int) | Count in the x direction. |
| yMin (int) | Minimum value allowed for count in the y direction. |
| yCount (ref int) | Count in the y direction. |
| corners (out Point3d[]) | corners of the rectangle in counter-clockwise order. |
Returns: Commands.Result.Success if successful.
public static Result GetRectangleWithCounts(int xMin, ref int xCount, int yMin, ref int yCount, ref bool subDCorners, out Point3d[] corners)
Gets a 3d rectangle with prompts for counts in X and Y directions, and a SubDCorners option.
Parameters:
| xMin (int) | Minimum value allowed for count in the x direction. |
| xCount (ref int) | Count in the x direction. |
| yMin (int) | Minimum value allowed for count in the y direction. |
| yCount (ref int) | Count in the y direction. |
| subDCorners (ref bool) | Value of the SubDCorners option. |
| corners (out Point3d[]) | corners of the rectangle in counter-clockwise order. |
Returns: Commands.Result.Success if successful.
Parameters:
| spiral (out NurbsCurve) |
Easy to use string getter.
Remarks: If you need options or more advanced user interface, then use GetString class.
Parameters:
| prompt (string) | command prompt. |
| acceptNothing (bool) | if true, the user can press enter. |
| outputString (ref string) | default string set to this value and string value returned here. |
Returns: Commands.Result.Success - got string Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel string getting.
Allows the user to interactively pick a viewport.
Easy to use getter for selecting multiple viewports.
Parameters:
| commandPrompt (string) | Prompt to display in command line during the operation. |
| viewports (out RhinoViewport[]) | An array of /selected Viewports. |
Returns: Commands.Result.Success - got point Commands.Result.Cancel - user cancel point getting.
Returns true if the document is current in a "Get" operation.
Parameters:
| doc (RhinoDoc) |
Returns: true if a getter is currently active.
Returns true if currently in a GetObject.GetObjects()
Parameters:
| doc (RhinoDoc) |
Returns true if currently in a GetPoint.Get()
Parameters:
| doc (RhinoDoc) |
public static LocalizeStringPair StringToCommandOptionName(string englishString, string localizedString)
Convert some arbitrary string value to a valid command option name removing any invalid characters.
Parameters:
| englishString (string) | English string to convert. |
| localizedString (string) | Optional localized string to convert. |
Returns: Returns null if the strings are null or empty or if they contain nothing but invalid characters. If the converted string is one or more characters in length then a LocalizeStringPair is returned characters the converted string values. If the localized string is null or empty then the English string is used as the localized value.
Convert some arbitrary string value to a valid command option name removing any invalid characters.
Parameters:
| stringToConvert (string) | String to convert. |
Returns: Returns null if the string is null or empty or if it contains nothing but invalid characters. If the converted string is one or more characters in length then the converted value is returned.