SketchUcation Premium Membership

 

 

[Plugin] View Parts (1.2) — Sept 13 2011

[Plugin] View Parts (1.2) — Sept 13 2011

Postby cmd » Tue Aug 02, 2011 9:17 pm

The View Parts ruby script will build a scene for every unique component and group in a selection set.

The idea behind the ruby was to find a quick way to isolate and view each part of an assembly either for general viewing or to put into the SketchUp LayOut program for dimensioning and part arrangement.

Here is a video to see it in action:

www.youtube.com Video from : www.youtube.com


UPDATE - 09-06-2011
Changed code to reflect best practices mentioned by TIG.
UPDATE - 09-13-2011
Menu load correction

Feel free to hack away at the ruby and improve it as you see fit.

Enjoy !

CMD
Please, register (free) to access all the attachments on the forums.
Last edited by cmd on Tue Sep 13, 2011 9:10 pm, edited 3 times in total.
- CMD
User avatar
cmd
SketchUp Team
 
Posts: 52
Joined: Wed May 07, 2008 6:13 pm
Location: Boulder, CO

Re: [Plugin] View Parts

Postby Rich O Brien » Tue Aug 02, 2011 9:23 pm

Very useful. Thanks
:::Blog:::

I'm a Trimbler now!
User avatar
Rich O Brien
Administrator
 
Posts: 8302
Joined: Fri Oct 31, 2008 9:05 am
Location: Limerick, Ireland
Name: Rich O'Brien
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Advanced

Re: [Plugin] View Parts

Postby EarthMover » Tue Aug 02, 2011 10:01 pm

Very cool. This should be very handy for presentation work. :enlight:
A designer is an emerging synthesis of artist, inventor, mechanic, objective economist and evolutionary strategist. - R. Buckminster Fuller
Some of my 3D crap
User avatar
EarthMover
Top SketchUcator
 
Posts: 1792
Joined: Fri Sep 12, 2008 9:06 pm
Location: Eastern Pennsylvania
Name: Adam Hails

Re: [Plugin] View Parts

Postby Dave R » Wed Aug 03, 2011 12:15 am

Very interesting indeed. Thank you.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 9011
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] View Parts

Postby baz » Wed Aug 03, 2011 12:30 am

Useful, thanks.
Baz
"What do we want?...Time travel... When do we want it?... Irrelevant"
Thanks to Funny Pics
baz
 
Posts: 453
Joined: Tue Nov 20, 2007 8:31 am
Location: Melbourne, Australia
Name: Barry
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] View Parts

Postby Chris Fullmer » Wed Aug 03, 2011 4:29 pm

Awesome, thanks for posting that Chris!
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6695
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

Re: [Plugin] View Parts

Postby Ben Ritter » Wed Aug 03, 2011 6:21 pm

Thank you.
Ben Ritter
 
Posts: 353
Joined: Wed Nov 14, 2007 4:55 pm
Location: Malta, Illinois

Re: [Plugin] View Parts

Postby Bob James » Wed Aug 03, 2011 7:09 pm

Thank you
"If you don't plan ahead you'll be at the mercy of those that do" - Ashleigh Brilliant

"Bad is not good until worse happens" - Bob James
User avatar
Bob James
Premium Member
Premium Member
 
Posts: 608
Joined: Fri Jan 18, 2008 9:29 pm
Location: Lompoc, CA, USA
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] View Parts

Postby wyatt » Wed Aug 03, 2011 7:46 pm

This is great. Thank you!
wyatt
 
Posts: 343
Joined: Wed May 28, 2008 3:41 pm
Location: Manhattan, Kansas
Name: Wyatt
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Intermediate

Re: [Plugin] View Parts

Postby spence » Wed Aug 03, 2011 7:53 pm

Oh this is fabulous, thanks Chris.
Spence
User avatar
spence
Premium Member
Premium Member
 
Posts: 255
Joined: Sun Nov 18, 2007 5:55 pm
Location: Utah, USA
Name: Spence

Re: [Plugin] View Parts

Postby Jean-Franco » Wed Aug 03, 2011 10:28 pm

Very useful, thank you !
Jean-Franco
User avatar
Jean-Franco
 
Posts: 427
Joined: Tue Nov 13, 2007 10:09 pm
Location: Mulhouse / France
Name: Jean-Franco
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Intermediate

Re: [Plugin] View Parts

Postby Studeag » Thu Aug 04, 2011 2:58 am

Extremely usefull,

Thank you!
Studeag
 
Posts: 14
Joined: Sun Apr 12, 2009 3:50 pm
Location: St-Come, Quebec, Canada

Re: [Plugin] View Parts

Postby modelhead » Thu Aug 04, 2011 2:59 am

That revs things up...thanks very much!!
modelhead
 

Re: [Plugin] View Parts

Postby TIG » Thu Aug 04, 2011 12:13 pm

This is a very good idea. :D

I have a few points...

Please remember to parenthesize you arguments, for future Ruby compatibility - e.g. it's best like
model.pages.add("Initial State")
and NOT
model.pages.add "Initial State"
I know the API is full of 'wrong' examples and they do work... BUT with changes to the way Ruby works across versions, then if they aren't inside () you will get issues...

You should protect you code inside a module - someone else might have also defined hideAll too in their 'unwrapped' code... which might mess up you [or them] !
So let's call it
module CMD
### ALL code goes here
end

Then recast your three methods with a leading self. like this
def self.hideAll()
...

etc,
Also ensure that any calls of those methods then appear as
self.hideAll()
etc
The menu section also needs to use
...{self.viewParts()}
if it's within the module, but if it's outside of the module then it becomes
...{CMD.viewParts()}

Also you could replace the
if file_loaded?("viewparts.rb")
etc with
if file_loaded?(File.basename(__FILE__))
as __FILE__ returns the path to the script itself and doesn't rely on the file keeping a certain name.

Personally I'd also put this Tool under the 'View' menu rather than in 'Plugins'... but that's me...

Please don't take my comments as criticisms of a great idea, that's well executed - it's just that these minor tweaks would make it more 'robust'... :geek:
TIG
User avatar
TIG
Global Moderator
 
Posts: 13993
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: [Plugin] View Parts

Postby MALAISE » Thu Aug 04, 2011 1:04 pm

Great tool for complex mechanisms

Thanks a lot
La Connaissance n'a de valeur que partagée
MALAISE
 
Posts: 620
Joined: Sun Apr 20, 2008 1:23 pm
Location: Cergy Pontoise FRANCE
Name: Pierre

Re: [Plugin] View Parts

Postby driven » Thu Aug 04, 2011 3:06 pm

hi,

does anyone have this working on a mac... [EDIT-the examples on a mac!!!]

I tried both standard and a version using TIG's mods, and although both create scenes, everything is hidden.

the only way to see any content is to use 'edit>>unhide>>all' but then 'ALL' are unhidden in 'ALL' scenes.

I tried using the hide 'other' feature to see the individual elements, but this gets zeroed when I switch pages[scenes].

does the model need to have separate layers for each group/component?

any ideas?
john
everything gets hidden.png
Please, register (free) to access all the attachments on the forums.
Last edited by driven on Thu Aug 04, 2011 9:56 pm, edited 1 time in total.
driven
Top SketchUcator
 
Posts: 1409
Joined: Fri May 01, 2009 11:50 pm
Name: John
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Intermediate

Re: [Plugin] View Parts

Postby fastech370 » Thu Aug 04, 2011 9:39 pm

Awesome Plugin. This saves a lot of time!!!!!
A Black Belt is a White Belt who refused to give up.
fastech370
 
Posts: 22
Joined: Wed Feb 27, 2008 8:17 am
Location: Modesto, CA
Name: Jerry Aukerman

Re: [Plugin] View Parts

