[Plugin] ComponentReporter++ v1.2

Re: [Plugin] ComponentReporter++ v1.2

Postby bagatelo » Sat Sep 07, 2013 5:52 pm

@TIG

I only need The only modification I would like this plugin would measure diagonal objects properly, instead of bounding box ... and to work with groups also...

Please take a look to another request made by me:

viewtopic.php?f=323&t=54080&p=490233#p490163
0
While the cat's away, the mice will play
User avatar
bagatelo 
 

Re: [Plugin] ComponentReporter++ v1.1

Postby nanolin » Wed Nov 13, 2013 4:50 am

TIG wrote:Here's a version that might do what you want or be adapted easily...
TIG-exportDCs2csv.rb
(c) TIG 2011
Script:
TIG-exportDCs2csv.rb
Type:
TIG.exportDCs2csv
in the Ruby Console to run it.
Exports all DCs is the model with a Name,LenX,LenY,LenZ,Layer[s]...
'CSV' file - in the model's folder and named after the model thus:
ModelName.skp >>> ModelNameDCs.csv
If a new model is unsaved the current directory receives the new file.
All Layers used in the DC are listed by name and visible ones marked
thus >>LayerName<<
Edit sep="," if something other than separating comma is desired e.g. ';'
Make sep="\t" if a TSV file is desired and change ext="csv" to ext="tsv".
It uses the current Model Units.
Version:
1.0 20111104 First issue.
:geek:


TIG

I was unable to generate the report. My model is in decimal> millimeters.
The dynamic component is in cm. Can you tell me what the problem is.

(This returns ruby console)

