AddResource Method (String, IDictionary(String, String))


Adds an external resource to the folder path by supplying the resource name and reference information.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2015

Syntax

C#
public void AddResource(
	string resourceName,
	IDictionary<string, string> referenceInformation
)
Visual Basic
Public Sub AddResource ( _
	resourceName As String, _
	referenceInformation As IDictionary(Of String, String) _
)
Visual C++
public:
void AddResource(
	String^ resourceName, 
	IDictionary<String^, String^>^ referenceInformation
)

Parameters

resourceName
Type: SystemString
The unique short name of external resource.
referenceInformation
Type: System.Collections.GenericIDictionaryString, String
The (String, String) map containing reference or lookup information that will be stored in Revit.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The resourceName is not a valid resource name used to display in Revit external resource browse UI. The name should be a unique non-empty short name and it should not contain any invalid character of \\/:*?"<>|. The length of combined path(server name + folder path + resourceName) should not exceeds 259.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →