How to properly specify a PEnum_ value with IfcOpenShell?

I'm trying to fill out the properties for PSet_Superelevation. The Side and TransitionSuperelevation properties are PEnum's.
Here is the line of code I'm using.

ifcopenshell.api.pset.edit_pset(file, pset=pset_superelevation, properties={"Side": side,"Superelevation":slope,"TransitionSuperelevation":"Linear"})

The resulting IFC is

#248=IFCPROPERTYSET('1r4PVnyen5EfW5cFgixdJC',$,'Pset_Superelevation',$,(#250,#251,#252));
#250=IFCPROPERTYSINGLEVALUE('Side',$,IFCLABEL('BOTH'),$);
#251=IFCPROPERTYSINGLEVALUE('Superelevation',$,IFCRATIOMEASURE(-0.02),$);
#252=IFCPROPERTYSINGLEVALUE('TransitionSuperelevation',$,IFCLABEL('Linear'),$);

As you can see, IfcLabel is used for the PEnum. The bSI validation service doesn't like this.

What is the correct way to specify a PEnum value?

Comments

  • try this:

    ifcopenshell.api.pset.edit_pset(file, pset=pset_superelevation, properties={"Side" : [side], "Superelevation" : slope, "TransitionSuperelevation" : ["Linear"]})

    steverugi
  • Awesome - thanks.... that did the trick

    #261=IFCREFERENT('3ab9bHdHX63e9AJ2UdN_mB',$,'Start End',$,$,#260,$,.SUPERELEVATIONEVENT.);
    #262=IFCPROPERTYSET('0$DzzfjaP4jf_fTLj00A6x',$,'Pset_Superelevation',$,(#265,#266,#268));
    #263=IFCRELDEFINESBYPROPERTIES('3N2IMWkyL04enHEoXwYbL3',$,$,$,(#261),#262);
    #264=IFCPROPERTYENUMERATION('Side',(IFCLABEL('BOTH'),IFCLABEL('LEFT'),IFCLABEL('RIGHT')),$);
    #265=IFCPROPERTYENUMERATEDVALUE('Side',$,(IFCLABEL('BOTH')),#264);
    #266=IFCPROPERTYSINGLEVALUE('Superelevation',$,IFCRATIOMEASURE(-0.02),$);
    #267=IFCPROPERTYENUMERATION('TransitionSuperelevation',(IFCLABEL('LINEAR')),$);
    #268=IFCPROPERTYENUMERATEDVALUE('TransitionSuperelevation',$,(IFCLABEL('LINEAR')),#267);
    
Sign In or Register to comment.