Pins
ReferencesClass for maintaining all pins stuck into a cushion.
Constructors
Pins
#Deserialisation constructor.
Parameters:
| docObject (IDocumentObject) | Parent object. Must also implement the IPinCushion interface. |
| reader (IReader) | Deserialisation reader. |
Pins
#Create a new pin collection.
Parameters:
| docObject (IDocumentObject) | Parent object. Must also implement the IPinCushion interface. |
Properties
Object
#Gets the object this collection is associated with. The instance is guaranteed to implement the IPinCushion interface.
Indexers
Methods
BothAgree
#Gets whether both the pin and the object agree that they belong together. Note that if this method returns false, the objects are not in a valid state. Although it probably doesn't stop Grasshopper from solving the document, it is nevertheless a serious issue.
Parameters:
| pin (IPin) | |
| obj (IDocumentObject) |
CanBeAttachedTo
#Test whether a specific pin can be attached to a given object. This method will test not just whether the association is in principle allowed, but also whether there's room for the given pin.
Parameters:
| pin (IPin) | Pin. |
| obj (IDocumentObject) | Potential object. |
Returns: True if pin and object are compatible and available. This method returns true even if the specified pin is already attached to the object.
GetInsertionSlots
#public static IEnumerable<(RectangleF box, int index)> GetInsertionSlots(IDocumentObject obj, IPin pin)
Enumerate over all pinning slots for an object.
Parameters:
| obj (IDocumentObject) | Object to iterate over. |
| pin (IPin) | Optional pin for filtering. |
GetPin
#Find the most relevant pin which affects the object which owns this Pins instance. Note that this method also searches groups which wrap this object, as well as parent documents which host this document.
Parameters:
| pinId (Guid) | Id of pin to find. |
| pin (out IParameter) | Found pin. |
GetTree
#Find the most relevant instance of a pin of the given type and return its volatile data.
Parameters:
| solution (Solution) | Solution within which this request happens. |
| pinId (Guid) | Id of pin to find. |
| pin (out IParameter) | Parameter (i.e. pin) which was found. |
| tree (out ITree) | Volatile data tree. |
Returns: True if a pin was found and it has a tree.
GetTree<T>
#Find the most relevant instance of a pin of the given type and return its volatile data.
Parameters:
| solution (Solution) | Solution within which this request happens. |
| pinId (Guid) | Id of pin to find. |
| pin (out IParameter<T>) | Parameter (i.e. pin) which was found. |
| tree (out Tree<T>) | Volatile data tree. |
Returns: True if a pin was found and it has a tree.
IsCompatibleWith
#Tests whether a pin can in principle be attached to the given object.
Parameters:
| pin (IPin) | Pin. |
| obj (IDocumentObject) | Potential object. |
Returns: True if object and pin are compatible.
IsPinned
#Test whether a pin with the given type id is attached to this object.
IsPinned
#Test whether a specific pin is attached to this collection.
Pin
#Stick a pin into the given object at the given pinning index. This method also removes the pin from any object it is currently stuck into.
Parameters:
| pin (IPin) | |
| obj (IDocumentObject) | |
| index (int) | |
| undo (ActionList) |
Returns: True if a change was made which requires a new solution. All objects involved will be expired by this method.
ResolvePins
#Find all pins which affect the object which owns this Pins instance. This is limited to only those pins which are supported by the object. Note that this method also collects pins attached to groups which wrap this object, as well as any parent documents.
Unpin
#Detach a pin from whatever object it is attached to.
Parameters:
| pin (IPin) | |
| undo (ActionList) |
Returns: True if the pin was actually removed.