ImportInstance.ByGeometry elements have wrong z-coordinates

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.

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

Are the Z coords all off by the same amount?

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?

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!

Yeah did the same now too.

1 Like