[Plugin] (TIG) Rotate Plan View v1.1 20110316

[Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby leminilab » Thu Mar 03, 2011 4:31 pm

Admin edit:

I have moved the topic to the Plugins folder and added the proper tag. The plugin can be found further down this page in this post.

(Gai...)



Hi everyone,

I'm trying to do something simple but... Can't figure out how... :roll:
I'd like to have this plan view rotated 45 degrees to better fit my screen...
sceno.jpg


I don't have a clue how to do that... :oops:
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: rotate plan view

Postby TIG » Thu Mar 03, 2011 4:59 pm

Here some short code to do it
Code: Select all
require 'sketchup.rb'
class Rotateplanview
 def initialize(angle=45.0)
  model=Sketchup.active_model
  view=model.active_view
  camera=view.camera
  up=camera.up
  return if up==Z_AXIS
  eye=camera.eye
  target=camera.target
  persp=false
  tr=Geom::Transformation.rotation(target, Z_AXIS, angle.degrees)
  up.transform!(tr)
  newcamera=Sketchup::Camera.new(eye, target, up, persp)
  view.camera=newcamera
  Sketchup.send_action("viewZoomExtents:")
 end
end#class
Copy/paste it into a file named Rotateplanview.rb in the Plugins folder.
To use set up your Plan [Top] view, without Perspective and in the Ruby Console type Rotateplanview.new to rotate the camera 45 degrees clockwise, repeat to rotate it another 45 degrees etc. The extents are zoomed after each rotation.
To do other angles provide an angle value in degrees - e.g. Rotateplanview.new 10 rotates the view 10 degrees clockwise or Rotateplanview.new -30 rotates the view 30 degrees counterclockwise.
When you are happy with it save the view to a new Scene tab so you can return to it later.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: rotate plan view

Postby leminilab » Thu Mar 03, 2011 5:14 pm

TIG wrote:Here some short code to do it
Code: Select all
require 'sketchup.rb'
class Rotateplanview
 def initialize(angle=45.0)
  model=Sketchup.active_model
  view=model.active_view
  camera=view.camera
  up=camera.up
  return if up==Z_AXIS
  eye=camera.eye
  target=camera.target
  persp=false
  tr=Geom::Transformation.rotation(target, Z_AXIS, angle.degrees)
  up.transform!(tr)
  newcamera=Sketchup::Camera.new(eye, target, up, persp)
  view.camera=newcamera
  Sketchup.send_action("viewZoomExtents:")
 end
end#class
Copy/paste it into a file named Rotateplanview.rb in the Plugins folder.
To use set up your Plan [Top] view, without Perspective and in the Ruby Console type Rotateplanview.new to rotate the camera 45 degrees clockwise, repeat to rotate it another 45 degrees etc. The extents are zoomed after each rotation.
To do other angles provide an angle value in degrees - e.g. Rotateplanview.new 10 rotates the view 10 degrees clockwise or Rotateplanview.new -30 rotates the view 30 degrees counterclockwise.
When you are happy with it save the view to a new Scene tab so you can return to it later.

:shock: TIG, Wow!
To have you replying to one of my question is an honor! I really admire you coding gurus!
You should all live together in a tiny house as a community along with ThomThom, Chris Fullmer, Whaaat (forgot how many A's...), Fredo6, Didier Bur...
Seriously, Michael Jackson would have replied, I wouldn't have been more honored!

I'll try this quickly! Thank you so much! (where's the worshipping smiley, the one that's on his knees... Whatever... You get the point! :D )
Nicolas
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: rotate plan view

Postby leminilab » Thu Mar 03, 2011 6:27 pm

Errr... I got an error message saying :

Rotateplanview.new
Error: #<NameError: (eval):54: uninitialized constant Rotateplanview>
(eval):54

What I did is copy the code you wrote in a notepad file and saved it as Rotateplanview.rb and pasted it in the plugins Folder.
Then I typed the trigger piece of code in the ruby console, hit enter and voilà!

:? <-- I have absolutely no idea what this error message mean...
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: rotate plan view

Postby TIG » Thu Mar 03, 2011 6:50 pm

Did you restart Sketchup ?
I suspect not :?
It should work after the script is auto-loaded - which is happens when Sketchup starts...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: rotate plan view

Postby leminilab » Thu Mar 03, 2011 9:10 pm

TIG wrote:Did you restart Sketchup ?
I suspect not :?
It should work after the script is auto-loaded - which is happens when Sketchup starts...

Yes, I did restart Sketchup. Actually my computer froze a little bit and almost crashed while SU was open :?
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: rotate plan view

Postby TIG » Thu Mar 03, 2011 11:32 pm

Have you tried running it with the Ruby Console open to see if there are errors ?
Did it rotate the plan view even if it was flaky ?
Did you have a plan view set BEFORE using it ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: rotate plan view

Postby leminilab » Fri Mar 04, 2011 12:05 am

TIG wrote:Have you tried running it with the Ruby Console open to see if there are errors ?
Did it rotate the plan view even if it was flaky ?
Did you have a plan view set BEFORE using it ?

It didn't rotate the view at all. :cry:

The ruby console was open and it returned this error again:

Rotateplanview.new 10
Error: #<NameError: (eval):54: uninitialized constant Rotateplanview>
(eval):54

Untitled-1.png

As you can see I already had a plan scene saved.
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

[Plugin] rotate plan view v1.1

Postby TIG » Fri Mar 04, 2011 11:08 am

Clearly the code isn't loading properly for some reason I can't ascertain at a distance...
Here's a ready-made rb file that should work... please remove your attempt...


Here' v1.1
(c) TIG 2011
Permission to use, copy, modify, and distribute this software for
any purpose and without fee is hereby granted, provided the above
copyright notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
File:
Put the file Rotateplanview.rb in the Plugins folder.***
Usage:
To use set up your Plan [Top] view, without Perspective and
in the Ruby Console type Rotateplanview.new to rotate the camera 45 degrees
clockwise, repeat to rotate it another 45 degrees etc.
The extents are zoomed after each rotation.
To do other angles provide an angle value in degrees -
e.g. Rotateplanview.new 10 rotates the view 10 degrees clockwise or
Rotateplanview.new -30 rotates the view 30 degrees counterclockwise.
When you are happy with it save the view to a new Scene tab so you can
return to it later.
Note: v1.1 includes a View Menu > 'Rotate Plan View' item and there is
also a 'Rotate Plan View' toolbar that can be activated from the
View > Toolbar menu, ***this needs the icon Rotateplanview.png in the
../Plugins/TIGtools subfolder.
If you use one of these tools this way you will get a dialog asking for
the angle, the default is +45 degrees. otherwise it works as above...
Donations: by PayPal to info @ revitrev.org
Version:
1.0 20110304 First issue.
1.1 20110316 Menu/Dialog/Toolbar item added.

Download/install this Plugin's latest RBZ from the PluginStore...

Download

0
TIG
User avatar
TIG 
Global Moderator
 

Re: rotate plan view

Postby leminilab » Fri Mar 04, 2011 1:06 pm

TIG wrote:Clearly the code isn't loading properly for some reason I can't ascertain at a distance...
Here's a ready-made rb file that should work... please remove your attempt...
Rotateplanview.rb

:berserk: :sketchstatic: :family: :ecstatic: :fro: :bounce: :enlight: :D :lol:
This is soooooooooooooooooooooooooooooooooooooooooooo great!

For your info and for the sake of my own public humiliation, I had pasted the rb file in my SKetchup 8 plugins folder... And was usin SU7! :oops: :oops: :oops: :oops:

Thank you so much! :thumb:
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: rotate plan view

Postby Gaieus » Fri Mar 04, 2011 1:33 pm

:roflmao:
0
User avatar
Gaieus 
 

Re: rotate plan view

Postby leminilab » Fri Mar 04, 2011 5:51 pm

TIG, this is really a must for me! Thank you so much! This should be a default option in Sketchup.

And it really saved my life on this :
9-pole-plan.jpg

9-pole-pers.jpg


Oh and by the way Gaieus, I had read one of your post on a google forum (http://www.google.com/support/forum/p/s ... 63b7&hl=en) before posting my question but for some reason I couldn't make my head to apply your suggestions to my situation...
I just didn't understand if this post relates to my problem or not... (I know it's scary... I scare myself very often :?)

Again, I wish my the world would be as effective and generous as this community... :roll:
Thanks everyone!

Nicolas
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: [Plugin] (by TIG) rotate plan view

Postby cobb89 » Wed Mar 16, 2011 1:46 pm

how can i use this rotate plan view plugin??
0

cobb89 
Banned
 

Re: [Plugin] (by TIG) rotate plan view

Postby Rich O Brien » Wed Mar 16, 2011 1:51 pm

Copy/paste it into a file named Rotateplanview.rb in the Plugins folder.
To use set up your Plan [Top] view, without Perspective and in the Ruby Console type Rotateplanview.new to rotate the camera 45 degrees clockwise, repeat to rotate it another 45 degrees etc. The extents are zoomed after each rotation.
To do other angles provide an angle value in degrees - e.g. Rotateplanview.new 10 rotates the view 10 degrees clockwise or Rotateplanview.new -30 rotates the view 30 degrees counterclockwise.
When you are happy with it save the view to a new Scene tab so you can return to it later.
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] (by TIG) rotate plan view

Postby Dave R » Wed Mar 16, 2011 2:34 pm

Thank you, TIG. This offers some interesting options for scene creation.
0
%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] (by TIG) rotate plan view

