sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Scenes tabs sequencing ?

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 4 Posters 258 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Didier BurD Offline
      Didier Bur
      last edited by

      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,

      scenes_menu.jpg

      DB

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @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 left

        You 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.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          @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.

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • Didier BurD Offline
            Didier Bur
            last edited by

            Thanks guys for your answers, they sure will help!
            But what a bunch of code to do a simple task like that by script... 😒

            DB

            1 Reply Last reply Reply Quote 0
            • renderizaR Offline
              renderiza
              last edited by

              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 left

              An 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!

              [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

              1 Reply Last reply Reply Quote 0
              • renderizaR Offline
                renderiza
                last edited by

                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

                [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @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.

                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • Dan RathbunD Offline
                    Dan Rathbun
                    last edited by

                    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 method

                    Be aware that there are still some bugs in the API methods regarding Page and Pages (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.

                    πŸ’­

                    I'm not here much anymore.

                    1 Reply Last reply Reply Quote 0
                    • Dan RathbunD Offline
                      Dan Rathbun
                      last edited by

                      @thomthom said:

                      And all the settings such as hidden layers and geometry etc, aspect ratio.

                      This can help (partly): [Code] save Camera properties method

                      I'm not here much anymore.

                      1 Reply Last reply Reply Quote 0
                      • Didier BurD Offline
                        Didier Bur
                        last edited by

                        @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,

                        DB

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement