revit二次开发之选择实体的某个面

 

 

UIApplication uiApp = commandData.Application;
Autodesk.Revit.ApplicationServices.Application application = uiApp.Application;
UIDocument uiDocument = uiApp.ActiveUIDocument;
Document document = uiDocument.Document;

Selection selection = uiDocument.Selection;  

Reference bridgeFace = selection.PickObject(ObjectType.Face, "选面");  //选择面类型

Element face = document.GetElement(bridgeFace);  //实体

Face downFace = face.GetGeometryObjectFromReference(bridgeFace) as Face; //

Face pf = downFace as PlanarFace;  //这个就是最后的Face面

return Result.Succeeded;

 

posted @ 2018-10-25 21:37  邢韬  阅读(1678)  评论(0编辑  收藏  举报