xBimTeam / XbimEssentials

A .NET library to work with data in the IFC format. This is the core component of the Xbim Toolkit
https://xbimteam.github.io/
Other
486 stars 172 forks source link

[QUESTION] What is the most logical thing to do in a deprecated case between IFC2x3 and IFC4 #175

Closed liszto closed 6 years ago

liszto commented 6 years ago

Hello guys, sorry to bother you again with a one more question 😈 . But with my luck, I'm trying to parse a file that contained this :

7634= IFCELECTRICHEATERTYPE('1PJXy4VsH72xUAwt7RTlcE',#4001,'AirHeater_WAH11',$,$,(#7714,#7736,#7745,#7776),(#7632),'4674',$,.ELECTRICPOINTHEATER.);

But IFCELECTRICHEATERTYPE is now deprecated and can't be imported into an IFC4 project without any issue :/ Have you something in your project that allow us to port those specials cases into the IFC4 ? My first idea was to get the upper class (even if I don't know how to do it right now) so if this one is still in use I can rewrite the line with it and removing the useless part from the inherited type. Maybe it's quite dirty... :/

But when I read this lil' erratum : http://www.buildingsmart-tech.org/implementation/ifc-implementation/ifc-impl-agreements/cv-2x3-166

it doesn't seem to be as simple as I thought :/

If you have any idea on what is the cleanest way to do it ?

I-Sokolov commented 6 years ago

1) IFC4 CHANGE: Electric heaters formerly defined by IfcElectricHeaterType are now represented by IfcSpaceHeater with PredefinedType set to CONVECTOR

2) The agreement you linked refers to Coordination View but another MVD not necessary to follow it.

On my understanding if you import 2x3 to ifc4 you have to implement the conversion in your code. I do not see XbimEssential does it automatically.

martin1cerny commented 6 years ago

No, xBIM doesn't have any code to translate between IFC2x3 and IFC4 in either way. It only has IFC4 interfaces implemented on top of IFC2x3 classes to it is possible to work with both schemas in a uniform way. But it is not possible to save IFC2x3 to IFC4 and vice versa. I did think about doing that and this is one of the problems to solve to do it. I didn't do it in the end because it didn't fit in any project. It is doable but you will have to make several decisions like this.

liszto commented 6 years ago

Yeah indeed. That was just to be sure that you didn't have any convertion class between 2x3 and 4 to manage the changes present in the ifc4 when it's something that could definietly break the 2x3 file.

I will see to manage this.

So for you the most common thing is to create a project based on the fileschema of the first file you will merge ? Cause if you have to merge multiple ifc files with different fileschema you have to do a choice. For me it's to keep a merged file in the most recent fileschema revision but maybe i'm wrong on this point ? :/

martin1cerny commented 6 years ago

I think that is a good strategy because IFC4 has many more classes and is more coherent in the area of IfcElementType and IfcElement subtypes. So you will deal with less conversions from IFC2x3 to IFC4 than vice versa. Also, we already deal with the conversion of the actual data in IFC4 interfaces. You just need to resolve these IFC2x3 types which only map to abstract types in IFC4. The rest is all done already.

liszto commented 6 years ago

ok that's why I make this decision by converting from 2x3 to 4 you already did a lot of work for me :) And @I-Sokolov thanks for your answer that what I was thinking by reading the changes between 2x3 & 4. But I hesitated due to "IfcFlowTerminal" and "IfcSpaceHeaterType" possibility ! So... Time to work ! Thanks again for your answer !

martin1cerny commented 6 years ago

Are you planning to contribute your merge code to xBIM? Your kind of contribution would certainly be greatly appreciated.

liszto commented 6 years ago

As soon I have something stable yes indeed it's definietly something that could be usefull ! I think it will take some time to have something stable due to all specific cases. but as soon as I have something good (according to me) I will create a ticket or a pull request to discuss on a possible submission in your project @martin1cerny

martin1cerny commented 6 years ago

That would be great. I'm looking forward seeing something interesting :-)

liszto commented 6 years ago

Just to let you know @martin1cerny, my current merging process logic :

My next step are :

From a unity side (which is not important for you, but it is for me)