Request

Response

    IElementDataModel.AddElement method (1 of 2)

    Adds an element to the model. Use Classify and DefineType/SetType after adding the element to assign classification and type.

    public IElement AddElement(string sourceId, string name, Transformation transformation = null, 
        Unit lengthUnit = null, Unit displayLengthUnit = null)
    
    parameterdescription
    sourceId The element's source identifier — the Id of the corresponding object in the authoring connector/application. Becomes SourceId. Not guaranteed to be unique.
    name Display name of the element.
    transformation Optional 4x4 transformation (translation/rotation/scale).
    lengthUnit Length unit (defaults to Feet).
    displayLengthUnit Display length unit (defaults to Feet).

    Return Value

    The created element.

    Exceptions

    exceptioncondition
    ArgumentNullException Thrown when sourceId or name is null or empty.

    See Also


    IElementDataModel.AddElement method (2 of 2)

    Adds an element to the model under a parent element. Use Classify and DefineType/SetType after adding the element to assign classification and type.

    public IElement AddElement(string sourceId, string name, IElement parent, 
        Transformation transformation = null, Unit lengthUnit = null, Unit displayLengthUnit = null)
    
    parameterdescription
    sourceId The element's source identifier — the Id of the corresponding object in the authoring connector/application. Becomes SourceId. Not guaranteed to be unique.
    name Display name of the element.
    parent The parent element, or null for a top-level element.
    transformation Optional 4x4 transformation (translation/rotation/scale).
    lengthUnit Length unit (defaults to Feet).
    displayLengthUnit Display length unit (defaults to Feet).

    Return Value

    The created element.

    Exceptions

    exceptioncondition
    ArgumentNullException Thrown when sourceId or name is null or empty.
    ArgumentException Thrown when parent is not an SDK-provided IElement implementation.

    See Also