opensourceBIM / bimvie.ws

Javascript client for Building Information Modelling, using open standards like IFC, BCF and BIMSie. Using Bootstrap, BIM Surfer, etc..
GNU Affero General Public License v3.0
172 stars 87 forks source link

Cannot change NominalValue #41

Closed EVersluys closed 9 years ago

EVersluys commented 9 years ago

Trying to change a value of an ifcproperty. I am able to change the fieldname string value. Also to read the nominalvalue by Bimsie1LowLevelInterface.getStringAttribute.

But cannot change the NominalValue. What am I doing wrong?

Request: "request": { "interface": "Bimsie1LowLevelInterface", "method": "setStringAttribute", "parameters": { "tid": "7", "oid": "516948484", "attributeName": "NominalValue", "value": "125"

At commit transaction I get: "__type": "UserException", "message": "No attribute with the name \"NominalValue\" found in class \"IfcPropertySingleValue\""

Output of Bimsie1LowLevelInterface.getDataObjectByOid: { "response": { "result": { "__type": "SDataObject", "guid": "", "name": "", "oid": 516948484, "rid": 0, "type": "IfcPropertySingleValue", "values": [ { "__type": "SSimpleDataValue", "fieldName": "Name", "oid": -1, "rid": 0, "stringValue": "Vnr" }, { "__type": "SSimpleDataValue", "fieldName": "Description", "oid": -1, "rid": 0, "stringValue": null }, { "__type": "SListDataValue", "fieldName": "PropertyForDependance", "oid": -1, "rid": 0, "values": [] }, { "__type": "SListDataValue", "fieldName": "PropertyDependsOn", "oid": -1, "rid": 0, "values": [] }, { "__type": "SListDataValue", "fieldName": "PartOfComplex", "oid": -1, "rid": 0, "values": [] }, { "__type": "SSimpleDataValue", "fieldName": "NominalValue", "oid": -1, "rid": 0, "stringValue": "121" } ] } } }

rubendel commented 9 years ago

The type of the NominalValue property of IfcPropertySingleValue is IfcValue. IfcValue is a "Select" type, which means it can be any subtype of IfcValue. BIMserver needs to know the exact type of the value you are trying to set. To provide BIMserver with this information, you need to call setWrappedStringAttribute, which has 1 extra argument compared to setStringAttribute, and that is the type.

EVersluys commented 9 years ago

Thank you. It worked.