Problem with script
-
Since the introduction of Dynamic components I have been trying to find a script for doing reports for them.
I came across this and thought I would try it to see what it does
http://code.google.com/apis/sketchup/docs/tutorial_attrreporting.html
I am no script writer, and find when I copy and paste the text and save it as an .rb, I get this error message when I start SU (V7)
@unknownuser said:
Error Loading File attrreporter.rb
C:/Program Files/Google/Google SketchUp 7/Plugins/attrreporter.rb:163: syntax errorClean 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
Can any of you script gurus explain the problem and what I need to do to correct it
Thanks
-
I don't have this code but there's at least one error in it just before line 163 in the
def clean_for_xml(value)...
section, the line
value = value.gsub(/\'/,''')
would work as
value = value.gsub(/\'/,"'")
Try editing that line with the "'" and see what happens...
[That's why the html formatted text suddenly goes green after that until it gets another ' in the line...can****'****t determine that...
] -
Thank you very much TIG. Much appreciated.
I corrected the line as you suggested and the script now loads and works.
The script produces a report (.csv or .html) which includes all the attributes of all the groups and sub-groups of all the components in the model, with dimensions in imperial measurements.
What I need is a list of only the groups (and/or sub groups) with a specific attribute (say I had an attribute called 'ReportThis' with a value 'Yes' or 'No'), and to only list some of the other attributes (eg Height, Length, Depth, Cost, Description etc), and the dimensions showing in cm or mm.
I could extract this information from a full report in .csv using Excel and formulas, but wondered if you, or anyone else could explain how I may add this to the script to do it with a ruby.
Thanks in advance for any forthcoming assistance.
-
Moved this topic to the Developer section of the forum.
-
Thanks Thomthom.
-
@peweuk said:
What I need is a list of only the groups (and/or sub groups) with a specific attribute (say I had an attribute called 'ReportThis' with a value 'Yes' or 'No'), and to only list some of the other attributes (eg Height, Length, Depth, Cost, Description etc), and the dimensions showing in cm or mm.
This report, does it need to know the group's nesting relationship to each other?
-
I think the answer is - yes.
What it is for is cabinets.
Sometimes I make them, and sometimes I buy in.
I have created some dynamic components for the carcasses. These consist of the various panels which make up the carcasses. Those I buy in could have a Reportthis attribute of 'Yes' for the parent (ie the whole carcass)and 'NO' for the sub-component panels which make it up.
Those I make could have the Reportthis attribute of the Parent as 'NO' and all the sub-components set to 'Yes'.
I hope this makes sense
-
But can't this already be done in SU with the Generate Report function?
-
@unknownuser said:
But can't this already be done in SU with the Generate Report function?
The problem with the inbuilt report generator is the same as the script referred to above.
It is not very flexible, even if you take the option to report on selected components ony, it still includes all the attributes of all the components, and it reports in imperial measurements even if the model is in metric.
What I would prefer is a report which is more selective such as the example I detailed above.
The problem I am having is finding someone who could modify the above script.
Advertisement