Request

Response

    IElementDataModel.GetOrCreateDesignRef method

    Create-or-reuse a design keyed by a stable, connector-chosen sourceId. First call references seedElement’s design; subsequent calls with the same SourceId return the existing design and ignore seedElement/designName. Idempotent within a model build.

    public IDesign GetOrCreateDesignRef(IElement seedElement, string designName, string sourceId)
    
    parameterdescription
    seedElement The IElement whose design is referenced on first creation. Must already carry geometry/model hierarchy.
    designName A name for the design. Ignored if the design already exists.
    sourceId The design's source identifier — a stable id from the authoring application. The idempotency key, and the value surfaced as SourceId.

    Return Value

    The newly created or already-existing design.

    Remarks

    This is the design-reference API to use. A SourceId already in use returns that existing design rather than throwing, which is what makes the design SourceId a usable reuse key; on reuse seedElement and designName are ignored and the existing definition wins.

    See Also