sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Help getting Parallel Projection in current view from Ruby

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 1.0k 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.
    • S Offline
      Skastafari
      last edited by

      I am currently tangled in a web of Camera/View/Page classes and need a working example of how to get parallel projection enabled in the current view from the Ruby console. I feel like View can be defined as what I am looking at on the screen currently, while Page is the saved Sketchup scene, and Camera seems to be how the view is displayed, fov etc. I can't seem to come up with a good method of showing parallel projection in the view. I tried setting fov to 0, it did not like that. I tried setting camera perspective to false, it likes that, but did not change the current view any. I am sure I am missing something here. It seem like a camera change should affect the current view, but found that is not the case. I found many ways not to view parallel projection, could use a snippet showing how.

      This is what I have that is working...

      model = Sketchup.active_model view = model.active_view pages = model.pages pages.selected_page = model.pages[0]#Uses Scene 1 to be parallel projected #Need method for parallel projection here, nothing I have come up with works yet. view.zoom_extents status = pages.add "Scene1_Parallel_Projected"

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

        view.camera.perspective = false

        http://www.sketchup.com/intl/en/developer/docs/ourdoc/camera#perspective=

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

        1 Reply Last reply Reply Quote 0
        • S Offline
          Skastafari
          last edited by

          Thanks thomthom, you never let me down.

          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