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:

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:

TBP is a Tekla container format, and part of what it typically contains is the model data in IFC format. Just open the TBP in an archive viewer like 7-zip:

ifc1.png

Now you can see the folder structure inside the TBP. If you open up the files subfolder, you should find some IFC data:

ifc2.png

You can copy or extract the IFC to a folder on your computer, and then open it or link it to Revit as usual.

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

Links below:

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

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

Update notes for IFC for Revit 2015 (v15.6):
General:
– Added some minor export performance tweaks.
– Added IFC4 Design Transfer View as an option.  With this option, Revit will attempt to create IfcAdvancedBReps in some cases.
– The import log file now contains the importer version at the end.

New Export Functionality:
– Display the element id for each element as it is exported.
– Create IfcGroups for multiple IfcReinforcingBars created by one rebar element in Revit.
– (IFC4) Add support for ConicalFace and fix RevolvedFace for IfcAdvancedBRep.
– (IFC4) Reuse IfcCartesianPoints when exporting an IfcAdvancedBRep.

Export Bug Fixes:
– Associate some entities with IfcBuilding if they have no other spatial containment, or there are no levels.
– Correctly export DirectShapes of Ramp, Stairs, or certain MEP categories.
– Correctly relate IfcAssembly to IfcBuildingStorey in certain cases.
– Export some elements with geometry that couldn’t be correctly split into multiple solids.
– Fix crash in certain cases where we can’t create a valid tessellation for a face.
– Fix crash when exporting certain vertical roofs.
– Fix crash when exporting elements with no bounding box when splitting elements by level.
– Fix crash when exporting filled regions with invalid color definitions.
– Fix the name of IfcArbitraryClosedProfileDef entities.
– Never export curtain wall panels independent of their curtain walls.
– Remove invisible geometry when exporting families when exporting elements in the current view.
– (IFC4) Correct export of IfcMechanicalFastener.

New Import Functionality:
– Add support for extra currency types.
– Allow import of unbounded grid lines, with a warning and an arbitrary length.

Import Bug Fixes:
– The IfcSweptSurface “Position” attribute is now optional.

resized_6c20dfe8-5576-4f70-b2a8-d02ccb23

Sometimes you have a set of DWFs that you would like to work with in Revit. For example, you might have DWFs of site equipment, fences and trucks that would be useful for site modelling in Revit. Here is one way to get those dwfs into a more Revit-friendly format…

Note: You need to have iConstruct with their Smart IFC Exporter for this workflow

Phase 1
Create a container NWD for DWF files, so that you can fix rotation and coordinates:

  1. Append DWFs
  2. Save as rotator.nwd
  3. Append to an NWF
  4. Adjust units, 90 degree rotation about 1-0-0 axis as per this link:
    http://forums.autodesk.com/t5/navisworks-general-discussion/naviswork-imports-dwfx-file-incorrectly-quickpen-dwfx-export/m-p/2879154#M1154
  5. Save as container.nwf

Phase 2
Steps to convert DWF to IFC with colours and object selectability:

  1. Open two Navisworks 2016 instances
  2. Open the rotator.nwd from above in one instance
  3. Append any DWFs you would like to convert
  4. Adjust their Units and Transform until they look right
  5. Save the rotator.nwd
  6. Open the container.nwf
  7. Refresh to reload the rotator if necessary
  8. Now, hide everything but ‘shell’ elements using a search like this:
  9. Save the search set for Item Type = Shell
  10. Set up an iConstruct IFC config…

    IFC2x3
    New
    Type a Name
    Press Building button
    Expand to IfcBuildingElementProxy, userdefined
    Choose search set for Item Type = Shell from above

    Save

  11. Should look like this…

  12. Close config dialog
  13. Go to Smart IFC Export and choose the export config you just saved
  14. Fill out next dialog and press ok
  15. Choose target IFC location
  16. Wait for Navisworks to export the IFC

Phase 3 – into Revit
After IFC is created, open Revit. Ensure you have latest IFC updates installed, then open the the IFC. Wait for Revit to complete importing… For the most part, you should get a pretty good looking result. One exception is where the DWF had one ‘shell’ with multiple materials, like this:

In any case, now you have a bunch of ‘Revit elements’ (yes, I use the term loosely) that can be made into Model Groups. They aren’t in families, but you can make them into little rvts to load as links. I realise there are some limitations in this workflow, but in some cases there is no other way…

If you are interested in more to do with DWF conversions, check out these links:

What Revit Wants: How to Convert a DWF to Editable Format, or How to Export from Navisworks and Keep Modelling in BIM
What Revit Wants: Convert DWF to DWG using free tools

