Hi All,
What is the correct way to add a new pset to an ifc model?
I want all my ifc entities of type IfcBuildingElementProxy to have a pset called _TypeDataSpec with 3 properties. Each entity will then have different property values.
Do I need to create a pset for each entity or can I create one pset with these 3 properties and then assign a value for each element?
model = ifcopenshell.open(r'TPZ_Zone.ifc')
trees = model.by_type("IfcBuildingElementProxy")
for t in trees:
pset = ifcopenshell.api.run("pset.add_pset", model, product=t, name="TypeData_Spec")
treeId = t.Name.split('-')[0]
treeIndex = id.index(treeId)
ifcopenshell.api.run("pset.edit_pset", model, pset=pset, properties={"Tree Status": treeStatus[treeIndex],
"Tree Height": height[treeIndex],
"Tree Name" : name[treeIndex]
})
model.write(newFile)
This code will create 3 IFCPROPERTYSET. Can't I just have one IFCPROPERTYSET with different IFCPROPERTYSINGLEVALUE in it?
Thank you
Giovanni