Creates a new material.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 18.0.0.0 (18.0.0.420)
Syntax
Return Value
Identifier of the new material.
Examples
CopyC#
ElementId materialId = Material.Create(document, "My Material");
Material material = document.GetElement(materialId) as Material;
StructuralAsset strucAsset = new StructuralAsset("My Property Set", StructuralAssetClass.Concrete);
strucAsset.Behavior = StructuralBehavior.Isotropic;
strucAsset.Density = 232.0;
PropertySetElement pse = PropertySetElement.Create(document, strucAsset);
material.SetMaterialAspectByPropertySet(MaterialAspect.Structural, pse.Id);
CopyVB.NET
Dim materialId As ElementId = Material.Create(document, "My Material")
Dim material__1 As Material = TryCast(document.GetElement(materialId), Material)
Dim strucAsset As New StructuralAsset("My Property Set", StructuralAssetClass.Concrete)
strucAsset.Behavior = StructuralBehavior.Isotropic
strucAsset.Density = 232.0
Dim pse As PropertySetElement = PropertySetElement.Create(document, strucAsset)
material__1.SetMaterialAspectByPropertySet(MaterialAspect.Structural, pse.Id)
Exceptions
See Also