Future post: hope to see some Dynamo method to consume DWFs and create DirectShapes in Revit 🙂

via email:
… updates to IFC for Revit 2015 and IFC for Revit 2016, which you can get to using the links below:

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

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

Updates from the previous version are listed below. Please upgrade to the newest version!

NOTES:
1. IFC Exporter for Revit 2013 and IFC Exporter for Revit 2014 will no longer be getting regular updates.
2. IFC for Revit 2015 and 2016 includes export, import and the alternate export UI. There is no need for separate installs of each.
3. This update will work for both Revit and Revit LT.

What’s new for IFC for Revit 2015 v15.5.0 and IFC for Revit 2016 v16.2.0:
General:

– This is the IFC2x3 Coordination View import certified version of Revit for Link IFC, as seen on http://www.buildingsmart.org/compliance/certified-software/. At the time of this writing, it incorrectly lists “Autodesk Revit Architecture” as being import certified instead of “Autodesk Revit”.

– Both Link and Export will use the IFC4 Addendum 1 schema instead of the IFC4 schema if the IFC4_ADD1.EXP is loaded in the EDM sub-folder of your Revit executable folder.

New Export Functionality:

– Allow setting of IfcBuildingStorey element composition type via IfcElementCompositionType shared parameter for levels.
– IFC4: handle elliptical edges for IFC4 Design Transfer View export.
– Support export of volumes as liters (a.k.a cubic decimeters)
– Support export of volumetric flow rates as liters per second (a.k.a. cubic decimeters per second).

New Export UI Functionality:

– Better progress messages in the status bar.
– Remove list of “Current Options” from the starting UI dialog; only display the IFC Schema and MVD as “IFC Version”
– Remove path from “Projects to Export” list; the path is now a tooltip.

Export Bug Fixes:

– Correctly toggle between SLIDING_TO_LEFT / SLIDING_TO_RIGHT for flipped doors.
– Use the element type “Function” parameter when setting the “IsExternal” common property for all element types, not just wall types.

New Import Functionality:

– Add “IfcElement HasPorts Name” and “IfcElement HasPorts IfcGUID” parameters to show port information for elements. There will be multiple shared parameters created if the element has multiple ports.
– Add support for more thermal transmittance units.
– Entities that are decomposed by IfcBuildingElementPart will now be visible if either the top level category or the Parts category is enabled by default.
– If attempting to create an IfcShellBasedSurfaceModel as a Solid results in any dropped faces, import it as a Mesh instead.
– (2016 only) If processing an IfcBooleanResult entity results in a failed Revit Boolean operation, try again by slightly shifting (by 1mm) the second of the two geometries in the operation.
– Improve import of IfcSweptDiskSolid when the geometric description of the entity would create a self-intersecting surface. In this case, create the minimum number of solids possible to import as much as the geometry as possible.
– Read in IfcSystems that aren’t associated to the building via a IfcRelServicesBuildings relation.
– Read in IfcPropertyBoundedValues (including support for IFC4 version).
– Support import of volumes as liters.
– Support import of volumetric flow rates as liters per second.

Import Bug Fixes:

– Add a message to the log file if we skip importing an IfcProduct that neither has geometry nor is decomposed by other entities.
– Fix a potential crash if a file contains a large number of elements in system joined by ports.
– Improve log message when an entity can’t be imported because it has no geometry.
– Improve log message when an entity can’t create all of the facets of its tessellated geometric representation.
– Move some MEP entities from Generic Models category to the appropriate categories by default.

I recently had the pleasure of presenting at the 1st Build SA event of the year. Overall, it was a very informative event that packed heaps of useful content into a half-day of presentations, labs and discussions of real world case studies.

You can get tickets for BuildSA Event 02 – Documentation and Deliverables Part 1 here at this link.

And… here are the downloads from my session on IFC interoperability and conversions:
Slideshow
Speaker Handout
Hands on resources for Lab

(The one missing piece that you don’t get access to is the larger resource download package. If you want to get hold of some of these extra goodies, may I suggest that you attend Build SA Session 2 as per link above? )

Embedded slides:

Embedded handout:

Update: this version added some comprehension of IfcElementAssembly. What this means is that your converted IFC may end up with a subelement, and then a duplicate of it inside an IfcElementAssembly. If you are trying to do 1:1 item count comparison between Revit and Tekla BimSight, you will have to selected and hide or delete the IfcElementAssembly components.

You can use this filter to isolate them and then delete select them to delete:

Significant improvements added thanks to CADQ (see release info below).

Get version 15.4 for Revit 2015 here:
http://sourceforge.net/projects/ifcexporter/files/2015/IFC%20for%20Revit%202015%20v15.4.0.msi/download

