XbimEssentials icon indicating copy to clipboard operation
XbimEssentials copied to clipboard

Saving to ifcXML

Open GVladislavG opened this issue 2 years ago • 3 comments

Hello, team!

I try to save my model to ifcXML. I get result file. But Revit can't read and load it. If I save the same model to simple IFC everything is OK. Files are in attached archive. Thank you! Files.zip

GVladislavG avatar Jun 15 '22 16:06 GVladislavG

As far as I'm aware we produce a valid XML based on the XSD validation. You can investigate Revit imported to see where the issue is. It is open source as well.

martin1cerny avatar Jun 16 '22 11:06 martin1cerny

I also have some more questions. xBim produce IFCXML according to IFC4ADD2 schema. Are the differences from IFC4ADD2TC1 schema critical? And is there any ability to change/choose XML-schema? If I need IFC4ADD2TC1-XML for example.

Thanks!

GVladislavG avatar Jun 23 '22 10:06 GVladislavG

The main issue lies in the XML/XSD itself. These two declare different unrelated namespaces. So, from the pure XSD point of view, it is just not the same thing. Saying so, the content should be largely compatible. By default, we use the XSD which is bound to the version of the standard implemented by the Toolkit. But you can use older settings to do what you are asking for:

using (var xml = XmlWriter.Create(path, new XmlWriterSettings { Indent = true }))
{
    var writer = new XbimXmlWriter4(XbimXmlSettings.IFC4Add1);
    writer.Write(model, xml);
    xml.Close();
}

martin1cerny avatar Jun 29 '22 16:06 martin1cerny