Component Axis Display Option
-
I tried this code from the API in an attempt to find the Option name for controlling the component axis visibility but it does not run. There is a optionsmanager but the options.name line fails.
model = Sketchup.active_model optionsmanager = model.options if (optionsmanager) # If an options manager is returned, iterate through each option # provider within the options manager and display its name. for option in optionsmanager name = options.name UI.messagebox name end else UI.messagebox "Failure" end
Is there a code method for controlling the component axis visibility?
Keith
-
It is not in the options manager / provider hierarchy.
It is in the model or scene page rendering_options hierarchy.
object.rendering_options["DisplaySketchAxes"]= false
The object can be a
Sketchup::Model
or aSketchup::Page
instance. -
OR...
object.rendering_options["DisplayInstanceAxes"]= false
-
Dan that code controls the global axis. I am trying to control the individual component axis visibility.
Keith
-
Sketchup.active_model.rendering_options['DisplayInstanceAxes'] = true
-
Instead of using messageboxes to inspect the possible options I use these snippets:
Sketchup.active_model.rendering_options.each { |k,v| puts "#{k} - #{v}" }
Sketchup.active_model.options.each { |op| puts op.name; op.each { |k,v| puts "> #{k} - #{v}" } }
-
Thanks that's what I needed. I am always amazed at how quick I get answers on this forum. I would never be able to find these on my own.
Wouldn't it be nice if the examples in the Sketchup Documentation actually worked.
Keith
-
-
@ktkoh said:
Dan that code controls the global axis. I am trying to control the individual component axis visibility.
And if you had read the NEXT post after THAT, before posting you would have seen I gave you the instance key as well.
Lesson: Read the whole thread before posting.
Advertisement