IFCファイルを作る/(7)プロパティセットとエンティテイの関係付け

2001年5月10日作成、2024年1月1日変更
三木(作成時、IAI設備FM分科会に所属)


(注)利用したIFCのバージョンは2.0。以降のバージョンでは差異がある。

◆プロパティセットとエンティテイの関係付け/IfcRelAssignsProperties

プロパティセットは、特定のエンティティの属性の入れ物である。 しかしながら、プロパティセットあるいはエンティティは、お互いを関係付けるための情報を持っていない。 そこで、これらを関係付けるために、特別な仕組みが必要になる。 これを行なうものが「IfcRelAssignsProperties」である。

'/// IfcRelAssignsPropertiesを追加 ///
'[2]または[3]に入れる
Dim objEntity
Set objEntity = objDesign.Add("IfcRelAssignsProperties")
If IsObject(objEntity) = TRUE Then
  Set objEntity = Nothing
End If
objDesign.save()

DATA;
#10=IFCRELASSIGNSPROPERTIES($,$,$,.F.,.F.,$,(),$);
ENDSEC;

◆IfcRelAssignsPropertiesの定義

「IfcRelAssignsProperties」は「IfcRelationship」の下位クラスであって、「RelatingPropertyDefinition」、「RelatedObjects」、「DomainView」の属性を持ち、それぞれ「IfcPropertyDefinition」、1個以上の「IfcObject」、文字列のデータを持つ。

ENTITY IfcRelAssignsProperties
  SUPERTYPE OF (ONEOF(
    IfcRelAssignsTypedProperties))
  SUBTYPE OF (IfcRelationship);
    RelatingPropertyDefinition : IfcPropertyDefinition;
    RelatedObjects             : LIST [1:?] OF UNIQUE IfcObject;
    DomainView                 : OPTIONAL STRING;
  DERIVE
    (略)
END_ENTITY;

また「IfcRelationship」は「IfcRoot」の下位クラスであって、「RelatedIsDependent」「RelatingIsDependent」の属性を持ち、それぞれはブール値のデータを持つ。

ENTITY IfcRelationship
  ABSTRACT SUPERTYPE OF (ONEOF(
    (略)
   ,IfcRelAssignsProperties
   ,(略)                  ))
  SUBTYPE OF (IfcRoot);
    RelatedIsDependent  : BOOLEAN;
    RelatingIsDependent : BOOLEAN;
END_ENTITY;

最後に「IfcRoot」は3個の属性を持つ。これらが継承されて「IfcRelAssignsProperties」の属性は8個になる。

IfcRoot /GlobalId,OwnerHistory,Label
IfcRelationship /RelatedIsDependent,RelatingIsDependent
IfcRelAssignsProperties /RelatingPropertyDefinition,RelatedObjects,DomainView

◆属性の定義

「IfcRelAssignsProperties」の属性である「RelatingPropertyDefinition」はプロパティセットを、「RelatedObjects」はエンティティ(の集合)をそれぞれ示す。すなわち、これが仲立ちをすることで、プロパティセットとエンティティが関係付けられるという仕組みになっている。

プロパティセットとエンティティの関係付け

従って、特定のエンティテイのプロパティセットを取得する手順は、下記による。

  1. 「IfcRelAssignsProperties 」の集合を取得する。
  2. その中から「RelatedObjects」に目的とするエンティティが含まれているものを検索する。
  3. 検索されたものの「RelatingPropertyDefinition 」で示されるプロパティセットを取得する。

◆IfcSpaceのプロパティセット

例えば、「IfcSpace」には「Pset_SpaceCommon」というプロパティセットがある。 15個のプロパティがある。

プロパティ名形式
Description(部屋の形式の記述)文字列
CodeUseType(部屋の建築法規上の所有形式)
SpaceCatalogue(部屋のカタログの記述)
ReqSommerSpaceTemperature(夏季の要求温度)実数および単位
ReqSummerSpaceHumidity(夏季の要求湿度)
ReqWinterSpaceTemperature(冬季の要求温度)
ReqWinterSpaceHumidity(冬季の要求湿度)
ReqIntermediateSpaceTemperature(中間季の要求温度)
ReqIntermediateSpaceHumidity(中間季の要求湿度)
ReqDiscontinuedHeating(非継続的な暖房の要求)非継続なら真、継続なら偽。
MainFireUse(主な火気使用)文字列
AncillaryFireUse(補助的な火気使用)文字列
FireRiskFactor(火気危険要因)整数
NaturalVentilation(自然換気)自然換気なら真、機械換気なら偽。
SprinklerProtection(スプリンクラーによる防火)有なら真、無なら偽。

