Param_ModelLineWidth
GH_PersistentParam<1>GH_Param<1>GH_ActiveObjectGH_DocumentObjectGH_InstanceDescriptionConstructors
Param_ModelLineWidth
#public Param_ModelLineWidth()
Fields
m_attributes
protected IGH_Attributes m_attributes
m_data
Contains the runtime data for this parameter, also known as "Volatile" data.
Values
#Properties
Access
Gets or sets the Access level for this parameter.
Implements: Access
Attributes
Gets or sets the attributes that are associated with this object. Only set custom attributes if you know what you are doing.
Implements: Attributes
Category
Gets or sets the Category in which this object belongs. If HasCategory() returns false, this field has no meaning.
Implements: Category
DataMapping
Gets or sets the data mapping of this Parameter.
Implements: DataMapping
DataType
Gets the type of data stored in this parameter.
Overrides: GH_Param<T>.DataType
Description
Gets or sets the description of the object. This field typically remains fixed during the lifetime of an object.
Implements: Description
Implements: HasCategory
HasProxySources
Gets a value indicating whether or not this parameter maintains proxy sources. Proxy sources are used during file IO, when actual sources might not be available yet. Once an IO operation has been completed there should be no more proxy sources.
Returns: True if the parameter has at least one proxy source, false if not.
Implements: HasProxySources
HasSubCategory
Gets whether or not the SubCategory field has been set.
Implements: HasSubCategory
Icon_24x24
public Bitmap Icon_24x24 { get; }
The icon associated with this object.
Implements: Icon_24x24
Icon_24x24_Locked
public Bitmap Icon_24x24_Locked { get; }
The greyscale icon of this object.
Implements: Icon_24x24_Locked
IconCapableUI
By default the NickName menu item supports the Icon Mode override toggle. If your UI is not capable of displaying icons, then override this property and return False.
IconDisplayMode
Gets the current display mode of the object.
Implements: IconDisplayMode
InstanceDescription
Gets the description of this instance. The default description is about the amount and source of the local values.
Overrides: GH_InstanceDescription.InstanceDescription
Implements: InstanceGuid
Internal_Icon_24x24
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
protected virtual Bitmap Internal_Icon_24x24 { get; }
Override this function to supply a custom icon. The result of this property is cached, so don't worry if icon retrieval is not very fast.
IsDataProvider
Overrides: GH_ActiveObject.IsDataProvider
IsPrincipal
Gets whether this parameter is a principal parameter. Principal parameters are maintained by components and are not part of the IGH_Param interface.
Keywords
Gets a list of additional keywords that describe the object. Typically this list is empty but you can override this property to aid in object searches.
Implements: Keywords
Kind
Gets the parameter kind. The kind is evaluated lazily and cached.
Implements: Kind
Locked
Gets or sets the enabled flag of this object. Disabled objects are ignored during solutions.
Implements: Locked
MutableNickName
Gets or sets a value that enables Nick name changes through the menu. The default is TRUE.
Implements: MutableNickName
Name
Gets or sets the name of the object. This field typically remains fixed during the lifetime of an object.
Implements: Name
NickName
Gets or sets the nickname of the object. This field can be changed by the user.
Implements: NickName
Obsolete
Gets whether this object is obsolete. Default implementation returns true if the class name contains the string "OBSOLETE" or if this class has been decorated with the ObsoleteAttribute. You are free to override this if you want, but I suggest adding the ObsoleteAttribute instead.
Implements: Obsolete
Optional
Gets or sets whether or not this parameter is considered optional by the owner component. Empty, non-optional parameters prevent the component from being solved.
Implements: Optional
PersistentData
Gets the persistent data stored in this parameter. If you modify the persistent data, be sure to call the: OnObjectChanged(GH_ObjectEventType.PersistentData) event.
PersistentDataCount
Gets the number of persistent data items stored in this parameter.
Phase
Gets or sets the solution phase this object is currenly in.
Implements: Phase
ProcessorTime
Overrides: GH_ActiveObject.ProcessorTime
ProxySourceCount
Gets the number of proxy sources for this parameter. Proxy sources are used during file IO, when actual sources might not be available yet. Once an IO operation has been completed there should be no more proxy sources.
Returns: The number of proxy sources associated with this parameter.
Implements: ProxySourceCount
Recipients
Gets a list of all the recipients of this parameter. I.e. a recipient has this parameter as one of the sources. The Recipient list is maintained by the parameter, do not modify it yourself.
Implements: Recipients
Implements: Reverse
RuntimeMessageLevel
Returns the worst case flag for the current object
If the object contains at least 1 error, the result is Error.
If the object contains at least 1 warning, the result is Warning.
If the object contains at least 1 message, the result is Remark.
If the object contains no errors, no warnings and no messages, the result is Blank.
Implements: RuntimeMessageLevel
Implements: Simplify
Implements: SourceCount
Sources
Gets a list of source parameters. Do not modify this list, if you wish to add or remove sources, use dedicated functions like AddSource() and RemoveSource() instead.
Returns: The sources for this parameter.
Implements: Sources
StateTags
Gets all the StateTags that are associated with this parameter. A state tag is a visual feedback icon that represents specific internal settings.
Implements: StateTags
SubCategory
Gets or sets the SubCategory in which this object belongs. If HasSubCategory() returns false, this field has no meaning.
Implements: SubCategory
Implements: Type
TypeName
Calls TypeName() on the first instance of T it can find. This is either an item in the volatile list, or a newly constructed instance.
Remarks: Override this for improved performance, but this function is only likely to be called from the GUI.
Implements: TypeName
VolatileData
Implements: VolatileData
VolatileDataCount
Implements: VolatileDataCount
WireDisplay
Gets or sets the wire display style for this parameter. Wire display only affects the wires connected to the parameter input.
Implements: WireDisplay
Methods
AddedToDocument
This method will be called when an object is added to a document. Override this method if you want to handle such events.
Parameters:
| document (GH_Document) | Document that now owns this object. |
Implements: AddedToDocument
AddPersistentData
obsoleteThis method has been superceded by SetPersistenData overloads
Utility function to add a new persistent data item. If the data is null or cannot be converted into T, this method will fail. You should probably use the PersistentData property to add type-safe data if you can.
Parameters:
| data (object) | Data to add. |
Returns: True on success, false on failure.
AddPersistentData
obsoleteThis method has been superceded by SetPersistenData overloads
Utility function to add a new persistent data item. If the data is null or cannot be converted into T, this method will fail. You should probably use the PersistentData property to add type-safe data if you can.
Parameters:
| data (T) | Data to add. |
Returns: True on success, false on failure.
AddRuntimeMessage
Add a new message to this object. Valid message type flags are Warning and Error. If the Message string is empty or zero-length no message is added.
Parameters:
| level (GH_RuntimeMessageLevel) | Type of message. Only Warnings and Errors are recorded. |
| text (string) | Content of message. |
Implements: AddRuntimeMessage
AddSource
Insert a new Source parameter into the Sources list. Sources provide this parameter with data at runtime.
AddSource
Append a new Source parameter to the end of the Sources list. Sources provide this parameter with data at runtime.
AddVolatileData
Inserts an item of volatile data into the data structure.
Parameters:
| path (GH_Path) | The branch path of the data. If the path doesn't exist yet, it will be created. |
| index (int) | The item index of the data. If the path doesn't contain the index yet, it will be enlarged to encompass the index. |
| data (object) | The data to store. |
Returns: True on success, False on failure. If the data cannot be converted, the topology will remain unmolested.
Implements: AddVolatileData
AddVolatileDataList
Parameters:
| path (GH_Path) | |
| list (IEnumerable) |
Implements: AddVolatileDataList
AddVolatileDataTree
Parameters:
| tree (GH_Structure<T>) |
AddVolatileDataTree
Parameters:
| tree (IGH_Structure) |
Implements: AddVolatileDataTree
Cast_Object
Attempts to convert the Object reference into an instance of T. This method will perform a direct cast if possible or it will call Casting functions on T or Data if they exist. Data will not be duplicated unless a type conversion is required.
Parameters:
| data (object) |
Returns: The cast value or Nothing on failure.
ClearData
public override void ClearData()
Overrides: GH_ActiveObject.ClearData
ClearProxySources
public virtual void ClearProxySources()
Remove all proxy sources without attempting to relink them.
Implements: ClearProxySources
ClearRuntimeMessages
public virtual void ClearRuntimeMessages()
Destroy all warning and error lists
Implements: ClearRuntimeMessages
CollectData
public sealed override void CollectData()
Overrides: GH_ActiveObject.CollectData
CollectVolatileData_Custom
protected sealed override void CollectVolatileData_Custom()
Overrides: GH_Param<T>.CollectVolatileData_Custom
CollectVolatileData_FromSources
protected virtual void CollectVolatileData_FromSources()
This method collects volatile data from all the source parameters.
ComputeData
public sealed override void ComputeData()
Overrides: GH_ActiveObject.ComputeData
ConnectNewObject
Parameters:
| obj (IGH_DocumentObject) |
ConversionCallback
This method is called whenever a successful conversion takes place from some source data into local target data. Override it if you wish to keep tabs on conversions.
Parameters:
| source (object) | Source data (never null). |
| target (T) | Target data (never null). |
CopyFrom
Copy all fields (except the instance ID) from another instance description.
Parameters:
| other (IGH_InstanceDescription) | Object to mimic. |
CreateAttributes
public override void CreateAttributes()
Overrides: GH_DocumentObject.CreateAttributes
CreateProxySources
public virtual void CreateProxySources()
Convert all proper source parameters into proxy sources.
Implements: CreateProxySources
DependsOn
Parameters:
| potential_source (IGH_ActiveObject) |
Overrides: GH_ActiveObject.DependsOn
DestroyIconCache
protected void DestroyIconCache()
Call this method to erase the existing icon cache. You must call this if you want to change the display icon of an object.
DocumentContextChanged
This method will be called when the document that owns this object moves into a different context.
Parameters:
| document (GH_Document) | Document that owns this object. |
| context (GH_DocumentContext) | The reason for this event. |
Implements: DocumentContextChanged
ExpireDownStreamObjects
protected override void ExpireDownStreamObjects()
Overrides: GH_ActiveObject.ExpireDownStreamObjects
ExpireOwner
Utility method for expiring the owner component (if it exists).
ExpirePreview
Call this function when you suspect that the preview has expired for this object. This will cause the display cache to be eradicated.
Parameters:
| redraw (bool) |
Implements: ExpirePreview
ExpireSolution
Informs the document that owns this object that the solution has expired. The current object will be set to BLANK as a result. This method is recursive, it will also expire any and all objects which depend on this object. If you want a less destructive expiration, consider using ClearData(). If this object is already Blank, you should consider not expiring it.
Parameters:
| recompute (bool) | If True, the document will be instructed to solve the new state. |
Overrides: GH_DocumentObject.ExpireSolution
ExpireSolutionTopLevel
Invoke the Expiresolution(bool) method on the toplevel object.
Parameters:
| recompute (bool) | If true, a new computation will start right away. |
Format
Returns "Null" if the data is a null reference, otherwise calls ToString() on the Data instance.
Parameters:
| Data (T) |
GetValue
Get a boolean value from the component value table.
GetValue
Get a color value from the component value table.
GetValue
Get a double value from the component value table.
GetValue
Get an integer value from the component value table.
GetValue
Get a string value from the component value table.
HtmlHelp_Source
Return a String which contains HTML formatted source for the help topic. If you want to pass a URL that points to a remote page, then prefix the URL with a GOTO: tag, like so: GOTO:http://www.YourWebAddressHere.com
Remarks: You can use the GUI.GH_HtmlFormatter class to generate an HTML page which conforms to Grasshopper Help standards
IsolateObject
public override void IsolateObject()
Overrides: GH_DocumentObject.IsolateObject
MovedBetweenDocuments
This method will be called when an object is moved from one document to another. Override this method if you want to handle such events.
Parameters:
| oldDocument (GH_Document) | Document that used to own this object. |
| newDocument (GH_Document) | Document that now owns ths object. |
Implements: MovedBetweenDocuments
NewInstanceGuid
public void NewInstanceGuid()
Generate a new random instance GUID
Implements: NewInstanceGuid
NewInstanceGuid
Set the instance ID to be a specific GUID. This is very dangerous, only use this function if you're 6"4' and your first name is David.
Parameters:
| UUID (Guid) |
Implements: NewInstanceGuid
OnAttributesChanged
public void OnAttributesChanged()
Raises the AttributesChanged event on the toplevel object.
Implements: OnAttributesChanged
OnDisplayExpired
Raises the DisplayExpired event on the toplevel object.
Parameters:
| redraw (bool) | If True, the canvas will be immediately redrawn. |
Implements: OnDisplayExpired
OnObjectChanged
Parameters:
| e (GH_ObjectChangedEventArgs) |
Implements: OnObjectChanged
OnObjectChanged
Parameters:
| eventType (GH_ObjectEventType) | |
| tag (object) |
Implements: OnObjectChanged
OnObjectChanged
Parameters:
| eventType (GH_ObjectEventType) |
Implements: OnObjectChanged
Implements: OnObjectChanged
OnObjectChanged
Parameters:
| customEvent (string) |
Implements: OnObjectChanged
OnPingDocument
Raise the PingDocument Event on the toplevel object and try to find the document which owns this object.
Returns: The document which owns this object if successful, or nothing if no document owns this object.
Implements: OnPingDocument
OnPreviewExpired
Raises the PreviewExpired event on the toplevel object.
Parameters:
| redraw (bool) | If True, the viewports will be immediately redrawn. |
Implements: OnPreviewExpired
OnSolutionExpired
Raises the SolutionExpired event on the toplevel object. You probably want to call ExpireSolution() instead of this method directly.
Parameters:
| recompute (bool) | If True, the solution will be immediately recalculated. |
Implements: OnSolutionExpired
OnVolatileDataCollected
protected virtual void OnVolatileDataCollected()
Once volatile data has been collected this method will be calles. The basic implementation does nothing, but you can add code here to post-process or analyze the volatile data.
PostProcessData
Apply data post-processes (simplify, reverse, graft, flatten etc. as well as overridden processes).
Implements: PostProcessData
PrepareForPrompt
protected virtual void PrepareForPrompt()
Preview_ComputeClippingBox
This function can be used to iterate over all items in the Volatile data tree and collect the union clipping box of all non-null items that implement Preview.IGH_PreviewData. This function requires a lot of TypeOf and DirectCasting, so if you're worried about performance you should consider doing this yourself.
Returns: The clipping box for all valid items.
Preview_DrawMeshes
This function can be used to iterate over all items in the Volatile data tree and call DrawViewportWires on each item that implements Preview.IGH_PreviewData. This function requires a lot of TypeOf and DirectCasting, so if you're worried about performance you should consider doing this yourself.
Parameters:
| args (IGH_PreviewArgs) |
Preview_DrawWires
This function can be used to iterate over all items in the Volatile data tree and call DrawViewportWires on each item that implements Preview.IGH_PreviewData. This function requires a lot of TypeOf and DirectCasting, so if you're worried about performance you should consider doing this yourself.
Parameters:
| args (IGH_PreviewArgs) |
Prompt_ManageCollection
Parameters:
| values (GH_Structure<T>) |
Prompt_Plural
#Parameters:
| values (ref List<ModelLineWidth>) |
Overrides: GH_PersistentParam<T>.Prompt_Plural
Prompt_Singular
#Parameters:
| value (ref ModelLineWidth) |
Overrides: GH_PersistentParam<T>.Prompt_Singular
Parameters:
| reader (GH_IReader) |
Overrides: GH_Param<T>.Read
ReadFull
GH_InstanceDescription does not by default serialize all fields. Use this function to read all fields from the archive. This method is compatible with the default Write()/Read() operations.
Parameters:
| reader (GH_IReader) | Writer for deserialization. |
Returns: True on success, false on failure.
RecordPersistentDataEvent
Add an undo record that stores changes to persistent data.
Parameters:
| name (string) | Name of undo record. |
RecordUndoEvent
Record a specific object change undo event.
Parameters:
| undoName (string) | Name of undo record. |
| action (IGH_UndoAction) | Undo action to record. |
Returns: The ID of the newly added record or Guid.Empty on failure.
Implements: RecordUndoEvent
RecordUndoEvent
Record a generic object change undo event.
Parameters:
| undoName (string) | Name of undo record. |
Returns: The ID of the newly added record or Guid.Empty on failure.
Implements: RecordUndoEvent
Parameters:
| record (GH_UndoRecord) | Record to push. |
Implements: RecordUndoEvent
RecoverFromPrompt
protected virtual void RecoverFromPrompt()
RegisterRemoteIDs
Override this function if you want object changes in the Rhino document to trigger a new solution.
Parameters:
| id_list (GH_GuidTable) | The object ID database Grasshopper is responsive to. |
Implements: RegisterRemoteIDs
RegisterRemoteIDsUtil
Utility function which treats all data in the Volatile cache as IGH_GeometricGoo and registers all referenced objects. Call this function from within RegisterRemoteIDs() if you are absolutely sure that all the items in volatiledata implement IGH_GeometricGoo.
Parameters:
| table (GH_GuidTable) |
RelinkProxySources
Attempt to replace all proxy sources with real sources. Proxy sources are used during file IO, when actual sources might not be available yet. Once an IO operation has been completed there should be no more proxy sources.
Parameters:
| document (GH_Document) | The document from which to harvest the real source parameters. |
Returns: True on success, false on failure.
Implements: RelinkProxySources
RemoveAllSources
public virtual void RemoveAllSources()
Remove all sources from this parameter.
Implements: RemoveAllSources
RemovedFromDocument
This method will be called when an object is removed from a document. Override this method if you want to handle such events.
Parameters:
| document (GH_Document) | Document that now no longer owns this object. |
Implements: RemovedFromDocument
RemoveEffects
public virtual void RemoveEffects()
Remove all post-process effects. Note to implementors, you must call the base method if you override this function.
Implements: RemoveEffects
RemoveSource
Remove the specified source from this parameter.
Parameters:
| source_id (Guid) | InstanceID of source to remove. |
Implements: RemoveSource
RemoveSource
Remove the specified source from this parameter.
Parameters:
| source (IGH_Param) | Source to remove. |
Implements: RemoveSource
Render_AppendGeometry
This function has been emptied because it is Obsolete.
Parameters:
| args (GH_RenderArgs) |
ReplaceSource
Replace an existing source with a new one. If the old_source does not exist in this parameter, nothing happens.
Implements: ReplaceSource
ReplaceSource
Replace an existing source with a new one. If the old_source does not exist in this parameter, nothing happens.
Implements: ReplaceSource
RuntimeMessages
Gets the list of cached runtime messages that were recorded during solver-time processes.
Parameters:
| level (GH_RuntimeMessageLevel) | Runtime message type to retrieve. |
Returns: A list of runtime message strings.
Implements: RuntimeMessages
Script_AddPersistentData
[EditorBrowsable(EditorBrowsableState.Never)]
public void Script_AddPersistentData(List<object> data)
Method used primarily for COM_Access code.
Script_ClearPersistentData
Method used primarily for COM_Access code.
SDKCompliancy
Test whether this object is compliant with a given Rhino version.
Parameters:
| exeVersion (int) | Rhino major release (4, 5, ...). |
| exeServiceRelease (int) | Rhino minor (service) release. |
Returns: True if this object is compliant with the given Rhino release.
Implements: SDKCompliancy
SetIconOverride
public void SetIconOverride(Bitmap customIcon)
Set a new custom icon override for this object.
Parameters:
| customIcon (Bitmap) | Icon override. Should be a 24x24 image. |
SetPersistentData
Assign a tree of items to the persistent data. This method will erase any existing data, record an undo event, raise the OnObjectChanged event for PersistentData flags and place a call to ExpireSolution(False). If you want to add a tree of data, you should use the appropriate overload for this method.
Parameters:
| items (GH_Structure<T>) | Items to add. |
SetPersistentData
Assign a list of items to the persistent data. This method will erase any existing data, record an undo event, raise the OnObjectChanged event for PersistentData flags and place a call to ExpireSolution(False). If you want to add a tree of data, you should use the appropriate overload for this method.
Parameters:
| items (IEnumerable<T>) | Items to add. |
SetPersistentData
Add a collection of values to the persistent data.
Parameters:
| values (params object[]) | Values to add. |
SetPersistentData
public void SetPersistentData(T item)
Add a single item to the persistent data. This method will record an undo event, raise the OnObjectChanged event for PersistentData flags and place a call to ExpireSolution(False). If you want to add more than one piece of data, you should use the appropriate overload for this method.
Parameters:
| item (T) | Item to add. |
SetPrincipal
Set the principal parameter state.
SetValue
Set a named value. This value will be serialized with the component.
SetValue
Set a named value. This value will be serialized with the component.
SetValue
Set a named value. This value will be serialized with the component.
SetValue
Set a named value. This value will be serialized with the component.
SetValue
Set a named value. This value will be serialized with the component.
TriggerAutoSave
public void TriggerAutoSave()
Triggers the AutoSave function on the owner document with the object_changed flag.
Implements: TriggerAutoSave
TriggerAutoSave
Triggers the AutoSave function on the owner document with a custom flag.
Parameters:
| trigger (GH_AutoSaveTrigger) | Reason for the autosave operation. It is possible that a user has decided to avoid autosave events for specific types, so if you can, try and provide a correct trigger flag. |
| id (Guid) | ID of autosave event. Consecutive autosave requests with the same ID will be ignored. |
Implements: TriggerAutoSave
TriggerAutoSave
Triggers the AutoSave function on the owner document with a custom flag.
Parameters:
| trigger (GH_AutoSaveTrigger) | Reason for the autosave operation. It is possible that a user has decided to avoid autosave events for specific types, so if you can, try and provide a correct trigger flag. |
Implements: TriggerAutoSave
TriggerAutoSave
Triggers the AutoSave function on the owner document with the object_changed flag.
Parameters:
| id (Guid) | ID of autosave event. Consecutive autosave requests with the same ID will be ignored. |
Implements: TriggerAutoSave
ValuesChanged
protected virtual void ValuesChanged()
Override this method if you want to respond to changes to the value table. The base implementation is empty, so you don't have to call it.
VolatileDataDescription
This method is called to populate the Tooltip data description field.
Parameters:
| writer (GH_IWriter) |
Overrides: GH_Param<T>.Write
WriteFull
GH_InstanceDescription does not by default serialize all fields. Use this function to write all fields to the archive. This method is compatible with the default Write()/Read() operations.
Parameters:
| writer (GH_IWriter) | Writer for serialization. |
Returns: True on success, false on failure.
Events
AttributesChanged
Raised whenever the number or kind of attributes changes. This event is handled by GH_Documents who subsequently wipe their attribute caches.
Implements: AttributesChanged
DisplayExpired
Raised whenever the display (on the Canvas) of a certain object becomes invalid.
Implements: DisplayExpired
ObjectChanged
Implements: ObjectChanged
PingDocument
Raised whenever an object needs to know which GH_Document it belongs to.
Implements: PingDocument
PreviewExpired
Raised whenever the display (in the Rhino viewports) of a certain object becomes invalid.
Implements: PreviewExpired
SolutionExpired
Raised whenever the solution of a certain object becomes invalid.
Implements: SolutionExpired