Rhino.rvb is a sample RhinoScript file that included with Rhino. The file contains many constant declarations that are useful when using RhinoScript methods. The following is a code listing of the Rhino.rvb file.
Option Explicit
' ---------------------------------------------------------------------------
' Appearance color constants
' ---------------------------------------------------------------------------
Public Const rhColorViewportBackground = 0
Public Const rhColorMajorGridLine = 1
Public Const rhColorMinorGridLine = 2
Public Const rhColorXAxisLine = 3
Public Const rhColorYAxisLine = 4
Public Const rhColorSelectedObject = 5
Public Const rhColorLockedObject = 6
Public Const rhColorNewLayer = 7
Public Const rhColorFeedback = 8
Public Const rhColorTracking = 9
Public Const rhColorCrosshair = 10
Public Const rhColorText = 11
Public Const rhColorTextBackground = 12
Public Const rhColorTextHover = 13
' ---------------------------------------------------------------------------
' Units and precision constants
' ---------------------------------------------------------------------------
Public Const rhUnitNone = 0
Public Const rhUnitMicrons = 1
Public Const rhUnitMillimeters = 2
Public Const rhUnitCentimeters = 3
Public Const rhUnitMeters = 4
Public Const rhUnitKilometers = 5
Public Const rhUnitMicroInches = 6
Public Const rhUnitMils = 7
Public Const rhUnitInches = 8
Public Const rhUnitFeet = 9
Public Const rhUnitMiles = 10
Public Const rhUnitCustom = 11
Public Const rhUnitDisplayDecimal = 0
Public Const rhUnitDisplayFractional = 1
Public Const rhUnitDisplayFeetInches = 2
' ---------------------------------------------------------------------------
' Object type and material source constants
' ---------------------------------------------------------------------------
Public Const rhObjectAll = 0
Public Const rhObjectPoint = 1
Public Const rhObjectPointCloud = 2
Public Const rhObjectCurve = 4
Public Const rhObjectSurface = 8
Public Const rhObjectPolySurface = 16
Public Const rhObjectMesh = 32
Public Const rhObjectLayer = 64
Public Const rhObjectMaterial = 128
Public Const rhObjectLight = 256
Public Const rhObjectAnnotation = 512
Public Const rhObjectUserData = 1024
Public Const rhObjectDefinition = 2048
Public Const rhObjectReference = 4096
Public Const rhObjectTextDot = 8192
Public Const rhObjectGrip = 16384
Public Const rhObjectScreenArrow = 32768
Public Const rhObjectMaterialByLayer = 0
Public Const rhObjectMaterialByObject = 1
' ---------------------------------------------------------------------------
' MessageBeep constants
' ---------------------------------------------------------------------------
Public Const rhBeepSimple = 0
Public Const rhBeepAsterisk = 1
Public Const rhBeepExclamation = 2
Public Const rhBeepHand = 3
Public Const rhBeepQuestion = 4
Public Const rhBeepDefault = 5
' ---------------------------------------------------------------------------
' MessageBox constants
' ---------------------------------------------------------------------------
Public Const rhOKOnly = 0
Public Const rhOKCancel = 1
Public Const rhAbortRetryIgnore = 2
Public Const rhYesNoCancel = 3
Public Const rhYesNo = 4
Public Const rhRetryCancel = 5
Public Const rhCritical = 16
Public Const rhQuestion = 32
Public Const rhExclamation = 48
Public Const rhInformation = 64
Public Const rhDefaultButton1 = 0
Public Const rhDefaultButton2 = 256
Public Const rhDefaultButton3 = 512
Public Const rhDefaultButton4 = 768
Public Const rhApplicationModal = 0
Public Const rhSystemModal = 4096
Public Const rhOK = 1
Public Const rhCancel = 2
Public Const rhAbort = 3
Public Const rhRetry = 4
Public Const rhIgnore = 5
Public Const rhYes = 6
Public Const rhNo = 7
' ---------------------------------------------------------------------------
' Render option constants
' ---------------------------------------------------------------------------
Public Const rhRenderAmbientLightColor = 0
Public Const rhRenderBackgroundColor = 1
Public Const rhRenderAntialiasNone = 0
Public Const rhRenderAntialiasNormal = 1
Public Const rhRenderAntialiasBest = 2
Public Const rhRenderShadows = 1
Public Const rhRenderHiddenLights = 2
Public Const rhRenderCurves = 4
Public Const rhRenderAnnotations = 8
' ---------------------------------------------------------------------------
' GetRectangle and GetBox constants
' ---------------------------------------------------------------------------
Public Const rhRectangleModeAll = 0
Public Const rhRectangleModeCorners = 1
Public Const rhRectangleMode3Point = 2
Public Const rhRectangleModeVertical = 3
Public Const rhRectangleModeCenter = 4
' ---------------------------------------------------------------------------
' Layer state constants
' ---------------------------------------------------------------------------
Public Const rhLayerNormal = 0
Public Const rhLayerHidden = 1
Public Const rhLayerLocked = 2
' ---------------------------------------------------------------------------
' View display and projection constants
' ---------------------------------------------------------------------------
Public Const rhDisplayModeWireframe = 0
Public Const rhDisplayModeShaded = 1
Public Const rhDisplayModeRenderPreview = 2
Public Const rhProjectionParallel = 0
Public Const rhProjectionPerspective = 1
' ---------------------------------------------------------------------------
' Plug-in type constants
' ---------------------------------------------------------------------------
Public Const rhPlugInAll = 0
Public Const rhPlugInRender = 1
Public Const rhPlugInExport = 2
Public Const rhPlugInImport = 4
Public Const rhPlugInDigitizer = 8
Public Const rhPlugInUtility = 16
' ---------------------------------------------------------------------------
' Object snap mode constants
' ---------------------------------------------------------------------------
Public Const rhOsnapModeNone = 0
Public Const rhOsnapModeNear = 1
Public Const rhOsnapModeFocus = 2
Public Const rhOsnapModeCenter = 4
Public Const rhOsnapModeKnot = 8
Public Const rhOsnapModeQuadrant = 16
Public Const rhOsnapModeMidpoint = 32
Public Const rhOsnapModeIntersection = 64
Public Const rhOsnapModeEnd = 128
Public Const rhOsnapModePerpendicula = 256
Public Const rhOsnapModeTangent = 512
Public Const rhOsnapModePoint = 1024
' ---------------------------------------------------------------------------
' Subroutine: Include
' Purpose: Includes, or loads, other RhinoScript files
' Argument: A script file name to include
' Example: Include "C:\Scripts\MyScriptFile.rvb"
' ---------------------------------------------------------------------------
Public Function Include (strScriptName)
Dim oFS, oFile
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oFile = oFS.OpenTextFile(strScriptName)
ExecuteGlobal oFile.ReadAll()
oFile.Close
Include = Null
End Function