SketchUcation Plugin Store

 

 

[Plugin] zoom_selection.rb

[Plugin] zoom_selection.rb

Postby Jim » Mon Nov 19, 2007 6:27 am

About

zoom_selection.rb adds 2 items under the Camera menu; Zoom Selection and Zoom Out.

  • Zoom Selection zooms to the selected item(s). If nothing is selected it zooms to the model extents.
  • Zoom Out zooms out by a factor of 2.

Suggested Usage

I set up 2 key Shortcuts. I use the 'z' key mapped to Zoom Selection, and 'Shift-Z' to Zoom Out.

Compatability

I'm not sure if SU5 had the ruby methods available. I don't believe it did, in which case this is for SU6 or later. Can someone confirm?

Installation

Download and move zoom_selection.rb into your Plugins folder, restart SketchUp.

zoom_selection.rb


Script Authors
Script writers can call the methods also:
Code: Select all
JF::zoomSelection
JF::zoomOut(factor) # the larger the factror, the larger the zoom out
Please, register (free) to access all the attachments on the forums.
Last edited by thomthom on Tue Dec 08, 2009 9:43 pm, edited 1 time in total.
Reason: Just cleaning up and organizing the Plugin forum. Correcting [Plugin] tag
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: zoom_selection.rb

Postby Stu » Mon Nov 19, 2007 6:29 am

Jim,
Another good one :!:
Don't stop now, mate, your on a roll :?:
:)
Stu
 
Posts: 457
Joined: Fri Nov 16, 2007 8:51 pm
Location: Melbourne

Re: zoom_selection.rb

Postby Didier Bur » Mon Nov 19, 2007 6:29 am

Hi Jim,
I confirm this is for V6 only.
A context menu would be handy too ! ;)
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur
 
Posts: 1238
Joined: Wed Nov 14, 2007 10:07 pm
Location: Nancy, France
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: zoom_selection.rb

Postby Jim » Mon Nov 19, 2007 6:30 am

Didier Bur wrote:Hi Jim,
I confirm this is for V6 only.
A context menu would be handy too ! ;)


Thanks Didier. There is a (mis-named) Zoom Extents context menu already in V6 - right-click > Zoom Extents. I could have used a simple key-shortcut to Edit/Item/Zoom Extents, but I think the single key shortcut to zoom to selection, or zoom to model extents makes for a better experience.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: zoom_selection.rb

Postby Edson » Mon Nov 19, 2007 6:31 am

jim,

the plugin is not working for me exactly as expected. for instance, when editing some group/component inside another group/component, what is taken as extents is not the object selected inside the group/component but the outside extents of the group.

i hope i made myself clear.

thanks.
edson mahfuz, architect
http://www.mahfuz.arq.br

Anyone can get you more for more, but it takes genius to get you more for less.
User avatar
Edson
Global Moderator
 
Posts: 2656
Joined: Mon Oct 22, 2007 1:46 pm
Location: Porto Alegre, Brasil
Name: Edson Mahfuz
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: zoom_selection.rb

Postby Edson » Mon Nov 19, 2007 6:31 am

jim,

forget it. i made it work by creating another shortcut. thanks for the very useful plugin.

edson
edson mahfuz, architect
http://www.mahfuz.arq.br

Anyone can get you more for more, but it takes genius to get you more for less.
User avatar
Edson
Global Moderator
 
Posts: 2656
Joined: Mon Oct 22, 2007 1:46 pm
Location: Porto Alegre, Brasil
Name: Edson Mahfuz
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: zoom_selection.rb

Postby Pixero » Mon Nov 19, 2007 6:32 am

I made a zoom selection a while ago. Even simpler.
You can find it under downloads at my site.
http://www.pixero.com
User avatar
Pixero
Premium Member
Premium Member
 
Posts: 1284
Joined: Wed Nov 14, 2007 2:58 pm
Location: Halmstad, Sweden
Name: Jan Sandström
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: zoom_selection.rb

Postby Jim » Mon Nov 19, 2007 6:33 am

I've made a minor mod to this. After zooming in, I always find myself scrolling out just a little, so I added this "back-off" to the script.

viewtopic.php?p=4960#p4960
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: zoom_selection.rb

Postby TIG » Mon Nov 19, 2007 6:34 am

Sorry for some bad news... Sketchup.send_action("viewZoomToSelection:") has zoomed the selection for some time !

Also if you select something and right-click there is a context-menu for this called "Zoom Extents" (Should be called Zoom Selection but lazy bug fixers !)

You can also shortcut key it to Z (I do already) by selecting something and then opening the Preferences Window and Shortcut option, filter for 'Zoom Ex' and you'll get Edit/Item/Zoom Extents - set the Z key to that...

Don't feel bad I have reinvented several inbuilt functions in my time !
TIG
User avatar
TIG
Global Moderator
 
Posts: 13929
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: zoom_selection.rb

Postby Jim » Mon Nov 19, 2007 6:35 am

TIG wrote:Sorry for some bad news... Sketchup.send_action("viewZoomToSelection:") has zoomed the selection for some time !

Also if you select something and right-click there is a context-menu for this called "Zoom Extents" (Should be called Zoom Selection but lazy bug fixers !)

You can also shortcut key it to Z (I do already) by selecting something ans then opening the Preferences Window and Shortcut option, filter for 'Zoom Ex' and you'll get Edit/Item/Zoom Extents - set the Z key to that...

Don't feel bad I have reinvented several inbuilt functions in my time !


Thanks TIG, the difference is that if nothing is selected, my zoom selected does a zoom extents. In addition, I add a little extra zoom-out to fit my zooming tastes. A minor enhancement perhaps, but I miss it when it's not there.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: zoom_selection.rb

Postby humanticnc » Mon Nov 19, 2007 6:37 am

I say thank you for it much RB work
humanticnc :)

[kecsaphu]
humanticnc
 
Posts: 76
Joined: Mon Nov 12, 2007 1:06 pm

Re: [Plugin] zoom_selection.rb

Postby hoangpi » Fri Nov 12, 2010 9:07 am

Thanks alot!
hoangpi
 
Posts: 1
Joined: Fri Nov 12, 2010 2:15 am
Name: Tuan Nguyen Ngoc

Re: [Plugin] zoom_selection.rb

Postby rv1974 » Sun Aug 19, 2012 7:41 am

It'd act as 'zoom extents' when nothing selected (a-la 3ds max)
Jim could you expand this rb please?
rv1974
 
Posts: 514
Joined: Tue Nov 13, 2007 11:38 am
Name: rv1974
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] zoom_selection.rb

Postby Jim » Sun Aug 19, 2012 4:34 pm

rv1974 wrote:It'd act as 'zoom extents' when nothing selected (a-la 3ds max)
Jim could you expand this rb please?


This is what it does.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] zoom_selection.rb

Postby rv1974 » Sun Aug 19, 2012 5:23 pm

Jim wrote:
rv1974 wrote:It'd act as 'zoom extents' when nothing selected (a-la 3ds max)
Jim could you expand this rb please?


This is what it does.

Jim thanks for attention.
I'm afraid it doesn't.
What I mean is the ruby should:
1. When nothing selected it'd zoom out (not zoom out by a factor of 2). It'd respect group\component extends while editing with the 'hide the rest of model' mode .
2. With item selected it'd zoom to object (no complains it's already OK).
3. It'd be 'two in one' command: one shortcut for 2 states (see p.1&2)
Edit: If I already got you 8-) could you please-please-please add the scale tweaking to your Mover 2? I love this tool but random\exact\by axys scaling is really missing.
Thank you in advance.
rv1974
 
Posts: 514
Joined: Tue Nov 13, 2007 11:38 am
Name: rv1974
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] zoom_selection.rb

Postby halroach » Tue May 07, 2013 11:21 am

This plugin is a wonderful idea when I have an imported DWG with real far away geometry that I'd like to select "blindly" geometry that I cannot see. I've tried it though, placing a bunch of components at the 0,0,0 and one component far - 1000 meters away... I select the far away component and it just won't zoom on it... it kind of zooms to extents or something similar, cause if I zoom extents I get something else... ideas?
halroach
 
Posts: 168
Joined: Sat Mar 29, 2008 1:12 pm
Name: Halroach

Re: [Plugin] zoom_selection.rb

Postby Dave R » Tue May 07, 2013 1:52 pm

The native Zoom Extents is an interesting tool. If you use Zoom extents from the toolbar, it zooms to fit all of the model that is displayed. If you make a selection and use Zoom Extents from the Context menu, it zooms to the selection.

Often, when I import a CAD file or open a SketchUp file from someone else, I hit Zoom Extents on the toolbar. If the camera zooms out so the obvious geometry is relatively small in the model space, I drag a right to left selection box around the apparently empty space making sure I don't get any of the model. Then I hit Delete and Zoom Extents again to see if I've removed the unneeded stuff.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8970
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: [Plugin] zoom_selection.rb

Postby halroach » Tue May 07, 2013 2:42 pm

Dave R wrote:
Often, when I import a CAD file or open a SketchUp file from someone else, I hit Zoom Extents on the toolbar. If the camera zooms out so the obvious geometry is relatively small in the model space, I drag a right to left selection box around the apparently empty space making sure I don't get any of the model. Then I hit Delete and Zoom Extents again to see if I've removed the unneeded stuff.


That is exactly what I do. I zoom extents and select the geometry I can't see and delete it. I was hoping though that with this plugin I could zoom in to the selected geometry to see what it is that I am going to be deleting... but it just won't zoom...
halroach
 
Posts: 168
Joined: Sat Mar 29, 2008 1:12 pm
Name: Halroach

Re: [Plugin] zoom_selection.rb

Postby Dave R » Tue May 07, 2013 2:45 pm

So use Zoom Extents from the Context menu.

I used to have a Zoom Extents on a custom toolbar that Jim did that would zoom in to the selection. I'll see if I can find it.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8970
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: [Plugin] zoom_selection.rb

Postby Dave R » Tue May 07, 2013 3:44 pm

Check this out.

There's a command for Center Selection which would probably get you started. On my PC I have his toolbar set up so Zoom Extents zooms to a selection if there is one.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8970
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: [Plugin] zoom_selection.rb

Postby halroach » Tue May 07, 2013 4:09 pm

Dave R wrote:Check this out.

There's a command for Center Selection which would probably get you started. On my PC I have his toolbar set up so Zoom Extents zooms to a selection if there is one.


Thanks!
The plugin from Jim's website (Is it the same Jim?) works!! It zooms to the selected item no matter how far or where it is.
The plugin can be found here:
https://sites.google.com/site/jimfoltz/ ... on-extents
halroach
 
Posts: 168
Joined: Sat Mar 29, 2008 1:12 pm
Name: Halroach

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Are you a Premium Member? Get your freebies here. Are you not a Premium Member yet? Upgrade your account to grab these freebies instantly.

Ad Machine
Robot
 
Posts: 2012


Return to Plugins

Who is online

Users browsing this forum: Anton_S, Dave R, Fredo6, JRicard, olopolo, saher.joubran, wanchoke and 7 guests