Query and Emphasise spatial containments #12
-
Hi, I am new to iTwin and I'm interested in understanding how to implement the functionality that allows querying a spatial containment (such as a restroom) and highlighting it in the iModel. I came across a video on YouTube (https://youtu.be/xqi3-sNdlzI?list=PL_HBHDZGo5EH5LI1GOGoAx0A4dNSMysqr&t=1318)that introduces this feature, but I'm unsure about how to actually implement it. Can you provide guidance or instructions on how to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi yibodong2001, To implement this feature you first need to query the After having the Note: You could also directly add the You can even define how an element should be highlighted by changing |
Beta Was this translation helpful? Give feedback.
Hi yibodong2001,
To implement this feature you first need to query the
iModel
to get the properties of element such as it'sECInstanceID
.You can learn about writing ECSQL queries from here https://www.itwinjs.org/learning/ecsqltutorial/
After having the
ECInstanceIDs
of the element you can highlight it by adding it in the iModelConnection'sSelectionSet
https://www.itwinjs.org/reference/core-frontend/selectionset/selectionset/ adding element into this set highlight the element.This perhaps only work if
wantSyncWithSelectionSet
property set to true inHiliteSet
.Note: You could also directly add the
ECInstanceIDs
of the element into the iModelConnection'sHiliteSet
https://www.itwinjs.or…