Postby Jean-Franco » Wed Aug 24, 2011 4:07 pm

Hi,
driven wrote:I tried both standard and a version using TIG's mods, and although both create scenes, everything is hidden.


I've the same situation under Windows XP 3.
If I select components within a group and launch Viewparts, it creates all the needed scenes but all is hidden. And no way to unhide anything.

Have a look at the attached file.

Driven, If you don't mind, I'd like to have your updated script with TIG's modifications to do a test.
I'm sorry but I'm really not a Ruby scripter.
Thanks.

cerificateur-scenes.skp
Please, register (free) to access all the attachments on the forums.
Jean-Franco
User avatar
Jean-Franco
 
Posts: 427
Joined: Tue Nov 13, 2007 10:09 pm
Location: Mulhouse / France
Name: Jean-Franco
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Intermediate

Re: [Plugin] View Parts

Postby Yellow Peril » Wed Aug 31, 2011 12:44 pm

Hi has anyone any idea why this script seams to lock up my files while using the arc tool, I have unstalled this excellent script and found that all is working fine, maybe its a mac issue, some help would be much appreciated........

Thank You
User avatar
Yellow Peril
 
Posts: 2
Joined: Sat Jan 30, 2010 12:24 pm

Re: [Plugin] View Parts (1.1) — Sept 06 2011

Postby rjhorky » Tue Sep 13, 2011 7:58 pm

for the life of me I cannot figure out why I cannot get this to work. I click on the link, save to the plugins folder within SU8. It does not show up anywhere but I can see it in the folder. Any ideas?
rjhorky
 
Posts: 2
Joined: Mon Jun 14, 2010 3:38 pm
Name: Bob horky

Re: [Plugin] View Parts (1.2) — Sept 13 2011

Postby Dave R » Tue Sep 13, 2011 10:10 pm

Did you restart sketchUp after installing the file in the Plugins folder? Did it install with the .rb extension?
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 9011
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] View Parts (1.2) — Sept 13 2011

Postby ksjoern » Wed Sep 14, 2011 7:57 am

The Plugin does not work with a Mac. I put it in the correct folder (Library/Application Support/Google SketchUp 8/SketchUp/plugins).
The required 'sketchup.rb' is included in the TT_Lib2. But the plug-in window shows no entry "Exploded View"
Any idea what I could change?
Could it be a problem not working with an english system interface?
Please, register (free) to access all the attachments on the forums.
ksjoern
 
Posts: 3
Joined: Fri Oct 09, 2009 10:07 am
Location: Kassel / Germany
Name: Kathm

Re: [Plugin] View Parts (1.2) — Sept 13 2011

Postby driven » Wed Sep 14, 2011 10:10 am

hi,

You need to have at least 1 group or component in your model,

you should have a 'Parts>> views ' entry in the Plugin Menu, [Edited following TT's comment..]

click on that entry, choose your options and it will make the scenes.

click on scene tabs to view.

group a square, then try it out.

if you open a drawing with lots of groups, it will make lots of scenes.

john
Last edited by driven on Wed Sep 14, 2011 10:49 am, edited 1 time in total.
driven
Top SketchUcator
 
Posts: 1409
Joined: Fri May 01, 2009 11:50 pm
Name: John
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Intermediate

Re: [Plugin] View Parts (1.2) — Sept 13 2011

Postby thomthom » Wed Sep 14, 2011 10:19 am

ksjoern wrote:The required 'sketchup.rb' is included in the TT_Lib2.

No - this plugin has no dependance on TT_Lib2.

The required sketchup.rb is located in SketchUp's Tools folder. (Where it should stay.)
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17642
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] View Parts (1.2) — Sept 13 2011

Postby thomthom » Wed Sep 14, 2011 10:21 am

driven wrote:You need to have at least 1 group or component in your model,

you will then get a 'Parts>> views ' entry in the Plugin Menu,

