As software and standards mature and even become archaic, they inevitably attract baggage along the way. Years of technical debt amassed by well-intentioned developers and product managers will be paid for by us and our children.

This is particularly evident when we start talking about the Id of Revit elements, and the IFC GUID syntax. As most of you are aware, Revit carries a number of different identifying attributes for each and every element. Here is a basic list:

  • Element Id – the numerical form of a Revit Id, you can interact directly with this using the Select By Id command in Revit
  • UniqueId – “A stable unique identifier for an element within the document.” This is not a correctly formed UUID, but rather a concatenation of a standard UUID for the Revit EpisodeId (session based), along with the Revit element Id. From Jeremy’s post: similar to the standard GUID format, but has 8 additional characters at the end. These 8 additional hexadecimal characters are large enough to store 4 bytes or a 32 bit number, which is exactly the size of a Revit element id.
  • DwfGuid (Export Guid) – this is a correctly formed UUID in .NET / standard format
  • IfcGuid – identical to DwfGuid, but encoded differently according to IFC rules created in the mid-90s. At the time, it was deemed worthwhile to ‘compress’ the IFC Guid to the shorter form we still have to deal with today.

It would be nice if Revit and IFC shared a single common unique identifying syntax, but unfortunately this is not the case.

The above Ids do actually bear some predictable relationship to each other. The UniqueId is formed by Revit joining the EpisodeId and the encoded Element Id, the Dwf or Export Guid is created by an algorithm that has a number of conditional rules, and the Dwf Guid can be converted to the backwards-compatible IfcGuid format through a different algorithm, originally created in C. Those algorithms can be sourced in various places (see links in Further Reading below).

Also, some of these get exposed in different ways – if you create Element-bound BCF files, they will typically show the IFC Guid syntax. Further, if you export an IFC file from Revit and tick the option on the Exporter, it will write the IfcGuid to a parameter on the element.

You can query the Element Id directly in Revit (Modify ribbon, Inquiry panel, IDs of Selection):

However, for the purpose of this post, let’s assume you are using Dynamo with IronPython, and you want to query all 4 Ids from an element.

We at least need to import the Revit API and the Revit IFC API:

clr.AddReference("RevitAPI")
import Autodesk 
from Autodesk.Revit.DB import *
clr.AddReference('RevitAPIIFC')
from Autodesk.Revit.DB.IFC import *

 

Following this, we can use the various Dynamo and Python commands to access the Ids:

elementIds, uniqueIds, DwfGuids, IfcGuids, successlist = [], [], [], [], []
for i in e:
    try:
        elementIds.append(i.Id)
        uniqueIds.append(i.UniqueId)
        DwfGuids.append(ExportUtils.GetExportId(doc, ElementId(i.Id)))
        IfcGuids.append(ExporterIFCUtils.CreateSubElementGUID (UnwrapElement(i),0))
        successlist.append("Success")
    except:
        successlist.append("Failure")
OUT = elementIds, uniqueIds, DwfGuids, IfcGuids, successlist

 

Notice the commands and properties used:

  • Element Id – query the Element.Id member
  • Unique Id – query the Element.UniqueId member
  • Dwf or Export Guid – use the ExportUtils.GetExportId method
  • IfcGuid – use the ExporterIFCUtils.CreateSubElementGUID method (index 0 refers to the main element itself)

 

From here, I create a Dynamo node that eats Revit elements and gives us back these Id values:

before node created

 

After “All The Ids” node created

 

This node will be published in the Bakery package on the package manager, and to Github.

 

Further, our VirtualBuiltApp platform has been developed to store and query multiple Ids for a single element.

 

Example output from the Dynamo / Python (initial test showed the Dwf Guid is still a .NET object, that probably should get converted to a string for consistency).

[2424]
['c98618bf-7112-4e90-8a71-8ab768f2b1c0-00000978']
[<System.Guid object at 0x0000000000000071 [c98618bf-7112-4e90-8a71-8ab768f2b8b8]>]
['39XXY$SH9Ea8fnYhTeyhYu']

 

I added str() to the Python:

 

Final test showing the 4 different Id values for a single object:

2424
'c98618bf-7112-4e90-8a71-8ab768f2b1c0-00000978'
'c98618bf-7112-4e90-8a71-8ab768f2b8b8'
'39XXY$SH9Ea8fnYhTeyhYu'

 

