Display Section Cuts
-
Is there a way to control the 'Display Section Cuts' with ruby?
-
I looked thru the SU Registry settings and it is not there.
We would expect these settings to be kept in the model's and page's RenderingOptions hash, but I dont see it there either.
PC ONLY:
Toggle "Display Section Planes"
Sketchup.send_action(21347)
Toggle "Display Section Cuts"
Sketchup.send_action(21348)
These are equivalent to telling the Windows API to perform the default action on the control (toolbar button in this case,) with the given Automation ID.
For a query.. it might be possible to use a call thru Win32API class, to get the checked state of the button. (The toolbar window name is "Sections" for US-en, and it's Automation ID is 477.)
Or, you might get the View menu object and check the checked states of the menu items, again via a Win32API call.
-
@dan rathbun said:
I looked thru the SU Registry settings and it is not there.
We would expect these settings to be kept in the model's and page's RenderingOptions hash, but I dont see it there either.
PC ONLY:
Toggle "Display Section Planes"
Sketchup.send_action(21347)
Toggle "Display Section Cuts"
Sketchup.send_action(21348)
These are equivalent to telling the Windows API to perform the default action on the control (toolbar button in this case,) with the given Automation ID.
For a query.. it might be possible to use a call thru Win32API class, to get the checked state of the button. (The toolbar window name is "Sections" for US-en, and it's Automation ID is 477.)
Or, you might get the View menu object and check the checked states of the menu items, again via a Win32API call.
Thanks Dan the toggle is good enough for me. But i read something that the send_action with a code doesn't work on the mac version. Do you know if this is correct?
-
@unknownuser said:
But i read something that the send_action with a code doesn't work on the mac version. Do you know if this is correct?
I believe that is correct because the platforms are built with different Automation IDs. (I'm not a Mac guy, but I think the Mac IDs are strings, rather than integers, as on Windows.)
What we need is a cross-platform Sketchup.send_action() string, or these keys added to the RenderingOptions hash.
-
@dan rathbun said:
@unknownuser said:
But i read something that the send_action with a code doesn't work on the mac version. Do you know if this is correct?
I believe that is correct because the platforms are built with different Automation IDs. (I'm not a Mac guy, but I think the Mac IDs are strings, rather than integers, as on Windows.)
What we need is a cross-platform Sketchup.send_action() string, or these keys added to the RenderingOptions hash.
I agree. What we need is that everything what you can do with SU is also supported in the API. I don't know why there are some parts that aren't supported (sectionplanes, Export 2D graphic (dxf), ...)
-
@unknownuser said:
I agree. What we need is that everything what you can do with SU is also supported in the API. I don't know why there are some parts that aren't supported (sectionplanes, Export 2D graphic (dxf), ...)
Dimensions, several Material & Layer methods ... the list goes on...
Advertisement