Revit to Unreal Engine and BIM Metadata

Hello Community,

I could not find anything regarding this, I am sorry if I missed something.

So I am working on development of data sharing between Revit and Unreal Engine. and I would like to get the BIM information along with the 3D elements. I see that in the speckle viewer the parameters are available as selection info.

  • Is there a way to access this information with the current version Unreal Engine Speckle plugin, inside my Unreal Engine Project?
  • Is this achievable with a custom convertor?

Thanks in advance for your help.

This topic was bought up recently (see BIM data in UE 5 connector) and unfortunately the situation is the same. We don’t support any mechanism to access properties on converter Unreal actors.

However, it may be possible access specific properties through a custom converter. We have a tutorial on creating a custom converter, I recommend you check that out. It does require some familiarity with BP and C++.

And for another example, we have a related proof of concept transferring custom “tags” from GH → Unreal.

1 Like

Ok I am ok with the C++ and BP, I was already starting to explore the development of my Custom Object Conversion, I will look to that proof of concept and work on this. If you have any recommendation of tip for this to be done, let me know. Thanks for your quick response.

So I was able to pass the BIM parameters as Tags in the Unreal Actors, modifying the UBase and the USpeckleConverterComponent. Off course I am not 100% sure that this is the optimal way to make it, but for now is working good.

UBase:
The Parse function of the UBase class gets as parameter a TSharedPtr which contains all the information that I was referring in the question under the field parameters, as shown in the viewer.

So by following the same way to extract the information used for the fields “units”, “speckle_type”… I look for the Name and Value to create a FString with this structure (ParameterName.ParameterValue). Then I add it to a variable inside the UBase class, TArray Parameters.

That is all I have modified in the UBase Class.

USpeckleConverterComponent:

In this class I have added a few lines inside the function USpeckleConverterComponent::RecusivelyConvertToNative_Internal to add the each element inside the variable Parameters created in the UBase as Actor Tag.

As a result we can find the information inside each StaticMeshActor like this.

In Urneal

In Speckle viewer

If you have any recommendation or feedback regarding this approach I would appreciate it!

Amazing, you’re definitely on the right lines here.

And it looks like this solution might work for you great :raised_hands:.


There’s a couple bits of feedback I can give.

Ideally, we’ve tried to keep UBase a 1-1 equivalent to Base since its the super class for all Speckle DTO classes.
Adding builtelement/Revit specific properties, like parameters and family in this way does break from
this pattern.

If you were hoping to contribute this feature back to our main branch, this would need to be addressed.
Other users would greatly benefit from this feature, so we’d be happy to help work towards this if you’d like.


Just thinking out loud here, the obvious alternative would be to create separate DTO classes for all the main built element types Wall, Collumn, Beam, etc. But I fear this would be too tedious to implement and maintain.

A cheater solution, we can create a new DTO class, say URevitBuiltElement inheriting UDisplayValueElement that has parameters + family properties.

Then, to apply the props to the actors, we could use a custom C++ converter, rather than modifying the RecursivlyConvertToNative_Internal function.

The result would functionally be the same, but we have a nice separation between revit DTO objects and others.


What do you think? How much would you be interested in taking this further?

Ok I understand that you want to keep UBase and Base 1-1, and the approach that you suggest makes a lot of sense.

Regarding the solution, I am all in to take further.

I will for sure come back with many questions regarding the custom converter, but sounds like a nice challenge. Also while you answer this I was thinking to pass the parameters with a custom class USpeckleAssetUserData that inheritates from UAssetUserData, because this would allow me to create a better way to retrieve the parameter with Keys and Values. Thus, this will be something to add in the custom converter.

@Jedd Hello,

I have created already the new DTO class URevitBuiltElement with the parameters property in it. This class overrides the Parse function to extract the parameters from the FJsonObject received.

I have followed the tutorial to create a Converter and then I have added it to the SpeckleConverterComponent but I cannot make it work yet. I have identified that the StaticMeshConverter isi the one that creates the actor where the tags or metadata, should be added, so I tried to rewrite it and add this extra step, but I do not think is the best option, could you give a hint about the converter implementation and how to make the Conversion process actually use the DTO i have created??

Thanks

Hey @Jedd ,

I have got the code working still modifying the USpeckleConverterComponent and the UDisplayValueElement classes.

I Have created my own converted, based on the UStaticMeshConverted that is the one that uses the UDisplayValueElement, this converter have added as SpeckleTypes the UMesh, UDisplayValueElement, the URevitBuiltElement.

However when I run the Receive button the UAggregateConverter gives me this Warning for the UDisplayValueElement

In the USpeckleConverterComponent I have replaced the UStaticMeshConverter for My URevitConverter and I add it to the SpeckleConverters Array as the other converters. I do not know where can be the problem, Any idea??

Thanks a lot for your help!

Hi @jairobpicott . Sounds like you’ve made a lot of progress, congrats :raised_hands:

How have you added your URevitConverter to the USpeckleConverterComponent’s converters array?

Have you created a new instance using the context menu like so:

And then add this Instance to the USpeckleConverterComponents array?


If so, perhaps you can debug the GetConverter method, and double check that URevitConverter is indeed added to the converters array, and is checked, and CanConvertToNative is returning true.

1 Like

Hello @Jedd,

Thanks for you fast answer,

I am initializing and adding the converter to the USpeckleConverterComponent this way

I have found out that the Converter inside this function is returning as nullptr,

I also found out the way I am creating the instance of my converter with the ConstructorHelpers::FObjectFinder is returning a nullptr which is the reason is not working… I will try to find out why is this happening.

About the array in the editor it look a bit different in UE 5.3, is here that you mentioned to add the instance of my converter?

Cheers!

I have just solved, I was ignoring how the ConstructorHelpers::FObjectFinder actually works.

I have just came back from holidays and I am ready to finish and solve this. o be able to commit it back to the community

Hello, so I got it to work but not yet as you referred to be able to make the commit back. I have solved the issues mentioned above but I found out that, there is never an element that get parsed A the URevitBuiltElement that inheritates from the UDisplayValueElement.
In my previous approach the UDisplayValueElement::Parse event was the one getting the information and storing the data in the UPROPERTY I added with the parameters. For the new approach I have moved all this to the URevitBuiltElement but when importing the information, with the URevitConverter it never get to use it. Is there something am I missing?

Hi @jairobpicott,
Sounds like you’re excitingly close!

Would it be possible for you to share your code with me? maybe you can push to a fork our our repo?

Hello @Jedd

Sure, I had it in a private repository, but I have just created a fork and this is it GitHub - jairo-picott/speckle-unreal: Unreal Engine 4/5 plugin for importing objects from Speckle v2.

Please let me know if you find something in there!!

Cheers!