viewer icon indicating copy to clipboard operation
viewer copied to clipboard

tree-widget question

Open edemiaochu opened this issue 6 months ago • 4 comments

Hi ,When I open a file that doesn't contain any geometric elements, the tree doesn't display any models, even though the file does contain models. After I create a geometric element, the tree still doesn't update. I have to reopen the file for the model to appear in the tree. Is this a bug or expected behavior? Is there a way to make the tree show models even when opening a file without geometry? Image

Image

Reopen the file

Image Image

edemiaochu avatar Jul 16 '25 08:07 edemiaochu

Hi. You can configure Models tree to show empty models by passing in this prop to ModelsTreeComponent:

<ModelsTreeComponent
  hierarchyConfig={{
    showEmptyModels: true,
  }}
/>

Models tree should update when elements are inserted into an iModel. Can you show the snippet of code adding elements to iModel?

saskliutas avatar Jul 16 '25 08:07 saskliutas

Thank you ! What about category ? The CategoriesTreeComponent componet doesn't have the hierarchyConfig prop. I use a tool , CreateLineStringTool , to insert elements

Image Image

edemiaochu avatar Jul 16 '25 08:07 edemiaochu

What about category ? The CategoriesTreeComponent componet doesn't have the hierarchyConfig prop.

https://github.com/iTwin/viewer-components-react/issues/1383

I use a tool , CreateLineStringTool , to insert elements

Am I right to think this is an Electron app? What are the resolved versions of these packages?

  • @itwin/presentation-backend
  • @itwin/presentation-frontend
  • @itwin/presentation-components

grigasp avatar Jul 23 '25 05:07 grigasp

Yes, this is an Electron app. The versions as follows:

"@itwin/presentation-backend": "^5.0.0",
"@itwin/presentation-common": "^5.0.0",
"@itwin/presentation-components": "^5.12.0",
"@itwin/presentation-frontend": "^5.0.0",
Image

edemiaochu avatar Jul 23 '25 07:07 edemiaochu