SketchUcation Premium Membership

 

 

[Request] - Component's options report

[Request] - Component's options report

Postby dedmin » Mon Jul 12, 2010 4:59 pm

From this:
2010-08-12_185248.jpg


to this:
2010-08-12_185329.jpg
Please, register (free) to access all the attachments on the forums.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby thomthom » Mon Jul 12, 2010 6:35 pm

:?:
Isn't that what you get from File -> Generate Report ?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17595
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: [Request] - Component's options report

Postby dedmin » Mon Jul 12, 2010 6:54 pm

Not exactly - a lot of useless info, no quantities and only inches:

2010-08-12_205048.jpg
Please, register (free) to access all the attachments on the forums.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby dedmin » Mon Jul 12, 2010 6:59 pm

dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm


Re: [Request] - Component's options report

Postby dedmin » Thu Jul 15, 2010 8:37 am

Up.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby dedmin » Sat Jul 17, 2010 1:16 pm

So, nobody knows a way to use all this data that we can put in an dynamic component? I tried with Generate report but it's useless - with 60-70 components it freezes SketchUP and the report is a real mess! I think this attributes can be a shortest way to have some BOM inside SketchUP!
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby dedmin » Mon Jul 19, 2010 10:53 am

I'm keep on searching for a solution and found this - http://code.google.com/intl/bg/apis/sketchup/docs/tutorial_attrreporting.html

But getting error when trying to load it:
Code: Select all
C:\Program Files\Google\Google SketchUp 7\Plugins\attrreporter.rb:199: warning: parenthesize argument(s) for future version
Error: #<SyntaxError: C:\Program Files\Google\Google SketchUp 7\Plugins\attrreporter.rb:163: syntax error
  # Clean up any point rounding weirdness for purposes of display andfilename.split('.').last
                                                                                       ^
C:\Program Files\Google\Google SketchUp 7\Plugins\attrreporter.rb:199: syntax error
  #      the value of the attribute, or nil if it can't determine that
                                                       ^
C:\Program Files\Google\Google SketchUp 7\Plugins\attrreporter.rb:538: syntax error>
C:/Program Files/Google/Google SketchUp 7/Plugins/rubytoolbar.rb:135:in `load'
C:/Program Files/Google/Google SketchUp 7/Plugins/rubytoolbar.rb:135:in `rt_load'
C:/Program Files/Google/Google SketchUp 7/Plugins/rubytoolbar.rb:180
C:/Program Files/Google/Google SketchUp 7/Plugins/rubytoolbar.rb:180:in `call'
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby TIG » Mon Jul 19, 2010 6:11 pm

There's an error in that published script ! :roll:
I suspect that
Code: Select all
value = value.gsub(/\"/,'"')
value = value.gsub(/\'/,''')
return value
should be
Code: Select all
value = value.gsub(/\"/,'"')
value = value.gsub(/\'/,'"')
return value
around line #159..............
TIG
User avatar
TIG
Global Moderator
 
Posts: 13978
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: [Request] - Component's options report

Postby Gaieus » Mon Jul 19, 2010 6:17 pm

Well TIG, I am not a coder but to my eyes, the two sniplets look exactly alike. :roll:


Edit; found the difference!
:sketchstatic:
Gai...
User avatar
Gaieus
Administrator
 
Posts: 27623
Joined: Sat Oct 20, 2007 8:24 am
Location: Pécs, Hungary
Name: Csaba Pozsárkó
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: historical reconstruction
Level of SketchUp: Advanced

Re: [Request] - Component's options report

Postby TIG » Mon Jul 19, 2010 6:59 pm

' ' ' >> ' " '
One 'character' is all it takes to **** up a script -
is there quality control at Google ??? :roll:
TIG
User avatar
TIG
Global Moderator
 
Posts: 13978
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: [Request] - Component's options report

Postby dedmin » Mon Jul 19, 2010 7:11 pm

:sketchstatic: :sketchstatic: :sketchstatic: :sketchstatic: :sketchstatic:
:thumb: :thumb: :thumb: :thumb: :thumb: :thumb:

2010-08-19_211023.jpg
Please, register (free) to access all the attachments on the forums.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby dedmin » Mon Jul 19, 2010 7:20 pm

SketchUP's Generate Report freezes the program just at 1 components

2010-08-19_211533.jpg


But this script is working fine so far!! :berserk: :berserk:
Please, register (free) to access all the attachments on the forums.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby dedmin » Mon Jul 19, 2010 7:45 pm

Now, that at least we can extract some data is there a way to filtered it. For instance to get components quantity and

2010-08-19_214334.jpg


2010-08-19_214415.jpg
Please, register (free) to access all the attachments on the forums.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby dedmin » Tue Jul 20, 2010 11:46 am

Up.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby dedmin » Wed Jul 21, 2010 2:06 pm

I found a way to convert the inches, but the problem with counting components still remain. Any idea how to include this into the report? :roll:
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby dedmin » Thu Jul 22, 2010 2:09 pm

Still hoping... :knockout:
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby TIG » Thu Jul 22, 2010 4:42 pm

Since your example is written in 'Cyrillic' [?] it's hard to understand... Ddo you find the details of a component and also want to show a total number of it in the report - like on the Entity Info window ?
You need to find its definition and then its instances and count them, the format the html/csv to include the 'count' - something like...
Code: Select all
ss=model.selection
ents=ss.to_a
### OR ents=model.entities
### OR ents=model.active_entities
defns=[] ### to become a list of used definitions
ents.each{|e|
  if e.class==Sketchup::ComponentInstance
    defns<< e.definition if not defns.include?(e.definition)
  end#if
}
counts=[] ### to become a collection of definitions [by name] and their instance counts [as a string]
defns.each[|d|
  counts<< [d.name, d.instances.length.to_s]
}
- note it's untested!
You now have an array of selected [or all used] definitions by name, paired with the total of their instances....
So to output it to the Ruby Console use something like...
Code: Select all
counts.each{|e|
  puts e[0]+"\t"+e[1]
}

I'll leave the formating of the csv / html lines etc to you or others............. :ugeek:
TIG
User avatar
TIG
Global Moderator
 
Posts: 13978
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: [Request] - Component's options report

Postby dedmin » Thu Jul 22, 2010 5:33 pm

Thanks so much! I made a component in English to show what I mean:

2010-08-22_193107.jpg

2010-08-22_193044.jpg


The report is a real mess and in inches, but I managed to clean it up in Excel.
Please, register (free) to access all the attachments on the forums.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Request] - Component's options report

Postby TIG » Thu Jul 22, 2010 7:23 pm

So you are almost sorted :)
TIG
User avatar
TIG
Global Moderator
 
Posts: 13978
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

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Need SketchUp Books, Models, Styles or Textures? Check out our One Stop Shop for SketchUp.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012


Return to Plugins

Who is online

Users browsing this forum: BARPAT, Google Feedfetcher, jorge2011, kwenvy, pcm1966, polat, slurm, stephenak and 9 guests