Create Method (Document, String, ElementId, LoadCaseCategory)


Creates a new LoadCase.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.484.0)
Since: 2016

Syntax

C#
public static LoadCase Create(
	Document document,
	string name,
	ElementId natureId,
	LoadCaseCategory loadCaseCategory
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	name As String, _
	natureId As ElementId, _
	loadCaseCategory As LoadCaseCategory _
) As LoadCase
Visual C++
public:
static LoadCase^ Create(
	Document^ document, 
	String^ name, 
	ElementId^ natureId, 
	LoadCaseCategory loadCaseCategory
)

Parameters

document
Type: Autodesk.Revit.DB Document
The Document to which new load case element will be added.
name
Type: System String
The name of the load case.
natureId
Type: Autodesk.Revit.DB ElementId
The load nature ID.
loadCaseCategory
Type: Autodesk.Revit.DB.Structure LoadCaseCategory
The predefined load case category.

Return Value

The newly created load case element if successful, a null reference ( Nothing in Visual Basic) otherwise.

Remarks

This method is designed to create LoadCase that is associated with one of the predefined category.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The given name is not unique.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration

See Also