/*------------------------------------------------------------------------- * 功能描述:MBIDocument * 作者:xulisong * 创建时间: 2019/6/28 10:57:07 * 版本号:v1.0 * -------------------------------------------------------------------------*/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Autodesk.Revit.DB; using JBIM; using SAGA.RevitUtils; namespace RevitToJBim.MBI { /// /// 项目传输数据结构 /// public class MBIDocument { public string MBIName { get; set; } public string PlanName { get; set; } public Dictionary> Elements { get;private set; } /// /// 附加元素Elements信息 /// /// public void AttachElements(BimDocument document) { var bimObjects = document.BimObjects; var group = bimObjects.GroupBy(bim => bim.ElementType); Dictionary> dic = new Dictionary>(); foreach (var collection in group) { dic[collection.Key + "s"] = collection.ToList(); } Elements = dic; } public static MBIDocument CreateDocument(Document document) { MBIDocument dto = new MBIDocument(); dto.MBIName = "PjXXX_001";//待读取 dto.PlanName = document.GetUseView()?.Name; return dto; } } }