I have a script which is numbering elements in order, using a spline to select the numbering order (see image: Element Renumbering Script).
I will run this script through Dynamo Player.
My issue is that sometimes I want to number elements without providing padding, for example: (1,2,3,4,5,6,7,8,9,10…)
and sometimes I want to number elements with padding, for example: (01,02,03,04,05,06,07,08,09,10…)
Is there a way I can choose to utilise the output from the green group when the boolean Padding Required is True and the output from the orange group
when the boolean is False? (see image: Zoom)
If anybody could point me in the direction of a similar post or provide any advice it would be greatly appreciated.
Just change the place of your IF node. You don’t need an IF block for each one of the operations. In fact, remove them and connect your inputs directly.
Place the IF node right before your code block with the “a + b”, taking as inputs the outputs of the 2 operations.
On a further point, is there a way to remove or grey out the inputs for the ’new width with padding’ and ‘pad with’ in the dynamo player, IF ‘padding required’ is switched to ‘false’?
I don’t have Dynamo open if front of me at the moment but looking at the screen caps another node I’ve used to capture similar functionality in my scripts that I don’t see mentioned yet is the Tool.RunMe node. I forget which package it’s from without Dynamo being open but basically I use it in conjunction with an if node for error checking or triggering complex branches of the script. I’ll feed an if-node a whole bunch of go/no go logic and then if it returns true trigger the required code. I like it because it keeps the error checking and functionality logic separate, each of which can be quite complex in their own right. Plus, sometimes I find it quite cumbersome to trigger certain behaviour directly from an if-node.
Thanks for your comment, I’ve heard of the Tool.RunMe node, I think it’s from the SteamNodes package iirc. I’ve shut down my pc for the night but I’ll have a play with this in the morning.
Hi I had a look at the Tool.RunMe node from the SteamNodes package and from what I can tell, this seems to function exactly like @john_pierson’s Helpers.Toggle node in the Rhythm package. I’ve been using the rhythm node extensively in my scripts as a means of controlling which parts of my script to run - it’s incredibly helpful. Does anybody know if there is a discernible difference between the two or do they basically achieve the same result?
Spooky @john_pierson piped up here because I’m pretty sure its from him I learned about the RunMe node last year. It sounds like the Rhythm package was updated without me noticing. I just checked and I do indeed already have that Rhythm node. Probably have had it for a while?
LOL, I added it back about a year ago. I had a user from Revit Forum ask for it after I removed the older DYF version. Along with it, I had added a few other nice helpers too.