MultiObjectWrapper

DocumentObject
public sealed class MultiObjectWrapper : DocumentObject
An object which can contain a collection of IDocumentObjects which together represent the full migration of a GH1 object. This object should never be added to a document as it is a meaningless object except within the context of migrating. Only construct this type when you wish to return more than one object from a migrator. implementation.

Constructors

MultiObjectWrapper

#
Create a new object wrapper around multiple objects.
public MultiObjectWrapper(
title,
If not null, a group with this username will be created for all objects.
params IDocumentObject[]
objects
Objects to encapsulate. Duplicate and subsidiary objects will automatically be removed from this list.
)

Properties

Activity

Gets or sets the active state of this object. Note that this property is meaningless for certain types of object.
public ObjectActivity Activity { get; set; }
inherited fromDocumentObject
Activity

Attributes

Gets or sets the attributes for this object.
public IAttributes Attributes { get; }
inherited fromDocumentObject
Attributes

ChildrenObjects

Gets all immediate child objects that belong to the current object. It is possible that an object does not have any children, and it is possible that a child object has children of its own.
public virtual IEnumerable<IDocumentObject> ChildrenObjects { get; }
inherited fromDocumentObject
ChildrenObjects

Connectivity

#
public override IObjectConnectivity Connectivity { get; }

CustomValues

Gets a collection of keyed values which can be used to store custom data which will survive (de)serialisation.
public KeyedValues CustomValues { get; }
inherited fromDocumentObject
CustomValues

Display

Gets or sets the display state of this object. Note that this property is meaningless for certain types of object.
public ObjectDisplay Display { get; set; }
inherited fromDocumentObject
Display

DisplayCapable

Gets whether this object makes allowance for 3D viewport displays.
public virtual bool DisplayCapable { get; }
inherited fromDocumentObject
DisplayCapable

DisplayName

Gets the display name of this object. Often the DisplayName is identical to the UserName, but there could be more complicated algorithms involved.
public virtual string DisplayName { get; }
inherited fromDocumentObject
DisplayName

DisplayStyle

Gets or sets the display style to use for the geometric data inside this object. Note that this property is meaningless for certain types of object.
public ObjectDisplayStyle DisplayStyle { get; set; }
inherited fromDocumentObject
DisplayStyle

Document

Gets or sets the document this object belongs to. It is possible an object does not belong to any document, however it can never belong to more than one document simultaneously.
public Document Document { get; set; }
inherited fromDocumentObject
Document

EntireFamily

Enumerates over all objects in the hierarchy this object is part of. This enumeration starts at the root object and then continues over all children and grandchildren in a breadth-first fashion.
public IEnumerable<IDocumentObject> EntireFamily { get; }
inherited fromDocumentObject
EntireFamily

FoundingObject

Gets the root or founding object in the object hierarchy. If the current object does not have a parent, it is a founding object.
public IDocumentObject FoundingObject { get; }
inherited fromDocumentObject
FoundingObject

Icon

Gets the icon associated with this object.
public IIcon Icon { get; }
inherited fromDocumentObject
Icon

IconInternal

Override this method to provide an icon for this object. If the icon is an embedded resource in this assembly with the same name as the class, it will automatically be loaded. The DocumentObject.Icon property calls this property and caches the result.
protected virtual IIcon IconInternal { get; }
inherited fromDocumentObject

InstanceId

Gets or sets the instance Id for this object. The instance Id should be different for every instance of every type. Do *not* assign this Id unless you know exactly what you are doing.
public Guid InstanceId { get; set; }
inherited fromDocumentObject
InstanceId

Nomen

Gets the user friendly description of this object.
public Nomen Nomen { get; }
inherited fromDocumentObject
Nomen

Objects

#
Gets all objects contained in this wrapper.
public IDocumentObject[] Objects { get; }

Obsolete

Gets whether this object is considered obsolete.
public bool Obsolete { get; }
inherited fromDocumentObject
Obsolete

ParentObject

Gets or sets the parent object that owns this object. Top-level objects do not have parents. Do not assign or remove parents unless you know exactly what you are doing.
public IDocumentObject ParentObject { get; set; }
inherited fromDocumentObject
ParentObject

Phase

Gets the current solution phase of this object.
public virtual Phase Phase { get; }
inherited fromDocumentObject
Phase

ProgressPercentage

Gets the progress as a percentage. If this object is currently not calculating a new solution, this number is not meaningful.
public int ProgressPercentage { get; }
inherited fromDocumentObject
ProgressPercentage

Relevance

Gets or sets the auxiliary state of this object. Auxiliary objects are drawn in an inconspicuous way as they are considered in-between logic. Note that this property is meaningless for certain types of object.
public ObjectRelevance Relevance { get; set; }
inherited fromDocumentObject
Relevance

Selected

Gets the main yes/no state from the SelectionState.
public bool Selected { get; }
inherited fromDocumentObject
Selected

