Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

What we have now is the identifier of the cube we are looking at. All the properties of the cube can be obtained through this "handle".

Section

 

 

Column
width350px
Code Block
languagetext
titleIFC4 Extract
ENTITY ifcfacetedbrep;
  outer    :   ifcclosedshell;
END_ENTITY

ENTITY ifcclosedshell;
  cfsfaces    :   SET [1:?] OF ifcface;
END_ENTITY;
Column

We are only interested in the geometry, so we will concentrate on the relevant attributes. An extract from the IFC4 EXPRESS schema shows us where to look for the six faces. The cube identifier we have has an attribute named "outer" that will be an instance of type IFCCLOSEDSHELL. This instance in turn has an attribute named "cfsfaces", which is what we look for; an identifier of an aggregate with all the six faces. We use the function sdaiGetAttrBN() to traverse this path of instances and attributes.

...

Code Block
languagetext
themeMidnight
titleOutput from Sample 202

================================================================
Compilation result of
    EXPRESS Schema   : IFC4
    in source file   : ./ifc4.exp
================================================================

    0 WARNINGS detected.
    0 ERRORS detected.

      P7          P8         This Cube is represented by an aggregate of six
    *---------------*        faces in a CUBE=IFCFACETEDBREP(F1,F2,F3,F4,F5,F6)
   /.              /|        Each face is represented by a polygon
  / .             / |        in an IFCFACEOUTERBOUND like;
 /P5.         P6 /  |
*---------------*   |        F1 = IFCFACEOUTERBOUND(IFCPOLYLOOP(P1,P2,P3,P4))
|   .           |   |        F2 = IFCFACEOUTERBOUND(IFCPOLYLOOP(P1,P2,P5,P6))
|   .           |   |        F3 = IFCFACEOUTERBOUND(IFCPOLYLOOP(P2,P3,P6,P8))
|   .           |   |
|   .           |   |        and so on.
|   . P4        |   |
|   *. .........|.. * P3     Below, this example will read and print the
|  .            |  /         coordinates of all the six faces.
| .             | /          The type graph from IFCFACETEDBREP to the
|.              |/           cubes set of four IFCCARTESIANPOINT is.
*---------------*
P1              P2       IFCFACETEDBREP.IFCCLOSEDSHELL.IFCFACE[6].IFCFACEBOUNDS[1].IFCLOOP.IFCCARTESIANPOINT[4]

Face No. 1: [ (-500, -500,    0) | ( 500, -500,    0) | ( 500,  500,    0) | (-500,  500,    0) ]
Face No. 2: [ (-500, -500,    0) | ( 500, -500,    0) | (-500, -500, 1000) | (-500, -500, 1000) ]
Face No. 3: [ ( 500, -500,    0) | ( 500,  500,    0) | ( 500,  500, 1000) | (-500,  500, 1000) ]
Face No. 4: [ (-500,  500,    0) | ( 500,  500,    0) | ( 500,  500, 1000) | (-500,  500, 1000) ]
Face No. 5: [ (-500, -500,    0) | (-500,  500,    0) | (-500,  500, 1000) | (-500, -500, 1000) ]
Face No. 6: [ ( 500, -500, 1000) | ( 500, -500, 1000) | ( 500,  500, 1000) | (-500,  500, 1000) ]


   *****  DONE *****

...