Search in sources :

Example 11 with IfcPropertySet

use of org.bimserver.models.ifc2x3tc1.IfcPropertySet in project BIMserver by opensourceBIM.

the class TestCreateProperties method createProperty.

private void createProperty(IfcWindow window, IfcModelInterface model, String name, String description, Object value) throws IfcModelInterfaceException {
    IfcRelDefinesByProperties ifcRelDefinesByProperties = model.create(IfcRelDefinesByProperties.class);
    window.getIsDefinedBy().add(ifcRelDefinesByProperties);
    IfcPropertySet propertySet = model.create(IfcPropertySet.class);
    ifcRelDefinesByProperties.setRelatingPropertyDefinition(propertySet);
    IfcPropertySingleValue property = model.create(IfcPropertySingleValue.class);
    propertySet.getHasProperties().add(property);
    property.setName(name);
    property.setDescription(description);
    if (value instanceof Boolean) {
        IfcBoolean ifcValue = model.create(IfcBoolean.class);
        ifcValue.setWrappedValue(((Boolean) value) ? Tristate.TRUE : Tristate.FALSE);
        property.setNominalValue(ifcValue);
    } else {
    // Unimplemented
    }
}
Also used : IfcPropertySingleValue(org.bimserver.models.ifc2x3tc1.IfcPropertySingleValue) IfcRelDefinesByProperties(org.bimserver.models.ifc2x3tc1.IfcRelDefinesByProperties) IfcBoolean(org.bimserver.models.ifc2x3tc1.IfcBoolean) IfcPropertySet(org.bimserver.models.ifc2x3tc1.IfcPropertySet) IfcBoolean(org.bimserver.models.ifc2x3tc1.IfcBoolean)

Aggregations

IfcPropertySet (org.bimserver.models.ifc2x3tc1.IfcPropertySet)11 IfcRelDefinesByProperties (org.bimserver.models.ifc2x3tc1.IfcRelDefinesByProperties)11 IfcPropertySetDefinition (org.bimserver.models.ifc2x3tc1.IfcPropertySetDefinition)9 IfcRelDefines (org.bimserver.models.ifc2x3tc1.IfcRelDefines)9 IfcProperty (org.bimserver.models.ifc2x3tc1.IfcProperty)6 IfcPropertySingleValue (org.bimserver.models.ifc2x3tc1.IfcPropertySingleValue)6 IfcCartesianPoint (org.bimserver.models.ifc2x3tc1.IfcCartesianPoint)4 IfcBoolean (org.bimserver.models.ifc2x3tc1.IfcBoolean)3 IfcValue (org.bimserver.models.ifc2x3tc1.IfcValue)3 URL (java.net.URL)2 HashSet (java.util.HashSet)2 IfcModelInterface (org.bimserver.emf.IfcModelInterface)2 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)2 SProject (org.bimserver.interfaces.objects.SProject)2 BimServerClientInterface (org.bimserver.plugins.services.BimServerClientInterface)2 UsernamePasswordAuthenticationInfo (org.bimserver.shared.UsernamePasswordAuthenticationInfo)2 Test (org.junit.Test)2 HashMap (java.util.HashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 NotImplementedException (org.apache.commons.lang3.NotImplementedException)1