Tools to move IFC geometry from global coordinates to local

If I recieve an IFC where all geometry is referenced to global coordinates, is there a tool available to move the base point or the geometry closer (local coordinates)?

I doubt it. One save way (not screwing with notepad) is Import 》 move 》 export

1 Like

Yes, there are a few ways to do this. If you want to do it headlessly, IfcPatch, which is part of IfcOpenShell and the BlenderBIM Add-on does it. Just run:

$ ifcpatch -i input.ifc -o output.ifc -r ResetAbsoluteCoordinates

The logfile which denote the offset it has determined.

Also, if you don’t want to patch the IFC file, the BlenderBIM Add-on has import options to offset coordinates, designed for BIM tools that work in global coordinates (and correctly so!) like 12D.

If, instead, the BIM authoring tool simply places the site or building coordinates incorrectly in global coordinates (e.g. in Revit), then this is how you bring it to local coordinates:

$ ifcpatch -i input.ifc -r ResetSpatialElementLocations -a IfcSite
$ ifcpatch -i input.ifc -r ResetSpatialElementLocations -a IfcBuilding

You can also change IfcBuildingStorey elevations:

$ ifcpatch -i input.ifc -r OffsetStoreyElevations -a "-12345"

All the software above is free software and cross platform.

3 Likes

Thanks a lot for the answers guys! I’ve been trying to figure out how to run ifcpatch from Windows. I used anaconda to install ifcopenshell. Is it possible to run ifcpatch from a python script?

I also tried to run ifcpath from Anaconda Promt like this, but got the following error:

python ifcpatch.py -i ifcfooting.ifc -o output.ifc -r ResetAbsoluteCoordinates
# Loading IFC file ...
# Loading patch recipe ...
Traceback (most recent call last):
  File "ifcpatch.py", line 52, in <module>
    execute(args)
  File "ifcpatch.py", line 12, in execute
    ifc_file, logger, args.arguments)
TypeError: __init__() takes 3 positional arguments but 4 were given

It depends with which software the IFC file was created, but if you know how the data is structured, you could be able to edit the file with a script. I use Python to tackle such issues and parse the IFC as a text file.

For simple and fast fixes, it’s enough, but it definitely isn’t an integrated solution.

1 Like

You’ve almost got it! Unfortunately you spotted a bug :slight_smile: It’s now fixed:

Please let me know if it works now through the Anaconda prompt :slight_smile: I will also package it as a standalone executable (i.e. no need to install Python, Anaconda, etc) in the future.

Of course it is possible to run from a Python script too. This is the module you need:

Then just:

import ResetAbsoluteCoordinates
import ifcopenshell
import logging

ResetAbsoluteCoordinates.Patcher(ifcopenshell.open('foo.ifc'), logging.getLogger('IFCPatch'), None)

Every recipe available with IfcPatch can run this way.

1 Like

Thanks! It worked like a charm in Anaconda Promt. Very quick too.

# Loading IFC file ...
# Loading patch recipe ...
# Patching ...
# Writing patched file ...
# All tasks are complete :-)
1 Like

Another solution, but specific for importing IFC by shared coordinates in Revit:The importer from Geometry Gym seems to work fine.

3 Likes

Simplebim by Datacubist has a graphical interface for location changes. (works well most of the time, but there is I think still today a rounding error for extremely large figures)

Thanks for the suggestion! I actually had a look around the menus in Simple BIM, but couldnt find a commamd to change coordinates. Maybe you can give me a clue?

Open the Model Placement Editor dialog from ‘Add Palette’.
There’s several ways to use this, the simplest maybe just to use ‘Pick Origin’ and click on the (survey?) point which you may know is designated as the local coordinate origin…
As said, there are some issues with this though in rounding errors, so YMMV.
Another way to move the model is to use the Simplebim excel templates, if you need to do the changes to a number of files or repeatedly.
I have sent in a request to Simplebim to offer a transformation matrix approach which would probably offer the best precision (we come across those often with pointclouds etc…).


image

1 Like

Most software has different options to import / export to locations.
BricsCAD DWG has these two. Either global or site specific

1 Like