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;
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;
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