The Autodesk.Revit.DB.Visual.PlasticVinyl
class is a subclass of the Material
class in the Autodesk Revit API. It represents a plastic vinyl material that can be applied to building elements such as walls, floors, and ceilings.
The Autodesk.Revit.DB.Visual.PlasticVinyl
class has the following properties:
Color
: The color of the plastic vinyl material.Pattern
: The pattern of the plastic vinyl material, as defined by the Autodesk.Revit.DB.Visual.Pattern
enum.Reflectance
: The reflectance of the plastic vinyl material.Shininess
: The shininess of the plastic vinyl material.Smoothness
: The smoothness of the plastic vinyl material.The Autodesk.Revit.DB.Visual.PlasticVinyl
class does not have any additional methods beyond those provided by the Material
class.
The Autodesk.Revit.DB.Visual.PlasticVinyl
class provides a way to create and modify plastic vinyl materials in the Autodesk Revit API. These materials can be applied to building elements using the ElementMaterialPreviewUtils.SetElementMaterialPreview
method.
The following code example demonstrates how to create a new plastic vinyl material and apply it to a wall element:
// create a new plastic vinyl material
Visual.PlasticVinyl vinylMaterial = new Visual.PlasticVinyl();
vinylMaterial.Color = new Color(255, 255, 255); // white
vinylMaterial.Pattern = Visual.Pattern.Solid;
vinylMaterial.Reflection = 0.8f;
vinylMaterial.Shininess = 0.5f;
vinylMaterial.Smoothness = 0.2f;
// get the wall element to apply the material to
ElementId wallId = new ElementId(/* wall element id */);
Wall wall = document.GetElement(wallId) as Wall;
// apply the material to the wall
ElementMaterialPreviewUtils.SetElementMaterialPreview(wall, vinylMaterial);
In this example, a new Visual.PlasticVinyl
material is created with a pure white color, solid pattern, high reflection, medium shininess, and low smoothness. This material is then applied to a wall element using the ElementMaterialPreviewUtils.SetElementMaterialPreview
method.
Autodesk.Revit.DB.Material
Autodesk.Revit.DB.Visual.Pattern
Autodesk.Revit.DB.Visual