xBimTeam / XbimWebUI

Web components for xBIM Toolkit
http://xbimteam.github.io/XbimWebUI/
Other
203 stars 121 forks source link

Coloring Element #437

Closed untecnologo closed 1 year ago

untecnologo commented 1 year ago

Hello, Thank you for taking your time.

I am trying to color a surface after being clicked.

image

Is there any tutorial or example, I was checking but the old documents are not available anymore in the old answers

untecnologo commented 1 year ago

This can be useful for someone else

image

The documentation says that the value of the element takes a number or an array of numbers. But it is not working for me unless it is a number array mandatory.

andyward commented 1 year ago

The latest docs are at https://docs.xbim.net/XbimWebUI/

I think the issue with your original code in the onClick is that the 2nd parameter expects an array of ids.

See https://docs.xbim.net/XbimWebUI/classes/Viewer.html#setStyle

It should be:

wexBimViewer.setStyle(3, [arg.id], arg.model);

When you pass in a number (rather than array) it's assumed to be the ProductType