From 32dfd423dbf6487e7308969f241ffdda38f31adb Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Wed, 3 Jan 2018 16:08:18 +0100 Subject: [PATCH] Fixed bug in IFC when dimensional exponent parameters in IfcSIUnits is not defined. Usually, the value of this parameter is derived from parents, but it is not always the case for some files. --- code/IFCReaderGen1.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/IFCReaderGen1.cpp b/code/IFCReaderGen1.cpp index d334e8322..d7753a841 100644 --- a/code/IFCReaderGen1.cpp +++ b/code/IFCReaderGen1.cpp @@ -2652,6 +2652,7 @@ template <> size_t GenericFill(const DB& db, const LIST& params, I size_t base = 0; if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcNamedUnit"); } do { // convert the 'Dimensions' argument std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } try { GenericConvert( in->Dimensions, arg, db ); break; } catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcNamedUnit to be a `IfcDimensionalExponents`")); }