sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Active_view.camera.get_center2d & .get_scale2d

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 259 Views 2 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.
    • T Offline
      tomasz
      last edited by

      I can read center2d and scale2d of a page camera through C++ SDK.
      Is there any chance I could get those values for active_view.camera?
      The active camera in C++ SDK is not being updated when SU view is modified (inside SketchUp).

      If it is not possible, then I kindly request this feature in Ruby API.
      Reading camera.field_of_view_is_height would be also good to have.

      Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

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

        Can't you just use:
        Sketchup.active_model.active_view.vpwidth and .vheight to get the model window's pixel size, then take half of those to get the center point relative to top-left corner of the window ?

        TIG

        1 Reply Last reply Reply Quote 0
        • T Offline
          tomasz
          last edited by

          get_center2d() and get_scale2d() C++ SDK functions return a camera shift and zoom-in factor for 2p perspective camera.

          You reply gave me idea, that maybe I could calculate the shift/zoom using InputPoint.position... This may work.

          Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

          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