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
Gets a rectangle in view window coordinates.
public static Result Get2dRectangle(
solidPen,
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,
user selected rectangle in window coordinates.
rectView
view that the user selected the window in.
)
Success or Cancel.

GetAngle

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

GetArc

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

GetBool

#Since v5.0
Easy to use Boolean getter.
public static Result GetBool(
prompt,
Command prompt.
acceptNothing,
If true, the user can press enter.
offPrompt,
The 'false/off' message.
onPrompt,
The 'true/on' message.
ref bool
boolValue
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
Asks the user to select a Box in the viewport.
public static Result GetBox(
out Box
box,
If the result is Success, this parameter will be filled out.
mode,
A particular "get box" mode, or GetBoxMode.All.
basePoint,
Optional base point. Supply Point3d.Unset if you don't want to use this.
prompt1,
Optional first prompt. Supply null to use the default prompt.
prompt2,
Optional second prompt. Supply null to use the default prompt.
prompt3
Optional third prompt. Supply null to use the default prompt.
)
Commands.Result.Success if successful.

GetBox

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

GetBoxWithCounts

#Since v6.0
Gets a 3d box with prompts for counts in X, Y and Z directions.
public static Result GetBoxWithCounts(
xMin,
Minimum value allowed for count in the x direction.
ref int
xCount,
Count in the x direction.
yMin,
Minimum value allowed for count in the y direction.
ref int
yCount,
Count in the y direction.
zMin,
Minimum value allowed for count in the z direction.
ref int
zCount,
Count in the z direction.
out Point3d[]
corners
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
)

GetColor

#Since v5.0
Easy to use color getter.
public static Result GetColor(
prompt,
Command prompt.
acceptNothing,
If true, the user can press enter.
ref Color
color
Color value returned here. also used as default color.
)
Remarks: If you need options or more advanced user interface, then use GetColor class.

Commands.Result.Success - got color.

Commands.Result.Nothing - user pressed enter.

Commands.Result.Cancel - user cancel color getting.

GetDistance

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

GetFileName

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

GetFileName

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

GetFileNameScripted

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

GetGrip

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

GetGrips

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

GetHelix

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

GetInteger

#Since v5.0
Easy to use number getter.
public static Result GetInteger(
prompt,
The command prompt.
acceptNothing,
If true, the user can press enter.
ref int
outputNumber,
default number is set to this value and number value returned here.
lowerLimit,
The minimum allowed value.
upperLimit
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
Easy to use number getter.
public static Result GetInteger(
prompt,
command prompt.
acceptNothing,
if true, the user can press enter.
ref int
outputNumber
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
Interactively picks the points of a curve interpolated through a surface. This is the getter behind the Rhino InterpCrvOnSrf command.
public static Result GetInterpolatedCurveOnSurface(
surface,
The surface to draw on, or null to have the user pick one.
out Curve
curve,
The resulting curve, or null when the result is not Success.
out ObjRef
surfaceObjRef,
The face the user picked, or null when a surface was supplied or nothing was picked.
out Point2d[]
surfaceParameters
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
Interactively picks the points of a curve interpolated through a surface. This is the getter behind the Rhino InterpCrvOnSrf command.
public static Result GetInterpolatedCurveOnSurface(
surface,
The surface to draw on, or null to have the user pick one.
out Curve
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
)

GetLinearDimension

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

GetMeshParameters

#Since v7.0
Asks the user to specify meshing parameters.
public static Result GetMeshParameters(
doc,
The active document
parameters,
The initial meshing parameters. If successful, the updated meshing parameters are returned here.
ref int
uiStyle
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
Easy to use object getter for getting multiple objects.
public static Result GetMultipleObjects(
prompt,
command prompt.
acceptNothing,
if true, the user can press enter.
filter,
geometry filter to use when getting objects.
out ObjRef[]
rhObjects
result of the get. may be null.
)
Remarks: If you need options or more advanced user interface, then use GetObject class.
Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.

GetMultipleObjects

#ExampleSince v5.0
Easy to use object getter for getting multiple objects.
[CLSCompliant(false)] public static Result GetMultipleObjects(
prompt,
command prompt.
acceptNothing,
if true, the user can press enter.
ObjectType
filter,
geometry filter to use when getting objects.
out ObjRef[]
rhObjects
result of the get. may be null.
)
Remarks: If you need options or more advanced user interface, then use GetObject class.
Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.

GetNumber

#ExampleSince v5.0
Easy to use number getter.
public static Result GetNumber(
prompt,
The command prompt.
acceptNothing,
If true, the user can press Enter.
ref double
outputNumber,
Default number is set to this value and the return number value is assigned to this variable during the call.
lowerLimit,
The minimum allowed value.
upperLimit
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
Easy to use number getter.
public static Result GetNumber(
prompt,
command prompt.
acceptNothing,
if true, the user can press enter.
ref double
outputNumber
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
Easy to use object getter.
public static Result GetOneObject(
prompt,
command prompt.
acceptNothing,
if true, the user can press enter.
filter,
geometry filter to use when getting objects.
out ObjRef
objref
result of the get. may be null.
)
Remarks: If you need options or more advanced user interface, then use GetObject class.
Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.

GetOneObject

#ExampleSince v5.0
Easy to use object getter.
[CLSCompliant(false)] public static Result GetOneObject(
prompt,
command prompt.
acceptNothing,
if true, the user can press enter.
ObjectType
filter,
geometry filter to use when getting objects.
out ObjRef
rhObject
result of the get. may be null.
)
Remarks: If you need options or more advanced user interface, then use GetObject class.
Commands.Result.Success - got object Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel object getting.

GetPlane

#ExampleSince v5.0
Gets an oriented infinite plane.
public static Result GetPlane(
out Plane
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
Gets a point coordinate from the document.
public static Result GetPoint(
prompt,
Prompt to display in command line during the operation.
acceptNothing,
if true, the user can press enter.
out Point3d
point
point value returned here.
)
Remarks: If you need options or more advanced user interface, then use GetPoint class.
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
Gets a point constrained to an existing mesh in the document.
public static Result GetPointOnMesh(
meshObjectId,
An ID of a mesh in the document.
prompt,
Text prompt.
acceptNothing,
true if nothing else should be accepted.
out Point3d
point
A point value will be assigned to this out parameter during this call.
)
obsoleteUse method that requires document
A command result based on user choice.

GetPointOnMesh

#Since v5.0 Obsolete v7.6
Gets a point constrained to an existing mesh in the document.
public static Result GetPointOnMesh(
meshObject,
An mesh object in the document.
prompt,
Text prompt.
acceptNothing,
true if nothing else should be accepted.
out Point3d
point
A point value will be assigned to this out parameter during this call.
)
obsoleteUse version that takes a document.
The command result based on user choice.

GetPointOnMesh

#Since v7.6
Gets a point constrained to an existing mesh in the document.
public static Result GetPointOnMesh(
doc,
Document containing mesh object.
meshObjectId,
An ID of a mesh in the document.
prompt,
Text prompt.
acceptNothing,
true if nothing else should be accepted.
out Point3d
point
A point value will be assigned to this out parameter during this call.
)
A command result based on user choice.

GetPointOnMesh

#Since v7.6
Gets a point constrained to an existing mesh in the document.
public static Result GetPointOnMesh(
doc,
The Rhino document
meshObject,
An mesh object in the document.
prompt,
Text prompt.
acceptNothing,
true if nothing else should be accepted.
out Point3d
point
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(
useActiveLayerLinetype,
ref int
numberSides,
ref bool
inscribed,
polyline
)

GetPolygon

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

GetPolyline

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

GetPrintWindow

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

GetRectangle

#Since v5.0
Gets a 3d rectangle made up of four points.
public static Result GetRectangle(
mode,
A get box mode.
firstPoint,
The first corner used. Pass Point3d.Unset if you do not want to set this.
prompts,
Optional prompts to display while getting points. May be null.
out Point3d[]
corners
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
Gets a 3d rectangle.
public static Result GetRectangle(
out Point3d[]
corners
corners of the rectangle in counter-clockwise order.
)
Commands.Result.Success if successful.

GetRectangle

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

GetRectangleWithCounts

#Since v6.0
Gets a 3d rectangle with prompts for counts in X and Y directions.
public static Result GetRectangleWithCounts(
xMin,
Minimum value allowed for count in the x direction.
ref int
xCount,
Count in the x direction.
yMin,
Minimum value allowed for count in the y direction.
ref int
yCount,
Count in the y direction.
out Point3d[]
corners
corners of the rectangle in counter-clockwise order.
)
Commands.Result.Success if successful.

GetRectangleWithCounts

#Since v9.0
Gets a 3d rectangle with prompts for counts in X and Y directions, and a SubDCorners option.
public static Result GetRectangleWithCounts(
xMin,
Minimum value allowed for count in the x direction.
ref int
xCount,
Count in the x direction.
yMin,
Minimum value allowed for count in the y direction.
ref int
yCount,
Count in the y direction.
ref bool
subDCorners,
Value of the SubDCorners option.
out Point3d[]
corners
corners of the rectangle in counter-clockwise order.
)
Commands.Result.Success if successful.

GetSpiral

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

GetString

#ExampleSince v5.0
Easy to use string getter.
public static Result GetString(
prompt,
command prompt.
acceptNothing,
if true, the user can press enter.
ref string
outputString
default string set to this value and string value returned here.
)
Remarks: If you need options or more advanced user interface, then use GetString class.
Commands.Result.Success - got string Commands.Result.Nothing - user pressed enter Commands.Result.Cancel - user cancel string getting.

GetView

#ExampleSince v5.0
Allows the user to interactively pick a viewport.
public static Result GetView(
commandPrompt,
The command prompt during the request.
view
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
Easy to use getter for selecting multiple viewports.
public static Result GetViewports(
commandPrompt,
Prompt to display in command line during the operation.
viewports
An array of /selected Viewports.
)
Commands.Result.Success - got point Commands.Result.Cancel - user cancel point getting.

InGet

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

InGetObject

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

InGetPoint

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

StringToCommandOptionName

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