by daiku » Tue Sep 07, 2010 3:13 pm
Not sure what you mean. Do you want to rotate EVERY time you place it? Just re-create the component with the correct orientation to the local axes. CB.
-

daiku
- PluginStore Author

-
- Posts: 216
- Joined: Mon Nov 12, 2007 2:54 pm
- Location: Minneapolis
- Name: Clark Bremer
-
by tor » Fri Sep 10, 2010 5:28 am
Well, what I was hoping for is to select a component from the component browser to place into the model, then as it is moving with the mouse at the insertion point, rotate it, so that it's in the correct orientation. Kind of a building block assembly system. And, sometimes a component would need to be rotated, sometimes not.
Obviously, I can put the component "down", rotate, then move it, but was just hoping to simplify that process in the creation of numerous modular assemblies.
But it seems that the component being placed is not actually selected, per se, so no shortcut key works on it.
Tor
-
tor
-
- Posts: 5
- Joined: Fri Jun 04, 2010 5:30 am
- Name: Tor Gilbertson
by InterArchi » Fri Sep 10, 2010 5:56 pm
-
InterArchi
-
- Posts: 44
- Joined: Mon Jul 05, 2010 10:36 pm
- Name: InterArchi
by EarthMover » Fri Sep 10, 2010 7:08 pm
Is there a plugin out there that will do this to multiple components at the same time? Or one that will rotate each around it's own z axis simultaneously?
3D Artist at Clearstory 3D Imaging Guide Tool at Winning With Sketchup Content Creator at Skapeup
-

EarthMover
- Premium Member

-
- Posts: 1801
- Joined: Fri Sep 12, 2008 9:06 pm
- Location: Eastern Pennsylvania
- Name: EarthMover
- Operating system: Windows
- SketchUp version: 2016
- License type: Pro
- SketchUp use: landscape architecture
- Level of SketchUp: Advanced
-
by daiku » Fri Sep 10, 2010 8:49 pm
EarthMover wrote:Is there a plugin out there that will do this to multiple components at the same time? Or one that will rotate each around it's own z axis simultaneously?
Easy change. Updated file at the top of the thread. CB.
-

daiku
- PluginStore Author

-
- Posts: 216
- Joined: Mon Nov 12, 2007 2:54 pm
- Location: Minneapolis
- Name: Clark Bremer
-
by EarthMover » Fri Sep 10, 2010 9:01 pm
That was fast. Thanks a ton!!
3D Artist at Clearstory 3D Imaging Guide Tool at Winning With Sketchup Content Creator at Skapeup
-

EarthMover
- Premium Member

