Personal tools
You are here: Home / Implementation / first steps and tools / hello wall / Example 1

Example 1

export of a basic IFC file with wall, opening and window, including property sets and base quantities

The HelloWall miniExample is a small application build to export valid ifc files, following the already agreed view definition "Coordination View" and a proposed view definition "Presentation View". The latest version includes the export of property sets (as part of the "Coordination View" and "Presentation View"), and the export of base quantities as part of the proposed "Quantity Take-off Addon View". The export can be configured by a range of shape parameters and options. The source code is provided so that developers can follow the algorithms used.

ifc application icon 32x32 download HelloWall MiniExample in C++

 


Example 1

export of the miniExample using the coordination view setting and enabling the exchange of parameterized extrusion based geometry for all building elements.  Enable the check box for the export of quantities and property sets.
figure 1: user interface of the miniExample.exe

NOTE: you need to install the Hello World package dated 2008-07-31 or later

sample input screen example 2
Results

the following export files are generated by miniExample/Release/miniExample.exe (with settings according to the figure):
  • the IFC file according to the IFC EXPRESS schema and P21 encoding (i.e. STEP physical file) (1)
  • the ifcXML file according to the IFC XSD schema and XML document encoding (i.e. XML file)
Explanations

the sample file has the basic structure of any IFC file, complying with the "Coordination View"
  • see here for more information about IFC view definitions and the Coordination View

It includes:
  • a file header
  • the IfcProject with the context information (units used, representation context, precision, etc.)
  • the IFC project structure (hierarchical structure of IfcSite, IfcBuilding, IfcBuildingStorey)
  • the three elements, IfcWall(StandardCase), the IfcOpeningElement, and the IfcWindow, including
    • the relationships (wall and window contained in IfcBuildingStorey), opening voiding wall, window filling opening
    • the different shape representations (body and bounding box representation, additional wall axis representation)
  • it exports the IFC defined property sets for wall, opening, window and the base quantities, as defined in the "quantity take-off addon view"

 


 

In the following sections a short analysis of the generated ifc file can be found

FILE HEADER section

