| Revit 2016 API |
| Document..::..NewLoadCase Method |
| Document Class See Also |
Creates a new instance of a LoadCase element within the project.
Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 16.0.0.0 (16.0.0.0)
Syntax
| C# |
|---|
[ObsoleteAttribute("This method is obsolete in Revit 2016. Use LoadCase.Create() instead.")] public LoadCase NewLoadCase( string name, LoadNature nature, Category category ) |
| Visual Basic |
|---|
<ObsoleteAttribute("This method is obsolete in Revit 2016. Use LoadCase.Create() instead.")> _ Public Function NewLoadCase ( _ name As String, _ nature As LoadNature, _ category As Category _ ) As LoadCase |
| Visual C++ |
|---|
[ObsoleteAttribute(L"This method is obsolete in Revit 2016. Use LoadCase.Create() instead.")] public: LoadCase^ NewLoadCase( String^ name, LoadNature^ nature, Category^ category ) |
Parameters
- name
- Type: System..::..String
The not empty name for the Load Case Element to create.
- nature
- Type: Autodesk.Revit.DB.Structure..::..LoadNature
The Load Case nature.
- category
- Type: Autodesk.Revit.DB..::..Category
The Load Case category.
Return Value
If successful, NewLoadCase and there isn't the Load Case Element with the same name returns an object for the newly created LoadCase. If such element exist and match desired one (has the same nature and number), returns existing element. Otherwise nullNothingnullptra null reference (Nothing in Visual Basic) is returned.
Exceptions
| Exception | Condition |
|---|---|
| Autodesk.Revit.Exceptions..::..InvalidOperationException | If the product is not Revit Structure. |
| Autodesk.Revit.Exceptions..::..ArgumentException | Thrown if the load case nature does not exist in the given document. |