|
发表于 2017-2-27 11:47:41
|
显示全部楼层
本帖最后由 ZFC 于 2017-2-27 11:52 编辑
您可以看看Level这个类,
private void GetLevelInformation(Autodesk.Revit.DB.Element element)
{
// Get the level object to which the element is assigned.
if (element.LevelId.Equals(ElementId.InvalidElementId))
{
TaskDialog.Show("Revit","The element isn't based on a level.");
}
else
{
Level level = element.Document.GetElement(element.LevelId) as Level;
// Format the prompt information(Name and elevation)
String prompt = "The element is based on a level.";
prompt += "\nThe level name is: " + level.Name;
prompt += "\nThe level elevation is: " + level.Elevation;
// Show the information to the user.
TaskDialog.Show("Revit",prompt);
}
}
还有ViewPlan两个结合着看看
|
|