AddToDocument Method


Adds a property set from a library to the document. The property set will be available for use even if the library is unloaded.

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

Syntax

C#
public PropertySetElement AddToDocument(
	string name,
	Document document,
	bool overwrite
)
Visual Basic
Public Function AddToDocument ( _
	name As String, _
	document As Document, _
	overwrite As Boolean _
) As PropertySetElement
Visual C++
public:
PropertySetElement^ AddToDocument(
	String^ name, 
	Document^ document, 
	bool overwrite
)

Parameters

name
Type: System String
The name of the property set in the library to add to the document. Will also become the name of the property set element created in the document.
document
Type: Autodesk.Revit.DB Document
The document to which the property set will be added.
overwrite
Type: System Boolean
If true, any existing property set with the given name will be overwritten.

Return Value

The new PropertySetElement.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException No property set with the given name exists in the library.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException a PropertySetElement with the given name already exists and the overwrite flag is false.

See Also