Autodesk.Revit.DB.SpatialElementType 是 Revit API 中的一个类,用于描述在 Revit 建模环境中的空间元素类型。空间元素是建筑物中的任何可用于空间管理或空间规划的元素,例如房间、区域、标记和分区。
Autodesk.Revit.DB.SpatialElementType 类具有以下属性:
CategoryId: 获取或设置空间元素的 ElementId,表示其所属的 Revit Category。HasAssociatedPlanView: 获取或设置一个值,该值指示此类型的空间元素是否需要计划视图。IsRoom: 获取或设置一个值,该值指示此类型的空间元素是否为房间类型。Name: 获取或设置空间元素的名称。Autodesk.Revit.DB.SpatialElementType 类具有以下方法:
Equals: 确定当前 SpatialElementType 对象是否等于指定对象。GetHashCode: 获取此 SpatialElementType 实例的哈希代码。以下代码显示如何在 Revit API 中创建一个新的 SpatialElementType 并设置其属性:
SpatialElementType roomType = new SpatialElementType("My custom room type");
roomType.CategoryId = new ElementId(BuiltInCategory.OST_Rooms);
roomType.IsRoom = true;
roomType.HasAssociatedPlanView = true;
Autodesk.Revit.DB.SpatialElementType 类提供对于空间元素类型的描述和控制的功能。开发人员可以使用该类来定制建筑物中的空间元素类型,以满足项目特定的需求。