AddConnectedAsset Method


Adds a new connected asset attached to this asset property, if it allows it.

Namespace: Autodesk.Revit.DB.Visual
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2018.1

Syntax

C#
public void AddConnectedAsset(
	string schema
)
Visual Basic
Public Sub AddConnectedAsset ( _
	schema As String _
)
Visual C++
public:
void AddConnectedAsset(
	String^ schema
)

Parameters

schema
Type: System String
The schema name.

Remarks

Cannot add a connected asset if one is already connected. Use RemoveConnectedAsset() to avoid an exception being thrown. A new preset asset is created and connected to the property. For "UnifiedBitmap", it contains an empty property unifiedbitmap_Bitmap.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The schema name is not valid.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions InvalidOperationException The asset property is not editable. -or- Cannot check validity for a property not being edited in AppearanceAssetEditScope. -or- Asset property is already connected to one asset.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →