[Plugin] DC Functions - Calculate Nested Attributes 0.4
-
Calculate Nested Attributes works with the Component Attributes window, and offers two new functions that calculate attribute values in nested components and groups, and updates them dynamically.
=NestedAttributeSum("attribute_name", "attribute_dictionary"{optional})
- sum of all attributes with name "attribute_name" of all groups and components nested in the component/group (inclusive of the current component/group).
=NestedAttributeCount("attribute_name", "attribute_dictionary"{optional})
- counts the instances of an attribute with "attribute_name" in nested components/groups.
For both functions, an optional "attribute_dictionary" argument is available for those users who wish to calculate values of attributes outside of the "dynamic_attributes" Attribute Dictionary.
You will not find these functions listed in the functions list at present; these must be typed in manually.
Installation
Install from the Plugin Store:
http://sketchucation.com/pluginstore?pln=DCFunctionNestedAttributesAs this plugin requires the Component Attributes feature, it will only work on Sketchup Pro. Sorry free users.
Tested on Sketchup 8, and 2014 Pro
Usage:
A classic use of this plugin would be to dynamically total prices for a set of components, or even for an entire project (as in image above).
Other uses would be to track total internal areas for costings, volume of concrete etc, all within the model without having to generate a report. These are simple tools which tie information about your project into the design workflow.
New in v0.3b
- New menu options added in Plugins > Attribute Formulas. "Dynamically Recalculate" switches on/of dynamic recalculation of nested attribute formulae. "Recalculate All Formulas" does what it says when "Dynamically Recalculate" option is turned off.
v0.4
- Compatability fix for Sketchup 2013 and 2014
Known Bugs
- Does not work well with newly opened models. To get formulas to calculate again when a model is opened, any attribute in the group/component with the formula in them must be edited again for the update process to be triggered.
- Unstable with larger models.
- Performance issues for very large models with many levels of nested groups/components.
Note to developers
This is my first successful attempt at a ruby plugin. Although I have tried to follow the advice given here in the forums and elsewhere, I could probably do with a code review from someone more experienced.Future development goals:
- Improve performance and stability.
- Add the function to the list of available functions in DC
Thanks to:
- Dan and his rigourous documenting of good practices in Ruby coding (I hope I followed them well enough!)
- TIG for elaborating on the potential of dynamic functions in this post: http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=37083|/viewtopic.php?f=180%26amp;t=37083
- Whoever made this useful document on dynamic attributes: http://wiki.cfcl.com/bin/view/SketchUp/Cookbook/DA
I welcome all comments! This module needs improvement
-
Hi Tommy,
thanks for sharing.
The plugin is now added to the PluginStore
SketchUp Plugins | PluginStore | SketchUcation
SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins
(sketchucation.com)
To access your plugin in the store you can go to...
You are added to the Plugin Authors group so you can directly upload to the store in future.
There's also a discussion forum here...
http://sketchucation.com/forums/viewforum.php?f=382
...with an author's guide on making plugins PluginStore Compatible
-
Nice idea, will give it a go. Thanks for sharing!
-
I know this plugin probably wasn't used much. I need to announce that it doesn't work on Sketchup 2013/14. It is in fact impossible for me to make it work on 2013/14, as Trimble have encrypted the DC ruby files that I need to be able to see to make the plugin work.
This does also mean that plugin developers can't realistically add functionalities at all to Dynamic Components. A bit sad really. I don't know why Trimble have taken this step.
[EDIT] I have since found that some simple files had changed position. I have updated the script for compatibility with 2014.
-
Could you make a video showing like it works? The use description's is interesting but looks like it's only for developers. I would like trying to input prices and i don't know how to begin.
-
Hi Greensp,
Do you have sketchup pro installed? This plugin only works with pro, and it's dynamic components feature. -
Hello,
I'm having trouble getting this plugin to work on SketchUp 2023. It always returns zero. Does anyone have any ideas on how to fix this issue?
Advertisement