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" endIs 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"]= falseThe object can be a
Sketchup::Modelor aSketchup::Pageinstance.
-
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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement