McNeel Wiki
Scripting methods for the Rhino RDK
edit · print · help · all topics
Main Pages

AccuRender

Bongo

Brazil r/s

Developer

Flamingo

Penguin

Rhino Blogs

Rhino

Rhino Labs

Search

Languages

Česky

Deutsch

English

Español

Français

Italiano

Polish

日本語

한국어

中文(繁體)

中文(简体)

 
.
TitleScripting methods for the Rhino RDK

Scripting methods for the Rhino RDK

To get a scripting object for the Rhino RDK, use the following code:

        dim rdk
        set rdk = Rhino.GetPlugInObject("Renderer Development Kit")

Then use the rdk object to access the functions below.

Methods

        FactoryList();

Return a list of RDK's content factory collection.

ReturnsArray of strings identifying the factory.
        ContentList(strContentType)

Returns a list of contents for a certain type: material, texture, environment.

ParametersstrContentType = Required. String. Type of content: material, texture or environment.
ReturnsArray of strings identifying the content.

NULL in error conditions.

        DeleteFactory(strFactoryId)

Deletes a content factory by its identifier.

ParametersstrFactoryId = Required. String. The identifier of the factory to delete.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        FactoryKind(strFactoryId);

Returns the kind of the content.

ParametersstrFactoryId = Required. String. The identifier of the factory.
ReturnsString of the kind of the factory.

NULL in error conditions.

        FactoryNewContent(strFactoryId, strParentId)

Create a new content of the specified type.

ParametersstrFactoryId = Required. String. The identifier of the factory.

strParentId = Optional. String. The identifier of the parent content.

ReturnsString which identifies new content.

NULL in error conditions.

        FactoryContentTypeId(strFactoryId)

Returns the identifier of the content type.

ParametersstrFactoryId = Required. String. The identifier of the factory.
ReturnsString which identifies the factory.

NULL in error conditions.

        FactoryContentInternalName(strFactoryId);

Returns the internal name of the content created by specified factory.

ParametersstrFactoryId = Required. String. The identifier of the factory.
ReturnsString which is the internal name of the factory.

NULL in error conditions.

        FactoryRenderEngineId(strFactoryId)

Returns the render engine id of the content that this factory produces.

ParametersstrFactoryId = Required. String. The identifier of the factory.
ReturnsString which is the identifier of the render engine.

NULL in error conditions.

        FactoryPlugInId(strFactoryId)

Returns the plug-in id of the plug-in that created this factory.

ParametersstrFactoryId = Required. String. The identifier of the factory.
ReturnsString which is the identifier of the plug-in.

NULL in error conditions.

        FactoryRebuildCache(strFactoryId)

Rebuild the factory cache. This forces a refresh of cached data such as the factory name.

ParametersstrFactoryId = Required. String. The identifier of the factory.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentRenderEngineId(strContentInstanceID)

Return Render engine identifier.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the render engine.

NULL in error conditions.

        ContentPlugInId(strContentInstanceID)

Return The plug-in id of the plug-in that defines this content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the plug-in.

NULL in error conditions.

        ContentTypeId(strContentInstanceID)

Return The unique id of the content type.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the content type.

NULL in error conditions.

        ContentInternalName(strContentInstanceID)

Return the internal name of the content type.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the internal name of the content.

NULL in error conditions.

        ContentTypeName(strContentInstanceID)

Return the name of the content type.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the name of the content type.

NULL in error conditions.

        ContentTypeDescription(strContentInstanceID)

Return the description of the content type.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the description of the content type.

NULL in error conditions.

        ContentCategory(strContentInstanceID)

Return the category of the content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the category of the content.

NULL in error conditions.

        ContentKind(strContentInstanceID)

Return return a string uniquely identifying the kind of the content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the uniquely identifying the kind of the content.

NULL in error conditions.

        ContentLibraryFileExtension(strContentInstanceID)

Return the library file extension of the content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the library file extension of the content.

NULL in error conditions.

        CurrentContent(strContentInstanceID)

Returns if content is currently selected in thumbnail display.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsBoolean True or false indicating if content is selected.

NULL in error conditions.

        ContentInstanceName(strContentInstanceID, strName)

Return content's name.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strName = Optional. String. Use to set content name.

ReturnsString which is the current name of the content.

NULL in error conditions.

        ContentNotes(strContentInstanceID, strNotes, strSendEvent)

Return the content's notes

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strNotes = Optional. Use to set notes.

// bSendEvent = Optional. Use to update UI.

ReturnsString which are the current notes.

NULL in error conditions.

        ContentOpenInThumbnailEditor(strContentInstanceID)

Call this method to open the content in the relevant thumbnail editor and select it.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentParameter(strContentInstanceID, strName, varValue)

Returns or modifies a content parameter.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strName = Optional. String. Name of the parameter.

// varValue = Optional. New value of the parameter.

ReturnsArray of strings which are the available paramter names when strName not specified.

// Variant with current value of parameter if strName is specified.

NULL in error conditions.

        UngroupContent(strContentInstanceID)

Remove this content tree from any instance group it may be a member of.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentGroupId(strContentInstanceID)

Returns the group id which this content is a member of.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the group.

