ifcquery / ifcplusplus

IfcPlusPlus is an open source C++ class model, as well as a reader and writer for IFC files in STEP format. Features: Easy and efficient memory management using smart pointers. Parallel reader for very fast parsing on multi-core CPU's. Additionally, there's a simple IFC viewer application, using Qt and OpenSceneGraph. It can be used as starting point for all kinds of applications around the open building model standard IFC.
http://www.ifcquery.com
MIT License
569 stars 210 forks source link

Supported IFC versions #85

Open dominichofer opened 6 years ago

dominichofer commented 6 years ago

Could you make a statement about the IFC-versions IFC++ is supporting, import and export? It looks like it's supporting IFC4Add2. Which looks like it's backwards compatible to IFC4 and IFC4Add1. But it also does a great job at importing IFC2x3. So, is IFC++ supposed to support the import of IFC2x3 or is this only based on the backward compatibility of IFC4 to IFC2x3?

I came across IfcDistributionChamberElement which has 8 parameters in IFC2x3 and 9 parameters in IFC3Add2. The 9th parameter has cardinality [0:1] but it results in a message "Wrong parameter count for entity IfcDistributionChamberElement, expecting 9, having 8.".

loebl commented 6 years ago

IFC++ supports only IFC4Add2 (4.0.2.0) Import of older versions is working on base of the compatibility between specifications (and possibly a few hacks in the parser, but they are rare and shouldn't be relied on). That means every entity that didn't change will still work.

In your example case the number of elements changed. The cardinality doesn't change the fact that the entity has to supply 9 attributes under IFC4. It means it can use the empty value ("$") for the 9th one.

As far as I know Core and Ressource elements are largely unchanged (chapters 5 and 8 in the spec , shared elements (chapter 6) work for the most part and domain-specific elements (chapter 7) are usually not expected to be compatible

ifcquery commented 6 years ago

I agree to the comment above. Most changed entities have just one more optional attribute at the end, so the parser just adds a "$" as empty value in case of a 2X3 file. That normally works fine. If not, I can fix it if you provide the example file.

If you want to write a 2X3 file, you need the class model generated for the 2X3 schema and a converter. I can do that with the class model and parser generator, please let me know when necessary.

ariaci commented 4 years ago

We also still need to write IFC2X3 TC1. Where can I find the class model generator to generate the source for IFC2X3 TC1? Formerly the generator was named IfcPlusPlusExtender and available using the following link: https://github.com/ifcquery/ifcplusplus/issues/41 ... but now there opens a chinese (?) page ...

Thanks in advance.

ifcquery commented 4 years ago

IFC4 is ISO standard since 2013, so there was plenty of time to update to IFC4. I can't think of a scenario where it makes sense to write out IFC2X3 files. The class and parser generator is not public domain, but I could generate a version of IFC++ for IFC2X3 if someone needs it.

dominichofer commented 4 years ago

Please don't. We ass well used to have lots of customers asking for IFC2X3. The major reasons for this was:

So for the love of progress, don't adopt an old standard. Move on! Update! Find an other solution and help the building industry make progress.

ifcquery commented 4 years ago

I totally agree ;)

claimred commented 4 years ago

The class and parser generator is not public domain, but I could generate a version of IFC++ for IFC2X3 if someone needs it.

As for IFC 2x3 TC1 code generation how do you recommend going forward with that, should one contact you by email?

Thanks!

ifcquery commented 4 years ago

Yes, we can discuss details via email: fbngerold (at) gmail.com

ifcquery commented 4 years ago

Version 4.0.2.1 and 4.0.2.0 have only tiny differences, there is just one added Type: TYPE IfcStrippedOptional = BOOLEAN; END_TYPE;

ifcquery commented 4 years ago

IFC4.1 (4.1.0.0) is definitely possible. We can discuss that via email too