No announcement yet.

My Very First (attempt at a production) Dynamo Graph (please, laugh away!)

  • Filter
  • Time
  • Show
Clear All
new posts

    My Very First (attempt at a production) Dynamo Graph (please, laugh away!)

    I don't 'do' New Year resolutions... but I have said to myself I need to get my head around Dynamo, so here I am!

    I thought I'd start with something simple, but alas... (Revit) Type parameters. I'm stumped at first hurdle. Working with (element) Instance parameters seems to be handled OOTB - but 'getting at' - or more specifically 'filter by' (type parameters) seems, by my current "understanding" a bit round-the-houses.

    At least not without custom packages. And, much like (Revit) addins, I'm of the (masochistic) mind to try and make things work OOTB before reaching for magic buttons - simply because I want to keep the worry of deploying a consistent Dynamo to my users to a separate question...

    So what is that I am actually trying to do?

    Well, all of my families differentiate themselves between being an "Assembly" or a "Component" - in so much the highest level parent family of say a door (or more accurately a doorset) is the "Assembly", and all "child" parts, (i.e. frame, panel, ironmongery,etc) are (shared) "Components". This is all handled by a Y/N selector for both, and a third parameter <Model Hierarchy> that returns a respective text value thanks to an IF I have in every family.

    Still with me? Hope so.

    Right, so I go to Dynamo, and want to do a concatenate trick (might as well start simple here) with some (instance) parameters to automate-populate the <Mark> field.

    Simples, a bit of copification (I've done this already with rooms & areas) pretty much gets me where I want to be....


    Until I realise/notice/despair that I'm collecting EVERY instance of EVERY door family.

    In a test scene with only 36No. "Assembly" door(sets), that translates to 774 (door family) instances.
    I've projects I want to push this out on that have 3000+ "Assembly" door(sets). The maths frightens me (& my computer). Not to mention, the "children" families don't have the instance parameters populated, and concatenating them will generate duplicate mark errors - which is one of the exact reasons why I'm tackling this.

    So, obviously, I want to filter the (list of) elements before plugging into the Element.SetParameterByName

    To Google! And a whole load of threads, many similar, but not quite close enough.

    I've found the nodes, and steps that can get me an element's family, and in turn, parameters from that family (that itself 54213 list items alone from this 36No. door test!!!!) and w/ a basic understanding of the Boolean node (not quite ready for the shorthand IFs of Dynamo's Code Blocks) I've ended up with a (filtered) list - of the 36 doors I do wish to process - but plugging that output into with the concatenating part throws the wob:


    ...and I get despondent.

    Here's the whole thing:

    How do I rally round the filtered to the function?

    Have I got about this the wrong/right way round?

    As before, I would prefer OOTB-leaning answers, but if there is a magic button out there, I could be persuaded.

    *my door families are, how would one say, a tad involved.

    Sorry, that saved graph image hasn't shown any of the node labels for some reason.


      You need to zoom in (in Dynamo) until the text shows up, before exporting the graph as an image.
      Aaron "selfish AND petulant" Maller |P A R A L L A X T E A M | Practice Technology Implementation
      @Web | @Twitter | @LinkedIn | @Email


        Based off what I can see you need to feed the filtered door list into each "get value" instead of the original list (if you need info from the components you need to tie it back to that main assembly element id to make sure you get the right info). Also use the filtered list in the set parameter. I've only used the set parameter a couple of times. I suspect its failing either because the count for the element list differs from the other list, or because its one of those nodes that needs to be run through to do it to every one.

        Also use watch nodes or pin the result to see what you are getting - that concentrate list may need to be flattened to a one dimensional list.
        Julie Kidder
        Architect + BIM Director
        Hartman + Majewski Design Group


          Right, a better capture, with some re-work* on nodes. But still no cigar. Not even close I imagine.

          *said changes being:
          a move to filter <Family Name> by "_A_" (our family-naming standard that also demarks "Assembly")
          connecting the filtered-output to the concatenating nodes as per JMK's suggestion

          But the error on the Element.SetParameterByName node now complains
          because - I suspect - the list being fed into it is now looking at my (filtered) types, not the instances of said (filtered) types.

          So essentially I've gone full circle!!! :banghead:

          Q. How might one "relate" the results of the filtered types list to "get at" (and list) the instances?

          I seriously could have flipped this fifty times over already with Excel.


            You are correct in why it isn't working. Double check that you are getting the same numbers in each list, but you should be filtering the output of "All elements of category" through the the string contains Boolean list, not the families.
            Last edited by jmk; January 12, 2017, 03:05 PM. Reason: families, not family types
            Julie Kidder
            Architect + BIM Director
            Hartman + Majewski Design Group


              Im pretty sure you can get Type Name or Family from the instances too. So use Get Parameter By Name to get the list of type names from the instances directly, then use that to filter the list of instances. Finally set the parameters in all the instances.

              I agree it takes much longer to program solutions to most problems than to just do it manually. So the real benefit comes with either tasks that are so time consuming/repetetive that they are impossible or for tasks that you will repeat again and again by multiple projects.

              So I started with sheet and view handling and useful tools like 'Find Replace' for text and object names. Basic stuff that saves you time.
              "One must imagine Sisyphus happy." Albert Camus - "The innovator has for enemies all those who have done well under the old conditions, and lukewarm defenders in those who may ​do well under the new." Nicolo Machiavelli -"Things that are too complex are not useful, Things that are useful are simple." Mikhail Kalashnikov


                Thanks for your assistance everyone - the answer (with a working re-worked .dyn) got posted last night over on Dynamobim:


                Processed 1865 doors in 50 seconds. Nice.


                Related Topics