Selection

Gets or sets the selected state of this object. Note that the selected setting of secondary objects is inherited from the parent.
public ObjectSelection Selection { get; set; }
inherited fromDocumentObject
Selection

SiblingObjects

Gets all sibling objects in the object family tree.
public IEnumerable<IDocumentObject> SiblingObjects { get; }
inherited fromDocumentObject
SiblingObjects

State

#
public override ObjectSolutionState State { get; }

UserName

Gets the user specified name of this object.
public string UserName { get; set; }
inherited fromDocumentObject
UserName

Methods

Add

#
public void Add()

AddAngle

#
Create an [Angle From Radians] or [Angle From Degrees] component and hook it up to the appropriate input.
public Component AddAngle(
name,
Name and index of input parameter to hook up.
source
Grasshopper 1 angle parameter.
)
Component which was added.

AddAngleOutput

#
Create a [Decompose Angle] behind a Grasshopper 2 angle output, so consumers still receive plain numbers.
public Component AddAngleOutput(
name,
Name and index of the Grasshopper 2 angle output.
source
Grasshopper 1 angle output.
)
Component which was added, or null if it could not be created.

AddUndoRecord

Add a custom undo record for this object.
public void AddUndoRecord(
Record
record
Undo record to add.
)
inherited fromDocumentObject
Id of undo record.
AddUndoRecord

AddUndoRecord

Add a single action undo record for this object.
public void AddUndoRecord(
name,
Name of undo record.
action
Specific action to undo.
)
inherited fromDocumentObject
Id of undo record.
AddUndoRecord

AppendBakeInput

Append the baking input panel.
protected void AppendBakeInput()
inherited fromDocumentObject

AppendStateInput

Append the 'Enabled' and 'Display' states to this input panel.
protected void AppendStateInput(
panel,
Panel to append to.
enabledState,
If true, the Enabled state button will be modifiable.
displayState
If true, the Display state button will be modifiable.
)
inherited fromDocumentObject

AppendToInputPanel

Override this method to populate the popover panel. The base implementation does not add any panel inputs, however the DocumentObject class does provide a slew of protected utility methods for adding standard inputs.
public virtual void AppendToInputPanel()
inherited fromDocumentObject
AppendToInputPanel

AppendUserNameInput

Append the user name text box within a category labelled 'Attributes'.
protected void AppendUserNameInput()
inherited fromDocumentObject

ChangeInstanceIds

public void ChangeInstanceIds()
inherited fromDocumentObject

Compute

#
public override SolutionData Compute(
solution,
stack
)

Connect

#
Connect and align two of the objects in this wrapper.
public void Connect(
source,
Source object name. Append '[index]' if a specific output is required.
target,
Target object name. Append '[index]' if a specific input is required.
verticalMotion = 0,
Vertical difference between source and target.
align = true
False to leave both objects where they are.
)

CreateAttributes

#
protected override IAttributes CreateAttributes()

DisplayBounds

Gets the bounds of the geometry this object might display.
public virtual BoundingBox DisplayBounds()
inherited fromDocumentObject
DisplayBounds

DisplayFaces

Draw the shaded faces for this object.
public virtual void DisplayFaces(
pipeline,
guises,
extents
)
inherited fromDocumentObject
DisplayFaces

DisplayWires

Draw the wires for this object.
public virtual void DisplayWires(
pipeline,
guises,
extents
)
inherited fromDocumentObject
DisplayWires

Expire

#
public override void Expire()

ExpireDisplay

Expire the attributes and raise the DisplayChanged event.
protected void ExpireDisplay()
inherited fromDocumentObject

Extract

#
Transfer the output properties of the gh1 parameter to the specified output.
public IParameter Extract(
name,
Name with index of output.
source
Gh1 parameter to harvest properties from.
)
The output parameter of the named component.

Find

#
Find the object in this wrapper with the given name.
public IDocumentObject Find(
name
)

Find

#
Find the input parameter in this wrapper with the given name.
public IParameter Find(
inputIndex,
name
)

Find

#
Find the output parameter in this wrapper with the given name.
public IParameter Find(
name,
outputIndex
)

GetCreationInfo

Gets information about who created this component and when.
public bool GetCreationInfo(
out string
name,
Name of creator.
time
Time of creation in UTC coordinates.
)
inherited fromDocumentObject
True if the creation data was available.
GetCreationInfo

GetModificationInfo

Gets information about who last modified this component and when.
public bool GetModificationInfo(
out string
name,
Name of modifier.
time
Time of modification in UTC coordinates.
)
inherited fromDocumentObject
True if the modification data was available.

InvalidateExistingLayout

Invalidate the attribute layout, but only if the attributes already exist.
protected void InvalidateExistingLayout()
inherited fromDocumentObject

ModifyIcon

