# Tools to move IFC geometry from global coordinates to local

**URL:** <https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534>\
**Category:** IFC\
**Created:** [March 25, 2020, 4:49pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534 "2020-03-25T16:49:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Einar](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Einar](https://forums.buildingsmart.org/u/Einar)\
**Post date:** [March 25, 2020, 4:49pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/1 "2020-03-25T16:49:05Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![Hans\_Lammerts](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/hans_lammerts/32/835_2.png) [@Hans\_Lammerts](https://forums.buildingsmart.org/u/Hans_Lammerts)\
**Post date:** [March 25, 2020, 8:05pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/2 "2020-03-25T20:05:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Moult](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/moult/32/196_2.png) [@Moult](https://forums.buildingsmart.org/u/Moult)\
**Post date:** [March 25, 2020, 10:07pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/3 "2020-03-25T22:07:25Z")

</div>

Yes, there are a few ways to do this. If you want to do it headlessly, [IfcPatch](https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.6.0/src/ifcpatch), which is part of [IfcOpenShell](https://ifcopenshell.org/) and the [BlenderBIM Add-on](https://blenderbim.org/) does it. Just run:

```auto
$ 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:

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

```

You can also change `IfcBuildingStorey` elevations:

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

```

All the software above is free software and cross platform.

---

<div class="post-metadata">

**Author:** ![Einar](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Einar](https://forums.buildingsmart.org/u/Einar)\
**Post date:** [March 26, 2020, 5:10pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/4 "2020-03-26T17:10:46Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![cesnik\_jure](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/cesnik_jure/32/1844_2.png) [@cesnik\_jure](https://forums.buildingsmart.org/u/cesnik_jure)\
**Post date:** [March 26, 2020, 6:37pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/5 "2020-03-26T18:37:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Moult](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/moult/32/196_2.png) [@Moult](https://forums.buildingsmart.org/u/Moult)\
**Post date:** [March 26, 2020, 10:07pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/6 "2020-03-26T22:07:13Z")

</div>

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

> <https://github.com/IfcOpenShell/IfcOpenShell/commit/46c878341dcd62ecd849e18b4fb7bd31dd5c586b>

Please let me know if it works now through the Anaconda prompt 🙂 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:

> <https://github.com/IfcOpenShell/IfcOpenShell/blob/46c878341dcd62ecd849e18b4fb7bd31dd5c586b/src/ifcpatch/recipes/ResetAbsoluteCoordinates.py>

Then just:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Einar](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Einar](https://forums.buildingsmart.org/u/Einar)\
**Post date:** [March 26, 2020, 10:34pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/7 "2020-03-26T22:34:29Z")

</div>

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 :-)
```

---

<div class="post-metadata">

**Author:** ![Einar](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Einar](https://forums.buildingsmart.org/u/Einar)\
**Post date:** [March 27, 2020, 9:14am UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/8 "2020-03-27T09:14:41Z")

</div>

Another solution, but specific for importing IFC by shared coordinates in Revit:The importer from [Geometry Gym](https://geometrygym.wordpress.com/) seems to work fine.

---

<div class="post-metadata">

**Author:** ![pejotu](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/pejotu/32/108_2.png) [@pejotu](https://forums.buildingsmart.org/u/pejotu)\
**Post date:** [April 1, 2020, 4:52pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/9 "2020-04-01T16:52:11Z")

</div>

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)

> **[Makes BIM Normal | Simplebim](https://simplebim.com/)**
>
> Makes BIM Normal on Simplebim…

---

<div class="post-metadata">

**Author:** ![Einar](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Einar](https://forums.buildingsmart.org/u/Einar)\
**Post date:** [April 1, 2020, 6:47pm UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/10 "2020-04-01T18:47:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pejotu](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/pejotu/32/108_2.png) [@pejotu](https://forums.buildingsmart.org/u/pejotu)\
**Post date:** [April 2, 2020, 5:54am UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/11 "2020-04-02T05:54:22Z")

</div>

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](https://us1.discourse-cdn.com/flex016/uploads/buildingsmart1/original/2X/f/f6afb437d9442a4bf12939f487133e7e7363f673.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/buildingsmart1/original/2X/3/36c826ec639eb36ca1c0538070158c44a69d6e7f.png)

---

<div class="post-metadata">

**Author:** ![Hans\_Lammerts](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/hans_lammerts/32/835_2.png) [@Hans\_Lammerts](https://forums.buildingsmart.org/u/Hans_Lammerts)\
**Post date:** [April 3, 2020, 8:43am UTC](https://forums.buildingsmart.org/t/tools-to-move-ifc-geometry-from-global-coordinates-to-local/2534/12 "2020-04-03T08:43:44Z")

</div>

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

 ![BricsCAD site options](https://us1.discourse-cdn.com/flex016/uploads/buildingsmart1/original/2X/f/fc60e23ebec7389624aa308e96dd0977e64158c0.jpeg)
