使用函数 UF_MODL_ask_body_faces 和 UF_MODL_ask_body_edges 可能获取面和边.
先看效果:
代码:
var tag = selection0.GetSelectedObjects().OfType<Body>().First().Tag;var fs = GetBodyFaces(tag);var es = GetBodyEdges(tag);$"选择的体有{fs.Length}个面".NxListing();$"选择的体有{es.Length}个边".NxListing();public Tag[] GetBodyFaces(Tag body) {var theUf = UFSession.GetUFSession();theUf.Modl.AskBodyFaces(body, out Tag[] face_list);return face_list;}public Tag[] GetBodyEdges(Tag body) {var theUf = UFSession.GetUFSession();theUf.Modl.AskBodyEdges(body, out Tag[] edge_list);return edge_list;}