Open alas2 opened 3 years ago
I just tested an example: #266940= IFCPROPERTYSINGLEVALUE('Weight',$,IFCMASSMEASURE(0.89336550494179),$);
It is read correctly.
Please check again, and use a debugger to reproduce a possible problem. If the problem persists, please provide the complete IFC file.
Thanks.
The file that I have is very large and it is difficult to reduce it.
By looking at the IFC++ code, the sample you have should work fine as IFCQUANTITYWEIGHT reads doubles... etc different than IFCPROPERTYSINGLEVALUE.
void IfcPropertySingleValue::readStepArguments( const std::vector
IfcValue::createObjectFromSTEP( args[2], map ) { ... // call readSelectType( arg, result_object, map ); // This function take care whether the value is IFCMASSMEASURE(0.89336550494179) or 0.89336550494179 }
While IfcQuantityWeight
void IfcQuantityWeight::readStepArguments( const std::vector
Within this function fcMassMeasure::createObjectFromSTEP( args[3], map ) { // Call readReal( arg, type_object->m_value );
}
inline void readReal( const std::wstring& attribute_value, double& target ) { target = std::stod( attribute_value ); // Here is the bug if you have IFCMASSMEASURE(0.89336550494179) }
IFCQUANTITYWEIGHT -Not Read.zip
Please find attached file where IFCQUANTITYWEIGHT are NOT read. The issue same as mentioned alas2 commented on Dec 1, 2020 in all the above functions.
Am hoping this will be fixed as every time we update the library we have to keep track of our local changes to fix this.
Best regards,
IfcMassMeasure is not defined as SELECT data type:
TYPE IfcMassMeasure = REAL; END_TYPE;
Whereas IfcValue is defined as SELECT type:
TYPE IfcValue = SELECT (IfcDerivedMeasureValue ,IfcMeasureValue ,IfcSimpleValue); END_TYPE;
SELECT types need the explicit type written out like this:
Because otherwise it wouldn't be clear which one it is. For MassMeasure that is not the case, it is always a real number.
I can implement a change for all classes derived from IfcPhysicalSimpleQuantity, but currently that is not a priority
For example, '#74= IFCQUANTITYWEIGHT('GrossWeight',$,$,IFCMASSMEASURE(196000.),$);'
readReal() in ReaderUtil.h expects double only i.e. 196000. not IFCMASSMEASURE(196000.). The same applies for readInteger(), readLogical(), readBool(), and readIntegerValue()