Override the icon for this object. Use this judiciously.
public void ModifyIcon(
newIcon,
New icon to assign, or null to revert to the default icon.
overrideExtrinsicIcon = true
If true, the permanent extrinsic icon will be overwritten. If false, the temporary intrinsic icon will be overwritten.
)
inherited fromDocumentObject
ModifyIcon

ModifyNameAndInfo

Programmatically modify the nickname, name and/or info strings on the Nomen.
public void ModifyNameAndInfo(
name = null,
New name if not null.
info = null
New info if not null.
)
inherited fromDocumentObject
ModifyNameAndInfo

OnDisplayChanged

public void OnDisplayChanged()
inherited fromDocumentObject
OnDisplayChanged

OnExpired

Raise the Expired event.
protected internal void OnExpired()
inherited fromDocumentObject

OnLayoutChanged

public void OnLayoutChanged()
inherited fromDocumentObject
OnLayoutChanged

OverrideAttributes

Assign new attributes to this object. Not all attributes may be accepted, it depends on the implementation.
public bool OverrideAttributes(
attributes
New attributes to assign. Assigning null will revert to default attributes.
)
inherited fromDocumentObject
True if attributes were accepted.
OverrideAttributes

RequestAutoSave

Request an autosave.
public AutoSaveResult RequestAutoSave(
reason,
Autosave reason.
autosaveId
Autosave Id. Consecutive requests with identical Ids are ignored.
)
inherited fromDocumentObject
RequestAutoSave

RequestAutoSave

Request an autosave using the instance ID of this object as a filter. This means hat subsequent autosave requests coming from the same object will be ignored.
public AutoSaveResult RequestAutoSave(
reason
Autosave reason.
)
inherited fromDocumentObject
RequestAutoSave

SetCreationInfo

Set the CreatedBy and CreatedAt fields if they haven't been set already.
public void SetCreationInfo()
inherited fromDocumentObject
SetCreationInfo

SetModificationInfo

Set the ModifiedBy and ModifiedAt fields.
public void SetModificationInfo()
inherited fromDocumentObject

SetProgressPercentage

Set the DocumentObject.ProgressPercentage field directly. The percentage is automatically limited to the [0, 100] interval.
public void SetProgressPercentage(
percentage
)
inherited fromDocumentObject

SetProgressPercentage

Set the DocumentObject.ProgressPercentage field based on a step count. This method always limits the percentage to the [1, 99] range, as 0% and 100% are oftentimes indicative of unstarted or completed processes, which probably gives the wrong impression.
public void SetProgressPercentage(
partial,
Current step.
total
Total steps.
)
inherited fromDocumentObject

Store

Serialise this object.
public virtual void Store(
writer
)
inherited fromDocumentObject
Store

UpdateDisplay

Recreate the display caches based on the given solution data and display rules.
public virtual void UpdateDisplay(
data,
Data from which to extract display caches.
rules,
Optional display rules.
token
Cancellation token.
)
inherited fromDocumentObject
UpdateDisplay

Events

ActivityChanged

Raised whenever the Enabled state of this object changes.
public event EventHandler<ObjectEventArgs> ActivityChanged
inherited fromDocumentObject
ActivityChanged

AutosaveRequested

Raised whenever this object requests an autosave.
public event EventHandler<ObjectAutoSaveEventArgs> AutosaveRequested
inherited fromDocumentObject
AutosaveRequested

DisplayChanged

Raised whenever the display state of this object changes.
public event EventHandler<ObjectEventArgs> DisplayChanged
inherited fromDocumentObject
DisplayChanged

DocumentChanged

Raised whenever this object becomes part of a different document.
public event EventHandler<ObjectDocumentEventArgs> DocumentChanged
inherited fromDocumentObject
DocumentChanged

Expired

Raised whenever the solution currently held by this object is expired.
public event EventHandler<ObjectEventArgs> Expired
inherited fromDocumentObject
Expired

InstanceIdChanged

Raised whenever the InstanceId of this object changes.
public event EventHandler<ObjectGuidEventArgs> InstanceIdChanged
inherited fromDocumentObject
InstanceIdChanged

LayoutChanged

Raised whenever the layout of this object changes. Layout invalidation triggers a canvas redraw.
public event EventHandler<ObjectEventArgs> LayoutChanged
inherited fromDocumentObject
LayoutChanged

NameChanged

Raised whenever the UserName of this object changes. This typically infers that the DisplayName also changes.
public event EventHandler<ObjectNameEventArgs> NameChanged
inherited fromDocumentObject
NameChanged

RelevanceChanged

Raised whenever the Auxiliary state of this object changes.
public event EventHandler<ObjectEventArgs> RelevanceChanged
inherited fromDocumentObject
RelevanceChanged

SelectedChanged

Raised whenever the Selected state of this object changes.
public event EventHandler<ObjectEventArgs> SelectedChanged
inherited fromDocumentObject
SelectedChanged