Skip to main content
October 6, 2017
Question

Can you turn off levels using Java Script?

  • October 6, 2017
  • 1 reply
  • 895 views

Hi,

I know that you can turn off levels by using the menus, but I would like to turn off certain levels in the model and attach this to a button.

I don't want it to be set to a view as in the PDF there are already 5 or 6 views and each view has its own button, I would like to be able to turn off certain levels but be able to do this function in any view. Therefor I would need double the buttons if I were to create another view in which the levels are tuned off and this would start to look a bit messy with lots of buttons everywhere so I would like to try and streamline it a bit by having as few buttons as possible.

Is Javascript the best way to achieve what I would like if it is at all possible?

Thanks

This topic has been closed for replies.

1 reply

Joel Geraci
Community Expert
Community Expert
October 6, 2017

The only way to manipulate the visibility of nodes in the 3D model without using views or the standard UI is through JavaScript so the short answer is "Yes".

To minimize the number of buttons, you might consider using a popup menu. That will let you consolidate all of the possible options under one button.

October 6, 2017

Thanks Joel,

I have tried to search for the JavaScript to turn off multiple levels but had no success do you know of any good websites that would help me learn how to code in JavaScript so I can achieve what I would like. I have no knowledge at all of JavaScript so I have no idea where to start.

I'm also guessing that a pop up menu is also down to JavaScript as I haven't managed to find anything in the normal menus.

Joel Geraci
Community Expert
Community Expert
October 6, 2017

What exactly do you mean by levels?

Also - Trying to learn JavaScript and get anything reasonable done in the 3D API at the same time will be a daunting task. You may want to outsource this functionality.