ISO-10303-21;
HEADER;
FILE_DESCRIPTION (('ViewDefinition [CoordinationView, 
  QuantityTakeOffAddOnView]'), '2;1');
FILE_NAME ('example.ifc', '2008-08-01T21:53:56', 
  ('Architect'), ('Building Designer Office'), 
  'IFC Engine DLL version 1.02 beta', 
  'IFC Engine DLL version 1.02 beta', 'The authorising person');
FILE_SCHEMA (('IFC2X3'));
ENDSEC;
  • file_description: indicates the view definition to which the IFC file complies (currently a proposed notation). Here it indicates: file is according to the Coordination View with additional elements according to the Quantity Take-off View.
  • file_name: information about the file name, creation time, creating user, creating user organization, name of the pre-processor (ifc toolbox), name of the application, name of the authorizing user
  • file_schema: IFC schema name

FILE DATA section

DATA;
#1 = IFCPROJECT('0YvctVUKr0kugbFTf53O9L', #2, 'Default Project', 
     'Description of Default Project', $, $, $, (#20), #7);
#2 = IFCOWNERHISTORY(#3, #6, $, .ADDED., $, $, $, 1217620436);
#3 = IFCPERSONANDORGANIZATION(#4, #5, $);
#4 = IFCPERSON('ID001', 'Bonsma', 'Peter', $, $, $, $, $);
#5 = IFCORGANIZATION($, 'TNO', 'TNO Building Innovation', $, $);
#6 = IFCAPPLICATION(#5, '0.10', 'Test Application', 'TA 1001');
#7 = IFCUNITASSIGNMENT((#8, #9, #10, #11, #15, #16, #17, #18, #19));
#8 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.);
#9 = IFCSIUNIT(*, .AREAUNIT., $, .SQUARE_METRE.);
#10 = IFCSIUNIT(*, .VOLUMEUNIT., $, .CUBIC_METRE.);
#11 = IFCCONVERSIONBASEDUNIT(#12, .PLANEANGLEUNIT., 'DEGREE', #13);
#12 = IFCDIMENSIONALEXPONENTS(0, 0, 0, 0, 0, 0, 0);
#13 = IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(1.745E-2), #14);
#14 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.);
#15 = IFCSIUNIT(*, .SOLIDANGLEUNIT., $, .STERADIAN.);
#16 = IFCSIUNIT(*, .MASSUNIT., $, .GRAM.);
#17 = IFCSIUNIT(*, .TIMEUNIT., $, .SECOND.);
#18 = IFCSIUNIT(*, .THERMODYNAMICTEMPERATUREUNIT., $, .DEGREE_CELSIUS.);
#19 = IFCSIUNIT(*, .LUMINOUSINTENSITYUNIT., $, .LUMEN.);
#20 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'Model', 3, 1.000E-5, #21, $);
#21 = IFCAXIS2PLACEMENT3D(#22, $, $);
#22 = IFCCARTESIANPOINT((0., 0., 0.));
  • IfcProject needs to be included exactly once, it serves as the root element in an IFC exchange file for the coordination view
  • It has a compressed GUID (as many IFC elements), a link to an IfcOwnerHistory (that may have dummy data) and references to the units used in this file and to the geometric representation contexts for the shape representations used in this file.
  • IfcUnitAssignment is the list of globally defined units (apply to all measure values within this file), e.g. all length measures in the geometry are given as "mm", all plane angles as "degree"
  • IfcGeometricRepresentationContext is the 3D context with a precision factor (here 0.00001), the placement is always 0.,0.,0.

Definition of the project structure

#23 = IFCSITE('3rNg_N55v4CRBpQVbZJoHB', #2, 'Default Site', 
      'Description of Default Site', $, #24, $, $, .ELEMENT., 
      (24, 28, 0), (54, 25, 0), $, $, $);
#24 = IFCLOCALPLACEMENT($, #25);
#25 = IFCAXIS2PLACEMENT3D(#26, #27, #28);
#26 = IFCCARTESIANPOINT((0., 0., 0.));
#27 = IFCDIRECTION((0., 0., 1.));
#28 = IFCDIRECTION((1., 0., 0.));
#29 = IFCBUILDING('0yf_M5JZv9QQXly4dq_zvI', #2, 'Default Building', 
      'Description of Default Building', $, #30, $, $, .ELEMENT., $, $, $);
#30 = IFCLOCALPLACEMENT(#24, #31);
#31 = IFCAXIS2PLACEMENT3D(#32, #33, #34);
#32 = IFCCARTESIANPOINT((0., 0., 0.));
#33 = IFCDIRECTION((0., 0., 1.));
#34 = IFCDIRECTION((1., 0., 0.));
#35 = IFCBUILDINGSTOREY('0C87kaqBXF$xpGmTZ7zxN$', #2, 'Default Building Storey', 
      'Description of Default Building Storey', $, #36, $, $, .ELEMENT., 0.);
#36 = IFCLOCALPLACEMENT(#30, #37);
#37 = IFCAXIS2PLACEMENT3D(#38, #39, #40);
#38 = IFCCARTESIANPOINT((0., 0., 0.));
#39 = IFCDIRECTION((0., 0., 1.));
#40 = IFCDIRECTION((1., 0., 0.));
  • This example has a three level project structure, created by exactly one site, one building, and one building storey. The levels of site and building storey are optional levels.
  • IfcSite is given with global positioning coordinates, located at 24° 28' 0'' north, and 54° 25' 0'' west
  • local coordinate system of the site is positioned at the origin 0.,0.,0. with no rotation (no project offsets)
  • IfcBuilding and IfcBuildingStorey, both positioned relative to the IfcSite, and with zero offset and rotation.

Creation of the project structure hierarchy

#41 = IFCRELAGGREGATES('2168U9nPH5xB3UpDx_uK11', #2, 'BuildingContainer', 
      'BuildingContainer for BuildigStories', #29, (#35));
#42 = IFCRELAGGREGATES('3JuhmQJDj9xPnAnWoNb94X', #2, 'SiteContainer', 
      'SiteContainer For Buildings', #23, (#29));
#43 = IFCRELAGGREGATES('1Nl_BIjGLBke9u_6U3IWlW', #2, 'ProjectContainer', 
      'ProjectContainer for Sites', #1, (#23));
#44 = IFCRELCONTAINEDINSPATIALSTRUCTURE('2O_dMuDnr1Ahv28oR6ZVpr', #2, 
      'Default Building', 'Contents of Building Storey', (#45, #124), #35);
  • IfcRelAggregates creates the hierarchical project structure site --> building --> building storey
  • IfcRelContainedInSpatialStructure creates the hierarchical assignment of building elements to the relevant project structure element, here: the wall and the window are contained in the building storey.

Creation of the wall object

#45 = IFCWALLSTANDARDCASE('3vB2YO$MX4xv5uCqZZG05x', #2, 'Wall xyz', 
      'Description of Wall', $, #46, #51, $);
#46 = IFCLOCALPLACEMENT(#36, #47);
#47 = IFCAXIS2PLACEMENT3D(#48, #49, #50);
#48 = IFCCARTESIANPOINT((0., 0., 0.));
#49 = IFCDIRECTION((0., 0., 1.));
#50 = IFCDIRECTION((1., 0., 0.));
#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#79, #83));
#79 = IFCSHAPEREPRESENTATION(#20, 'Axis', 'Curve2D', (#80));
#80 = IFCPOLYLINE((#81, #82));
#81 = IFCCARTESIANPOINT((0., 1.500E-1));
#82 = IFCCARTESIANPOINT((5., 1.500E-1));
#83 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#84));
#84 = IFCEXTRUDEDAREASOLID(#85, #92, #96, 2.300);
#85 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #86);
#86 = IFCPOLYLINE((#87, #88, #89, #90, #91));
#87 = IFCCARTESIANPOINT((0., 0.));
#88 = IFCCARTESIANPOINT((0., 3.000E-1));
#89 = IFCCARTESIANPOINT((5., 3.000E-1));
#90 = IFCCARTESIANPOINT((5., 0.));
#91 = IFCCARTESIANPOINT((0., 0.));
#92 = IFCAXIS2PLACEMENT3D(#93, #94, #95);
#93 = IFCCARTESIANPOINT((0., 0., 0.));
#94 = IFCDIRECTION((0., 0., 1.));
#95 = IFCDIRECTION((1., 0., 0.));
#96 = IFCDIRECTION((0., 0., 1.));
Creation of the wall object, since it is defined parametrically, it can be exchanged as standard case wall.
  • IfcWallStandardCase is positioned relative to the building storey
  • is a single layer wall, with a material layer of 300mm thickness and placed in the middle of the wall axis (material layer set usage offset -150mm)
  • has a wall axis starting 0.,150. ending at 5000.,150. (within the object coordinate system of the wall, defined by #46 IfcLocalPlacement)
  • has a wall footprint defined as a area #63 IfcArbitraryClosedProfileDef
  • has a solid body extruding the footprint by 2300mm at #62 IfcExtrudedAreaSolid
  • has an optional bounding box geometry

Adding IfcMaterialLayerSetUsage information

#74 = IFCRELASSOCIATESMATERIAL('2zeggBjk9A5wcc3k9CYqdL', #2, $, $, (#45), #75);
#75 = IFCMATERIALLAYERSETUSAGE(#76, .AXIS2., .POSITIVE., -1.500E-1);
#76 = IFCMATERIALLAYERSET((#77), $);
#77 = IFCMATERIALLAYER(#78, 3.000E-1, $);
#78 = IFCMATERIAL('Name of the material used for the wall');
Adding the IfcMaterialLayerSetUsage information (required for standard case)
  • is a single layer wall, with a material layer of 300mm thickness and placed in the middle of the wall axis (material layer set usage offset -150mm)

Alphanumeric property and quantity information

#52 = IFCPROPERTYSET('18RtPv6efDwuUOMduCZ7rH', #2, 'Pset_WallCommon', $, 
      (#53, #54, #55, #56, #57, #58, #59, #60, #61, #62));
#53 = IFCPROPERTYSINGLEVALUE('Reference', 'Reference', IFCTEXT(''), $);
#54 = IFCPROPERTYSINGLEVALUE('AcousticRating', 'AcousticRating', IFCTEXT(''), $);
#55 = IFCPROPERTYSINGLEVALUE('FireRating', 'FireRating', IFCTEXT(''), $);
#56 = IFCPROPERTYSINGLEVALUE('Combustible', 'Combustible', IFCBOOLEAN(.F.), $);
#57 = IFCPROPERTYSINGLEVALUE('SurfaceSpreadOfFlame', 'SurfaceSpreadOfFlame', IFCTEXT(''), $);
#58 = IFCPROPERTYSINGLEVALUE('ThermalTransmittance', 'ThermalTransmittance', IFCREAL(2.400E-1), $);
#59 = IFCPROPERTYSINGLEVALUE('IsExternal', 'IsExternal', IFCBOOLEAN(.T.), $);
#60 = IFCPROPERTYSINGLEVALUE('ExtendToStructure', 'ExtendToStructure', IFCBOOLEAN(.F.), $);
#61 = IFCPROPERTYSINGLEVALUE('LoadBearing', 'LoadBearing', IFCBOOLEAN(.F.), $);
#62 = IFCPROPERTYSINGLEVALUE('Compartmentation', 'Compartmentation', IFCBOOLEAN(.F.), $);
#63 = IFCRELDEFINESBYPROPERTIES('3IxFuNHRvBDfMT6_FiWPEz', #2, $, $, (#45), #52);

#64 = IFCELEMENTQUANTITY('10m6qcXSj0Iu4RVOK1omPJ', #2, 'BaseQuantities', $, $, 
      (#65, #66, #67, #68, #69, #70, #71, #72));
#65 = IFCQUANTITYLENGTH('Width', 'Width', $, 3.000E-1);
#66 = IFCQUANTITYLENGTH('Lenght', 'Lenght', $, 5.);
#67 = IFCQUANTITYAREA('GrossSideArea', 'GrossSideArea', $, 11.500);
#68 = IFCQUANTITYAREA('NetSideArea', 'NetSideArea', $, 10.450);
#69 = IFCQUANTITYVOLUME('GrossVolume', 'GrossVolume', $, 3.450);
#70 = IFCQUANTITYVOLUME('NetVolume', 'NetVolume', $, 3.135);
#71 = IFCQUANTITYLENGTH('Height', 'Height', $, 2.300);
#72 = IFCQUANTITYAREA('GrossFootprintArea', 'GrossFootprintArea', $, 1.500);
#73 = IFCRELDEFINESBYPROPERTIES('0cpLgxVi9Ew8B08wF2Ql1w', #2, $, $, (#45), #64);

Creation of the alphanumeric property and quantity information
  • a set of alphanumeric properties is attached to the wall, this is done by assigning an IfcPropertySet using IfcRelDefinesByProperties to the wall
  • the notation Pset_WallCommon indicates, that these properties are defined as part of the IFC specification
  • the set of properties represents the complete set defined as Pset_WallCommon, in an actual exchange less properties can be included. Not including properties indicate that those are not available for the exchange file.
  • a set of base quantities is attached to the wall, this is done by assigning an IfcElementQuantity using IfcRelDefinesByProperties to the window
  • the notation BaseQuantities indicates, that these quantities are defined as part of the IFC specification, base quantities also means, that the measure of measurement for the quantity is based on the real geometry of the element in the underlying BIM

Opening

#97 = IFCOPENINGELEMENT('2LcE70iQb51PEZynawyvuT', #2, 'Opening Element xyz', 
      'Description of Opening', $, #98, #103, $);
#98 = IFCLOCALPLACEMENT(#46, #99);
#99 = IFCAXIS2PLACEMENT3D(#100, #101, #102);
#100 = IFCCARTESIANPOINT((9.000E-1, 0., 2.500E-1));
#101 = IFCDIRECTION((0., 0., 1.));
#102 = IFCDIRECTION((1., 0., 0.));
#103 = IFCPRODUCTDEFINITIONSHAPE($, $, (#110));
#109 = IFCRELVOIDSELEMENT('3lR5koIT51Kwudkm5eIoTu', #2, $, $, #45, #97);
#110 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#111));
#111 = IFCEXTRUDEDAREASOLID(#112, #119, #123, 1.400);
#112 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #113);
#113 = IFCPOLYLINE((#114, #115, #116, #117, #118));
#114 = IFCCARTESIANPOINT((0., 0.));
#115 = IFCCARTESIANPOINT((0., 3.000E-1));
#116 = IFCCARTESIANPOINT((7.500E-1, 3.000E-1));
#117 = IFCCARTESIANPOINT((7.500E-1, 0.));
#118 = IFCCARTESIANPOINT((0., 0.));
#119 = IFCAXIS2PLACEMENT3D(#120, #121, #122);
#120 = IFCCARTESIANPOINT((0., 0., 0.));
#121 = IFCDIRECTION((0., 0., 1.));
#122 = IFCDIRECTION((1., 0., 0.));
#123 = IFCDIRECTION((0., 0., 1.));
Creation of the opening
  • IfcOpeningElement defined within the object coordinate system of the wall - #79 IfcLocalPlacement is defined relative to #46)
  • has an IfcRelVoidsElement relationship to the wall, indicating that the opening is to be subtracted from the wall
  • has a solid body created by #87 IfcExtrudedAreaSolid
  • has an optional bounding box geometry

Alphanumeric quantity information

#104 = IFCELEMENTQUANTITY('2yDPSWYWf319fWaWWvPxwA', #2, 'BaseQuantities', $, $, 
       (#105, #106, #107));
#105 = IFCQUANTITYLENGTH('Depth', 'Depth', $, 3.000E-1);
#106 = IFCQUANTITYLENGTH('Height', 'Height', $, 1.400);
#107 = IFCQUANTITYLENGTH('Width', 'Width', $, 7.500E-1);
#108 = IFCRELDEFINESBYPROPERTIES('2UEO1blXL9sPmb1AMeW7Ax', #2, $, $, (#97), #104);
Creation of the alphanumeric quantity information
  • a set of base quantities is attached to the opening, this is done by assigning an IfcElementQuantity using IfcRelDefinesByProperties to the opening
  • the notation BaseQuantities indicates, that these quantities are defined as part of the IFC specification, base quantities also means, that the measure of measurement for the quantity is based on the real geometry of the element in the underlying BIM.

Window

#124 = IFCWINDOW('0LV8Pid0X3IA3jJLVDPidY', #2, 'Window xyz', 
       'Description of Window', $, #125, #130, $, 1.400, 7.500E-1);
#125 = IFCLOCALPLACEMENT(#98, #126);
#126 = IFCAXIS2PLACEMENT3D(#127, #128, #129);
#127 = IFCCARTESIANPOINT((0., 1.000E-1, 0.));
#128 = IFCDIRECTION((0., 0., 1.));
#129 = IFCDIRECTION((1., 0., 0.));
#130 = IFCPRODUCTDEFINITIONSHAPE($, $, (#150));
#131 = IFCRELFILLSELEMENT('1CDlLMVMv1qw1giUXpQgxI', #2, $, $, #97, #124);
#150 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#151));
#151 = IFCEXTRUDEDAREASOLID(#152, #159, #163, 1.400);
#152 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #153);
#153 = IFCPOLYLINE((#154, #155, #156, #157, #158));
#154 = IFCCARTESIANPOINT((0., 0.));
#155 = IFCCARTESIANPOINT((0., 1.000E-1));
#156 = IFCCARTESIANPOINT((7.500E-1, 1.000E-1));
#157 = IFCCARTESIANPOINT((7.500E-1, 0.));
#158 = IFCCARTESIANPOINT((0., 0.));
#159 = IFCAXIS2PLACEMENT3D(#160, #161, #162);
#160 = IFCCARTESIANPOINT((0., 0., 0.));
#161 = IFCDIRECTION((0., 0., 1.));
#162 = IFCDIRECTION((1., 0., 0.));
#163 = IFCDIRECTION((0., 0., 1.));
Creation of the window
  • IfcWindow defined within the object coordinate system of the opening - 104 IfcLocalPlacement is defined relative to #79)
  • has an IfcRelFillsElement relationship to the opening, indicating that the opening is to be filled with the window
  • has a solid body created by #112 IfcExtrudedAreaSolid
  • has an optional bounding box geometry

Alphanumeric property and quantity information

#132 = IFCPROPERTYSET('0fhz_bHU54xB$tXHjHPUZl', #2, 'Pset_WindowCommon', $, 
       (#133, #134, #135, #136, #137, #138, #139, #140, #141, #142, #143, #144));
#133 = IFCPROPERTYSINGLEVALUE('Reference', 'Reference', IFCTEXT(''), $);
#134 = IFCPROPERTYSINGLEVALUE('FireRating', 'FireRating', IFCTEXT(''), $);
#135 = IFCPROPERTYSINGLEVALUE('AcousticRating', 'AcousticRating', IFCTEXT(''), $);
#136 = IFCPROPERTYSINGLEVALUE('SecurityRating', 'SecurityRating', IFCTEXT(''), $);
#137 = IFCPROPERTYSINGLEVALUE('IsExternal', 'IsExternal', IFCBOOLEAN(.T.), $);
#138 = IFCPROPERTYSINGLEVALUE('Infiltration', 'Infiltration', IFCBOOLEAN(.F.), $);
#139 = IFCPROPERTYSINGLEVALUE('ThermalTransmittance', 'ThermalTransmittance', IFCREAL(2.400E-1), $);
#140 = IFCPROPERTYSINGLEVALUE('GlazingAresFraction', 'GlazingAresFraction', IFCREAL(7.000E-1), $);
#141 = IFCPROPERTYSINGLEVALUE('HandicapAccessible', 'HandicapAccessible', IFCBOOLEAN(.F.), $);
#142 = IFCPROPERTYSINGLEVALUE('FireExit', 'FireExit', IFCBOOLEAN(.F.), $);
#143 = IFCPROPERTYSINGLEVALUE('SelfClosing', 'SelfClosing', IFCBOOLEAN(.F.), $);
#144 = IFCPROPERTYSINGLEVALUE('SmokeStop', 'SmokeStop', IFCBOOLEAN(.F.), $);
#145 = IFCRELDEFINESBYPROPERTIES('2fHMxamlj5DvGvEKfCk8nj', #2, $, $, (#124), #132);
#146 = IFCELEMENTQUANTITY('0bB_7AP5v5OBZ90TDvo0Fo', #2, 'BaseQuantities', $, $, (#147, #148));

#147 = IFCQUANTITYLENGTH('Height', 'Height', $, 1.400);
#148 = IFCQUANTITYLENGTH('Width', 'Width', $, 7.500E-1);
#149 = IFCRELDEFINESBYPROPERTIES('0FmgI0DRX49OXL_$Wa2P1E', #2, $, $, (#124), #146);
Creation of the alphanumeric property and quantity information
  • a set of alphanumeric properties is attached to the window, this is done by assigning an IfcPropertySet using IfcRelDefinesByProperties to the window
  • the notation Pset_WindowCommon indicates, that these properties are defined as part of the IFC specification
  • the set of properties represents the complete set defined as Pset_WindowCommon, in an actual exchange less properties can be included. Not including properties indicate that those are not available for the exchange file.
  • a set of base quantities is attached to the window, this is done by assigning an IfcElementQuantity using IfcRelDefinesByProperties to the window
  • the notation BaseQuantities indicates, that these quantities are defined as part of the IFC specification, base quantities also means, that the measure of measurement for the quantity is based on the real geometry of the element in the underlying BIM.

End of the DATA SECTION

ENDSEC;
END-ISO-10303-21;

 


Result shown in an IFC Viewer

NOTE: for displaying the ifcXML file you need to install the latest version (build 452 and later) of the IfcStoreyView.

result in viewer example 2