RhinoGet

public static class 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

AllBitmapFileTypes

#Since v6.0
public static RhinoGet.BitmapFileTypes AllBitmapFileTypes { get; }

Methods

Get2dRectangle

#Since v5.0
public static Result Get2dRectangle(bool solidPen, out Rectangle rectangle, out RhinoView rectView)
Gets a rectangle in view window coordinates.
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.
Success or Cancel.

GetAngle

#Since v5.2
public static Result GetAngle(string commandPrompt, Point3d basePoint, Point3d referencePoint, double defaultAngleRadians, out double angleRadians)
Allows user to interactively pick an angle
commandPrompt (string)if null, a default prompt will be displayed
basePoint (Point3d)
referencePoint (Point3d)
defaultAngleRadians (double)
angleRadians (out double)

GetArc

#Since v5.0
public static Result GetArc(out Arc arc)
arc (out Arc)

GetBool

#Since v5.0
public static Result GetBool(string prompt, bool acceptNothing, string offPrompt, string onPrompt, ref bool boolValue)
Easy to use Boolean getter.
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.
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.

GetBox

#Since v5.0
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.
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.
Commands.Result.Success if successful.

GetBox

#Since v5.0
public static Result GetBox(out Box box)
Asks the user to select a Box in the viewport.
box (out Box)If the result is Success, this parameter will be filled out.
Commands.Result.Success if successful.

GetBoxWithCounts

#Since v6.0
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.
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.
Commands.Result.Success if successful.

GetCircle

#Since v5.0
public static Result GetCircle(out Circle circle)
circle (out Circle)

GetColor

#Since v5.0
public static Result GetColor(string prompt, bool acceptNothing, ref Color color)
Easy to use color getter.
Remarks: If you need options or more advanced user interface, then use GetColor class.
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.

Commands.Result.Success - got color.

Commands.Result.Nothing - user pressed enter.

Commands.Result.Cancel - user cancel color getting.

GetDistance

#Since v9.0
public static Result GetDistance(string commandPrompt, double defaultDistance, out double distance)
Allows the user to interactively pick a distance
commandPrompt (string)if null, a default prompt will be displayed
defaultDistance (double)
distance (out double)

GetFileName

#ExampleSince v6.0
public static string GetFileName(GetFileNameMode mode, string defaultName, string title, object parent, BitmapFileTypes fileTypes)
mode (GetFileNameMode)
defaultName (string)
title (string)
parent (object)
fileTypes (RhinoGet.BitmapFileTypes)

GetFileName

#ExampleSince v6.0
public static string GetFileName(GetFileNameMode mode, string defaultName, string title, object parent)
mode (GetFileNameMode)
defaultName (string)
title (string)
parent (object)

GetFileNameScripted

#Since v5.0
public static string GetFileNameScripted(GetFileNameMode mode, string defaultName)
mode (GetFileNameMode)
defaultName (string)

GetGrip

#Since v5.0
public static Result GetGrip(out GripObject grip, string prompt)
grip (out GripObject)
prompt (string)

GetGrips

#Since v5.0
public static Result GetGrips(out GripObject[] grips, string prompt)
grips (out GripObject[])
prompt (string)

GetHelix

#Since v5.0
public static Result GetHelix(out NurbsCurve helix)
helix (out NurbsCurve)

GetInteger

#Since v5.0
public static Result GetInteger(string prompt, bool acceptNothing, ref int outputNumber, int lowerLimit, int upperLimit)
Easy to use number getter.
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.
Commands.Result.Success - got number Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel number getting.

GetInteger

#Since v5.0
public static Result GetInteger(string prompt, bool acceptNothing, ref int outputNumber)
Easy to use number getter.
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.
Commands.Result.Success - got number Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel number getting.

GetInterpolatedCurveOnSurface

#Since v9.0
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.
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.
The command result. UnknownCommand means the user chose the Edit option, which the InterpCrvOnSrf command answers by restarting in edit mode.

GetInterpolatedCurveOnSurface

#Since v9.0
public static Result GetInterpolatedCurveOnSurface(Surface surface, out Curve curve)
Interactively picks the points of a curve interpolated through a surface. This is the getter behind the Rhino InterpCrvOnSrf command.
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.
The command result.

GetLine

#Since v5.0
public static Result GetLine(out Line line)
line (out Line)

GetLinearDimension

#ExampleSince v5.0
public static Result GetLinearDimension(out LinearDimension dimension)
dimension (out LinearDimension)

GetMeshParameters

#Since v7.0
public static Result GetMeshParameters(RhinoDoc doc, ref MeshingParameters parameters, ref int uiStyle)
Asks the user to specify meshing 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.
Commands.Result.Success if successful.

GetMultipleObjects

#Since v5.0
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.
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.
Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.

GetMultipleObjects

