Scenes tabs sequencing ?
-
Hi all,
I would like to change the sequence of the scenes tabs by script, such as what you can do with a right-clic on a scene tab: move left, move right ,etc (see image).
Is there a way to do this with Ruby ? I don't think so...
Regards, -
@unknownuser said:
The code below I have tried using but seems I not understanding how to use it properly.
Sketchup.send_action(21177)
#Move selected scene right
Sketchup.send_action(21178)
#Move selected scene leftYou cannot use command ids from popup (context) mouse menus, because they are only valid when the specific popup menu is active. Also, these mouse menus are built "on-the-fly" by the application engine, and a reference to the menu objects cannot be kept.
P.S.: Do not put space between method names and their parameter list opening parenthesis.
-
@didier bur said:
I would like to change the sequence of the scenes tabs by script, such as what you can do with a right-clic on a scene tab: move left, move right ,etc (see image).
Is there a way to do this with Ruby ? I don't think so...Didier, the only current way, is to copy the scene's camera info to a new page, with a temporary name, at the new location, then delete the old page, and rename the temporary page using the old name.
Before you begin, save the page transitions setting from
model.rendering_options
and turn it OFF.
Create a reference to the old page, and save it's camera settings.
Select the page just before where you want the new page, add the new temp page.
It will automatically have the same camera settings as the page before it.
The new page will become the current selected page.
Set it's camera to the saved camera settings, and update the page.
Delete the old page.
Rename the new page, so it has the old name.
Restore the page transitions setting. -
Thanks guys for your answers, they sure will help!
But what a bunch of code to do a simple task like that by script... -
Hi,
The code below I have tried using but seems I not understanding how to use it properly.
Sketchup.send_action (21177) #Move selected scene right
Sketchup.send_action (21178) #Move selected scene leftAn alternative solution is to ignore pages is position and just call them by name & not position. Here is a thread I made asking how to do this... http://sketchucation.com/forums/viewtopic.php?f=180&t=48629
Good Luck!Fixed the link!
-
The link I posted was wrong so I fixed it..sorry about that. Here it is again... http://sketchucation.com/forums/viewtopic.php?f=180&t=48629
-
@dan rathbun said:
Didier, the only current way, is to copy the scene's camera info to a new page, with a temporary name, at the new location, then delete the old page, and rename the temporary page using the old name.
And all the settings such as hidden layers and geometry etc, aspect ratio.
But, there is many things the API doesn't give access to. Layer material and PhotoMatch scenes for instance. And in some cases the AOV is defined vertically, while other times horizontally - but this is also not exposed. So it is currently impossible to 100% recreate a scene.
-
Actually, I just re-read the description for
Pages.add
and you can copy the current page to any index if you use all 3 arguments, the 3rd is the new 0 based position index.You need to re-create the page flags.
See: [ Code ] Scene Page flags getter methodBe aware that there are still some bugs in the API methods regarding
Page
andPages
(as discussed in other topics.)You also need to have some delay in your code, so the application engine has time to create the new page, and switch between pages. And always check to be sure that
pages.selected_page
is the page you think it is, before doing something that relies upon the correct page being selected. -
@thomthom said:
And all the settings such as hidden layers and geometry etc, aspect ratio.
This can help (partly): [Code] save Camera properties method
-
@Dan,
@unknownuser said:
I just re-read the description for Pages.add
I should have done so...
Along with your "save camera" and "get_page_flags" methods, this will be easy to regenerate all my pages in the correct order (which I want to be always the same).
Thanks folks,
Advertisement