Also 16.1 is available for Revit 2016:
http://sourceforge.net/projects/ifcexporter/files/2016/IFC%20for%20Revit%202016%20v16.1.0.msi/download

15.4 Release Info:

We have upgraded the 2015 Open source IFC project to version 15.4.0.
Changes include:

(15.4.0) IFC for Revit 2014 v15.4.0.msi
IFC for Revit 2015 Source v15.4.0.zip

General:

  • Special thanks to CAD-Q (http://www.cad-q.com/) for their contribution of this improvement to the Open Source. Their contributions will be marked with (CADQ) below.
  • The installer has been updated to once again work with Revit LT.

New Export Functionality:

  • (CADQ) Ability to export only schedules whose titles include “PSet”, “IFC” or “Common”.
  • (CADQ) Added option to use the active view to generate the exported geometry. Note that this can have unexpected effects if used in a non-3D view.
  • (CADQ) Added an export progress report to the status bar, similar to how Link IFC displays progress.
  • (CADQ) Allow export of multiple loaded exportable projects. Note that for phasing, the list of available phases will be based on the current project only. If a phase other than the default phase is chosen, it will be used for all projects assuming that they have the same phase with the same element id. If multiple projects are chosen, default names will be used for the created files in the chosen folder.
  • (CADQ) Split walls and columns by level now also splits duct segments by level.
  • (CADQ) The “Advanced” tab tessellation level of detail controls now also apply to pipe fittings. In addition, instead of being a checkbox, there are now four options: “Extra Low”, “Low”, “Medium” and “High”. The default setting is Low, which is slightly higher than the previous setting.
  • (CADQ) When splitting elements by level, if the splitting operation fails, use the original solid.
  • Added a setup for the IFC4 Design Transfer View MVD. This is still a work in progress and is intended for advanced users to experiment with. The bulk of the new functionality is around using the IfcAdvancedBRep to generate non-faceted geometry and topology on export.
  • Added support for properties with friction loss and linear velocity units, both for standard Revit properties and user defined property sets.
  • All properties for PSet_ZoneCommon are prepended with “Zone” to distinguish them from Room properties. See the wiki for more information.

Export Bug Fixes:

  • (CADQ) IFC2x3: PSet_ZoneCommon now correctly exports “GrossAreaPlanned” and “NetAreaPlanned” properties (instead of the IFC4 GrossPlannedArea and NetPlannedArea).
  • Allow export of IfcElectricDistributionPoint (IFC2x3) and IfcElectricDistributionBoard (IFC4) entity types.
  • Allow export of DirectShapes in certain categories that were previously ignored.
  • Allow export of some infill elements in host objects. Infill elements are created when a host object has an opening that is not in the currently exported phase.
  • Exporting schedules as property sets will now include room elements.
  • Fix orientation of some floors exported as containers.
  • IFC2x3: Allow export of type properties for elements whose corresponding IFC entity doesn’t have a type in user-defined property sets assigned to “IfcElementType”.
  • Significantly improve the export of walls with openings in the corners. Both the wall profile and the opening geometry have been improved to reflect user intent, and fewer clip planes are used.
  • Switch between the IFC4 IfcBurner/IfcBurnerType and IfcSpaceHeater/IfcSpaceHeaterType and their IFC2x3 counterparts depending on the schema version.

New Import Functionality:

  • Always reload a linked IFC file if the importer version is different than the one used to originally link the IFC file.
  • Better handling of IFC color information when scaling is involved.
  • Create the log file earlier, allowing for logging of more general failures.
  • If the default log file is locked, create a log file with a temporary name in the same directory.
  • Log an error if no template file could be found to generate an IFC file.
  • Log an error if the IFC file contains a zero length vectors used in local coordinate systems.
  • Process IfcPresentationLayerAssignment for grids.
  • Store IfcProject, IfcSite and IfcBuilding parameters and GUIDs in Revit Project Information if no element was created for them.

Import Bug Fixes:

  • Correctly rotate projects whose true north deviates from project north.
  • Correct unit scaling and symbol display for friction loss, linear velocity, luminous efficacy, thermal transmittance, and volumetric flow rate.
  • Include units when displaying material thicknesses in the IfcMaterialList parameter and in some log messages.
  • Import extruded geometry whose profile is a single, unbounded, closed curve (e.g., a fule circle or ellipse).
  • Improve creation of geometry in cases where a Solid couldn’t be created, and we reverted to Mesh geometry instead.
  • Improve material assignment for geometries where the material was attached to the first argument of a Boolean operation.
  • Properly scale IfcVertexPoint input.
  • Stop displaying irrelevant property sets in the IfcPropertySetList parameter.