Postby Rich O Brien » Wed Mar 16, 2011 2:35 pm

No problem Dave, glad I could help... 8-)
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] (by TIG) rotate plan view

Postby cobb89 » Wed Mar 16, 2011 3:39 pm

Rich O'Brien wrote:
Copy/paste it into a file named Rotateplanview.rb in the Plugins folder.
To use set up your Plan [Top] view, without Perspective and in the Ruby Console type Rotateplanview.new to rotate the camera 45 degrees clockwise, repeat to rotate it another 45 degrees etc. The extents are zoomed after each rotation.
To do other angles provide an angle value in degrees - e.g. Rotateplanview.new 10 rotates the view 10 degrees clockwise or Rotateplanview.new -30 rotates the view 30 degrees counterclockwise.
When you are happy with it save the view to a new Scene tab so you can return to it later.


can anyone create a toolbar button for this plugin??
0

cobb89 
Banned
 

Re: [Plugin] (by TIG) rotate plan view

Postby TIG » Wed Mar 16, 2011 3:41 pm

As well as a toolbar you'd need a dialog for the angle ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] (by TIG) rotate plan view

Postby Dave R » Wed Mar 16, 2011 3:44 pm

Seems to me entering the text into the console works very nicely. And I don't have to find room for another toolbar.

Oh, and Rich, I very happy to have your assistance while your wife is ironing. ;)
0
%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] (by TIG) rotate plan view

