Selaa lähdekoodia

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.

Leo Terziman 8 vuotta sitten
vanhempi
sitoutus
32dfd423db
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      code/IFCReaderGen1.cpp

+ 1 - 0
code/IFCReaderGen1.cpp

@@ -2652,6 +2652,7 @@ template <> size_t GenericFill<IfcNamedUnit>(const DB& db, const LIST& params, I
 	size_t base = 0;
 	size_t base = 0;
 	if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcNamedUnit"); }    do { // convert the 'Dimensions' argument
 	if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcNamedUnit"); }    do { // convert the 'Dimensions' argument
         std::shared_ptr<const DataType> arg = params[base++];
         std::shared_ptr<const DataType> arg = params[base++];
+		if (dynamic_cast<const UNSET*>(&*arg)) break;
         if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::IfcNamedUnit,2>::aux_is_derived[0]=true; break; }
         if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::IfcNamedUnit,2>::aux_is_derived[0]=true; break; }
         try { GenericConvert( in->Dimensions, arg, db ); 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`")); }
         catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcNamedUnit to be a `IfcDimensionalExponents`")); }