TIG.exportDCs2csv
Error: #<ArgumentError: C:/Program Files (x86)/SketchUp/SketchUp 2013/Plugins/TIG-exportDCs2csv.rb:48:in `to_l': Cannot convert "23.425196850393703" to Length>
C:/Program Files (x86)/SketchUp/SketchUp 2013/Plugins/TIG-exportDCs2csv.rb:48
C:/Program Files (x86)/SketchUp/SketchUp 2013/Plugins/TIG-exportDCs2csv.rb:48:in `exportDCs2csv'
C:/Program Files (x86)/SketchUp/SketchUp 2013/Plugins/TIG-exportDCs2csv.rb:45:in `each'
C:/Program Files (x86)/SketchUp/SketchUp 2013/Plugins/TIG-exportDCs2csv.rb:45:in `exportDCs2csv'
(eval):48


thanks
0
User avatar
nanolin 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby TIG » Wed Nov 13, 2013 12:23 pm

Do you have ',' set as your decimal-separator, instead of '.' ?
This might cause issues ??
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ComponentReporter++ v1.2

Postby nanolin » Wed Nov 13, 2013 5:14 pm

TIG wrote:Do you have ',' set as your decimal-separator, instead of '.' ?
This might cause issues ??


TIG

I did 2 tests
1) drawing from scratch, I think the componet, add option LenX leny, lenz, the report is generated normally.

2) If this same component attributes modify a component value (eg 10 cm to 20 cm lenz), then display the error of failing to convert ...

thanks

pd. I have a component I created and I'm doubling, changing their values ​​to create furniture.
This report would be a solution to export cuts grain orientation panel
0
User avatar
nanolin 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby nanolin » Fri Nov 15, 2013 6:37 pm

TIG wrote:Do you have ',' set as your decimal-separator, instead of '.' ?
This might cause issues ??


TIG

With separator "," error occurs.
With separator "." export the file, but does not make mm

As coidgo would have to call from the menu?

It would be so?

require 'sketchup.rb'
###
UI.menu("PlugIns").add_item("Tig Export") {
exportDCs2csv
}

Thanks
0
User avatar
nanolin 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby TIG » Fri Nov 15, 2013 7:02 pm

The units are probably arriving in SketchUp base units == inches.
So either multiply your columns in Excel by 25.4 to make mm OR when you a 'length' in inches do something like
sprintf("%.1f", length.to_mm)
so 1.0" >> 25.4 ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ComponentReporter++ v1.2

Postby nanolin » Sat Nov 16, 2013 3:51 am

TIG wrote:The units are probably arriving in SketchUp base units == inches.
So either multiply your columns in Excel by 25.4 to make mm OR when you a 'length' in inches do something like
sprintf("%.1f", length.to_mm)
so 1.0" >> 25.4 ?




TIG

Thanks for your help.
the ComponentReporter + + plugins I reported in mm but axes x, y, z
You could modify this plugin to me that report LenX leny, lenz,(dynamic attributes)+ material, definition, of what is selected?
in one csv.

Thanks again, my knowledge of programming are very beginner
0
User avatar
nanolin 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby TIG » Sat Nov 16, 2013 11:17 am

This original viewtopic.php?p=373590#p373590
does some DC attribute data things...
This is a NEWER version...
(c) TIG 2013
Script:
TIG-exportDCs2csv[2].rb
Type into the Ruby Console:
TIG.exportDCs2csv2
OR use
Plugins menu > TIG.exportDCs2csv2
It Exports all Selected DCs' data into a file, as:
Name,LenX,LenY,LenZ,Material,Layer
It uses 'mm' for the XYZ units.
It is a 'CSV' [COMMA separated variable] file - made in the model's folder and named after the model thus:
ModelName.skp >> ModelNameDCs.csv
If a new model is unsaved the current directory receives this new file.
Edit sep="," if something other than separating comma is desired.
Make sep="\t" if a 'TSV' [TAB separated variable] file is desired and change ext="csv" to ext="tsv".
...
1
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ComponentReporter++ v1.2

Postby nanolin » Sat Nov 16, 2013 4:37 pm

TIG wrote:This original viewtopic.php?p=373590#p373590
does some DC attribute data things...
This is a NEWER version...
(c) TIG 2013
Script:
TIG-exportDCs2csv[2].rb
Type into the Ruby Console:
TIG.exportDCs2csv2
OR use
Plugins menu > TIG.exportDCs2csv2
It Exports all Selected DCs' data into a file, as:
Name,LenX,LenY,LenZ,Material,Layer
It uses 'mm' for the XYZ units.
It is a 'CSV' [COMMA separated variable] file - made in the model's folder and named after the model thus:
ModelName.skp >> ModelNameDCs.csv
If a new model is unsaved the current directory receives this new file.
Edit sep="," if something other than separating comma is desired.
Make sep="\t" if a 'TSV' [TAB separated variable] file is desired and change ext="csv" to ext="tsv".
...


Tig

thank you very much, works perfect.
Just an observation. If doubled within skp component and modify its dimensions (eg. LenX) reports all copies with the same value

Deputy model

Thanks
0
User avatar
nanolin 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby nanolin » Tue Jan 28, 2014 1:05 am

TIG wrote:This original viewtopic.php?p=373590#p373590
does some DC attribute data things...
This is a NEWER version...
(c) TIG 2013
Script:
TIG-exportDCs2csv[2].rb
Type into the Ruby Console:
TIG.exportDCs2csv2
OR use
Plugins menu > TIG.exportDCs2csv2
It Exports all Selected DCs' data into a file, as:
Name,LenX,LenY,LenZ,Material,Layer
It uses 'mm' for the XYZ units.
It is a 'CSV' [COMMA separated variable] file - made in the model's folder and named after the model thus:
ModelName.skp >> ModelNameDCs.csv
If a new model is unsaved the current directory receives this new file.
Edit sep="," if something other than separating comma is desired.
Make sep="\t" if a 'TSV' [TAB separated variable] file is desired and change ext="csv" to ext="tsv".
...


TIG

ud can have the report grouped plugin components, adding the name of the group in a new column?
thanks post your feedback
0
User avatar
nanolin 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby StygianStorm » Thu Jun 26, 2014 1:33 am

Hi TIG - Love the plugin! I just recently stumbled on this page and it has been super useful tracking my work! I was wondering if you had the time to help me make a slight tweak? Basically, I want to tidy up the parentage report to display nested components in a more intuitive way similar to the sketchup outliner?. Hopefully the attached image makes sense: It shows only the counts of of instances, and also puts the them to the right of its parent component. This way, I can visually track the hierarchy.

If you have the time, I'd really appreciate the help given that I am not versed in ruby.

Thank you very much!

0

StygianStorm 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby nghminh81 » Fri Jul 25, 2014 8:09 am

Hi TIG, Thank you so much for your powerful script. I'm using it to do my construction schedules. It helps me a lot. Could you please add a modification that allow me to get volume numbers for components? (my components are solid ready). I don't have much Ruby knowledge and was failed to do it my self.
0
User avatar
nghminh81 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby TIG » Fri Jul 25, 2014 12:42 pm

nghminh81 wrote:Hi TIG, Thank you so much for your powerful script. I'm using it to do my construction schedules. It helps me a lot. Could you please add a modification that allow me to get volume numbers for components? (my components are solid ready). I don't have much Ruby knowledge and was failed to do it my self.
Edit the file with Notepad++...
Around line #149 you can see the 'area' code.
You need to add some similar 'volume' code near that, like this:
Code: Select all
volume=0.0
volume=c.volume if c.volume > 0
# it's always in cu" - to make into something else use a conversion factor like this for cu metres:
volume=volume*0.000016387064
# convert it into a string
volume=volume.to_s.tr(",",".")### trap for comma as decimal point...
# edit line ~ # 166 [remember that it will have shifted down after you entered the new volume code !]
ilist.push([dname,iname,lname,cname,id,x,y,z,pname,area,areas].flatten!)
# to include volume...
ilist.push([dname,iname,lname,cname,id,x,y,z,pname,area,areas,volume].flatten!)
# edits the lines making the header text ~ # 178
file.puts("DEFN-NAME,PARENT[NAME<TYPE>],INST-NAME,LAYER,MATERIAL,ID,X,Y,Z,AREA,SUB-MAT-AREAS\n\n")if miner
file.puts("DEFN-NAME,INST-NAME,LAYER,MATERIAL,ID,X,Y,Z,AREA,SUB-MAT-AREAS\n\n")if not miner
# to read...
file.puts("DEFN-NAME,PARENT[NAME<TYPE>],INST-NAME,LAYER,MATERIAL,ID,X,Y,Z,AREA,SUB-MAT-AREAS,VOLUME\n\n")if miner
file.puts("DEFN-NAME,INST-NAME,LAYER,MATERIAL,ID,X,Y,Z,AREA,SUB-MAT-AREAS,VOLUME\n\n")if not miner
# now edit the code around lines ~ #
ilist.each{|c|
    xx=""; c[10..-1].each{|x|;xx=","+x.to_s}
    if miner
      file.puts(c[0]+","+c[8]+","+c[1]+","+c[2]+","+c[3]+","+c[4]+","+c[5]+","+c[6]+","+c[7]+","+c[9]+xx)
    else
      file.puts(c[0]+","+c[1]+","+c[2]+","+c[3]+","+c[4]+","+c[5]+","+c[6]+","+c[7]+","+c[9]+xx)
    end#if
}
# to read with the extra volume element ... +","+c[-1] ...
# -1 says last element in array which we know in the newly added 'volume' string.
ilist.each{|c|
    xx=""; c[10..-1].each{|x|;xx=","+x.to_s}
    if miner
      file.puts(c[0]+","+c[8]+","+c[1]+","+c[2]+","+c[3]+","+c[4]+","+c[5]+","+c[6]+","+c[7]+","+c[9]+","+c[-1]+xx)
    else
      file.puts(c[0]+","+c[1]+","+c[2]+","+c[3]+","+c[4]+","+c[5]+","+c[6]+","+c[7]+","+c[9]+","+c[-1]+xx)
    end#if
}
Hope that helps...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ComponentReporter++ v1.2

Postby nghminh81 » Sat Jul 26, 2014 3:15 am

Thanks TIG so much for spending time with my case. Your help make it works perfectly. I've learned many many of Ruby language with your code.
0
User avatar
nghminh81 
 

Re: [Plugin] ComponentReporter++ v1.1

Postby vmsremy66 » Fri Sep 12, 2014 1:23 pm

sorry....
0
Last edited by vmsremy66 on Fri Sep 12, 2014 7:40 pm, edited 1 time in total.

vmsremy66 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby vmsremy66 » Fri Sep 12, 2014 2:33 pm

Hello TIG
thank you for your time with this plugin.

do you think it is possible to list dynamic components and their LenX, LenY, LenZ that are inside another dynamic component?
0

vmsremy66 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby TIG » Fri Sep 12, 2014 11:11 pm

This is somewhat more complex...
Why not post a similar request in the DC forum ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ComponentReporter++ v1.2

Postby maxim_ » Wed Oct 08, 2014 10:35 am

Hi TIG, thanks for the plugin!
Whether it is possible to copy the report in a clipboard? But only "Instances+Report"!
It is sometimes better than the CSV file.
0

maxim_ 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby oceanembers » Wed Nov 19, 2014 12:24 pm

Hi Tig, I'm trying to get this to work, reporting the components only if the dynamic attribute "report" is true. After a little experimentation, I think I should be changing line 135 to read
Code: Select all
       inlist.push(c) if ((c.typename=="ComponentInstance") && (c.attribute_dictionaries['report'] == 'TRUE'))

But that creates no results (I do have a DC in my model with the attribute 'report' set to 'TRUE')

Could you point out where I'm going wrong?
0
User avatar
oceanembers 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby TIG » Wed Nov 19, 2014 1:02 pm

Should you not be looking at the c.definition rather than the instance ?
Also are you sure that's the attribute_dictionary name ?
Perhaps 'dynamic_attributes' ??
Try this Ruby Console snippet on a selected DC instance to see what I mean:
Sketchup.active_model.selection[0].definition.attribute_dictionaries.each{|d|puts;p d.name;puts;d.each_pair{|k,v|puts"#{k} = #{v}"}}
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ComponentReporter++ v1.2

Postby oceanembers » Wed Nov 19, 2014 2:56 pm

oh I see! I completely misunderstood attribute_dictionaries.
Code: Select all
      dict = c.attribute_dictionaries['dynamic_attributes']
       inlist.push(c) if ((c.typename=="ComponentInstance") && (dict['report'] == 1))

This works great, thanks Tig.
0
User avatar
oceanembers 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby rubenamaroh » Fri May 08, 2015 2:02 am

Hi TIG
About "ComponentReporter++.rb"
is theres some way the plugin including columns like Lenght X, Lenght y and Lenght Z of the box ?:
im new in rubys, sorry. :(

DEFN-NAME | COUNT | DESCRIPTION | X | Y | Z | GUID |

Any help i will apreciate. :D
0

rubenamaroh 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby TIG » Fri May 08, 2015 10:07 am

rubenamaroh wrote:Hi TIG
About "ComponentReporter++.rb"
is theres some way the plugin including columns like Lenght X, Lenght y and Lenght Z of the box ?:
im new in rubys, sorry. :(

DEFN-NAME | COUNT | DESCRIPTION | X | Y | Z | GUID |

Any help i will apreciate. :D
Of course.
This is just an 'example' script.
Get the group/component-instance .bounds and get .width/height/depth [lenX/lenY/lenZ]
The add the extra columns into the CSV and include the three values .to_s etc...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ComponentReporter++ v1.2

Postby rubenamaroh » Sat May 09, 2015 11:10 pm

TIG wrote:
rubenamaroh wrote:Hi TIG
About "ComponentReporter++.rb"
is theres some way the plugin including columns like Lenght X, Lenght y and Lenght Z of the box ?:
im new in rubys, sorry. :(

DEFN-NAME | COUNT | DESCRIPTION | X | Y | Z | GUID |

Any help i will apreciate. :D
Of course.
This is just an 'example' script.
Get the group/component-instance .bounds and get .width/height/depth [lenX/lenY/lenZ]
The add the extra columns into the CSV and include the three values .to_s etc...


Ok.
I will try to do it :D
I was trying to make a list of material of framing walls but did not have the length of the studs and ledgers, i'm more familiar with the language of AutoLISP for AutoCAD, so I'm starting to learn the language of the rubys, any suggestions to learn ruby?
thanks.
0

rubenamaroh 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby katalikammello » Fri Sep 25, 2015 3:55 pm

Is it possible to find and retrieve information from attributes in nested components?
ideally I would like to achieve a plugin like "TIG-exportDCs2csv[2].rb" that is able to Exports all Selected DCs' data into a file BUT FROM "NESTED" (or child) COMPONENTS AS WELL.
Anyone can help with this?
0

katalikammello 
 

Re: [Plugin] ComponentReporter++ v1.2

Postby sjdorst » Tue Jan 19, 2016 12:27 am

@Tig,

Can this plugin report current Attribute values AND formulas (if any) side by side?

If yes - Great!

If not, please consider this a suggested improvement, as well as a request for information - should you know of another plugin that provides this functionality.

Thanks in advance!

Steve
0
User avatar
sjdorst 
Premium Member
Premium Member
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Previous


 

Return to Plugins

Who is online

Users browsing this forum: blackcrowx87, jhnysmn, markus and 12 guests

Visit our sponsors: