InstanceDefinitionTableAdd Method (String, String, String, String, Point3d, IEnumerableGeometryBase, IEnumerableObjectAttributes, Boolean) |
Adds an instance definition to the instance definition table, optionally replacing an
existing definition of the same name.
Namespace:
Rhino.DocObjects.Tables
Assembly:
RhinoCommon (in RhinoCommon.dll)
Syntaxpublic int Add(
string name,
string description,
string url,
string urlTag,
Point3d basePoint,
IEnumerable<GeometryBase> geometry,
IEnumerable<ObjectAttributes> attributes,
bool overrideExisting
)
Public Function Add (
name As String,
description As String,
url As String,
urlTag As String,
basePoint As Point3d,
geometry As IEnumerable(Of GeometryBase),
attributes As IEnumerable(Of ObjectAttributes),
overrideExisting As Boolean
) As Integer
Parameters
- name
- Type: SystemString
The definition name. - description
- Type: SystemString
The definition description. - url
- Type: SystemString
A URL or hyperlink. When overriding, null leaves the existing value unchanged and an
empty string clears it.
- urlTag
- Type: SystemString
A description of the URL or hyperlink. When overriding, null leaves the existing value
unchanged and an empty string clears it.
- basePoint
- Type: Rhino.GeometryPoint3d
A base point. - geometry
- Type: System.Collections.GenericIEnumerableGeometryBase
An array, a list or any enumerable set of geometry. - attributes
- Type: System.Collections.GenericIEnumerableObjectAttributes
An array, a list or any enumerable set of attributes. - overrideExisting
- Type: SystemBoolean
If true and a definition with this name exists, its geometry, description and URL are
replaced. The definition keeps its index, id, name and user data, and every existing
instance reference keeps its transform. Linked and reference definitions cannot be
replaced this way, and -1 is returned for those, as it is for geometry that would make
the definition reference itself.
If false, a name already in use is an error: -1 is returned and a message naming the
definition is printed to the command line.
Return Value
Type:
Int32
>=0 index of instance definition in the instance definition table. -1 on failure.
See Also