#ExampleSince v5.0
[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.
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.
Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.

GetNumber

#ExampleSince v5.0
public static Result GetNumber(string prompt, bool acceptNothing, ref double outputNumber, double lowerLimit, double upperLimit)
Easy to use number getter.
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.

Commands.Result.Success - got number.

Commands.Result.Nothing - user pressed enter.

Commands.Result.Cancel - user cancel number getting.

GetNumber

#ExampleSince v5.0
public static Result GetNumber(string prompt, bool acceptNothing, ref double outputNumber)
Easy to use number getter.
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.
Commands.Result.Success - got number Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel number getting.

GetOneObject

#Since v5.0
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.
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.
Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.

GetOneObject

#ExampleSince v5.0
[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.
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.
Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.

GetPlane

#ExampleSince v5.0
public static Result GetPlane(out Plane plane)
Gets an oriented infinite plane.
plane (out Plane)The plane result.

Commands.Result.Success - got plane.

Commands.Result.Nothing - user pressed enter.

Commands.Result.Cancel - user cancel number getting.

GetPoint

#ExampleSince v5.0
public static Result GetPoint(string prompt, bool acceptNothing, out Point3d point)
Gets a point coordinate from the document.
Remarks: If you need options or more advanced user interface, then use GetPoint class.
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.
Commands.Result.Success - got point Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel point getting.

GetPointOnMesh

#Since v5.0 Obsolete v7.6
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.
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.
A command result based on user choice.

GetPointOnMesh

#Since v5.0 Obsolete v7.6
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.
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.
The command result based on user choice.

GetPointOnMesh

#Since v7.6
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.
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.
A command result based on user choice.

GetPointOnMesh

#Since v7.6
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.
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.
The command result based on user choice.

GetPolygon

#Since v8.0
public static Result GetPolygon(bool useActiveLayerLinetype, ref int numberSides, ref bool inscribed, out Polyline polyline)
useActiveLayerLinetype (bool)
numberSides (ref int)
inscribed (ref bool)
polyline (out Polyline)

GetPolygon

#Since v6.0
public static Result GetPolygon(ref int numberSides, ref bool inscribed, out Polyline polyline)
numberSides (ref int)
inscribed (ref bool)
polyline (out Polyline)

GetPolyline

#Since v5.9
public static Result GetPolyline(out Polyline polyline)
polyline (out Polyline)

GetPrintWindow

#Since v6.1
public static Result GetPrintWindow(ref ViewCaptureSettings settings)
settings (ref ViewCaptureSettings)

GetRectangle

#Since v5.0
public static Result GetRectangle(GetBoxMode mode, Point3d firstPoint, IEnumerable<string> prompts, out Point3d[] corners)
Gets a 3d rectangle made up of four points.
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.
Commands.Result.Success if successful.

GetRectangle

#ExampleSince v5.0
public static Result GetRectangle(out Point3d[] corners)
Gets a 3d rectangle.
corners (out Point3d[])corners of the rectangle in counter-clockwise order.
Commands.Result.Success if successful.

GetRectangle

#Since v6.0
public static Result GetRectangle(string firstPrompt, out Point3d[] corners)
Gets a 3d rectangle.
firstPrompt (string)
corners (out Point3d[])corners of the rectangle in counter-clockwise order.
Commands.Result.Success if successful.

GetRectangleWithCounts

#Since v6.0
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.
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.
Commands.Result.Success if successful.

GetRectangleWithCounts

#Since v9.0
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.
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.
Commands.Result.Success if successful.

GetSpiral

#Since v5.0
public static Result GetSpiral(out NurbsCurve spiral)
spiral (out NurbsCurve)

GetString

#ExampleSince v5.0
public static Result GetString(string prompt, bool acceptNothing, ref string outputString)
Easy to use string getter.
Remarks: If you need options or more advanced user interface, then use GetString class.
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.
Commands.Result.Success - got string Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel string getting.

GetView

#ExampleSince v5.0
public static Result GetView(string commandPrompt, out RhinoView view)
Allows the user to interactively pick a viewport.
commandPrompt (string)The command prompt during the request.
view (out RhinoView)The view that the user picked.

If the operation is successful, then this out parameter is assigned the correct view during this call.

The result based on user choice.

GetViewports

#Since v9.0
public static Result GetViewports(string commandPrompt, out RhinoViewport[] viewports)
Easy to use getter for selecting multiple viewports.
commandPrompt (string)Prompt to display in command line during the operation.
viewports (out RhinoViewport[])An array of /selected Viewports.
Commands.Result.Success - got point Commands.Result.Cancel - user cancel point getting.

InGet

#Since v5.0
public static bool InGet(RhinoDoc doc)
Returns true if the document is current in a "Get" operation.
doc (RhinoDoc)
true if a getter is currently active.

InGetObject

#Since v6.0
public static bool InGetObject(RhinoDoc doc)
Returns true if currently in a GetObject.GetObjects()
doc (RhinoDoc)

InGetPoint

#Since v6.0
public static bool InGetPoint(RhinoDoc doc)
Returns true if currently in a GetPoint.Get()
doc (RhinoDoc)

StringToCommandOptionName

#Since v6.0
public static LocalizeStringPair StringToCommandOptionName(string englishString, string localizedString)
Convert some arbitrary string value to a valid command option name removing any invalid characters.
englishString (string)English string to convert.
localizedString (string)Optional localized string to convert.
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.

StringToCommandOptionName

#Since v6.0
public static string StringToCommandOptionName(string stringToConvert)
Convert some arbitrary string value to a valid command option name removing any invalid characters.
stringToConvert (string)String to convert.
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.