Folders
Provides static properties for files and folders relevant to the Grasshopper process.
Fields
Properties
DiagnosticsFolder
#Gets the Grasshopper diagnostics folder for the roaming user. This is where logged data and other output useful for debugging is kept.
DocumentationAuthoringFolder
#Gets or sets the folder within which in-progress documenation content resides. When set, and when the folder exists, various UI elements providing access to documentation editing tools become visible.
DocumentationCacheFolder
#Gets the folder for storing cached content generated or downloaded for the documentation.
DocumentationCustomFolders
#Gets all enabled, user specified custom documentation folders. This property automatically selects the correct language subfolder if possible, so it does more work than DocumentationCustomFolderSet.
DocumentationCustomFolderSet
#Gets all specified custom folders including the 'enabled' state for each. This property will return all set folders, even if they do not exist on the disc.
DocumentationFolder
#Gets the folder which holds the canonical documentation content. For a source build that is the 'Grasshopper2Documentation' folder in the repository; for an installed instance it is the 'Documentation' folder which ships alongside Grasshopper. Returns null when neither can be located.
RoamingAppDataFolder
#Gets the Grasshopper application data folder for the roaming user. This is where resources and settings are stored since no elevated priviliges are required to access the appdata folder.
UnnamedFilesFolder
#Gets the folder under which autosave files for unnamed documents live. Named documents place their autosaves next to the original file on disk; unnamed documents have nowhere to put a sibling autosave, so they get a managed home under LocalAppDataFolder instead. Filenames within this folder are keyed by a short prefix of the document's runtime Document.Identity.
Methods
AddCustomDocumentationFolder
#Add a custom documentation folder alongside the enabled state.
EditCustomDocumentationFolders
#Show the editor for adding and removing custom documentation folders.
Returns: True if a change to the custom folders as made.
EnsureDefaultResources
#Ensure that all required resource files exist. This method will copy resource files from the Grasshopper2.dll assembly resources into the Resources folder in the app data. Note however that it will only replace missing files, not invalid files.
Returns: Array of files that were re-instated.
GetResourceAsBitmap
#Try and get embedded resources from an assembly in image format.
GetResourceAsBytes
#Try and get embedded resources from an assembly in byte array format.
GetResourceAsStream
#Try and get embedded resources from an assembly as a byte stream.
GetResourceAsString
#Try and get embedded resources from an assembly in text format.
RequestInternetAccess
#Check the RhinoApp.IsInternetAccessAllowed state and displays a message when it returns false.
ResourceFolder
#Gets a specific resource folder.
Parameters:
| folder (ResourceFolder) | Folder type. |
Returns: Folder path.
SanitizeFolder
#Ensure that a folder uri ends with the OS-specific directory separator.
Parameters:
| folder (string) |
ShowDirectoryInOsFileViewer
#Ask the OS to display a folder in its native viewer.
Parameters:
| directory (string) |
ShowFileInOsFileViewer
#Ask the OS to display a file in its native viewer.
Parameters:
| filePath (string) |
TryFindResourceUri
#Try and find the uri of embedded resources within some assembly. The hint must name the resource in full, although the namespace prefix may be omitted and casing is not significant. Partial names are not matched, as suffix matching yields false positives.