该类用于设置Revit中Ordinate Dimension的起点符号的可见性。
ShowOrigin
: 控制Ordinate Dimension的起点符号是否可见。该类通常在通过编程方式自动创建和修改Revit文档时使用。以下是一个例子,设置Ordinate Dimension的起点符号可见性:
// 获取文档中所有的Ordinate Dimension
FilteredElementCollector collector = new FilteredElementCollector(doc);
ElementCategoryFilter categoryFilter = new ElementCategoryFilter(BuiltInCategory.OST_Dimensions);
List<Element> dimensions = collector.WherePasses(categoryFilter).ToList();
// 遍历每一个Ordinate Dimension,并将ShowOrigin属性设置为false
foreach (Element dimension in dimensions)
{
if (dimension is Dimension d)
{
if (d.DimensionShape == DimensionShapeType.SegmentAndTwoPoints)
{
OrdinateDimension ordinateDimension = dimension as OrdinateDimension;
ordinateDimension.OriginVisibility = OrdinateOriginVisibility.HideOrigin;
}
}
}