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

    Setting camera eye

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 4 Posters 280 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.
    • B Offline
      Brett McAllister
      last edited by

      Hi there
      I want to set my camera eye at the equivalent of zoom extents, would anyone know what array values to use?
      By the way superb forum, have learnt so much through the people who post here.

      Regards
      Brett

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        You can directly invoke zoom_extents with a send_action see http://code.google.com/apis/sketchup/docs/ourdoc/sketchup.html#send_action ( Sketchup.send_action("viewZoomExtents:")). You could then reverse engineer the Sketchup.active_model.active_view.camera.eye from that if you still want it ?

        TIG

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

          View.zoom_extents
          http://code.google.com/apis/sketchup/docs/ourdoc/view.html#zoom_extents

          @unknownuser said:

          The zoom_extents method is used to zoom to the extents about the entire model, as if the user has selected the zoom extents command from the menu.

          From the docs it seem to be identical to View.zoom... Either the methods are aliases or the docs is wrong about one of these methods...

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

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            model.active_view.zoom_extents zooms to the model's extents
            model.active_view.zoom(2.0) zooms in x2
            model.active_view.zoom(0.5) zooms out x2
            model.active_view.zoom(model.selection.to_a) zooms to the extents of the selection
            model.active_view.zoom([group1,group2]) zooms to the extents of the two groups specified in the array
            model.active_view.zoom(group) zooms to the extents of the group or one entity

            πŸ€“

            TIG

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

              So the arguments that the docs claim for .zoom_extent is incorrect?

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

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                @thomthom said:

                So the arguments that the docs claim for .zoom_extent is incorrect?

                The linked doc has NO arguments for view.zoom_extents in the text - it only gives them for view.zoom() - where it's either a float for the amount to zoom in/out >1.0/<1.0, OR an entity or an array of entities to zoom to the extents of...
                The wrong examples are given for zoom_extents - they have been copied down from view.zoom in error !!!
                πŸ˜•

                TIG

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

                  I was looking at the example - didn't notice the example under View.zoom_extents said View.zoom.

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

                  1 Reply Last reply Reply Quote 0
                  • snicoloS Offline
                    snicolo
                    last edited by

                    Should be fixed soon, I have submitted the change and it needs to be picked up by the servers.

                    thanks for the report.
                    Simone.

                    Simone Nicolo
                    QA Manager
                    http://www.sketchup.com

                    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