how do i highlight selected element of datasmith runtime?

i know its supposed to be easy but it doesn’t work as i expected to


instead of one at a time on item clicked


but still show the color on the other element

You need to detail more what you are trying to do, it is not clear.

There are some functions to get actors under cursor: Get Hit Result Under Cursor for Objects | Unreal Engine Documentation

You have to store the default materials of a static mesh component somewhere, so you can reapply the good material once you deselect. Applying “none” is not a good solution.


that’s the code that manage the selection and shows the attribute of the element of the Revit model based on

and for the attribute two part

so my Q is how do I make selection with one element is highlighted each time with its his attribute

You need to store the last actor you have “Highlighted” (1).

If this actor is not empty you first have to “de Highlight” it (2): that means you need to store the original material that was stored on your static mesh component of your actor, something you should do in step (3). Then you need to reapply all the original materials to your static mesh components. To be done in step (2) but not fully shown on the screenshot.

Please note that some actors have static mesh component but are not static mesh actors, so instead of casting to a static mesh actor you should get all static mesh component on actor (2) and (3)

Once you have “de highlighted” your last Hit actor you got to step (3):

  • you have to replace it by the new hit actor, you need to store it into the variable
  • you need to “highlight” your new hit actor
  • you need to save all the material slots of all the static mesh component of your new hit actor to be able to reset this actor later on. To be done in step (3) but not shown on the screenshot.