Is there a plugin...

Is there a plugin...

Postby cotty » Sun Mar 05, 2017 9:58 am

...for the rotation of all selected groups/components so that their x-y-plane gets horizontal?

e.g.:

rotateplugin.JPG
0
User avatar
cotty 
Top SketchUcator
 

Re: Is there a plugin...

Postby pilou » Sun Mar 05, 2017 10:39 am

Try the allign & distribute by Sdmitch ? (not yet tested with your case)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: Is there a plugin...

Postby sdmitch » Sun Mar 05, 2017 10:32 pm

cotty wrote:...for the rotation of all selected groups/components so that their x-y-plane gets horizontal?

e.g.:

rotateplugin.JPG


This just requires resetting the axes in the transformation.
Code: Select all
unless file_loaded?((__FILE__))
   UI.add_context_menu_handler do |menu|
      sel = Sketchup.active_model.selection
      if sel.first.is_a?(Sketchup::ComponentInstance)||sel.first.is_a?(Sketchup::Group)
         menu.add_separator
         menu.add_item('Put on XY Plane') {
            Sketchup.active_model.start_operation "Put on XY Plane"
            sel.each{|ci|
               next unless (ci.is_a?(Sketchup::ComponentInstance)||ci.is_a?(Sketchup::Group))
               t=ci.transformation.to_a
               t[0]=1;t[1]=0;t[2]=0;#t[3]=nil
               t[4]=0;t[5]=1;t[6]=0;#t[7]=nil
               t[8]=0;t[9]=0;t[10]=1;#t[11]=nil
               #t[12]=0;t[13]=0;t[14]=0;#t[15]=nil
               ci.transformation=ci.transformation.set! t
            }
            Sketchup.active_model.commit_operation
         }
      end
   end
   file_loaded((__FILE__))
end
2
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Is there a plugin...

Postby pilou » Mon Mar 06, 2017 12:15 am

@Sdmitch
Does the plugin "plane" on the current x,y plane of each local "Z" object?
1
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: Is there a plugin...

Postby sdmitch » Mon Mar 06, 2017 12:41 am

pilou wrote:@Sdmitch
Does the plugin "plane" on the current x,y plane of each local "Z" object?


Yes, it doesn't change the transformations point of origin.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Is there a plugin...

Postby pilou » Mon Mar 06, 2017 12:55 am

So Cool! :)

What must do with the code above ? Run on the Console, or...
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: Is there a plugin...

Postby sdmitch » Mon Mar 06, 2017 3:59 pm

pilou wrote:So Cool! :)

What must do with the code above ? Run on the Console, or...


You can copy and paste it in the Ruby Console to check it out.

Or you can copy and paste it to an .rb file and save it in the Plugins folder.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Is there a plugin...

Postby mics_54 » Sat Mar 11, 2017 7:35 pm

"Or you can copy and paste it to an .rb file and save it in the Plugins folder."
Which text editor is recommended/preferred to create.rb files? I'm a total newb to ruby but want to learn. I run a windows 10 computer.

OK I downloaded notepad++, converted the text file and installed it in the proper plugins folder and it works great. Thanks again sdmitch.
0

mics_54 
 

Re: Is there a plugin...

Postby cotty » Sun Mar 12, 2017 8:37 am

Thank you very much, sdmitch!
It does exactly what I was searching for... :thumb:
0
User avatar
cotty 
Top SketchUcator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: Duyan, hydevine and 6 guests

Visit our sponsors: