SetDesiredReferenceData Method


Sets the ExternalFileReference information which Revit should use the next time it opens the document which this TransmissionData belongs to.

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

Syntax

C#
public void SetDesiredReferenceData(
	ElementId elemId,
	ModelPath path,
	PathType pathType,
	bool shouldLoad
)
Visual Basic
Public Sub SetDesiredReferenceData ( _
	elemId As ElementId, _
	path As ModelPath, _
	pathType As PathType, _
	shouldLoad As Boolean _
)
Visual C++
public:
void SetDesiredReferenceData(
	ElementId^ elemId, 
	ModelPath^ path, 
	PathType pathType, 
	bool shouldLoad
)

Parameters

elemId
Type: Autodesk.Revit.DBElementId
The id of the element associated with this reference.
path
Type: Autodesk.Revit.DBModelPath
A ModelPath indicating the location to load the external file reference from.
pathType
Type: Autodesk.Revit.DBPathType
A PathType value indicating what type of path the ModelPath is.
shouldLoad
Type: SystemBoolean
True if the external file should be loaded the next time Revit opens the document. False if it should be unloaded.

Remarks

There must already be a reference associated with the given id for this function to be valid. New references cannot be created in a closed file. See the documentation for a particular reference type to see its creation API.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException elemId does not correspond to an ExternalFileReference contained in this TransmissionData. -or- These inputs will not produce a valid ExternalFileReference.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration

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 →