Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- createUI() {
- const viewer = this.viewer;
- const lvlSectionPanel = new LevelSectionPanel( viewer, 'Level Section' );
- viewer.addPanel(lvlSectionPanel);
- this.panel = lvlSectionPanel;
- const lvlSectionButton = new Autodesk.Viewing.UI.Button( 'toolbar-adnLevelSectionsTool' );
- lvlSectionButton.setToolTip( 'Level Sections' );
- lvlSectionButton.setIcon( 'adsk-icon-plane-y' );
- lvlSectionButton.onClick = () => {
- lvlSectionPanel.setVisible(!lvlSectionPanel.isVisible());
- };
- // ...
- const subToolbar = new Autodesk.Viewing.UI.ControlGroup( 'toolbar-adn-tools' );
- subToolbar.addControl( lvlSectionButton );
- this.subToolbar = subToolbar;
- viewer.toolbar.addControl( this.subToolbar );
- lvlSectionPanel.addVisibilityListener(( visible ) => {
- if ( visible )
- viewer.onPanelVisible( lvlSectionPanel, viewer );
- lvlSectionButton.setState( visible ? Autodesk.Viewing.UI.Button.State.ACTIVE : Autodesk.Viewing.UI.Button.State.INACTIVE );
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment