IDataAccess
ReferencesInterface used for accessing input and output data from within Component.Process methods.
Properties
CustomData
#Gets the custom data where you can put values which are supposed to end up in the SolutionData.CustomData storage.
Methods
AccessIn
#Gets the access associated with the specified input parameter.
Parameters:
| index (int) | Index of input parameter. |
Returns: Access of input parameter.
AccessOut
#Gets the access associated with the specified output parameter.
Parameters:
| index (int) | Index of output parameter. |
Returns: Access of output parameter.
AddError
#Add an error message to the object solution.
Parameters:
| text (string) | Error message. |
| details (string) | In depth explanation. |
| actions (params MessageAction[]) | Available actions for this message. |
AddError
#Add an error message to the object solution.
Parameters:
| text (string) | Error message. |
| details (string) | In depth explanation. |
| actions (params MessageDelegate[]) | Available actions for this message. |
AddError
#Add an error message to the object solution.
AddMessage
#Add a constructed message to the object solution.
Parameters:
| message (Message) | Message to add. |
AddRemark
#Add a remark to the object solution.
Parameters:
| text (string) | Remark message. |
| details (string) | In depth explanation. |
| actions (params MessageAction[]) | Available actions for this message. |
AddRemark
#Add a remark to the object solution.
Parameters:
| text (string) | Remark message. |
| details (string) | In depth explanation. |
| actions (params MessageDelegate[]) | Available actions for this message. |
AddRemark
#Add a remark to the object solution.
AddWarning
#Add a warning message to the object solution.
Parameters:
| text (string) | Warning message. |
| details (string) | In depth explanation. |
| actions (params MessageAction[]) | Available actions for this message. |
AddWarning
#Add a warning message to the object solution.
Parameters:
| text (string) | Warning message. |
| details (string) | In depth explanation. |
| actions (params MessageDelegate[]) | Available actions for this message. |
AddWarning
#Add a warning message to the object solution.
CoverageIn
#Gets the coverage for the given input associated with this iteration.
Parameters:
| index (int) |
CoverageOut
#Gets the coverage for the given output associated with this iteration.
Parameters:
| index (int) |
GetCurve
#Gets a pairing of an item and its associated curve assistant. If no assistant is available, this method will append an error message and throw.
GetIndex
#Gets an integer describing the index within a collection.
GetIndexing
#Gets the indexing modifier associated with the specified input parameter. For this request to work, the input must be of type IntegerParameter and the IntegerParameter.IsIndex property must be set to true. If that's not the case an exception will be thrown.
Parameters:
| index (int) |
GetIndices
#Gets a collection of integers describing the indices within a collection.
GetIPear
#Gets the item+meta data IPear from the specified input parameter. For this method to not throw exceptions the IParameter.Access of the associated parameter must be set to Access.Item.
Parameters:
| index (int) | Index of parameter. |
| pear (out IPear) | Pear containing item value and meta data will be returned here. This is a reference to the actual item, do not modify it unless you know exactly what you are doing. |
Returns: True if item and/or data are not null.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Item. |
GetIPears
#Gets an array of IPear instances from the specified input. This method works both when the IParameter.Access of the parameter is set to Access.Item or Access.Twig.
GetIPears
#Get pears out of every specified input. This requires that each specified input has Access.Item access.
GetIPears
#Get pears out of every input. This requires that each input has Access.Item access.
GetIPearWithCurveAssistant
#Gets the item+meta data IPear and its associated curve assistant. If no assistant is available, this method will append an error message and throw.
Parameters:
| index (int) | Index of parameter. |
| pear (out IPear) | Pear will be return here. |
| assistant (out ICurveAssistant) | Assistant associated with item type. |
Returns: True if the item is not null and an assistant could be found.
GetIPearWithSurfaceAssistant
#Gets the item+meta data IPear and its associated surface assistant. If no assistant is available, this method will append an error message and throw.
Parameters:
| index (int) | Index of parameter. |
| pear (out IPear) | Pear will be return here. |
| assistant (out ISurfaceAssistant) | Assistant associated with item type. |
Returns: True if the item is not null and an assistant could be found.
GetIPearWithTypeAssistant
#Gets the item+meta data IPear and its associated type assistant. If no assistant is available, this method will append an error message and throw.
Parameters:
| index (int) | Index of parameter. |
| pear (out IPear) | Pear will be return here. |
| assistant (out ITypeAssistant) | Assistant associated with item type. |
Returns: True if the item is not null and an assistant could be found.
GetItem<T>
#Gets the item from the specified pin.
Parameters:
| pinId (Guid) | TypeId of pin. |
| value (out T) | Pin value will be returned here. This is a reference to the actual item, do not modify it unless you know exactly what you are doing. |
Returns: True if pin of the given type was attached and it had a value.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the pin is not Access.Item. |
GetItem<T>
#Gets the item from the specified input parameter.
Parameters:
| index (int) | Index of parameter. |
| value (out T) | Item value will be returned here. This is a reference to the actual item, do not modify it unless you know exactly what you are doing. |
Returns: True if item is not null.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Item. |
GetItemArray<T>
#Gets the item array from the specified input parameter.
Parameters:
| index (int) | Index of parameter. |
| items (out T[]) | Array of all items (including all nulls) will be returned here. These are references to the actual items, do not modify them unless you know exactly what you are doing. |
Returns: True if array is not empty.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Twig. |
GetItemWithCurveAssistant
#Gets an item and its associated curve assistant. If no assistant is available, this method will append an error message and throw.
Parameters:
| index (int) | Index of parameter. |
| value (out object) | Item value will be return here. |
| assistant (out ICurveAssistant) | Assistant associated with item type. |
Returns: Always true.
GetItemWithSurfaceAssistant
#Gets an item and its associated surface assistant. If no assistant is available, this method will append an error message and throw.
Parameters:
| index (int) | Index of parameter. |
| value (out object) | Item value will be return here. |
| assistant (out ISurfaceAssistant) | Assistant associated with item type. |
Returns: Always true.
GetItemWithTypeAssistant
#Gets an item and its associated type assistant. If no assistant is available, this method will append an error message and throw.
Parameters:
| index (int) | Index of parameter. |
| value (out object) | Item value will be return here. |
| assistant (out ITypeAssistant) | Assistant associated with item type. |
Returns: Always true.
GetITree
#Gets the data tree from the specified input parameter.
Returns: True if a tree was available.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Tree. |
GetITwig
#Gets the tree twig from the specified input parameter.
Parameters:
| index (int) | Index of parameter. |
| twig (out ITwig) | Twig will be returned here. This is a reference to the actual twig, do not modify it unless you know exactly what you are doing. |
Returns: True if twig is not empty.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Twig. |
GetLanguage
#Gets the language locale for this component. This will either harvest the data from an attached LinguisticCulturePin or it will return Language.Invariant.
Parameters:
| language (out Language) |
Returns: True if the language is specified via a pin.
GetMeta
#Gets the meta data (if any) associated with the item. You could access the data using GetPear<T>(int, Pear<T>), which has meta data embedded.
Parameters:
| index (int) | Index of parameter. |
Returns: True if item is not null.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Item. |
GetMetaArray
#Gets the meta data array from the specified input parameter.
Parameters:
| index (int) | Index of parameter. |
| metas (out MetaData[]) | Array of meta data associated with each item. |
Returns: True if array is not empty.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Twig. |
GetNull
#Gets whether the item is considered a null value. If you are accessing the items using GetItem<T>(int, T), and T is a value type, you must check for null this way. Or you could access the data using GetPear<T>(int, Pear<T>), which has null state embedded.
Parameters:
| index (int) | Index of parameter. |
Returns: True if item is not null.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Item. |
GetNullArray
#Gets the null array from the specified input parameter.
Parameters:
| index (int) | Index of parameter. |
| nulls (out bool[]) | Array of booleans indicating whether each item is assumed to be null. This is only meaningful if the data consists of value types. |
Returns: True if array is not empty.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Twig. |
GetPear<T>
#Gets the item+meta data pear from the specified input parameter. For this method to not throw exceptions the Access of the associated parameter must be set to Item.
Parameters:
| index (int) | Index of parameter. |
| pear (out Pear<T>) | Pear containing item value and meta data will be returned here. This is a reference to the actual item, do not modify it unless you know exactly what you are doing. |
Returns: True if item and/or data are not null.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Item. |
GetPears<T>
#Gets an array of Pear<T> instances from the specified input. This method works both when the IParameter.Access of the parameter is set to Access.Item or Access.Twig.
GetPointsInPlane
#Gets a set of three dimensional points and their projection onto a two-dimensional plane.
Parameters:
| planeParameter (int) | Index of plane parameter. Parameter IParameter.Requirement may be any Requirement. If no plane was provided, a plane will be fitted to the 3d points. |
| pointParameter (int) | Index of point parameter. This must be a twig parameter. |
| plane (out Plane) | Plane, harvested or fitted. |
| points3 (out Point3d[]) | Three dimensional points without any nulls. |
| points2 (out Point2d[]) | Projections of three dimensional points onto plane. |
Returns: True on success, false on failure.
GetQuaternion
#Gets the quaternion stored in the specified input parameter. If the value is not a quaternion based transformation an error will be appended and false will be returned.
Parameters:
| index (int) | |
| quaternion (out Quaternion) |
GetSingularTreeValue<T>
#Gets the one and only non-null value out of an input tree. If the tree contains zero or more-than-one non-null values, an error will be added.
GetTolerance
#Gets the angular tolerance for this iteration. This will either harvest the data from an attached AngularTolerancePin or it will retrieve the angular tolerance of the current Rhino document.
Parameters:
| angularTolerance (out Angle) |
Returns: True if tolerance was reliably retrieved, false if it's a fallback value.
GetTolerance
#Gets the absolute tolerance for this iteration. This will either harvest the data from an attached AbsoluteTolerancePin or it will retrieve the absolute tolerance of the current Rhino document.
GetTolerance
#Gets the absolute tolerance for this iteration. This will either harvest the data from an attached AbsoluteTolerancePin or it will retrieve the absolute tolerance of the current Rhino document.
Parameters:
| absoluteTolerance (out double) | Absolute tolerance. |
Returns: True if tolerance was reliably retrieved, false if it's a fallback value.
GetTransform
#Gets the proper transformation stored in the specified input parameter. Use this method if you do not wish to have to check whether the stored transformation represents a quaternion.
GetTree<T>
#Gets the data tree from the specified input parameter. For this method to not throw exceptions the Access of the associated parameter must be set to Tree.
Parameters:
| index (int) | Index of parameter. |
| tree (out Tree<T>) | Tree will be returned here. This is a reference to the actual tree, do not modify it unless you know exactly what you are doing. |
Returns: True is a tree was available.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Tree. |
GetTwig<T>
#Gets the tree twig from the specified input parameter. For this method to not throw exceptions the Access of the associated parameter must be set to Twig.
Parameters:
| index (int) | Index of parameter. |
| twig (out Twig<T>) | Twig will be returned here. This is a reference to the actual twig, do not modify it unless you know exactly what you are doing. |
Returns: True if twig is not empty.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the input parameter is not Access.Twig. |
GetUnitScaling
#Gets the unit system scaling factor for this iteration.
Parameters:
| unitSystemScaling (out double) | The scaling factor required to convert shapes specified in the associated unit system to the Rhino document unit system. |
Returns: True if there is an associated unit system pin.
GetUnitScaling
#Gets the unit system scaling factor for this iteration.
Parameters:
| baseSystem (UnitSystem) | The input unit system. |
| unitSystemScaling (out double) | The scaling factor required to go from your base system to the document system. |
Returns: True if a non-unit scaling factor is required.
GetUnitSystem
#Gets the unit system for this iteration. This will either harvest the data from an attached UnitSystemPin or it will retrieve the unit system of the current Rhino document.
Parameters:
| unitSystem (out UnitSystem) |
Returns: True if the unit system came from a pin override.
HasInputChanged
#Gets whether the specified input contains different data from the previous time this component was run. Note that it does not perform a value comparison, it only checks to see whether the volatile data inside the input parameter is the exact same Tree instance as it is now.
Parameters:
| index (int) | Index of input to check. |
Returns: True is the input now contains a different data tree than during the previous solution.
NameOut
#Gets the IDocumentObject.DisplayName of the indicated output parameter.
Parameters:
| index (int) |
RectifyDomain
#Make sure a number is within some domain.
Parameters:
| value (ref double) | Value to test. |
| interval ((double min, double max)) | Allowed domain. |
| name (string) | Parameter name. |
Returns: True if value did not need repairing.
RectifyDomain
#Make sure an integer is within some domain.
Parameters:
| value (ref int) | Value to test. |
| interval ((int min, int max)) | Allowed domain (inclusive lower and upper limits). |
| name (string) | Parameter name. |
Returns: True if value did not need repairing.
RectifyEnum<T>
#obsoleteConsider just using GetItem with the Enum type as constraint.
Test an integer to see if it is part of an enum.
RectifyLessThan
#Make sure a number is less than another number.
RectifyLessThan
#Make sure a number is less than another number.
RectifyLessThanOrEqualTo
#Make sure a number is less than or equal to another number.
RectifyLessThanOrEqualTo
#Make sure a number is less than or equal to another number.
RectifyNonNegative
#Make sure a number is at least zero.
RectifyNonNegative
#Make sure an integer is at least zero.
RectifyPositive
#Make sure a number is at least somewhat positive.
RectifyPositive
#Make sure a number is at least somewhat positive. Hard-cutoff in this method is 1e-6
RectifyPositive
#Make sure an integer is at least one.
SetItem
#Sets an item with some meta data to the specified output parameter.
Parameters:
| index (int) | Index of parameter. |
| value (object) | Value to assign. |
| meta (MetaData) | Meta data to include. |
Exceptions:
| AccessException | Thrown if the IParameter.Access of the output parameter is not Access.Item. |
SetItem
#Sets the item to the specified output parameter.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the output parameter is not Access.Item. |
SetPear
#Sets the item+meta data pear to the specified output parameter.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the output parameter is not Access.Item. |
SetProgress
#Typically the component progress just counts how many iterations have been completed out of the total set. However it is possible to provide more fine-grained progress feedback using this method. This is typically only sensible if the component performs a potentially long running process in each iteration such as brep solid operations or quad-remeshing, which is able to synchronously report on its own progress.
Parameters:
| percentage (int) | A value between zero and one-hundred indicating the progress for this iteration. |
SetTree
#Sets the data tree to the specified output parameter. It is the responsibility of the caller to ensure that multiple assigned trees are not inadvertendly merged. A tree prefix can be obtained from this IDataAccess instance to avoid that.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the output parameter is not Access.Tree. |
SetTwig
#Sets the twig to the specified output parameter.
Exceptions:
| AccessException | Thrown if the IParameter.Access of the output parameter is not Access.Twig. |
SetTwig<T>
#Sets the twig to the specified output parameter.
Parameters:
| index (int) | Index of parameter. |
| values (T[]) | Value to store in the twig. |
| metas (MetaData[] = null) | Optional meta data per item. |
| nulls (bool[] = null) | Optional null states per item. |
Exceptions:
| AccessException | Thrown if the IParameter.Access of the output parameter is not Access.Twig. |
TryTransform
#Try and apply a squishy deformation to the item and meta data inside a pear. This method calls GetTolerance(double) as part of its process, so the component that calls this should probably be a IPinCushion component which supports AbsoluteTolerancePin.
TryTransform
#Try and apply a linear transformation to the item and meta data inside a pear.
Verify<T>
#Apply a test to a value. This will automatically throw an exception if it doesn't pass.
VerifyAssistant
#Verify that a type assistant is available for a given value. If no assistant is available this method will throw.
Parameters:
| value (object) | Value to assist. |
| assistant (out ITypeAssistant) | Assistant for value, if any. |
VerifyCurveAssistant
#Verify that a curve assistant is available for a given value. If no assistant is available this method will throw.
Parameters:
| value (object) | Value to assist. |
| assistant (out ICurveAssistant) | Assistant for value, if any. |
VerifyDomain
#Make sure a number is within some domain. This will automatically throw an exception if it isn't.
Parameters:
| value (double) | Value to test. |
| interval ((double min, double max)) | Allowed domain. |
| name (string) | Parameter name. |
VerifyDomain
#Make sure an integer is within some domain. This will automatically throw an exception if it isn't.
Parameters:
| value (int) | Value to test. |
| interval ((int min, int max)) | Allowed domain (inclusive lower and upper bounds). |
| name (string) | Parameter name. |
VerifyEqualTwigItemCount
#Verify that two twigs have the same number of non-null values.
VerifyEqualTwigLeafCount
#Verify that two twigs have the same length.
VerifyNonCoincident
#Verify two points are not coincident.
VerifyNonCoincident
#Verify two points are not coincident.
VerifyNonCoincident
#Verify two points are not coincident.
VerifyNonCoincident
#Verify two points are not coincident.
VerifyNonColinear
#Verify three points are not coincident or collinear.
VerifyNonEmpty
#Verify an array is not null or empty.
VerifyNonEmpty
#Verify a string is not null or empty.
VerifyNonEqual
#Verify two numbers are not identical. This will automatically throw an exception if they aren't.
VerifyNonEqual
#Verify two numbers are not identical. This will automatically throw an exception if they aren't.
VerifyNonEqual
#Verify two numbers are not identical. This will automatically throw an exception if they aren't.
VerifyNonParallel
#Verify two vectors are not parallel or anti-parallel.
VerifyNonZeroVector
#Verify a vector does not have zero length.
VerifySurfaceAssistant
#Verify that a surface assistant is available for a given value. If no assistant is available this method will throw.
Parameters:
| value (object) | Value to assist. |
| assistant (out ISurfaceAssistant) | Assistant for value, if any. |
VerifyTwigItemCount
#Verify that a twig contains a specific number of non-null values.
VerifyTwigLeafCount
#Verify that a twig contains a specific number of values (both nulls and non-nulls).