Utilities
Properties
Get the plug-in Id for the default render plug-in
Specifies whether incompatible content should be shown in the corresponding editor.
Specifies whether incompatible content should be shown in the corresponding editor.
Methods
public static RenderContent ChangeContentType(RenderContent oldContent, Guid newType, bool harvestParameters)
Changes the type of a content. This deletes the content and creates a replacement of the specified type allowing the caller to decide about harvesting.
Parameters:
| oldContent (RenderContent) | oldContent is the old content which is deleted. |
| newType (Guid) | The type of content to replace pOldContent with. |
| harvestParameters (bool) | Determines whether or not parameter harvesting will be performed. |
Returns: A new persistent render content.
Parameters:
| filename (string) |
[CLSCompliant(false)]
public static string FindFile(RhinoDoc doc, string fullPathToFile, bool unpackFromBitmapTableIfNecessary)
Finds a file and also handles network shares. This is a replacement for CRhinoFileUtilities::FindFile().
Finds a file and also handles network shares. This is a replacement for CRhinoFileUtilities::FindFile().
Gets a folder associated with the document for unpacking textures to
Parameters:
| doc (RhinoDoc) | The document the folder is associated with |
| create (bool) | If true, this will create a directory if it does not exist |
Returns: The path to the unpacked files folder
Exceptions:
| ArgumentNullException | When doc is null |
Determines if any texture in any persistent content list is using the specified file name for caching.
Parameters:
| textureFileName (string) | The file name to check for. The extension is ignored. |
Returns: true if the texture is present.
[CLSCompliant(false)]
public static RenderContent LoadPersistentRenderContentFromFile(uint docSerialNumber, string filename)
Loads a content from a library file and adds it to the persistent content list of a particular document.
public static string PromptForSaveImageFileParameters(string filename, ref int width, ref int height, ref int colorDepth)
Prompts the user for a save file name and the width, height and depth of an image to be saved.
Queries whether or not the Safe Frame is visible.
Parameters:
| doc (RhinoDoc) |
Set default render application
Parameters:
| pluginId (Guid) | ID of render plug-in |
Returns: True if plug-in found and loaded successfully. False if pluginId is invalid or was unable to load plug-in
public static Utilities.ShowContentChooserResults ShowContentChooser(Guid defaultType, Guid defaultInstanceId, RenderContentKind kinds, ref Guid instanceIdOut, ShowContentChooserFlags flags, RhinoDoc doc)
obsolete: Use ShowContentNewExistingBrowser() instead
Shows the Content New / Existing Browser to allow the user to select a new or existing content.
Parameters:
| defaultType (Guid) | |
| defaultInstanceId (Guid) | |
| kinds (RenderContentKind) | |
| instanceIdOut (ref Guid) | |
| flags (RenderContent.ShowContentChooserFlags) | |
| doc (RhinoDoc) |
public static Utilities.ShowContentChooserResults ShowContentChooser(RhinoDoc doc, Guid defaultType, Guid defaultInstanceId, RenderContentKind kinds, ContentChooserFlags flags, string presetCategory, IEnumerable<string> categories, IEnumerable<Guid> types, out Guid[] instanceIdsOut)
obsolete: Use ShowContentNewExistingBrowser() instead
Shows the Content New / Existing Browser to allow the user to select a new or existing content, or multiple contents.
Parameters:
| doc (RhinoDoc) | |
| defaultType (Guid) | |
| defaultInstanceId (Guid) | |
| kinds (RenderContentKind) | |
| flags (Utilities.ContentChooserFlags) | |
| presetCategory (string) | |
| categories (IEnumerable<string>) | |
| types (IEnumerable<Guid>) | |
| instanceIdsOut (out Guid[]) |
public static Utilities.ShowContentChooserResults ShowContentChooser(RhinoDoc doc, Guid defaultType, Guid defaultInstanceId, RenderContentKind kinds, ShowContentChooserFlags flags, string presetCategory, IEnumerable<string> categories, IEnumerable<Guid> types, out Guid[] instanceIdsOut)
obsolete: Use ShowContentNewExistingBrowser() instead
Shows the Content New / Existing Browser to allow the user to select a new or existing content.
Parameters:
| doc (RhinoDoc) | |
| defaultType (Guid) | |
| defaultInstanceId (Guid) | |
| kinds (RenderContentKind) | |
| flags (RenderContent.ShowContentChooserFlags) | |
| presetCategory (string) | |
| categories (IEnumerable<string>) | |
| types (IEnumerable<Guid>) | |
| instanceIdsOut (out Guid[]) |
public static Utilities.ContentNewExistingResults ShowContentNewExistingBrowser(RhinoDoc doc, Guid defaultType, Guid defaultInstanceId, RenderContentKind kinds, ContentNewExistingFlags flags, string presetCategory, IEnumerable<string> categories, IEnumerable<Guid> types, out Guid[] contents)
Shows the Content New / Existing Browser to allow the user to select a new or existing content, or multiple contents.
Parameters:
| doc (RhinoDoc) | A Rhino document. |
| defaultType (Guid) | The content type that will be initially selected in the 'New' tab. |
| defaultInstanceId (Guid) | The content instance that will be initially selected in the 'Existing' tab. |
| kinds (RenderContentKind) | Semicolon-delimited string specifying which content kinds will be displayed. |
| flags (Utilities.ContentNewExistingFlags) | Flags controlling the browser (tabs to hide, type of selection). |
| presetCategory (string) | Specifies the category to preset in the drop-down list on the 'New' tab. If this string is empty, the preset category will be 'All'. |
| categories (IEnumerable<string>) | Specifies the categories to display. Render contents that do not belong to one of these categories will not be listed. If this array is empty, all render contents from all categories will be listed. |
| types (IEnumerable<Guid>) | Specifies content types to display. Contents that are not one of these types will not be listed. If this array is empty, all content types will be listed. |
| contents (out Guid[]) | Array of Guid(s) of the chosen item(s). Depending on the result, this can accept type id(s) of content type(s) or instance id(s) of existing content(s). |
Returns: The result of displaying the browser.