GH_ComponentServer
ReferencesMaintains proxies for all components, parameters and other object types as defined in all grasshopper assemblies.
Constructors
GH_ComponentServer
#public GH_ComponentServer()
Properties
AllAddOns
#Gets a list of all the gha and ghuser files that will be loaded as Grasshopper add-ons.
obsoleteThis property has been replaced by the ExternalFiles() Shared method
Returns: A list of target file paths.
CompleteRibbonLayout
#Gets the default component layout featuring all non-hidden components and parameters.
DiscardedProxies
#Returns the total number of IGH_DocumentObjects that were discarded during assembly parsing. This includes both skipped and replaced proxies.
GHA_AppDataDirectory
#obsoleteThis property has been replaced by Grasshopper.Folders.DefaultAssemblyFolder
GHUser_AppDataDirectory
#obsoleteThis property has been replaced by Grasshopper.Folders.GhUserAppDataFolder
IsLoading
#Gets whether the component server is currently executing its external-file load pass. True from entry to LoadExternalFiles until it returns.
LoadingExceptions
#Gets a list of all the exceptions that were recorded during the most recent loading sequence.
ObjectProxyNames
#Returns a specialized string collection of all component names.
Remarks: This property is used for autocompletion in textboxes.
TypeHints
#Gets a list of all IGH_TypeHint types in all loaded assemblies.
Returns: A list of System.Type containing all classes that implement IGH_TypeHint.
Methods
AddAlias
#Add an alias to a target.
AddCategoryIcon
#Add an icon for a tab category. 16x16 images are required.
public void AddCategoryIcon()
fullCategoryName,
The full name of the category.
Bitmap
icon
the icon to display on the tab (has to be a 16x16 image).
AddCategoryShortName
#Add an abbreviation for a tab category. 2~4 letter abbreviations are best.
AddCategorySymbolName
#Add a single char category description.
AddProxy
#Add a proxy object to the component server. Expert user function, talk to David Rutten before calling it.
Returns: True on success, false on failure.
AddProxyLibraryInfo
#Add a library info for a proxy object to the component server. Expert user function, talk to David Rutten before calling it.
Returns: True on success, false on failure.
AliasTargets
#Get all the target Component IDs for a given alias.
ClearStaleUserObjects
#Remove all user objects that no longer point to existing files.
public void ClearStaleUserObjects()
CompareProxies
#Compare two object proxies. Names and exposures are taken into account.
Returns: -1 if A is valued lower than B, 0 if A and B are considered equal, +1 if A is valued higher than B.
CopyFileToAppropriateFolder
#Copy a GHA or GHUSER file into the appropriate Roaming Application Data folder. Of the file is already in the top-level roaming folder it will not be copied.
Returns: The path of the copied file.
CreateComponentPalette
#DestroyLoadingUI
#Destroy the loading UI (the banner and the progress bar).
public void DestroyLoadingUI()
EmitGraph
#Create a new instance of the IGH_Graph that matches the id. If no proxy can be matched to the id, a null reference will be returned.
EmitObject
#Create a new instance of the IGH_DocumentObject that matches the id. If no proxy can be matched to the id, a null reference will be returned.
EmitObjectIcon
#Get the icon that is associated with the given Object ID.
Returns: Icon of object or null if object is not defined or if object does not have an icon.
ExternalFiles
#Get lists of all the external files (GHA, GHUSER and GHCLUSTER) that will be loaded by Grasshopper. Note: this does not equal the files that may already have been loaded, just the files that we'll attempt to load if we were asked to load all plugins now. The list contains no duplicate file paths, but it may contain identical files which won't be filtered until actual loading.
public static List<GH_ExternalFile> ExternalFiles()
testGrasshopperCollisions,
If true, invalid duplicates of Grasshopper.dll will be tested for and warned about.
testExternalCollisions
If true, duplicates of GHA, GHUSER and GHCLUSTER files will be tested for and warned about.
FindAssembly
#Gets the assembly that corresponds to the given library ID.
Returns: The library info, or null if the ID is not registered.
FindAssemblyByObject
#Gets the assembly that corresponds to the given library ID.
Returns: The library info, or null if the ID is not registered.
FindAssemblyByObject
#Gets the assembly that corresponds to the given library ID.
Returns: The library info, or null if the ID is not registered.
FindObjectByName
#Find an object by name. Obsolete and hidden objects are ignored. Only exact matches are included.
public IGH_ObjectProxy FindObjectByName()
name,
Name to search for. Name may be prefixed by Category and Subcategory.
ignoreWhiteSpace,
If true, whitespace is ignored during matching.
ignoreCapitalisation
If true, capitalisation is ignored during matching.
Returns: The proxy that matches the name, or null if no such object could be found.
FindObjects
#Searches the list of cached object proxies for objects that might be implied by a search term.
Returns: A sorted list of search results.
FindObjects
#Find all the objects that are part of a certain library.
Returns: A list of all the objects that are defined in the specified library.
FindUpgrader
#Find the upgrader that can convert from the given target.
Returns: Matching upgrader or null if no upgrader is defined.
GetAlias
#Gets the alias display string for a given object.
Returns: A parsable display string of aliases.
GetCategoryIcon
#Get the icon for a specific category. If the icon hasn't been defined, this method will return the default icon.
Returns: The category icon.
GetCategoryShortName
#Get the abbreviation (short name) for a specific category. If the short name hasn't been defined, this method will return the full name instead.
Returns: The abbreviated name or the full name.
GetCategorySymbolName
#Get the single char representation for a specific category. If the char hasn't been defined, this method will return the first char of the full name instead.
Returns: The category char.
IsGraphCached
#Tests the graph cache for an existing graph type ID.
Returns: True if the ID is cached, false if it aint.
IsObjectCached
#Tests the caches for an existing object type ID.
Returns: True if the ID is cached, false if it aint.
LoadAliases
#Load the Alias table from the settings directory. Only use this function if you suspect the alias table settings file has changed due to some external process.
public void LoadAliases()
LoadExternalFiles
#Attempt to parse all external files. This includes GHA libraries, GHUSER objects and GHCLUSTER files.
obsoleteThis method has been replaced by an overload which takes a single boolean.
Returns: True on success, false on failure.
LoadExternalFiles
#Attempt to parse all external files. This includes GHA libraries, GHUSER objects and GHCLUSTER files.
Returns: True on success, false on failure.
NewUserObject
#Create a new UserObject and write it to the Grasshopper User Object folder.
Returns: True on success, false on failure.
RemoveCachedGraph
#Remove a cache entry from the graph cache. This cannot be undone.
Returns: True on success, false on failure.
RemoveCachedObject
#Remove a cache entry from the object cache. This cannot be undone.
Returns: True on success, false on failure.
RemoveCachedObject
#Remove the user object (if any) that loads itself from a specified *.ghuser file.
Returns: True if an object proxy was removed, false if not.
SaveAliases
#Save the alias table to the settings directory. Use this function if you change the alias table while ignoring usual channels.
public void SaveAliases()
SetAlias
#Sets the aliases for a given target.
UpdateRibbonUI
#Forces an update of the Ribbon control on the Grasshopper main form.
public static void UpdateRibbonUI()