Pulldown Nodes keep reseting to blank

I’ve noticed that some pulldown node keep reseting to blank. One type is the “Line Pattern” node. Sometime when I open the script I will notive that it doesn’t have the value I set last time I saved. This has happened to me on 2.0 and 2.1. Another one that I noticed did this was “Select Filter Type”. Once I figured out it just output a string I replaced it. Is there any reason this is happening?

Have you opened it with the same project? It happened to me if I open the script in another project that´s not the one I created for.

I think I have. I’ve been testing a project startup scipt so I’ve been using it on dozens of new files. It is strange how some node don’t have this issue.

The only similar thing I noticed is when I first opened it in 2.1 some other pulldowns changed to random values. I made a new script specifically for 2.1, replaced broken nodes and they have all been fine from that point onward.

Well, if the dropdown is not for selection the best thing is to hardcoded it in the script.

1 Like

That is defninitly true I just don’t know how to do that for all nodes. I can obviously do that for strings. I don’t know how to do that for the cutLinePatter or projectionLinePattern inputs in the “OverrideGraphicSettings.ByProerties” node. I’m slowly learning how to do more things in dynamo but code blocks and inputs for nodes can be frustrating. It seems like the naming standards aren’t great for them.

Hey, I updated to 2.0.3 and I don’t believe it happens any more. I think it was a bug. As I’m sure you’re aware, the nodes will tell you the expected input so you can usually work around it, but it is a pain in the behind…

Hope that’s of interest,

Mark

1 Like

I’m trying to understand how to set a class using code blocks is either of the blocks below going to do what is needed. If not how do I do this?

Code%20block%20class%2001

This will help:

@Mark.Ackerley is right that 2.0.3 should fix this problem but for older versions that cannot be upgraded, as @architectcoding said, if you are having problems with consistency between scripts with dropdowns, hardcoding is the best solution.

Most dropdowns have an alternate method of getting the same outcome, either with .GetByName (like LinePatternElement.GetByName()) or by checking what the output of the dropdown actually gives you.

Sometimes it is an element, other ones might just give you a string, Select Rule Type is an example. So making a normal string of “BeginsWith” is the same as the output from SelectRuleType set to BeginsWith.

2 Likes