NULL in error conditions.

        DeleteContent(strContentInstanceID)

Delete the content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        DuplicateContent(strContentInstanceID)

Duplicate the content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the new content.

NULL in error conditions.

        ContentParent(strContentInstanceID)

Return parent content or empty string if this is the top level object.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of parent or empty string if this is the top level object.

NULL in error conditions.

        ContentFirstChild(strContentInstanceID)

Return first child of this content or NULL if none.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the child.

NULL in error conditions or if no child.

        ContentNextSibling(strContentInstanceID)

Return first sibling of this content or NULL if none.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the first sibling.

NULL in error conditions or if no sibling.

        ContentTopLevelParent(strContentInstanceID)

Return identifier of top level parent of this content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the top level parent.

NULL in error conditions.

        ContentReplaceChild(VARIANT vaContentInstance, strOldChild, strNewChild)

Replace a child content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strOldChild = Required. The identifier of the old child.

// strNewChild = Required. The identifier of the new child.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentAddChild(strContentInstanceID, strContent)

Adds another content as a child of this content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strContent = Required. String. The identifier of the child content.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentChildSlotName(strContentInstanceID, strChildSlotName)

Return the child-slot-name of this content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// varChildSlotName = Optional. String. The new child slot name:

ReturnsString which is current child slot name.

NULL in error conditions.

        ContentChildSlotNameFromParamName(strContentInstanceID, strParamName)

Return the child-slot-name corresponding to a parameter name.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strParamName = Required. String. The parameter name of the slot name.

ReturnsString which is the current child slot name.

NULL in error conditions.

        ContentParamNameFromChildSlotName(strContentInstanceID, strChildSlotName)

Return the parameter name corresponding to a child-slot-name.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strChildSlotName = Required. String. The child slot name.

ReturnsString which is the current parameter name of the child slot.

NULL in error conditions.

        ContentFindChild(strContentInstanceID, strChildSlotName)

Return the immediate child that has the specified child-slot-name or NULL if none.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strChildSlotName = required. String. The child slot name.

ReturnsString which is the identifier of child content.

NULL in error conditions.

        IsContentTypeAcceptableAsChild(strContentInstanceID, strType, strChildSlotName)

Return true only if content type can be accepted as a child in the specified child slot.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strType = Required. String. The identifier of a content type.

// strChildSlotName = Required. String. Name of the child slot.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        IsTypeAcceptableAsChild(strContentInstanceID, strFactory, strChildSlotName)

Return true only if content produced by pFactory can be accepted as a child in the specified child slot.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strFactory = Required. The identifier of the factory.

// strChildSlotName = Required. The name of the child slot.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentGetChildren(strContentInstanceID)

Return all the children of this content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsArray of strings which are the identifier of the child content.

NULL in error conditions.

        ContentGetChildSlots(strContentInstanceID)

Return all child slots.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsArray of strings of child slot names.

NULL in error conditions.

        ContentFactory(strContentInstanceID)

Return the factory that creates this type of content.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is the identifier of the factory

NULL in error conditions.

        FindContentInstance(strContentInstanceID, strInstance)

Searches for the content with the specified instance id.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strInstance = Required. String. The identifier of the instance to search for.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentDestroyChildContent(strContentInstanceID, strPlugIn)

Unlink and destroy all child contents belonging to the specified plug-in.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strPlugIn = Required. String. The identifier of the plug-In.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        IsContentCompatible(strContentInstanceID, strRenderEngine)

A content is compatible with a render engine when its RenderEngineId() matches the id of the render engine.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strRenderEngine = Required. String. The identifier of the render engine.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        IsContentUniversal(strContentInstanceID)

A content is universal if it is meant to be used with any render engine.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        IsContentPrivate(strContentInstanceID)

A content is private if it is not intended to show in any editor.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentSaveToFile(strContentInstanceID, strFullPath)

Save the content to a library file.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strFullPath = Required. String. The full path to the library file to be created.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentLoadFromFile(VARIANT vaFullPath)

Load content from a library file.

ParametersstrFullPath = Required. String. The full path to the library file to be created.
ReturnsString which is the identifier of the content.

NULL in error conditions.

        IsContentInDocument(strContentInstanceID)

Query whether or not the content is in the document.

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentEmbeddedFiles(strContentInstanceID)

Return a semicolon-delimited string of full paths to files used by the content

ParametersstrContentInstanceID = Required. String. The identifier of the content.
ReturnsString which is a semicolon-delimited string of full paths.

NULL in error conditions.

        ContentSupportsCommand(strContentInstanceID, strCommand)

Indicates whether or not the content supports a particular command.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strCommand = Required. String. Command identifier.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentExecuteCommand(strContentInstanceID, strCommand)

Executes a command.

ParametersstrContentInstanceID = Required. String. The identifier of the content.

// strCommand = Required. String. Command identifier.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        SunEnableAllowed([optional]
        VARIANT vaAllowed)

Returns or modifies the sun enable allowed value.

ParametersbAllowed = Optional. Boolean. Use to enable/disable this option.
ReturnsBoolean which is the current value.

NULL in error conditions.

        SunEnableOn(bOn)

