| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Quick reference for geometry types supported by the visualization system.
RevitDevTool can visualize all standard Revit geometry types directly in 3D views. Simply print the geometry object (Python) or use TraceGeometry.Show() (C#).
See complete examples:
Supported Types:
Python Example:
from Autodesk.Revit.DB import Line, Arc, XYZ
# Line
line = Line.CreateBound(XYZ(0, 0, 0), XYZ(10, 0, 0))
print(line)
# Arc
arc = Arc.Create(XYZ(0, 0, 0), 5, 0, 3.14, XYZ.BasisX, XYZ.BasisY)
print(arc)C# Example:
using Autodesk.Revit.DB;
using RevitDevTool.Visualization;
var line = Line.CreateBound(XYZ.Zero, new XYZ(10, 0, 0));
TraceGeometry.Show(line);
var arc = Arc.Create(XYZ.Zero, 5, 0, Math.PI, XYZ.BasisX, XYZ.BasisY);
TraceGeometry.Show(arc);See: CurveVisualization.cs, visualization_curve_script.py
Supported Types:
Python Example:
# Get face from element
options = Options()
geometry = element.get_Geometry(options)
for geo_obj in geometry:
if isinstance(geo_obj, Solid):
for face in geo_obj.Faces:
print(face) # Visualize each faceC# Example:
var options = new Options();
var geometry = element.get_Geometry(options);
foreach (var geoObj in geometry)
{
if (geoObj is Solid solid)
{
foreach (Face face in solid.Faces)
{
TraceGeometry.Show(face);
}
}
}See: FaceVisualization.cs
Description:
Python Example:
# Get solid from element
options = Options()
geometry = element.get_Geometry(options)
for geo_obj in geometry:
if isinstance(geo_obj, Solid) and geo_obj.Volume > 0:
print(geo_obj) # Visualize entire solidC# Example:
var options = new Options();
var geometry = element.get_Geometry(options);
foreach (var geoObj in geometry)
{
if (geoObj is Solid solid && solid.Volume > 0)
{
TraceGeometry.Show(solid);
}
}See: SolidVisualization.cs, visualization_solid_script.py
Description:
Python Example:
# Get mesh from element
options = Options()
geometry = element.get_Geometry(options)
for geo_obj in geometry:
if isinstance(geo_obj, Mesh):
print(geo_obj)C# Example:
var options = new Options();
var geometry = element.get_Geometry(options);
foreach (var geoObj in geometry)
{
if (geoObj is Mesh mesh)
{
TraceGeometry.Show(mesh);
}
}See: MeshVisualization.cs
Description:
Python Example:
from Autodesk.Revit.DB import XYZ
# Single point
point = XYZ(10, 20, 5)
print(point)
# Multiple points
points = [XYZ(0, 0, 0), XYZ(10, 0, 0), XYZ(10, 10, 0)]
for pt in points:
print(pt)C# Example:
using Autodesk.Revit.DB;
using RevitDevTool.Visualization;
// Single point
var point = new XYZ(10, 20, 5);
TraceGeometry.Show(point);
// Multiple points
var points = new List<XYZ>
{
XYZ.Zero,
new XYZ(10, 0, 0),
new XYZ(10, 10, 0)
};
foreach (var pt in points)
{
TraceGeometry.Show(pt);
}See: XYZVisualization.cs, visualization_xyz_script.py
Description:
Python Example:
# Get bounding box from element
bbox = element.get_BoundingBox(None)
if bbox:
print(bbox)
# Multiple elements
elements = FilteredElementCollector(doc).OfClass(Wall).ToElements()
for elem in elements:
bbox = elem.get_BoundingBox(None)
if bbox:
print(bbox)C# Example:
// Get bounding box from element
var bbox = element.get_BoundingBox(null);
if (bbox != null)
{
TraceGeometry.Show(bbox);
}
// Multiple elements
var elements = new FilteredElementCollector(doc)
.OfClass(typeof(Wall))
.ToElements();
foreach (var elem in elements)
{
var box = elem.get_BoundingBox(null);
if (box != null)
{
TraceGeometry.Show(box);
}
}Description: All geometry types can be visualized in collections:
Python:
# Mixed geometry types
geometries = [line1, face1, solid1, point1]
for geom in geometries:
print(geom)C#:
// Mixed geometry types
var geometries = new List<GeometryObject> { line1, face1, solid1 };
foreach (var geom in geometries)
{
TraceGeometry.Show(geom);
}| Back | FazBrowse Home | New Git URL |