IFCファイルを作る/(12)階の情報を取得する

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


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

◆階

階は「IfcBuildingStorey」で表わされる。

ENTITY IfcBuildingStorey
  SUBTYPE OF (IfcProduct);
    BuildingStoreyReference : OPTIONAL STRING;
    BuildingStoreyName      : OPTIONAL STRING;
    Elevation               : IfcLengthMeasure;
    calcTotalHeight         : OPTIONAL IfcLengthMeasure;
    calcTotalArea           : OPTIONAL IfcAreaMeasure;
    calcTotalVolume         : OPTIONAL IfcVolumeMeasure;
  WHERE
    (略)
END_ENTITY;

DATA;
#10=IFCBUILDINGSTOREY($,$,$,$,(),$,(),$,$,$,0.,0.,0.,0.);
ENDSEC;

階自体の属性には、階参照、階名、基準高、階高、面積、容積がある。 これらを取得するには、下記による。

'/// 階を取得する ///
'[3]に入れる
Set objEntities = objDesign.FindObjects("IfcBuildingStorey")
If IsObject(objEntities) = TRUE Then
  For i = 1 To objEntities.Count
    Set objEntity = objEntities.Item(i)
    If IsObject(objEntity) = TRUE Then
      Set objAttributes = objEntity.Attributes
      If IsObject(objAttributes) = TRUE Then

        txt_tmp = ""
        txt_tmp = txt_tmp &  "階参照:" & objAttributes("BuildingStoreyReference").Value
        txt_tmp = txt_tmp &   "/階名:" & objAttributes("BuildingStoreyName").Value
        txt_tmp = txt_tmp & "/基準高:" & CStr(objAttributes("Elevation").Value)
        txt_tmp = txt_tmp &   "/階高:" & CStr(objAttributes("calcTotalHeight").Value)
        txt_tmp = txt_tmp &   "/面積:" & CStr(objAttributes("calcTotalArea").Value)
        txt_tmp = txt_tmp &   "/容積:" & CStr(objAttributes("calcTotalVolume").Value)
        MsgBox txt_tmp

        Set objAttributes = Nothing
      End If
      Set objEntity = Nothing
    End If
  Next
  Set objEntities = Nothing
End If

DATA;
#10=IFCBUILDINGSTOREY($,$,$,$,(),$,(),$,'Floor3','3F',7.,3.5,200.,700.);
ENDSEC;

階

◆階の参照

階は、その階に属する部屋や構造物から参照される場合が多い。 しかし、階あるいは部屋や構造物には、それぞれを直接関係付ける情報がない。 そこで、両者を関係付けるために、「IfcRelContains」が用いられる。

ENTITY IfcRelContains
  SUBTYPE OF (IfcRelationship);
    RelatingObject        : IfcObject;
    RelatedObjects        : LIST [1:?] OF UNIQUE IfcObject;
    RelationshipType      : IfcContainmentEnum;
    ContainedOrReferenced : IfcContainedOrReferencedEnum;
  WHERE
    (略)
END_ENTITY;

TYPE IfcContainmentEnum = ENUMERATION OF (
    ProjectContainer
   ,SiteContainer
   ,BuildingContainer
   ,BuildingStoreyContainer
   ,SpaceContainer
   ,ZoneContainer
   ,NotDefined);
END_TYPE;

TYPE IfcContainedOrReferencedEnum = ENUMERATION OF (
    Contained
   ,Referenced);
END_TYPE;

ENTITY IfcRelationship
  ABSTRACT SUPERTYPE OF (ONEOF(
    IfcRelActsUpon
   ,IfcRelAssignsProperties
   ,IfcRelContains
   ,IfcRelControls
   ,IfcRelGroups
   ,IfcRelNests
   ,IfcRelProcessOperatesOn
   ,IfcRelSequence
   ,IfcRelAdjacencyReq
   ,IfcRelAggregatesConstraints
   ,IfcRelAggregatesCrewResources
   ,IfcRelAssemblesElements
   ,IfcRelAssemblesSpaces
   ,IfcRelAttachesElements
   ,IfcRelAttachesToBoundaries
   ,IfcRelConnectsElements
   ,IfcRelConnectsPorts
   ,IfcRelCoversBldgElements
   ,IfcRelFillsElement
   ,IfcRelSeparatesSpaces
   ,IfcRelServicesBuildings
   ,IfcRelUsesResource
   ,IfcRelVoidsElement
   ,IfcRelWorkInteraction ))
  SUBTYPE OF (IfcRoot);
    RelatedIsDependent  : BOOLEAN;
    RelatingIsDependent : BOOLEAN;
END_ENTITY;

DATA;
#10=IFCRELCONTAINS($,$,$,.F.,.F.,$,(),.PROJECTCONTAINER.,.CONTAINED.);
ENDSEC;

「IfcRelContains」の属性である「RelatingObject」には階を、「RelatedObjects」には部屋や構造物を、それぞれ設定する。 また、「RelationshipType」には「BuildingStoreyContainer」を、「ContainedOrReferenced」には「Contained」(包含)を設定する。 例えば、2つの部屋が3階にある場合は、下記のようになる。

DATA;
#10=IFCRELCONTAINS($,$,$,.F.,.F.,#11,(#12,#13),.BUILDINGSTOREYCONTAINER.,.CONTAINED.);
#11=IFCBUILDINGSTOREY($,$,$,$,(),$,(),$,'Floor3','3F',7.,3.5,200.,700.);
#12=IFCSPACE($,$,$,$,(),$,(),$,(),.INTERNAL.,$,'Office Room',0.,0.,0.,0.,0.,0.,0.);
#13=IFCSPACE($,$,$,$,(),$,(),$,(),.INTERNAL.,$,'Meeting Room',0.,0.,0.,0.,0.,0.,0.);
ENDSEC;

ここに、部屋から階を参照するには、下記による。

'/// 部屋から階を参照する ///
'[3]に入れる

Set objEntities = objDesign.FindObjects("IfcSpace")
If IsObject(objEntities) = TRUE Then
  For i = 1 To objEntities.Count
    Set objEntity = objEntities.Item(i)
    If IsObject(objEntity) = TRUE Then
      Set objAttributes = objEntity.Attributes
      If IsObject(objAttributes) = TRUE Then

        txt_tmp = ""
        txt_tmp = txt_tmp &  "室名:" & objAttributes("SpaceName").Value

'       ↓「objEntity(IfcSpace)」が「RelatedObjects」に設定されている「IfcRelContains」を取得
        Set objEntities_rel = objEntity.GetUsedIn("IfcRelContains","RelatedObjects")
        If IsObject(objEntities_rel) = TRUE Then
          For j = 1 To objEntities_rel.Count
            Set objEntity_rel = objEntities_rel.Item(j)
            If IsObject(objEntity_rel) = TRUE Then
              Set objAttributes_rel = objEntity_rel.Attributes
              If IsObject(objAttributes_rel) = TRUE Then

                If objAttributes_rel("RelationshipType").Value = "BuildingStoreyContainer" Then
'                 ↓「IfcBuildingStorey」を取得
                  Set objEntity_bs = objAttributes_rel("RelatingObject").Value
                  If IsObject(objEntity_bs) = TRUE Then
                    Set objAttributes_bs = objEntity_bs.Attributes
                    If IsObject(objAttributes_bs) = TRUE Then

                      txt_tmp = txt_tmp & "/階名:" & objAttributes_bs("BuildingStoreyName").Value
                    End If
                    Set objAttributes_bs = Nothing
                  End If
                  Set objEntity_bs = Nothing
                End If

                Set objAttributes_rel = Nothing
              End If
              Set objEntity_rel = Nothing
            End If
          Next
          Set objEntities_rel = Nothing
        End If
        MsgBox txt_tmp

        Set objAttributes = Nothing
      End If
      Set objEntity = Nothing
    End If
  Next
  Set objEntities = Nothing
End If

室名と階名

室名と階名


目次 / /