Extract an exhaustive list of property names for a given Pset with ifcopenshell

Hi,

I already posted this question but it seems it has vanished/disappeared after I made a simple edit while someone was answering it, so my apologies if it pops out from nowhere in the future as a duplicate of the current one. I will try to rephrase it but I couldn't remember some of my main thoughts.

Anyway...

For a given schema,
the same way pset_qto.get_applicable_names(ifc_class) works to extract available Psets for a given IFC class :

import ifcopenshell
pset_qto = ifcopenshell.util.pset.PsetQto("IFC4X3_ADD2")
base_psets = pset_qto.get_applicable_names("IfcWall")
base_psets
['Pset_ConcreteElementGeneral',
 'Pset_Condition',
 'Pset_ConstructionAdministration',
 'Pset_ConstructionOccurence',
 'Pset_ElementKinematics',
 'Pset_EnvironmentalCondition',
 'Pset_EnvironmentalImpactIndicators',
 'Pset_EnvironmentalImpactValues',
 'Pset_InstallationOccurrence',
 'Pset_MaintenanceStrategy',
 'Pset_MaintenanceTriggerCondition',
 'Pset_MaintenanceTriggerDuration',
 'Pset_MaintenanceTriggerPerformance',
 'Pset_ManufacturerOccurrence',
 'Pset_ManufacturerTypeInformation',
 'Pset_PrecastConcreteElementFabrication',
 'Pset_PrecastConcreteElementGeneral',
 'Pset_ReinforcementBarPitchOfWall',
 'Pset_RepairOccurrence',
 'Pset_Risk',
 'Pset_ServiceLife',
 'Pset_Tolerance',
 'Pset_Uncertainty',
 'Pset_WallCommon',
 'Pset_Warranty',
 'Qto_BodyGeometryValidation',
 'Qto_WallBaseQuantities']

how for a given Pset could I extract all its values defined by the current schema as a list or a tuple with ifcopenshell 0.8.0+ ?

For example:

pset_qto.get_pset_names("Pset_Risk")
['RiskName'
'RiskType'
'NatureOfRisk'
'RiskAssessmentMethodology'
'UnmitigatedRiskLikelihood'
'UnmitigatedRiskConsequence'
'UnmitigatedRiskSignificance'
'MitigationPlanned'
'MitigatedRiskLikelihood'
'MitigatedRiskConsequence'
'MitigatedRiskSignificance'
'MitigationProposed'
'AssociatedProduct'
'AssociatedActivity'
'AssociatedLocation']

Maybe a better option would be to output a dictionary with the properties' names as the keys and their data types as values. Just a thought...

Thanks.

Sign In or Register to comment.