Material.Create Method

MaterialCreate Method

Creates a new material.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public static ElementId Create(
	Document document,
	string name
)
Public Shared Function Create ( 
	document As Document,
	name As String
) As ElementId
public:
static ElementId^ Create(
	Document^ document, 
	String^ name
)
static member Create : 
        document : Document * 
        name : string -> ElementId 

Parameters

document  Document
The document in which to create the material.
name  String
The name of the new material.

Return Value

ElementId
Identifier of the new material.
Exceptions
ExceptionCondition
ArgumentException name cannot include prohibited characters, such as "{, }, [, ], |, ;, less-than sign, greater-than sign, ?, `, ~". -or- The given value for name is already in use as a material element name.
ArgumentNullException A non-optional argument was null
See Also