Zooming In To One Locked Position Only


#1

On one SketchUp 2016 drawing only it zooms in to what looks like an axes / scissors / two lines with balls on the end. I cannot get it to zoom in to any other area. When I click on zoom extents everything disappears and I have to click on the tab in the top left of the drawing to get it back. I’ve spent hours looking for the solution online. Can anyone help me please? See image below.


#2

It sounds like you have a “fragment” with very big coordinate values. If you can, zoom in on what you want to keep and select all(Ctrl+A). Then press and hold Ctrl+Shift and deselect what you want to keep and delete what is still selected.

If you are unable to do this then post the model and let someone else try.


#3

Thank you for the quick response. I think you might have us now looking in the right direction. We think the drawing may be way too big (the file is massive for a line drawing, 141mb). We want to keep everything on the drawing so can’t deselect any of it. However the scale appears to be too big (or small depending on how you look at it). We’ve pressed S but can’t get the green toggles to appear on the yellow scale box. It just shows one yellow line if that makes sense?


#4

Select all. Open the Ruby Console, paste the following ‘one-liner’ and press Enter.

m=Sketchup.active_model;e=m.active_entities;s=m.selection;t=Geom::Transformation.scaling(0.001,0.001,0.001);e.transform_entities(t,s.to_a)

this will reduce the size by 1000. Repeat if necessary.


#5

Unfortunately it doesn’t make much sense (to me anyway). Could you upload/share the model?
The file seems to be too big to upload directly into the forum, so find some other way (perhaps DropBox?).


#6

Hi Samuel, isn’t there a risk to get lots of vertices merge into much less this way? Scaling down the model that much.


#7

Perhaps I guess but, the model being as big as it is, I would think it would only get rid of tiny segments.


#8

We tried it once and it appeared to do nothing. We did it again and everything appeared to disappear. However we saved the file (original is safe) and the file is still the same size. Opened it again and still nothing there. We tried zoom extents and still nothing.

Sorry I can’t share as confidential info on there and I can’t remove it at the moment.


#9

The fact that you get what appears to be a single yellow line tells me that there is an entity very far away from the origin. Here is another one-liner that will erase the edge farthest from the origin

m=Sketchup.active_model;e=m.active_entities;e.map{|e|e.vertices}.flatten.uniq.max_by{|v|v.position.x.abs+v.position.y.abs}.edges.each{|x|e.erase_entities(x)}


#10

Thank you both for your help. We’ve had to knock it on the head and start drawing it from scratch again as we could have done that by now.


#11

The symptoms you describe sound typical of a model that has contents scattered over an area that is very large compared to the individual elements. This sometimes happens when models are imported from CAD, but it can also happen when a stray element somehow gets moved far away. When a model has this defect, zoom-extents zooms out so far that the individual elements are so small they disappear from the view, all you see is the empty space between them!

@sdmitch provided a snippet that may work if the offender is a stray edge. If there is more than one stray edge you will need to invoke the code multiple times because it deletes only one at a time. Also, if a stray edge is not the issue, the code will delete a valid edge that just happens to be farthest from the origin, so make sure you keep a safe copy of your model before you do this.

Recently we have seen several instances of a different problem that suggests a bug in SketchUp’s handling of text annotations when a model is fundamentally a 2D drawing: a Text object may have its leader information replaced with huge values. The following will find such errant Texts if you copy and paste it into the Ruby Console. The result will be an empty Array if there are none, or will contain the bad ones if there are.

  def self.singular_texts
    bad_texts = []
    texts = Sketchup.active_model.entities.grep(Sketchup::Text) do |txt|
      bad_texts << txt if !txt.nil? && singular_text?(txt)
    end
    defs = Sketchup.active_model.definitions
    defs.each do |defn|
      texts = defn.entities.grep(Sketchup::Text) do |txt|
        bad_texts << txt if !txt.nil? && singular_text?(txt)
      end
    end
    bad_texts
  end
  
  # Test for nan values in a Text's point or vector
  def self.singular_text?(txt)
    pt=txt.point
    vec = pt.vector
    pt.x.nan? || pt.y.nan? || pt.z.nan? || vec.x.nan? || vec.y.nan? || vec.z.nan?
  end
bad_texts = singular_texts

If the Array is not empty, the following will delete them:

bad_texts.each {|txt| txt.erase!}

Edit: Another less technical way if you have ThomThom’s selection toys extension is:

  • create a new layer and turn off its visibility
  • right-click and choose Select Only -> Text
  • in the Entity Info window, associate the selection with the new layer
  • Try zoom-extents now that all the texts are hidden. If things now behave properly, there is a singular text somewhere in your model.

#12

Keep the original file and experiment on a copy of the file.

Some questions about the model:

  • did you import a dwg into the modeling space and if yes, with preserving its origin?
  • is your model geo-located? If so, try clearing the geo-location to see what happens. Select all and move the selection to the origin.
  • did you import other objects from say 3D-Warehouse?
  • do you have (many) guides in your model? Try deleting all guides to see what happens. Guides in a selection have impact on the size of the yellow scale box.

#13

Answers below:

Some questions about the model:

  • did you import a dwg into the modeling space and if yes, with preserving its origin? - yes and yes
  • is your model geo-located? If so, try clearing the geo-location to see what happens. Select all and move the selection to the origin.- No
  • did you import other objects from say 3D-Warehouse? - no
  • do you have (many) guides in your model? Try deleting all guides to see what happens. Guides in a selection have impact on the size of the yellow scale box. - have done so but no change

#14

This could well be the root of your issue.
The default origin of a SketchUp model is in Boulder Colorado, if you have imported a .dwg that thinks it is somewhere else and you have Preserved the origin you can get a conflict.
Your geometry can be 1000s of miles away from the origin point of the model making it impossible to see.
Try importing the .dwg without preserving the origin and see if you get a workable result.


#15

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.