sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    [Plugin] DC Functions - Calculate Nested Attributes 0.4

    Scheduled Pinned Locked Moved Plugins
    7 Posts 5 Posters 3.2k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TommyKT Offline
      TommyK
      last edited by TommyK

      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=DCFunctionNestedAttributes

      As 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:
      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

      1 Reply Last reply Reply Quote 0
      • Rich O BrienR Offline
        Rich O Brien Moderator
        last edited by

        Hi Tommy,

        thanks for sharing.

        The plugin is now added to the PluginStore

        Link Preview Image
        SketchUp Plugins | PluginStore | SketchUcation

        SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

        favicon

        (sketchucation.com)

        To access your plugin in the store you can go to...

        favicon

        (sketchucation.com)

        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

        http://sketchucation.com/forums/viewtopic.php?f=382&t=52516

        Download the free D'oh Book for SketchUp πŸ“–

        1 Reply Last reply Reply Quote 0
        • wilsonbuilt78W Offline
          wilsonbuilt78
          last edited by

          Nice idea, will give it a go. Thanks for sharing!

          1 Reply Last reply Reply Quote 0
          • TommyKT Offline
            TommyK
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • greenskpG Offline
              greenskp
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • TommyKT Offline
                TommyK
                last edited by

                Hi Greensp,
                Do you have sketchup pro installed? This plugin only works with pro, and it's dynamic components feature.

                1 Reply Last reply Reply Quote 0
                • M Offline
                  Monalins
                  last edited by

                  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?

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement