博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
xBIM 多个IFC文件合并
阅读量:5952 次
发布时间:2019-06-19

本文共 2917 字,大约阅读时间需要 9 分钟。

     目录

    多个模型联合:统一访问数据,就好像是一个单一的模型,IFC 联合可以存储为IFC文件(在IfcStore中)

using System;using Xbim.Common.Step21;using Xbim.Ifc;using Xbim.Ifc4.Interfaces;namespace BasicExamples{    public class FederationExample    {        public void CreateFederation()        {            var editor = new XbimEditorCredentials            {                ApplicationDevelopersName = "You",                ApplicationFullName = "Your app",                ApplicationIdentifier = "Your app ID",                ApplicationVersion = "4.0",                //your user                EditorsFamilyName = "Santini Aichel",                EditorsGivenName = "Johann Blasius",                EditorsOrganisationName = "Independent Architecture"            };            using (var federation = IfcStore.Create(editor, IfcSchemaVersion.Ifc4, XbimStoreType.InMemoryModel))            {                 federation.AddModelReference("SampleHouse.ifc", "Bob The Builder", "Original Constructor"); //IFC4 文件                federation.AddModelReference("SampleHouseExtension.ifc", "Tyna", "Extensions Builder"); //IFC2x3  文件                Console.WriteLine($"Model is federation: {federation.IsFederation}");                Console.WriteLine($"Number of overall entities: {federation.FederatedInstances.Count}");                Console.WriteLine($"Number of walls: {federation.FederatedInstances.CountOf
()}"); foreach (var refModel in federation.ReferencedModels) { Console.WriteLine(); Console.WriteLine($" Referenced model: {refModel.Name}"); Console.WriteLine($" Referenced model organization: {refModel.OwningOrganisation}"); Console.WriteLine($" Number of walls: {refModel.Model.Instances.CountOf
()}"); } //保存IFC文件 federation.SaveAs("federation.ifc"); } } }}

控制台输出

Model is federation: TrueNumber of overall entities: 50303Number of walls: 8    Referenced model: SampleHouse.ifc    Referenced model organization: Bob The Builder    Number of walls: 5    Referenced model: SampleHouseExtension.ifc    Referenced model organization: Tyna    Number of walls: 3

保存为IFC文件的联合设置如下所示。这个惯例是xBIM 发明的。所以不能与其他的工具操作。

ISO-10303-21;HEADER;FILE_DESCRIPTION ((''), '2;1');FILE_NAME ('', '2016-10-27T13:14:43', (''), (''), 'Xbim File Processor version 3.2.0.0', 'Xbim version 3.2.0.0', '');FILE_SCHEMA (('IFC4'));ENDSEC;DATA;#1=IFCACTORROLE(.USERDEFINED.,'Original Constructor',$);#2=IFCORGANIZATION($,'Bob The Builder',$,(#1),$);#3=IFCDOCUMENTINFORMATION('1','SampleHouse.ifc',$,$,$,'XbimReferencedModel',$,$,#2,$,$,$,$,$,$,$,$);#4=IFCACTORROLE(.USERDEFINED.,'Extensions Builder',$);#5=IFCORGANIZATION($,'Tyna',$,(#4),$);#6=IFCDOCUMENTINFORMATION('2','SampleHouseExtension.ifc',$,$,$,'XbimReferencedModel',$,$,#5,$,$,$,$,$,$,$,$);ENDSEC;END-ISO-10303-21;

转载地址:http://mhaxx.baihongyu.com/

你可能感兴趣的文章
利用WCF改进文件流传输的三种方式
查看>>
程序员的素养
查看>>
Spring学习总结(2)——Spring的常用注解
查看>>
关于IT行业人员吃的都是青春饭?[透彻讲解]
查看>>
钱到用时方恨少(随记)
查看>>
mybatis主键返回的实现
查看>>
org.openqa.selenium.StaleElementReferenceException
查看>>
Android Intent传递对象为什么要序列化?
查看>>
数论之 莫比乌斯函数
查看>>
linux下查找某个文件位置的方法
查看>>
python之MySQL学习——数据操作
查看>>
Harmonic Number (II)
查看>>
长连接、短连接、长轮询和WebSocket
查看>>
day30 模拟ssh远程执行命令
查看>>
做错的题目——给Array附加属性
查看>>
Url.Action取消字符转义
查看>>
JQuery选择器大全
查看>>
Gamma阶段第三次scrum meeting
查看>>
python3之装饰器修复技术@wraps
查看>>
[考试]20150606
查看>>