Returns or modifies the sun ON value

ParametersbOn = Optional. Boolean. Use to enable/disable this option.
ReturnsBoolean which is the current value.

NULL in error conditions.

        SunManualControlAllowed(bAllowed)

Returns or modifies the ManualControlAllowed value.

ParametersbAllowed = Optional. Boolean. Use to enable/disable this option.
ReturnsBoolean which is the current value.

NULL in error conditions.

        SunManualControlOn(bManual)

Returns or modifies the ManualControlOn value.

ParametersbManual = Optional. Boolean. Use to enable/disable this option.
ReturnsBoolean which is the current value.

NULL in error conditions.

        SunNorth(dblNorth)

Returns or modifies the azimuth corresponding to North.

ParametersdblNorth = Optional. Use to set/get north.
ReturnsArray which is the current value.

NULL in error conditions.

        SunVector(vVector)

Return the sun's direction vector in world space,

ParametersvVector = Optional. Array. 3D-Vector
ReturnsArray which is the current value.

NULL in error conditions.

        SunAzimuth(dblAzimuth)

Return the azimuth of the sun in degrees.

ParametersdblAzimuth = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunAltitude(dblAltitude)

Return the altitude of the sun in degrees.

ParametersdblAltitude = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunLatitude(dblLatitude)

Return the latitude of the observer.

ParametersdblLatitude = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunLongitude(dblLongitude)

Return the longitude of the observer.

ParametersdblLongitude = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunTimeZone(dblHours)

Return the time zone of the observer in hours.

ParametersdblHours = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunDaylightSavingOn(bOn)

Return true if daylight saving is on

ParametersbOn = Optional. Boolean.
ReturnsBoolean which is the current value.

NULL in error conditions.

        SunDaylightSavingMinutes(intMinutes)

Return the daylight saving of the observer in minutes.

ParametersintMinutes = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunLocalDate(intDate)

Retrieves the local date of the observer.

ParametersintDate = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunLocalTime(dblHours)

Retrieves the local time of the observer.

ParametersdblHours = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunUTCDate(intDate)

Retrieves the UTC date of the observer.

ParametersintDate = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunUTCTime(dblHours)

Retrieves the UTC time of the observer.

ParametersdblHours = Optional. Number.
ReturnsNumber which is the current value.

NULL in error conditions.

        SunLight()

Get an ON_Light which represents the sun.

]

ReturnsString which is the identifier of the light.

NULL in error conditions.

        MaterialInstanceId(intMaterialTableIndex)

Returns the content instance id for a given index into the Rhino material table

ParametersintMaterialTableIndex = Required. Number. Index in material table.
ReturnsString which is the identifier of the content.

NULL in error conditions.

        SetMaterialInstanceId(strInstanceId, intMaterialTableIndex)

Assigns a certain content to a material table index.

ParametersstrInstanceId = Required. String. Identifier of content.

// intMaterialTableIndex = Required. Number. Index in material table.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        HSB2RGB(arrColor)

Converts color

ParametersarrColor = Required. Array. 3D Array of doubles.
ReturnsArray of Numbers.

NULL in error conditions.

        RGB2HSB(arrColor)

Converts color

ParametersarrColor = Required. Array. 3D Array of doubles.
ReturnsArray of Numbers.

NULL in error conditions.

        ShowContentChooser(strDefaultType, strDefaultInstance, strAllowedKinds)

Shows the content chooser to allow the user to select a new or existing content.

ParametersstrDefaultType = Required. String. Is the content type that will be initially selected in the 'New' tab.

// strDefaultInstance = Required. String. Is the content instance that will be initially selected in the 'Existing' tab.

// strAllowedKinds = Required. Array. List of strings of content kinds that will be displayed.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentKindList()

Returns list of content kinds.

]

ReturnsArray of strings of content kinds.

NULL in error conditions.

        SelectedContent(strContentType)

Get the selected content of the specified kind.

ParametersstrContentType = Required. String. Content type to look for selection.
ReturnsString which is the identifier of the selected content.

NULL in error conditions.

        OpenFloatingContentPreview(strContentInstanceID, arrPos, arrSize)

Open content preview window.

ParametersstrContentInstanceID = Required. String. Content identifier.

// arrPos = Required. Array. 2D array of integers x,y.

// arrSize = Required. Array. 2D array of integers width, height.

ReturnsString which is the identifier of the preview window.

NULL in error conditions.

        CloseFloatingContentPreview(strWindowId)

Close content preview window.

ParametersstrWindowId = Required. String. Identifier of preview window.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ContentResetToDefaults(strContentInstanceID)

Reset content to defaults.

ParametersstrContentInstanceID = Required. String. Content identifier.
ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

        ChangeContent(strContentInstanceID, strNewContentId, bHarvest)

Change content.

ParametersstrContentInstanceID = Required. String. Content identifier.

// strNewContentID = Required. String. Content identifier to change too.

// bHarvest = Required. Boolean. Determines whether or not parameter harvesting will be performed.

ReturnsBoolean True or false indicating success or failure.

NULL in error conditions.

rename · changes · history · subscriptions · lost and found · references · file upload