What are Extensions?
Extensions are modules or classes methods written in Ruby.
They extend the basic functionality of IFC classes and the server.
The class methods can be used inside server scripts or inside any report.
IFC
getObjectByLineID(id)
Return an IFC object by its STEP ID
IFC_CLASS_NAME.nonInverseAttributes
Return a list of IFC class basic attributes
IFCCOLUMN.nonInverseAttributes: -->>>
"|globalId |ownerHistory |name |description |objectType |objectPlacement |representation |tag"
IFCObject.to_xml (obj)
Serialize any IFC object as XML
Example: "#61185".to_obj.to_xml -->>>
<IFCCOLUMN>
<line_id>61185</line_id>
<globalId>'0APvzagRfDa8S2CxmCLJFH'</globalId>
<ownerHistory>#13</ownerHistory>
<name>'St\S\|tze-001'</name>
<description>''</description>
<objectType>$</objectType>
<objectPlacement>#61239</objectPlacement>
<representation>#61228</representation>
<tag>$</tag>
</IFCCOLUMN>
IFCObject.to_csv(obj)
Serialize any IFC object as Comma-Separated Values (CSV)
IFCObject.to_html (obj)
Serialize any IFC object as row in HTML table
IFC_CLASS_NAME.list(cols="")
Return a list of all IFC class instances, the parameter 'cols' can be used to define a set of custom data fields to be reported
IFCObject.as_link
Return HTML hyperlink to any IFC object instance
IFC_CLASS_NAME.where (cond,output)
Return a hash of user defined output applied on IFCCLASS object's instances which meet the 'cond' expression, 'all' or true can be used to retrive all instances, 'cond' can be any valid Ruby expression applied on each object instance, the 'o' is used as place holder for object instances
IFCWINDOW.where("all","o.area > 2.00")
IfcAlignment2DHorizontalSegment
to_svg
polarToCartesian(centerX, centerY, radius, angleInDegrees)
IfcArbitraryClosedProfileDef
area
diameter
perimeter
to_svg
svg(scale=1,transformation="")
xyz_array
xy_array
IfcArbitraryOpenProfileDef
perimeter
xyz_array
xy_array
to_svg
IfcArbitraryProfileDefWithVoids
area
xyz_array
IfcAsymmetricIShapeProfileDef
to_svg
svg(scale=1,transformation="")
IfcAxis2Placement2D
xy
x
y
matrix
matrix2d
IfcAxis2Placement3D
x_axis
z_axis
xyz
matrix
matrix2d
IfcBoundingBox
to_dae(objectPlacement=nil,*args)
convert the geometry data of IfcBoundingBox object to COLLADA format
corner_xyz
x_min
x_max
y_min
y_max
z_min
z_max
volume
return the volume of the BoundingBox object
center
*
IfcBuilding
getBuildingAddress
*
getBuildingStoreys
*
getGrossFloorArea
*
getSpaces
*
getGetPropertySet
*
getContainedElements()
*
IfcBuildingElement
hasCoverings
*
IfcBuildingElementType_classes
attach_to_obj(obj)
attach_to_obj(obj)
IfcCShapeProfileDef
IfcCartesianPoint
to_xml( o=self)
to_xyz
xyz
min_max
return a list of Xmin,Xmax,Ymin,Ymax,Zmin,Zmax of all IfcCartesianPoint instances
IfcCartesianPointList
size
coordArray
IfcCircle
area
perimeter
xyz_array
to_svg
svg(scale=1,transformation="")
IfcCircleHollowProfileDef
area
perimeter
xyz_array
*
to_svg
svg(scale=1,transformation="")
IfcCircleProfileDef
area
perimeter
xyz_array
xy_array
to_svg
svg(scale=1,transformation="")
IfcClassification
classificationForObjects
*
hasReferences
*
contains
*
IfcClassificationReference
attach_to_obj(obj)
classificationRefForObjects
*
hasReferences
*
IfcClosedShell
area
to_dae(placement=nil, *args)
to_dae_geometry(mesh_id="")
to_dae_node(placement=nil)
IfcColourRgb
to_RGB
to_RGB_HEX
to_html_div
IfcComplexProperty
to_row
to_table
IfcCompositeCurve
xyz_array
IfcCompositeCurveSegment
xyz_array
usingCurves
*
IfcCompositeProfileDef
IfcConnectedFaceSet
to_dae(objectPlacement=nil, *args)
to_dae_geometry(mesh_id="")
to_dae_node(placement=nil)
IfcConstraint
hasExternalReferences
*
propertiesForConstraint
*
IfcConversionBasedUnit
IfcDateTime
date_time
IfcDerivedProfileDef
IfcDimensionalExponents
unitExponent
IfcDirection
get_normal
IfcDistributionFlowElement
hasControlElements
*
IfcDoor
area
IfcDoorLiningProperties
property_details
attach_to_obj(obj)
IfcDoorPanelProperties
property_details
attach_to_obj(obj)
IfcDoorStyle
property_details
IfcDraughtingPreDefinedColour
to_html_div
to_RGB
to_RGB_HEX
IfcEdge
length
to_dae
to_dae_geometry(mesh_id="")
to_dae_node(ifclocalplacemenet=nil)
to_xml( o=self)
IfcElement
get_inverse_attributes
*
fillsVoids1
hasStructuralMember1
*
connectedTo1
return information (class, globalId, name) about the elements which are connected to this element through IfcRelConnectsEelement relationship
Example: List all connected IfcBuildingElements in the IFC model: __4D_IFC2x4.ifc
hasCoverings1
referencedInStructures1
List the spatial structure elements(site, building, buildingStorey, space) in which this IfcElement object is referenced (through IfcRelReferencedInSpatialStructure), but not primarily contained
hasPorts1
*
hasOpenings1
providesBoundaries1
return a table of spaces objects of space boundaries which are defined through IfcRelSpaceBoundary relation for this IfcElement instance
Example: List space boundaries of slabs and walls in the IFC model :AC10-Institute-Var-1.ifc
connectedFrom1
return information (class, globalId, name) about the elements which are connected with this element through IfcRelConnectsEelement relationship
containedInStructure1
return the parent object(container) of this element
TODO: hasProjections,isConnectionRealization
IfcElementQuantity
to_details(str="")
property_names_values_hash
property_details
property_details_xml
to_details_xml(str="")
attach_to_obj(obj)
names_values_hash(str="")
IfcEllipseProfileDef
area
perimeter
IfcExternalReference
externalReferenceForResources
IfcExternalSpatialElement
boundedBy
IfcExtrudedAreaSolid
area
perimeter
diameter
area_side
volume
height
to_dae(objectPlacement=nil,*args)
xyz_min_max(location=[0,0,0])
to_dae_geometry(mesh_id = "")
to_dae_node(ifclocalplacement=nil)
svg(scale=1,transformation="")
to_svg
IfcFace
to_mesh
get_normal
to_dae(objectPlacement=nil,*args)
to_dae_geometry(mesh_id="")
to_dae_node(ifclocalplacemenet=nil)
area
IfcFaceBound
get_normal
to_mesh
to_dae(objectPlacement=nil,*args)
to_dae_geometry(mesh_id="")
to_dae_node(localplacement=nil)
area
IfcFaceOuterBound
to_dae(objectPlacement=nil)
to_dae_geometry(mesh_id="")
to_dae_node(local=nil)
to_mesh
area
IfcFacetedBrep
to_dae(objectPlacement=nil,*args)
to_mesh
to_dae_geometry(mesh_id="")
to_dae_node(local=nil)
area
IfcFillAreaStyle
validate_rules
fillStyles_colour
IfcGeometricCurveSet
to_dae(objectPlacement=nil,*args)
to_dae_geometry(mesh_id="")
to_dae_node(local=nil)
svg(scale=1,transformation="")
IfcGrid
IfcGridAxis
to_dae
svg(scale=1,transformation="")
IfcIShapeProfileDef
area
perimeter
xyz_array
*
xy_array
*
to_svg
svg(scale=1,transformation="")
IfcLShapeProfileDef
IfcLibraryReference
IfcLine
xyz_array(value=1)
xyz_min_max(value=1)
IfcLocalPlacement
location
IfcMappedItem
area
volume
area_side
height
to_dae(objectPlacement=nil)
to_dae_geometry(mesh_id="")
to_dae_node(local=nil)
check_transformation
IfcMaterial
attach_to_obj(obj)
This method links the name of the material object to the associated objects through the relation IfcRelAssociatesMaterial as a new attribute . The new attribute to be used in reports or filters called:
IfcMaterialLayerSet
materials_list
materials_thickness_list
IfcMaterialLayerSetUsage
attach_to_obj(obj)
This method links the names, count and total thickness of the material layers (IfcMaterialLayerSetUsage) which are associated to objects through the relation IfcRelAssociatesMaterial as a new attributes . The new attributes to be used in reports or filters called:
- ext_MaterialLayerSetUsage_material_name
- ext_MaterialLayerSetUsage_layer_count
- ext_MaterialLayerSetUsage_total_thickness
- ext_MaterialLayerSetUsage_layerSetName
- ext_MaterialLayerSetUsage_OffsetFromReferenceLine
IfcMaterialList
getMaterials
attach_to_obj(obj)
This method links the names and count of the material objects which are associated to objects through the relation IfcRelAssociatesMaterial as a new attributes . The new attributes to be used in reports or filters called:
- ext_materiallist_name
- ext_materiallist_count
IfcMeasureWithUnit
IfcMirroredProfileDef
IfcObject
isDefinedBy
db_pset
return a table with all object proeprties saved in the BIM-DB
db_select_pset(propertyname, psetName= "")
return a table with one or more object proeprties saved in the BIM-DB. The user can add filter by PSetName
db_get_property(propertyname, psetName= "")
return the value of object proeprty.
IfcObjectDefinition
hasAssignments
isNestedBy #
hasContext
decomposes
hasAssociations
IfcOpenShell
to_dae(objectPlacement=nil,*args)
convert the geometry data of this BoundingBox object to COLLADA format
IfcOpeningElement
area
IfcOwnerHistory
creationDate
IfcPhysicalQuantity
IfcPlanarExtent
IfcPolyLoop
get_normal_default
get_normal
to_xml(obj=self)
to_svg
to_xy_xml
perimeter
to_mesh
to_dae(objectPlacement=nil)
to_dae_geometry(mesh_id="")
to_dae_node(placement=nil)
area
dx_dy_dz
xyz_min
xyz_max
is_circle?(precision=0.01)
inXY?
IfcPolyline
to_a
xyz_array
xy_array
xy_min_max
to_xml1(obj=self)
to_xml(obj=self)
to_svg(scale=1)
svg(scale=1,transformation="")
area
perimeter
contains_point?(point)
outside_bounding_box?(point)
to_dae(placement=nil, *args)
to_dae_geometry(mesh_id="")
to_dae_node(placement=nil)
add_point(id)
self.new_from_points_array(xy_array=[])
IfcProduct
referencedBy
area
to_dae(placement=nil,*args)
volume
area_side
location
IfcProductDefinitionShape
to_dae(objectPlacement=nil,*args)
to_dae_geometry(mesh_id="")
to_dae_node(local=nil)
volume
IfcProductRepresentation
to_dae(objectPlacement=nil,*args)
IfcProfileDef
hasExternalReference
*
hasProperties
*
IfcPropertyBoundedValue
IfcPropertyDefinition
to_details(str="")
to_details_xml(str="")
property_names_values
valid_name(obj=self)
names_values(str="")
names_values_hash(str="")
IfcPropertyEnumeratedValue
to_row
to_xml(obj)
attach_to_obj(obj)
IfcPropertyEnumeration
IfcPropertySet
property_details
properties
Return an alphabitic sorted array of property names defined insinde the PropertySet object
hasProperty?(property)
Check if the PropertySet has a single Property with the name 'property', returns false or true
hasPropertyWithValue?(property,val)
Check if the PropertySet has a single Property with the name 'property' and the value 'value', returns false or true
property_value(name="")
property_details_xml
to_xml(obj=self)
property_names_values
property_names_values_hash
attach_to_obj(obj)
IfcPropertySetTemplate
propertyTemplates_html
propertyTemplates
IfcPropertySingleValue
to_row
valid_name(obj=self)
valid_value(obj=self)
to_xml(obj=self)
to_xml_full(obj=self)
#to_csv(obj=self)
attach_to_obj(obj)
IfcPropertyTableValue
to_row
*
IfcQuantityArea
to_row
to_xml(obj)
attach_to_obj(obj)
IfcQuantityCount
to_row
to_xml(obj)
attach_to_obj(obj)
IfcQuantityLength
to_row
to_xml(obj)
attach_to_obj(obj)
IfcQuantityTime
to_row
to_xml(obj)
attach_to_obj(obj)
IfcQuantityVolume
to_row
to_xml(obj)
attach_to_obj(obj)
IfcQuantityWeight
to_row
to_xml(obj)
attach_to_obj(obj)
IfcRectangleHollowProfileDef
#area
*
perimeter
IfcRectangleProfileDef
area
xyz_array
perimeter
svg(scale=1,transformation="")
IfcRelAggregates
IfcRelAssigns
IfcRelAssignsTasks
saveTimeForTask
IfcRelAssociatesClassification
attach_to_obj
IfcRelAssociatesMaterial
attach_to_obj
This method will be called automatically if this extension is loaded (the class IfcRelAssociatesMaterial is selected and the caching is disabled)
It links the material properties with the associated objects as new attributes to be used in reports and quires as fellow:
- IfcMaterial
- IfcMaterialList
- ext_materiallist_name
- ext_materiallist_count
- IfcMaterialLayer
- IfcMaterialLayerSet
- IfcMaterialLayerSetUsage
- ext_MaterialLayerSetUsage_material_name
- ext_MaterialLayerSetUsage_layer_count
- ext_MaterialLayerSetUsage_total_thickness
- ext_MaterialLayerSetUsage_layerSetName
- ext_MaterialLayerSetUsage_OffsetFromReferenceLine
qto
This method can be used to create a QuantityTakeOff report.
Beside selecting IfcRelAssociatesMaterial class we have to select the IfcRelDefinedByProperties,IfcRelDefinesByType classes as well.
The fellowing attributes will be used for calculations:
- Width
- Height
- Length
- Perimeter
- Volume,NetVolume, GrossVolume
- Area, GrossArea ,GrossSideArea, NetSideArea, GrossFootprintArea,NetFootprintArea, NetWallArea, GrossWallArea
IfcRelConnectsPortToElement
count()
add(instance_id)
count_by_class
IfcRelConnectsPorts
count()
add(instance_id)
count_by_class
IfcRelContainedInSpatialStructure
attach_to_obj
count()
add(instance_id)
count_by_class
IfcRelDecomposes
attach_to_obj
IfcRelDefinesByProperties
to_xml(obj=self)
cache
*
attach
IfcRelDefinesByType
attach_to_obj
IfcRelFillsElement
count()
add(instance_id)
count_by_class
IfcRelSequence
count()
add(instance_id)
count_by_class
IfcRelVoidsElement
count()
add(instance_id)
count_by_class
IfcRelationship
count()
add(instance_id)
count_by_class
IfcRepresentation
ofProductRepresentation
layerAssignments
representationMap
area
area_side
volume
height
to_svg
to_dae(objectPlacement=nil,*args)
IfcRepresentationItem
layerAssignment
styledByItem
*
IfcRepresentationMap
to_dae
to_dae_geometry(mesh_id=nil)
to_dae_node(local=nil)
IfcResource
resourceOf
*
IfcRoundedRectangleProfileDef
area
perimeter
IfcScheduleTimeControl
detail
IfcShapeRepresentation
preview
to_dae_geometry(mesh_id="")
to_dae_node(local=nil)
to_dae(objectPlacement=nil,*args)
volume
IfcSimplePropertyTemplate
IfcSite
to_PSF21
IfcSlab
IfcSpace
getBoundedBy
*
getElementQuantities
*
getHeight
*
IfcSpatialStructureElement
containsElements
containsElements_count
IfcStyledItem
IfcSurfaceStyle
to_dae_material
IfcSurfaceStyleRendering
surfaceColour_html
effect
material
IfcTShapeProfileDef
IfcTask
IfcTrapeziumProfileDef
IfcTrimmedCurve
xyz_array
IfcTypeProduct
attach_to_obj(obj)
This method links the "Type" properties with the associated objects(through
IfcRelDefinesByType) as new attributes to be used in reports and quires as fellow:
- IfcTypeProduct
- ext_Type_Name
- ext_Type_Description
- ext_Type_ApplicableOccurrence
- ext_Type_HasPropertySets
- ext_Type_RepresentationMaps
- ext_Type_Tag
IfcElementType- ext_Type_ElementType
IfcBuildingElementType- ext_Type_PredefinedType
IfcDoorStyle and IfcWindowStyle- ext_Type_OperationType
- ext_Type_ConstructionType
- ext_Type_ParameterTakesPrecedence
- ext_Type_Sizeable
IfcUShapeProfileDef
IfcVertexPoint
to_dae
to_dae_geometry(mesh_id="")
to_dae_node(ifclocalplacemenet=nil)
IfcWindow
area
IfcWindowLiningProperties
property_details
IfcWindowPanelProperties
property_details
IfcWindowStyle
property_details
IfcZShapeProfileDef
property_window_extension
format_property(obj,att)
property_table(obj=self)
Project website: https://github.com/ifcwebserver| Blog