# ImportInstance.ByGeometry elements have wrong z-coordinates

**URL:** <https://forum.dynamobim.com/t/importinstance-bygeometry-elements-have-wrong-z-coordinates/86442>\
**Category:** Revit\
**Tags:** geometry, dynamo, bug\
**Created:** [February 21, 2023, 3:28pm UTC](https://forum.dynamobim.com/t/importinstance-bygeometry-elements-have-wrong-z-coordinates/86442 "2023-02-21T15:28:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonard.moelders](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/leonard.moelders/32/108216_2.png) [@leonard.moelders](https://forum.dynamobim.com/u/leonard.moelders)\
**Post date:** [February 21, 2023, 3:28pm UTC](https://forum.dynamobim.com/t/importinstance-bygeometry-elements-have-wrong-z-coordinates/86442/1 "2023-02-21T15:28:16Z")

</div>

Hi guys,

I have the following problem. In my code I create planar surfaces which are transferred to Revit with the `ImportInstance.ByGeometry`-Node. In Revit 2019 it works just fine, but in Revit 2021 the surfaces have wrong z-coordinates. The x- and y-coordinates are just fine. When I transfer the surfaces via `DirectShape.ByGeometry` the z-coordinates are correct.  
Does somebody know about this issue?

Here a picture of a fraction of my code:

The `Surface.PerimeterCurves`-Node on the left shows the perimetercurves from the surfaces which are handed over to revit. In the middle are the ones obtained from the revit element created via `ImportInstance.ByGeometry` and on the right from the `DirectShape`-Node. X & Y are correct. Z is wrong for the `ImportInstance`-Node. `DirectShape` is just fine.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/1/c19cdbc6a304431bbf431a74705467ed8ba19869.png)

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [February 21, 2023, 9:44pm UTC](https://forum.dynamobim.com/t/importinstance-bygeometry-elements-have-wrong-z-coordinates/86442/2 "2023-02-21T21:44:48Z")

</div>

Maybe a stupid question but have you checked your levels in Revit?

Are the Z coords all off by the same amount?

---

<div class="post-metadata">

**Author:** ![leonard.moelders](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/leonard.moelders/32/108216_2.png) [@leonard.moelders](https://forum.dynamobim.com/u/leonard.moelders)\
**Post date:** [February 22, 2023, 8:48am UTC](https://forum.dynamobim.com/t/importinstance-bygeometry-elements-have-wrong-z-coordinates/86442/3 "2023-02-22T08:48:53Z")

</div>

You are right about the level thing. In Revit 2019 the element has no base level, but in Revit 2021 its a custom level from our company which is 20m lower, which explains the difference of 20m for the z-coordinates. But how do I choose which level is the base level? Can I set a level as default?

---

<div class="post-metadata">

**Author:** ![diogoo21](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@diogoo21](https://forum.dynamobim.com/u/diogoo21)\
**Post date:** [February 22, 2023, 11:33am UTC](https://forum.dynamobim.com/t/importinstance-bygeometry-elements-have-wrong-z-coordinates/86442/4 "2023-02-22T11:33:25Z")

</div>

Hello! I had the same problem before. I think the base level it is always the lower level, and the offset value references to level 0. To solve that problem, usually i create a new level at coordinate z = 0 and set this level to the reference level of the import instance.  
It worked for me!

---

<div class="post-metadata">

**Author:** ![leonard.moelders](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/leonard.moelders/32/108216_2.png) [@leonard.moelders](https://forum.dynamobim.com/u/leonard.moelders)\
**Post date:** [February 22, 2023, 11:50am UTC](https://forum.dynamobim.com/t/importinstance-bygeometry-elements-have-wrong-z-coordinates/86442/5 "2023-02-22T11:50:31Z")

</div>

Yeah did the same now too.