Further reading:

Its good to see that IFC for Revit development is continuing… This post shows how you can download and install the new version, along with detail on what has been updated in this version.

Installation:

Download and run MSI, you can use this link to Direct Download IFC v19.2.0.0 from GitHub

Checking your Version:

In Revit, go to:

  • File menu
  • Export ->
  • IFC
  • Look at the top of the dialog box, it should say “Export IFC (v.19.2.0.0)

Here is a list of fixes from the Release Notes:

General:
• This is generally a bug fix release with some new IFC functionality.

New Export Functionality:
• IFC Exporter now supports IFC Spatial Container assignment override using IfcSpatialContainer parameter. Valid values are: “IFCSITE”, “IFCBUILDING”, or name of the Building Storey
• Improved detection of Door operation type using the 2D swing symbol (arc). The improved version detects range of angles (not limited to 90, 180 or 360 degrees only)
• Added support for IfcCivilElement
• Replace IfcRelConnectsPortToElement with IfcRelNests for IFC4 export as recommended in IFC4 specifications, allowing non-IfcDIstributionElement to participates in the connectivity
• Added support for RampFlight and Run from generic models or family representing more complex Ramp for export to IfcRamp and IfcRampFlight
• Added various property Calculators
• Improve performance when exporting a large mesh
• Enable IFC Property Templates
• Allow multiple Property Template mapping from txt
• Projection improvement
• Enable site and project property creation
• Utilize Site GlobalId method
• Add multilanguage support files for German language (DE)
• Provide a complete list of all Shared Parameters used by Revit on export including ALL properties defined in IFC PropertySet Definition for both Instances and Types. The lists are included in the installer and will be placed in the install folder: IFC Shared Parameters-RevitIFCBuiltIn_ALL.txt (for the Instance parameters) and IFC Shared Parameters-RevitIFCBuiltIn-Type_ALL.txt (for the Type parameters).
• Improve consistency for setting the object direct attributes, support IfcObjectType[Type] special parameter to drive instance ObjectType parameter from the Type, update the shared parameter definition files (now for [Type] parameters we will also maintain the GUID as long as it remains)
• Incremental work towards IFC4RV 1.2 MVD

Export Bug Fixes:
• Consistent ExportAs entity and its PredefinedTypes
• Export fails when there is no associated Plan View to a level
• Additional fix for error getting 2D data when there is no Level associated to the FamilyInstance
• Various fixes related to missing geometry and export failures
• Fixed performance issue in IFC2x3 export due to error in creating types
• Fixed issue with slanted Pile
• Fixed issue related to element that is split into parts
• Improvement in handling level of Part Override
• Some improvements on classification (issue #31)
• Improve voiding of IfcMappedItem representation (issue #9)
• Fixed issue on Composite curve tolerance (issue #5)
• Fixed issue where element is still exported even though it is set to not-exported in the mapping table
• Bugfix for incorrect cylindrical hollow core Beam export in IFC4RV
• Fixed for issue #51
• Bugfix based on Pull request #52 for MEP connector, and a few clean-ups
• Fixed minor issue to ensure generic element exporter will generate consistent GUID for the instance
• Fixed issue when OverrideElementContainment is used but the Site does not have site geometry (from Topography surface)
• Add support of OverrideElementContainment also for SpatialElement (Room/Space/Area). This enables export to place IfcSpace directly to IfcSite for example, which is useful for outdoor spaces
• Refactored the handling of valid entity and type and fixed a few defects related to it (Github issue #68)
• Fixed issue with Stair Landing that is offset far away from the supposed location
• Fixed issue with missing geometry when assigning IfcExportAs to the Spatial Element (Issue #23) However, in IFC4RV or DTV, there is a fixed list of valid entities that will be enforced, entity such as IfcExternalSpatialElement will be exported as IfcBuildingElementProxy.
• Fixed performance issue when there is a large triangulated geometry for export to IFC4RV
• Fixed issue of exception raised during export when “Export schedules as property sets” option is selected, and the model contains ViewSchedule from the template
• Update Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml.cs (issue #59)
• IFCBooleanOperator.Union don’t work! (issue #32)
• Fixed issue in exporting IfcBuildingElementProxy that assigns an invalid enumeration for CompositionType in Ifc2x3 export
• Fixed issue related to opening that cuts through multiple walls (note that this is not yet 100%. In some cases, due to the extended body of the opening (that is defined in the native code) there may be more cut than it should for a few cases
• Fixed issue with changing GUID of Window or Door when it is in the context of the opening that cuts multiple walls (issue “IFC Guid on family” in SourceForge)
• Fixed IfcWindowLiningProperties, IfcWindowPanelProperties GUID issue
• Improve handling for multiple meshes in a tessellated geometry that causes missing some surface body.
• Fixed issues of UserDefined propertysets that fails to recognize the Pset assigned to a Type. Also improve the handling for Conditional Pset (by PredefinedType)
• Fixed regression issue #70 missing toprail for IfcRailing on export
• Fixed issue with “runaway” flex duct with “Keep Tessellated Geometry as Triangulation” option selected (issue #58)
• Fixed regression issue (issue #96) IfcZone ObjectType not exported
• Fixed issue of Naming override/default value, and issue of Qto_ properties are not exported
• Fixed issue on a wrong enumeration for the SweptArea (it was set to .CURVE., should be .AREA.)
• Fixed for orphaned entities and wrong footprint information due to incorrect projection direction for IFC4RV requirements. IFC4RV Beam (Arch) is now without error in the automated test
• 1st fixed for issue related to runaway parts in “export only elements visible in view” (there are still situations that may cause a wrong rotation, but the test case reported in issue #86 so far looks good)

Import Bug Fixes:
• Improve voiding of IfcMappedItem representation (#9)

 

I have posted about BIMserver a few times before, including how to setup and run your own IFC web server. It seems that BIMserver and IFCWebserver are actually different but similar things (see this page). There is a publicly accessible instance of IFC Web Server over at this link.

The hosted version seems to be a bit of tech demonstration rather than a full production tool? Here is a link to the GitHub repos as well.

To test it out, you can take these basic steps:

  1. Create a user account and login
  2. Upload an IFC file (I tried a 20mb file which took quite a while)
  3. Wait for processing
  4. View and work with your file

Here is a look at the basic interface:

It offers a few interesting functions, including the ability to browse the data as a tree:

 

From the website:

IFC WebServer is a data model server and online viewer for Building Information Models (BIM) based on IFC standards.

It aims to simplify sharing and exchanging of information from BIM models using open and standard formats like (IFC, HTML, XML, CSV, JSON) and check the quality of BIM models (Level of Details, Level of Development). BIM managers and designers can query, filter and make reports about any information inside IFC models easily.

The project consists mainly of two parts:

(1) Data model server IFCWebServer

IFCWebServer enable 100% access to all information and relations inside IFC models. It supports  all IFC official release starting with IFC2X_Final issued on 2001 to the latest release IFC4 Add 2 release issued on July 2016. Moreover, it supports any valid IFC sub schema or extended schema so it can be used by researchers and IFC developers .

The IFCWebServer can be used also in universities as an easy to use portal within BIM courses. Students can register and upload IFC models, explore the models structure, apply filters, create sub-models, generate reports, study the IFC data model and compare IFC official releases.

(2) Online BIMViewer

Despite of having easy access to the information in BIM models as the main interest (through queries, filters, scripts and reports), the online 3D visualization offered by BIMViewer provide an handy way to view, share BIM models and visualize the results of data queries online inside the web browser.

The excellent and open-source IFC extension for Revit (previously known as IFC Exporter) has been updated. Please see below for download links and update details.

Download links:
16.6 for Revit 2016

17.3 for Revit 2017

Readme details for the latest release:

General:

– Minor improvements to the Importer class to make it easier for developers to create a custom Importer.
– We now support the IFC4 Addendum 2 schema.  Specific improvements based on that will be listed below.  For this update, you will have to manually add the IFC4_Add2.exp file (included with this package), to the EDM subfolder of your Revit Program folder.  We will automate this in a future update.

New Export Functionality:

– Allow overriding material names on export by using IfcName shared parameter.
– Expand the use of types for many elements that didn’t export types before, including beams (IfcBeamType), curtain walls (IfcCurtainWallType, and types for mullions and panels), and footings (IfcFootingType).
– Improved ability to export some geometry as IfcSweptSolid.
– Try to use axis information, if it exists, when exporting beams and members in addition to columns.
– (IFC4) Better support beam, column, and member base quantities, including weight.
– (IFC4) Collect material information for profiles for beams and columns.
– (IFC4) Expand use of FootPrint representations to columns and slabs.
– (IFC4) Expand use of IfcMaterialLayerSetUsage if the entity has a compound structure in Revit, as allowed by IFC.
– (IFC4) No longer create StandardCase IFC entities, as these have been deprecated (including IfcWallStandardCase).
– (IFC4) Support IfcMaterialConstituent and IfcMaterialProfileSet for a number of elements.
– (IFC4) Use Built-in parameter “Structural_Bend_Dir_Angle” to get “Roll” property for PSet_BeamCommon and PSet_ColumnCommon.
– (IFCAdd2) Support IfcPolygonalFaceSet.

Export Bug Fixes:
– Allow exporting to IFC while using Collaboration for Revit where the default directory isn’t local.
– Better support for MEP type entities, that didn’t always export correctly.
– Correct the parameters of the directrix of some IfcSweptSolids.
– Fix correct mapping of IfcBurnerType/IfcGasTerminalType and IfcElectricHeaterType/IfcSpaceHeaterType.
– Fix creation of types for sub-entities of IfcDistributionControlElement.
– Fix offset problem when using the “Export Linked Files as Separate IFCs” option in locales where the decimal mark is not a point.
– (IFC4) Correct names of IFC4 entity quantity sets.
– (IFC4) Fix the name of IfcCommunicationsApplianceType.

New Import Functionality:

– Add support for IfcDerivedProfileDef.
– Support IfcRelClassification.
– (IFC4) Support IfcMaterialProfile, IfcMaterialProfileSet, and IfcMaterialProfileSetUsage.
– (IFC4) Support IfcMaterialConstituent and IfcMaterialConstituentSet.
– (IFC4) Support IfcTessellatedFaceSet and IfcPolygonalFaceSet.
– (IFC4) Improve mapping from Roll parameter to structural bend direction angle.
– (API only) Allow for two new options, CreateDuplicateZoneGeometry and CreateDuplicateContainerGeometry, that disable the duplication of geometry for zone elements and containers, respectively.

Import Bug Fixes:
– Better reporting when importing an IFC file with invalid rectangular or circular profiles (e.g., a 0 radius profile).
– Don’t show the void geometry when subtracting a void from an empty solid as a result of an IfcBooleanResult calculation.
– Ensure that IFC2x schema files can still be imported.
– Fix import of some IfcSurfaceCurveSweptAreaSolids.

When Revit exports to IFC, it typically uses the current Location (Survey Point) Shared Coordinates as Origin. You can observe this in the IFC file:

2%2Bifc.png

But what if you want to Export to IFC with Project coordinates (Revit origin), not Shared?

We want to do this because we have set up the import process from Tekla using this same Revit origin, here and particularly this:

tekla.png

1) Firstly, make a container RVT file with one Site Location, no shared coordinates. In other words, Project Base Point, Survey Point, and Revit Origin are all in one place.

1%2Bproject.png

2) Then, open the project you want to export, and link this ‘container’ file Origin-to-Origin

3) Transfer Project Standards:

3.png

4) Choose the Link you made, and Project Info (only):

4.png

5) Choose New Only (this will just bring in the uniquely named project location from the link):

5.png

6) Open Location dialog in Revit, under Site you will notice a new “Site“. Set it current with the Make Current button:

6.png

7) Now that the Project Origin (neutral coordinates) are set, you can export to IFC:

7.png

8) After Exporting, reset the coordinates back to what it was before with Make Current:

8.png

9) Optional: delete the IFC Export site definition if you don’t need it anymore…

I previously posted about a similar method, but it was a bit ‘destructive’, whereas the above process can be implemented into a live project more easily:
What Revit Wants: When and how to neutralize Survey coordinates for IFC export from Revit

Further reading:

Ever wondered how to install and use BIMserver to create your own IFC web viewer?

Sometimes I finish a blog post and think, what a mess…

That’s because I often sketch out things as I do them, on the fly. And so you end up with essentially a collection of notes. In any case, here are my notes on how I got BIMserver up and running on my workstation, so that I can view, merge and work with IFC files locally. I hope you can understand the fragments of thought below 🙂

Prerequisites
The bimserver Java module will be limited by the Java version on your system. So, if you want to be able use big memory, you should be running a 64 bit Java engine.

Install JDK for 64 bit windows, such as from here:

Windows x64 187.31 MB jdk-8u77-windows-x64.exe

Download and Installation
Release 1.4.0-FINAL-2015-11-04 · opensourceBIM/BIMserver

osbim.png

Put the bimserver jar file in some logical place on your computer, it will create subfolders here.

Important Note! I discovered that bimserver doesn’t play nicely with file paths that have a whitespace character, so use underscores if you have to

Start by double clicking the JAR file – bimserver-1.4.0-FINAL-2015-11-04.jar

Then, tweak settings to your liking. Here are mine:

settings.png

Click Start

Allow the BIMserver engine to initialize itself for a few moments, it will create a bunch of folders.

Once its ready, you might have to give it access through Windows Firewall

firewall.png

Click Launch Webbrowser, then fill out the login details:

ui.png

Once logged in to the client in the browser, use Project – New Project, and give it a name.

You now have a space where you can upload, merge, view, query and validate IFC files.

To Merge IFC Files

  1. Add ‘sub projects’ for each IFC you want to merge
  2. Checkin a model to each subproject
  3. You can now view the 3D merged IFC model in your web browser by clicking on the top level ‘eye’ symbol and wait for Loading to complete
  4. Also, you can download the top level ‘merged’ project as a single IFC

 

SUBPROJ.png

To test your merged model, you can immediately create a New Project and Checkin your merged model.

Further notes
You can now create multi-tasked IFC geometry tasks, which look like this:

ifc%2Bmultitasking.png

Sometimes they use lots of memory!

geommem.png

Keep in mind that this is essentially a web application. The ‘next level’ would be to set this up to run on your company webserver to share IFC models internally or to everyone via the cloud.

The source for the web viewer is here:
opensourceBIM/bimvie.ws: Javascript client for Building Information Modelling, using open standards like IFC, BCF and BIMSie. Using Bootstrap, BIM Surfer, etc..

This video may be of interest:
https://www.youtube.com/watch?v=jqIVylRMRu0

IFC for Revit 2015 (v15.7):
http://apps.exchange.autodesk.com/RVT/en/Detail/Index?id=appstore.exchange.autodesk.com%3aifc2015_windows32and64%3aen

IFC for Revit 2016 (v16.4):
http://apps.exchange.autodesk.com/RVT/en/Detail/Index?id=appstore.exchange.autodesk.com%3aifc2016_windows32and64%3aen

Details:
New Export Functionality:
Append “(Type)” to all internal Revit type property sets, to avoid having multiple property sets with the same name assigned to the same IFC entity.
Changed how the classification code is parsed so that classifications can have brackets and colons in them.
“Extra Low” level of detail now applies to all faceted BRep geometry, allowing many more files to export without hitting the size limit.
If a userdefined property set contains the same property name more than once, take the last nonempty value (don’t duplicate the property name).
Rebar elements can generate up to 1024 consistent GUIDs for individual IfcReinforcementBars, up from 256.
(IFC4) Zones can now have a long name, set by the “ZoneLongName” shared parameter for nonMEP zones, and the “IfcLongName” parameter for MEP zones.

Export Bug Fixes:
Don’t create orphaned IfcStyledItems.
Don’t export invisible geometry in beams.
Export DirectShapes of Walls category.
Export elements with empty custom classification field values.
Floors exported as IfcSlabs correctly report if they are load bearing or not, using either the “LoadBearing” shared parameter or the Structural builtin parameter, in that order.
Improve performance in certain cases where we can’t create a valid tessellation for a face.
The “Use active view to generate geometry” option now works correctly.
(IFC4) Correct the orientation of some IfcAdvancedBRep faces.

New Import Functionality:
Import IfcProxy as Generic Models.

Import Bug Fixes:
Fix how the IFC GUID is set for certain elements.
Fix the orientation of some imported objects where part of the local placement needs to be calculated.
(IFC4) Read in some missing relations caused by “IsDefinedBy” split into 3 inverse attributes.

via email

ifc.png