How to set View Guides ON?


#1

It’s not in the list of "Sketchup::send_action"s.
Guides AKA construction lines and points: no reference to setting view on for them either?


#2

The command to cause Guides to be visible is

Sketchup.send_action('viewShowGuides:')

Oddly, so far as I know there is no command to hide the guides.


#3

Oddly it’s not in the documentation.
\http://ruby.sketchup.com/Sketchup.html#send_action-class_method
But then again, that’s not so odd.


#4

Alas, over time people have turned up a number of send_action command strings that are not officially documented but that work reliably. I’ve never seen an explanation for the omissions.


#5

You shouldn’t be using send_actions when you don’t need to.

Sketchup.active_model.rendering_options[“HideConstructionGeometry”]
returns the current value - ‘false’ if ON, ‘true’ if OFF,

Sketchup.active_model.rendering_options[“HideConstructionGeometry”]=true
hides the clines.
Sketchup.active_model.rendering_options[“HideConstructionGeometry”]=false
shows the clines.

To see all of the possible ‘rendering_options’ use:
Sketchup.active_model.rendering_options.each{|opt| puts opt }
There are many…


#6

Yet in the ruby console:
Sketchup.active_model.rendering_options[“HideConstructionGeometry”]=false
Gives:

“undefined local variable or method `“HideConstructionGeometry”’ for main:Object”


#7

Gotta be a typo somewhere in your test! That is a string literal, which can’t possibly be undefined.


#8

It will work fine.
At first I suspected that you copied it with some formatting ?
Or made a typo…

Now I tested it myself.
If you copy directly from the post ‘smart-quotes’ get used - this must be a recent change ??
If you ensure that the " are all vanilla " it’ll work OK.

I think this is a reversion and needs fixing in the forum: @SketchUp_Moderator


#9

use single quotes and avoid the issue…

Sketchup.active_model.rendering_options['HideConstructionGeometry'] = false

john


#10

I didn’t realize there were three types of double quotes: Left leaning,
center, and right leaning.

When I copy from TIG’s post its pastes as a left and a right.(??)
When I type it myself I get 2 center double quotes which works.
As do single quotes.

Barry Milliken, Architect


#11

The root of the issue is that I simply used ‘bold’ on the text, not a code-block.
So weirdly both “cat” and “cat” fail with smart-quotes substituted BUT "cat" [in a code-block] keeps its " correctly.
The work around of using single quotes has limitations.
So if using double-quotes ‘code’ block it !


#12

Ruby allows the use of all quote mark types in Text and it’s easily shown with neither of these needing escaping…

"Don’t say “Hello”" and 'Don’t say “Hello”'

however, only 'singles' or "doubles" and not ‘singles’ or “doubles” can be used for enclosing strings …

and only <<- HEREDOC, %[], %Q[] or "doubles" allow interpolation…

“#{ENV['HOME']}” with other types of encaptulation won’t work

I tend to use the common ruby style: double-quoted for strings with interpolated values and single-quoted strings with literal values.

john


#13

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.