Revit MEP Fabrication Part support in Unity and Revit

Hello,

We are aiming to export MEP Fabrication Parts from Revit into Unity, and then utilise the Speckle Properties of these parts for some automated processes. However, we’ve come across some issues while trying to do so.

First issue we came across is regarding rendering of these objects in Unity. We have used the Revit connector version 2.18.0-wip4 to push the Fabrication Parts to Speckle, and Unity connector version 2.16.0 to fetch these objects into Unity. Seems like the mesh of these Fabrication Parts in Unity are rendered incorrectly, making parts of the object look like they are invisible depending on the angle you are viewing them from.

Second issue is about the properties that are uploaded to Speckle. It seems like for Fabrication Parts that have Angle properties, such as bends, the value of the Angle property that is sent to Speckle from the Revit connector is sometimes way off. Below is an example of a 30 degree bend, where the angle is showing up as 0.159 degrees.

Below is a link to our Speckle commit that has these Fabrication Parts in question:
https://speckle.xyz/streams/e9ef826a7b/commits/e48b52fc34

We are aware that the latest 2.18 connector for Revit is still WIP. We were wondering what is the estimated release date for the completed 2.18 connector version for Revit. In addition, we were also wondering what is currently in the roadmap for supporting the rendering of these fabrication parts in Unity. And finally, if the fixes to above issues are currently not in the roadmap, what are some measures we can take to fix this problem ourselves? Thanks in advance for your help!

Hi,

I’ve requested access to the stream. But from the screenshot you posted. I would guess this is an issue with 1 vs 2 sided face rendering.

By default, Unity will use 1 sided face rendering. If you want 2 sided face rendering, you can pass in your own shader into the converter component.

What render pipeline are you wanting to use?

Using shadergraph, its quite easy to create a shader with Render Face set to Both

Thank you, for the response Jed. We’ve passed in our own shader and it seems to have solved the problem with the rendering on the Unity side.

Are there any news regarding the bug on the Angle property of Fabrication Parts?

@duzun I have done a deep dive into the routines that return those angles, and we return exactly what the Revit API gives us for that parameter.

Inspecting the stream you have shared, it is true that 1 of the radius elbows is 30 degrees, and the others have a seemingly random figure, but we don’t perform any further transformation on the returned value.

Indeed, I have tried to replicate the problem and haven’t been able.

Perhaps something funky in the Revit model’s specific fabrication parts you sent to that stream causes the internal API to fail.

Could you share that file?

2 Likes

@duzun I have replied by private message to your file share, but for the benefit of future Googlers…

Between Revit 2020 and 2023 (at some point, I’ve only tested those two), the internal API improved to the point that the values reported by Speckle are a faithful rendition of the value retrieval from Revit.

In 2020, just retrieving the value of the Radius Angle of the elbow parts returns nonsensical values with a slightly different unit definition, still degrees but pre-forge APIs. So you’ll see the same version in Speckle from the two Revit versions gives different results.

Happily, this is not a conversion error introduced by our connector.

The two versions above both came from 2.17.1 Revit connector.

Screenshot 2024-02-20 114857

The unit definition changes between the two Revit versions - I suspect this is a bug fix at some point between the two.