Zoom Selection
-
Oh !! I have found a script can control this function !! Thank you Jim !
Sketchup.active_model.rendering_options["InactiveHidden"] = !Sketchup.active_model.rendering_options["InactiveHidden"]
The code is ready guys !
-
Sir Matt!!!
-
Dear Matt,
How does your script work?
Regards,
Bob -
-
Thank you for the instructions.
-
Maybe my questions was not understandable.
I would like not to zoom all selected items, but to see them from the near with same distance, so that a door or a door handle is shown with same scale in the middle of the screen. Is that possible with »Zoom Selection«?
-
Hi N Lindenthal !
Ok I see ! I don't know if it's possible. I will see. -
-
Matt, a couple of bugs i think - when i am inside a group and i select a face, SU zooms to the face but hides all other geometry inside the group (!) - second (even worse) is that after i zoom, i can't do anything: the cursor is the selection tool but it actually doesn't work..it's in some kind no tool suspension. thought you'd be glad to know!
-
@CadFather
Your list of mistakes I could verify. But with right mouse click I could leave the marked object.@Matt
Is there a difference to zsel.rb?I look to your Zoom Selection, because I look for a way to find objects in my SU-model by name by dragging them in the middle of screen with even same distance. Looking distance for example even 200 cm. This way, all found objects are shown with same scale.
-
@CadFather,
When the tool's activating, you can read on the bottom left of the screen : "Right-click to quit..."@n lindenthal said:
Is there a difference to zsel.rb?
Yes but this is not what you want... I don't understand what you want, sorry... Can you show some images, perhaps ?
-
thanks Matt, but i'm slightly confused. the idea is to zoom a selected object to screen (and if nothing is selected all objects) - what is the right click for? obviously i'm missing something..
-
The last script was for N lindenthal. But i don't understand what he relly wants... My poor english language !!
This last script zooms on selected entities, and hide others. The right click stops script and gives last view before starting script.
-
thanks Matt, i understand now (to be sure i also don't grasp N lindenthal idea - maybe with some screenshots..).
here is my alternate idea: the script centers the selection to screen (one can assign a shortcut key). however, if say CTRL is pressed then all other objects (not in the selection) get hidden. But there is no right click.
-
@matt666 said:
…
But i don't understand what he relly wants... My poor english language !!
…My poor english language, too.
What I want: Zoom selection with distance by preference. For example: I select a door and zoom it. The door comes to the middle of the screen and zooms to fill the screen. Now I measure the distance. Next selctions will be the door handle or the door hinge. If one of them is selected and zoomed, the model will only slide so that the door handle is in the middle of screen but is not zoomed. So the scale of door and the scale of door handle are the same. I see the door handle and the door in same scale (with same distance).
How can I measure the distance to selection? How can I set the distance to an object by name?
-
@cadfather said:
ok, this is what happens to the script: if i am inside of a group/component and 'hide rest of model' is on, zoom selection does not work. surely this must happen to everyone?
You are correct, it does not work. There are 2 ways to zoom to a selection using the API and they both fail when "hide rest of model" is enabled.
I'm not seeing a quick solution other than Matt's idea of temporarily switching 'hide rest' on, zooming, and then switching it off again.
I'm sure a better "Zoom to Selection" could be written, though - one that would work in all configurations.
-
Jim, you mean if a script was written from scratch it could be done?
-
@cadfather said:
Jim, you mean if a script was written from scratch it could be done?
Yes, a camera zoom is simply moving the camera closer to the target, and can be done using Ruby.
-
@jim said:
…
a camera zoom is simply moving the camera closer to the target, and can be done using Ruby.Please, Jim, tell me how to move the camera to a selected item with distance of 2 meter by ruby script.
-
model = Sketchup.active_model view = model.active_view camera = view.camera eye = camera.eye target = camera.target up = camera.up vector = target - eye vector.length = 2.m eye = eye + vector camera.set eye, target, up
Advertisement