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

    Model disappears when I click Zoom Extents

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    4 Posts 2 Posters 2.5k 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.
    • P Offline
      PhoebeAnn
      last edited by

      I've had this problem in the past when I had too many Dimension items, but this one has none. If anyone can tell me how to locate the reason for the failure, I'd appreciate it.
      Sheet4c.skp

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

        This is usually caused by something many miles from the origin causing the model's extents to become unexpectedly large.
        A bug in newer SketchUp versions is known, relating to text associated with geometry...
        When the geometry is deleted its associated text can whizz off into outer-space...

        You can copy+paste this code into the Ruby Console +<enter>
        It moves any such wayward Text entities back to the origin...

        model = Sketchup.active_model
        model.start_operation("TextCheck", false)
        ss = model.selection
        txts = []
        ctr = 0
        puts "\nChecking Text in Model...\n\n"
        model.entities.grep(Sketchup;;Text).each{|t|
          if t.point.to_a.any?(&;nan?)
            ctr+=1
            puts "#{ctr}; \"#{t.text}\" on Layer \"#{t.layer.name}\" @ #{t.point.to_a} - relocated at [0, 0, 0]"
            t.point=ORIGIN
            t.bounds.clear
            t.layer.visible = true
            t.hidden = false
            txts << t
          end
        }
        dtxs = []
        ctr = 0
        puts "\nChecking Text inside Definitions...\n\n"
        model.definitions.each{|d|
          d.entities.grep(Sketchup;;Text).each{|t|
            if t.point.to_a.any?(&;nan?)
              ctr+=1
              puts "#{ctr}; Defn \"d.name\" ; Text = \"#{t.text}\" on Layer \"#{t.layer.name}\" @ #{t.point.to_a} - relocated at [0, 0, 0]"
              t.point=ORIGIN
              t.bounds.clear
              t.layer.visible = true
              t.hidden = false
              dtxs << t
            end
          }
          d.invalidate_bounds
        }
        view = model.active_view
        if txts[0]
          model.bounds.clear
          bb = Geom;;BoundingBox.new
          bb.add(ORIGIN)
          model.bounds.add(bb)
          view.refresh
          puts "\nTrying to force Model 'Zoom Extents' - please wait, it might take several seconds..."
          puts "\nThe relocated Model Text will now be Selected - after it completes press Delete if desired..."
          puts "\nAny problem Text relocated inside Definitions must be manually edited..." if dtxs[0]
          ss.clear
          ss.add(txts)
          3.times{
            view.zoom_extents
            view.refresh
          }
          model.commit_operation
          view.refresh
          puts "\nDone."
        elsif dtxs[0]
          puts "\nAny problem Text relocated inside Definitions must be manually edited..."
          puts "\nDone."
          view.refresh
          model.commit_operation
        else
          puts "\nNo Text problems found..."
          model.abort_operation
        end
        puts
        

        I ran it on your SKP and it's a single Text entity saying, "6 3/4 x 18 24 FV4 GlueLam (B3) above", that is flaky and so far from the origin it's NaN away !

        I haven't attached the fixed SKP, because you can do the simple fix yourself in under a second...

        Also note that your model needs 'fixing' because it has duplicate persistent IDs for several groups [use Model Info > Statistics > Fix...]

        And it'd also be easier to navigate in your model if the Axes were switched on and you used a Perspective Camera...

        TIG

        1 Reply Last reply Reply Quote 0
        • P Offline
          PhoebeAnn
          last edited by

          Thanks. I didn't know I had a Ruby console (using Make 2017), but I'll look. Didn't use perspective camera because I'm working in 2D/parallel all the time. Very likely duplicate IDs - I have never been able to find, use, or delete a group after creating one. You may infer I'm a rank beginner...

          1 Reply Last reply Reply Quote 0
          • P Offline
            PhoebeAnn
            last edited by

            Excellent. Thanks again, and thanks for making me do it myself.

            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