ここに、「ReqSommerSpaceTemperature」〜「ReqIntermediateSpaceHumidity」は「IfcSimplePropertyWithUnit」、その他は「IfcSimpleProperty」である。「IfcSimplePropertyWithUnit」は「IfcSimpleProperty」に「UnitComponent」の属性が加わったものである。

ENTITY IfcSimplePropertyWithUnit
  SUBTYPE OF (IfcProperty);
    ValueWithUnit : IfcMeasureWithUnit;
END_ENTITY;

ENTITY IfcMeasureWithUnit;
    ValueComponent : IfcMeasureValue;
    UnitComponent  : IfcUnit;
END_ENTITY;

◆IfcSpaceのプロパティセットを取得

2つの部屋『Office Room』『Meeting Room』があり、両者の温湿度条件が夏季は26℃60%RH、冬季は22℃40%RHであるようなサンプルデータを下記に示す(単位は略)。

DATA;
#10=IFCRELASSIGNSPROPERTIES($,$,$,.T.,.T.,#13,(#11,#12),$);
#11=IFCSPACE($,$,$,$,(),$,(),$,(),.INTERNAL.,$,'Office Room',0.,0.,0.,0.,
0.,0.,0.);
#12=IFCSPACE($,$,$,$,(),$,(),$,(),.INTERNAL.,$,'Meeting Room',0.,0.,0.,0.,
0.,0.,0.);
#13=IFCPROPERTYSET($,$,$,'Pset_SpaceCommon',(#14,#15,#16,#17));
#14=IFCSIMPLEPROPERTYWITHUNIT('ReqSummerSpaceTemperature',#18);
#15=IFCSIMPLEPROPERTYWITHUNIT('ReqSummerSpaceHumidity',#19);
#16=IFCSIMPLEPROPERTYWITHUNIT('ReqWinterSpaceTemperature',#20);
#17=IFCSIMPLEPROPERTYWITHUNIT('ReqWinterSpaceHumidity',#21);
#18=IFCMEASUREWITHUNIT(IFCPOSITIVELENGTHMEASURE(26.),$);
#19=IFCMEASUREWITHUNIT(IFCPOSITIVELENGTHMEASURE(60.),$);
#20=IFCMEASUREWITHUNIT(IFCPOSITIVELENGTHMEASURE(22.),$);
#21=IFCMEASUREWITHUNIT(IFCPOSITIVELENGTHMEASURE(40.),$);
ENDSEC;

これらのデータを取得する方法と実行結果を下記に示す。

'/// IfcSpaceのプロパティセットを取得 ///
'[9]に入れる
Dim objEntitiesR
Dim objEntityR
Dim objAttributesR
Dim objEntityPS
Dim txt_sum
txt_sum = ""
txt_sum = txt_sum & "/部屋名:" & objAttributes.Item("SpaceName").Value

Set objEntitiesR = objEntity.GetPropertySets()
'GetPropertySets()の戻り値は「IfcPropertySet」ではなく「IfcRelAssignsProperties」である!
If IsObject(objEntitiesR) = TRUE Then
  For Each objEntityR In objEntitiesR
    If IsObject(objEntityR) = TRUE Then
      Set objAttributesR = objEntityR.Attributes
      If IsObject(objAttributesR) = TRUE Then
        Set objEntityPS = objAttributesR.Item("RelatingPropertyDefinition").Value
        If IsObject(objEntityPS) = TRUE Then
'         →(6)参照
          Set objEntityPS = Nothing
        End If
        Set objAttributesR = Nothing
      End If
      Set objEntityR = Nothing
    End If
  Next
  Set objEntitiesR = Nothing
End If

'/// IfcSimplePropertyWithUnitを取得 ///
'[16]に入れる
Set objAttributesP = objEntityP.Attributes
If IsObject(objAttributesP) = TRUE Then
  Set objAttributesP = objAttributesP("ValueWithUnit").Value.Attributes
  If IsObject(objAttributesP) = TRUE Then
'   (ValueComponentは→(6)参照、UnitComponentは略)
    Set objAttributesP = Nothing
  End If
End If

1番目の部屋のプロパティセット

2番目の部屋のプロパティセット


目次 / /