Postby Rich O Brien » Wed Mar 16, 2011 3:48 pm

while your wife is ironing


Prioritize Dave...Prioritize ;)
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] (by TIG) rotate plan view

Postby cobb89 » Wed Mar 16, 2011 4:19 pm

TIG wrote:As well as a toolbar you'd need a dialog for the angle ?

yeah....whatever is possible.... :roll:
0

cobb89 
Banned
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby TIG » Wed Mar 16, 2011 4:59 pm

Here's v1.1 viewtopic.php?p=313264#p313264
It includes View menu item and toolbar with dialog entry of angles - the Ruby Console version works as before for those of you not wishing clutter... The toolbar only gets made if there's a png file so that's a simple way to stop that being created if you don't want it!
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby Michaelv » Wed Mar 16, 2011 6:06 pm

TIG, can I use it to include into a tool I'm working on. It's an easy simple rotate tool, and I'd like to include this as planview rotation when hovering over the origin.
0

Michaelv 
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby TIG » Wed Mar 16, 2011 8:18 pm

Michaelv wrote:TIG, can I use it to include into a tool I'm working on. It's an easy simple rotate tool, and I'd like to include this as planview rotation when hovering over the origin.

No problem, just give some acknowledgment in the header :D
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby cobb89 » Mon Mar 21, 2011 1:31 pm

TIG wrote:Here's v1.1 viewtopic.php?p=313264#p313264
It includes View menu item and toolbar with dialog entry of angles - the Ruby Console version works as before for those of you not wishing clutter... The toolbar only gets made if there's a png file so that's a simple way to stop that being created if you don't want it!


Thanks a lot!! :D
0

cobb89 
Banned
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby Bob James » Sat Apr 02, 2011 8:21 pm

It seems that whenever I go to parallel projection and top view the scene is never at the angle I want it, so this plugin is really handy.

Okay, so I'm lazy, but it would be very nice to speed up workflow if the plugin did the preliminary steps automatically: set camera to parallel projection and set to top view 8-)
0
i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
User avatar
Bob James 
Premium Member
Premium Member
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby EarthMover » Sat Apr 02, 2011 9:15 pm

Great idea and very useful. Thanks TIG!! :thumb:
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby dan19936 » Tue Apr 26, 2011 9:32 pm

Also available is the free Camera Controls by Smustard
http://www.smustard.com/script/CameraControls

Dan
0

dan19936 
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby jwliii » Tue Feb 19, 2013 4:21 pm

Great Great Great - Donated!
0
User avatar
jwliii 
 

Re: [Plugin] (TIG) Rotate Plan View v1.1 20110316

Postby seasdes » Thu Feb 28, 2013 12:03 pm

This is a wonderful tool. I was made aware of it by Dave.
Is there a way to lock the scene so that it cannot be accidentally dragged away from its intended orientation?
0
Last edited by seasdes on Fri Mar 01, 2013 2:56 am, edited 1 time in total.
Using Sketchup Pro 2016

seasdes 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 6 guests

Visit our sponsors: