Fred Coud
Fred Coud

Reputation: 147

Change size of model structure panel in Forge Autodesk

I want to change the size of the model structure panel inside Forge Autodesk. I have been looking for the good 'height' parameter in the code, but I do not find anything related to that...

Among dynamic extensions, I have tried with DataTreeView.scss, HierarchyTreeView.scss, SelectTreeView.scss, even ModelLoader...

Maybe the model structure panel's size is generated and not written in the code ? Does anyone know how I could change it, from the code ?

Upvotes: 0

Views: 875

Answers (1)

Felipe
Felipe

Reputation: 4375

You need to understand the code you are referring to (Forge RDCB) is a sample, this is NOT part of the viewer and its API directly. It provide examples using the viewer and other Forge APIs. Some of the extensions may alter some of the default styles of the viewer through custom css and some others implement custom UI using the viewer components, such as treeview but you will not find what you are looking for in those examples.

In order to modify the native panels of the viewer you need to add to your app some custom css. To find out what css properties/classes you have to overwrite, you can use Chrome developer tools, especially the Elements tab as illustrated in the picture below. Mastering that tool will help you save a lot of time when it comes to overwriting the default css.

enter image description here

You can find the implementation of the viewer at https://developer.api.autodesk.com/derivativeservice/v2/viewers/viewer3D.js

And the associated default css at https://developer.api.autodesk.com/derivativeservice/v2/viewers/style.css

Also it's not clear what you mean by change the size of the model structure panel... If you want to set the default width/height of that panel then you probably need to add the following css:

.docking-panel.model-structure-panel {
   height: 500px !important;
   width: 500px !important;
}

Upvotes: 1

Related Questions