Menus in the top level menus (File,Edit,View,Plugins,etc...) does not hide or show based on selection. They are fixed. Only context menus are dynamic like that.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17642
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] View Parts (1.2) — Sept 13 2011

Postby driven » Wed Sep 14, 2011 10:52 am

thomthom wrote:Menus in the top level menus (File,Edit,View,Plugins,etc...) does not hide or show based on selection. They are fixed. Only context menus are dynamic like that.


edited my post, your are correct, I loaded it from console to test, so it wasn't there before , but was after... dohh
driven
Top SketchUcator
 
Posts: 1409
Joined: Fri May 01, 2009 11:50 pm
Name: John
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Intermediate

Re: [Plugin] View Parts (1.2) — Sept 13 2011

Postby ksjoern » Fri Sep 16, 2011 7:44 am

Great, now it works on my mac. - I've probably always have the downloaded previous (1.1) version.
Please, register (free) to access all the attachments on the forums.
ksjoern
 
Posts: 3
Joined: Fri Oct 09, 2009 10:07 am
Location: Kassel / Germany
Name: Kathm

Re: [Plugin] View Parts

Postby dannyver » Tue Oct 04, 2011 6:37 pm

Jean-Franco wrote:Hi,
driven wrote:I tried both standard and a version using TIG's mods, and although both create scenes, everything is hidden.


I've the same situation under Windows XP 3.
If I select components within a group and launch Viewparts, it creates all the needed scenes but all is hidden. And no way to unhide anything.

Have a look at the attached file.

Driven, If you don't mind, I'd like to have your updated script with TIG's modifications to do a test.
I'm sorry but I'm really not a Ruby scripter.
Thanks.

cerificateur-scenes.skp



i have the same problem is ther any one ho has a answer or solution for this problem already :?: :?:
dannyver
 
Posts: 20
Joined: Sat Dec 26, 2009 11:33 am
Name: danny verschoore

Re: [Plugin] View Parts

Postby dannyver » Sun Oct 09, 2011 6:52 pm

dannyver wrote:
Jean-Franco wrote:Hi,
driven wrote:I tried both standard and a version using TIG's mods, and although both create scenes, everything is hidden.


I've the same situation under Windows XP 3.
If I select components within a group and launch Viewparts, it creates all the needed scenes but all is hidden. And no way to unhide anything.

Have a look at the attached file.

Driven, If you don't mind, I'd like to have your updated script with TIG's modifications to do a test.
I'm sorry but I'm really not a Ruby scripter.
Thanks.

cerificateur-scenes.skp



i have the same problem is ther any one ho has a answer or solution for this problem already :?: :?:



is there no one ho has a solution for this problem :cry: . this can make this plugin very useful :D
dannyver
 
Posts: 20
Joined: Sat Dec 26, 2009 11:33 am
Name: danny verschoore

Re: [Plugin] View Parts (1.2) — Sept 13 2011

Postby driven » Sun Oct 09, 2011 7:58 pm

hi dannyver,

I don't use SU 6 and I'm on a mac so it's hard to know what issues your having.

maybe you could re-cast your question to target your setup better.

e.g. "I've tried this plugin using SU6 on this skp and it doesn't seem to function, can someone check if it's my skp?

or "can someone post a skp that works with this plugin in SU6 so I can check my setup..."

With the first example you'll likely find out if your skp works or with the second you'll eliminate a wrongly setup skp...

sorry I can't be of more help. Personally I know it 'basically' works on mac using SU8, but I only tested the functionality for future use.

other than that I suggest checking you've got the latest version, and re-read any instructions or posts.
also, if you no longer use SU6 update your User Settings.
john
driven
Top SketchUcator
 
Posts: 1409
Joined: Fri May 01, 2009 11:50 pm
Name: John
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Intermediate

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Artisan Organic Toolset - a set of powerful organic modeling tools.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012

Next

Return to Plugins

Who is online

Users browsing this forum: Bing [Bot], Galerin, I.Aleks.S, zxx and 11 guests