-
- Posts: 1801
- Joined: Fri Sep 12, 2008 9:06 pm
- Location: Eastern Pennsylvania
- Name: EarthMover
- Operating system: Windows
- SketchUp version: 2016
- License type: Pro
- SketchUp use: landscape architecture
- Level of SketchUp: Advanced
-
by glro » Sun Feb 05, 2012 1:29 pm
Jim wrote:HFM wrote:okay, very nice script... but could you please also make it work on X and Y axis? And make it so that you can select a shortcut for the tools? Tried to edit it myself but my knowledge of ruby is lacking [did get the 15 degrees to work though  ]
I always wanted to make a rotator that is sensitive to the view. For example, it would rotate the selection around the axis that is closest to the axis from the camera to the target. If you wanted ro rotate around the Z, you could select the entities, go to Top view and press the shortcut. If you wanted to rotate around the Y axis, select the entities, go to the Front view and use the same shortcut. What do you think?
My idea is that, having to change the view would take away the advantage of having the rotator sensitive to the view I have another suggestion: Rot90.rb rotate the component around (ent.bounds.center); would it be possible to rotate around the origin instead, as you did in your mover2.rb plugin?
-
glro
-
- Posts: 390
- Joined: Mon Nov 30, 2009 9:45 am
- Location: Spain
- Name: glro
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by glro » Sun Feb 05, 2012 2:59 pm
HFM wrote:okay, very nice script... but could you please also make it work on X and Y axis? And make it so that you can select a shortcut for the tools? Tried to edit it myself but my knowledge of ruby is lacking [did get the 15 degrees to work though  ]
I don't know much about ruby either, but here is a simplified version of the plugin: > rotate around the component origin instead of center > only around z axis and 90 degrees > no context menu, a line in the plugin menu instead (so you can add a keyboard shortcut (pop up menu, window>preferences>shortcut - Code: Select all
require 'sketchup.rb' ## ## Rotate selected component instance 90 degrees around Z axis ## ## Copyright (c) 2010 Clark Bremer (aka daiku) ## Northern Lights Timber Framing ## clarkb@northernlightstimberframing.com ## ## 05/02/12: rotation autour de l'origine du composant, axe z seulement, acces menu deroulant ou raccourci clavier ## 9/10/2010: Multiple Groups/Comps ## 5/17/08: All 3 axes. Input from Matt666 ## 4/24/08: Use center as rotation point instead of CI origin. Also works on groups now. ##
# Add a menu item to launch our plugin. UI.menu("PlugIns").add_item("rotation90z") { rotate90z } # -----------------------------------------------------------------------------
def selected_comps_and_groups mm = Sketchup.active_model ss = mm.selection return nil if ss.empty? ss.each do |cc| return nil if not ((cc.instance_of? Sketchup::ComponentInstance) or (cc.instance_of? Sketchup::Group)) end ss end
#def rotate90(sel, axis) def rotate90z sel = selected_comps_and_groups # axis == "z" rv = Geom::Vector3d.new(0,0,1) # rv = Geom::Vector3d.new(0,0,1) if axis == "z" # rv = Geom::Vector3d.new(0,1,0) if axis == "y" # rv = Geom::Vector3d.new(1,0,0) if axis == "x" ra = 90.degrees #rt = Geom::Transformation.rotation(rp, rv, ra) #autour du centre de la boite enveloppe sel.each do |ent| # rp = Geom::Point3d.new(ent.bounds.center) #rotation point rp = Geom::Point3d.new(ent.transformation.origin) ent.transform!(Geom::Transformation.rotation(rp, rv, ra)) end end
#if( not file_loaded?("rot90.rb") ) # UI.add_context_menu_handler do |menu| # if menu == nil then # UI.messagebox("Error setting context menu handler") # else # if (sel = selected_comps_and_groups) # sbm = menu.add_submenu("Rotate 90") # sbm.add_item("Around Red") {rotate90 sel, "x"} # sbm.add_item("Around Green") {rotate90 sel, "y"} # sbm.add_item("Around Blue") {rotate90 sel, "z"} # end # end # # end #end
#file_loaded("rot90.rb")
-
glro
-
- Posts: 390
- Joined: Mon Nov 30, 2009 9:45 am
- Location: Spain
- Name: glro
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Mainline411 » Fri Jul 27, 2012 12:34 pm
glro wrote:HFM wrote:okay, very nice script... but could you please also make it work on X and Y axis? And make it so that you can select a shortcut for the tools? Tried to edit it myself but my knowledge of ruby is lacking [did get the 15 degrees to work though  ]
I don't know much about ruby either, but here is a simplified version of the plugin: > rotate around the component origin instead of center > only around z axis and 90 degrees > no context menu, a line in the plugin menu instead (so you can add a keyboard shortcut (pop up menu, window>preferences>shortcut - Code: Select all
require 'sketchup.rb' ## ## Rotate selected component instance 90 degrees around Z axis ## ## Copyright (c) 2010 Clark Bremer (aka daiku) ## Northern Lights Timber Framing ## clarkb@northernlightstimberframing.com ## ## 05/02/12: rotation autour de l'origine du composant, axe z seulement, acces menu deroulant ou raccourci clavier ## 9/10/2010: Multiple Groups/Comps ## 5/17/08: All 3 axes. Input from Matt666 ## 4/24/08: Use center as rotation point instead of CI origin. Also works on groups now. ##
# Add a menu item to launch our plugin. UI.menu("PlugIns").add_item("rotation90z") { rotate90z } # -----------------------------------------------------------------------------
def selected_comps_and_groups mm = Sketchup.active_model ss = mm.selection return nil if ss.empty? ss.each do |cc| return nil if not ((cc.instance_of? Sketchup::ComponentInstance) or (cc.instance_of? Sketchup::Group)) end ss end
#def rotate90(sel, axis) def rotate90z sel = selected_comps_and_groups # axis == "z" rv = Geom::Vector3d.new(0,0,1) # rv = Geom::Vector3d.new(0,0,1) if axis == "z" # rv = Geom::Vector3d.new(0,1,0) if axis == "y" # rv = Geom::Vector3d.new(1,0,0) if axis == "x" ra = 90.degrees #rt = Geom::Transformation.rotation(rp, rv, ra) #autour du centre de la boite enveloppe sel.each do |ent| # rp = Geom::Point3d.new(ent.bounds.center) #rotation point rp = Geom::Point3d.new(ent.transformation.origin) ent.transform!(Geom::Transformation.rotation(rp, rv, ra)) end end
#if( not file_loaded?("rot90.rb") ) # UI.add_context_menu_handler do |menu| # if menu == nil then # UI.messagebox("Error setting context menu handler") # else # if (sel = selected_comps_and_groups) # sbm = menu.add_submenu("Rotate 90") # sbm.add_item("Around Red") {rotate90 sel, "x"} # sbm.add_item("Around Green") {rotate90 sel, "y"} # sbm.add_item("Around Blue") {rotate90 sel, "z"} # end # end # # end #end
#file_loaded("rot90.rb")
How do I use this plugin I put the file in plugins and there is nothing in plugins dropdown and nothing when I right click.
-
Mainline411
-
- Posts: 9
- Joined: Mon Jul 09, 2012 11:49 am
by d12dozr » Fri Dec 07, 2012 2:35 am
Great plugin when mapped to a shortcut. Thanks Clark! FYI everybody, Clark just headed up a local meetup about ruby programming. 
-
d12dozr
- Top SketchUcator
-
- Posts: 2247
- Joined: Mon Feb 09, 2009 8:43 am
- Location: Minnesota
- Name: Marcus
- Operating system: Windows
- SketchUp version: 2015
- License type: Pro
- SketchUp use: product design
- Level of SketchUp: Advanced
-
by waltersalter » Wed Apr 12, 2017 1:08 pm
Sorry, does anyone know hot to use this very useful plugin in SketchUp2016? I tried just putting it with other rb files in rooth folder, but it didn't work. Help please!
-
waltersalter
-
- Posts: 3
- Joined: Mon May 12, 2014 1:00 pm
- Name: Salt W
- Operating system: Windows
- SketchUp version: 2013
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
by Kmyklpenter » Tue Mar 17, 2020 10:08 pm
Hello! Thanks for the plugin! For some reason Im having problem assigning a keybouard shortcut for certain actions. The plugin does not appear in shortcuts list.
How can I do that?
Thank you.
-
Kmyklpenter
-
- Posts: 3
- Joined: Tue Feb 04, 2020 9:19 am
- Name: Kamil
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: interior design
- Level of SketchUp: Beginner
by Dave R » Wed Mar 18, 2020 1:52 pm
Kmyklpenter wrote:The plugin does not appear in shortcuts list.
Do you have a group or component selected in the model? Like other Context menu items, you need to have something selected that would make this plugin appear in the menu. Screenshot - 3_18_2020 , 7_52_15 AM.png
Etaoin Shrdlu
%
(THERE'S NO PLACE LIKE)
G28 X0.0 Y0.0 Z0.0
M30
%
-

Dave R
- Global Moderator
-
- Posts: 18133
- Joined: Tue Nov 13, 2007 11:52 pm
- Location: SE Minnesota
- Name: Dave R
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Advanced
by oman3000 » Fri Oct 02, 2020 11:14 am
hello im a fan of this extension. simple yet useful. im just hope it to rotate even ungroup entities for the next version update. 
-
oman3000
-
- Posts: 2
- Joined: Thu Oct 31, 2019 10:09 am
- Name: Norman C Olleta
- Operating system: Windows
- SketchUp version: 2018
- License type: Free/Make
- SketchUp use: architecture
- Level of SketchUp: Beginner
by Vizan » Mon Nov 23, 2020 11:29 am
How to make only the axis of a component or a group rotate?
-
Vizan
-
- Posts: 20
- Joined: Sat May 10, 2014 3:36 pm
- Name: Vitaliy
- Operating system: Windows
- SketchUp version: 2014
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Beginner
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Plugins
|