Parameter.HasValue

Hi,

I am trying to run a script, that should fill Assembly Name to a created parameter, but only if that parameter has no value. In my case it is called BA_VF. I tested it on a clean project where it worked perfectly, but when I run it on the actual project, dynamo tells me that my that this parameter has value everywhere, even though it doesnt. Does anyone know how to solve this? Thank you in advance.


VF.dyn (43.0 KB)

Can’t explain why the Parameter.HasValue node is doing that. Curious as to why you are getting the ids from the list of elements and then getting the elements by the ids? Why not just feed the list of elements straight into your filtering.

Alternative to what you are trying to accomplish.

Only certain parameter types can have a null state (no value). Parameter.HasValue only works for those parameter types. String parameters just have empty strings, which you can check for with a simple code block condition:

value == "";

1 Like

Hi,

thank you for your reply. I ll give it a try, but I already see, it should do the job.

To answer your question, I am quite new to Dynamo, so when I do some process like this, I usually get the ID’s first and then work with them through out the whole process, but I am sure there is a easier way.

ElementFilter.ByParameterEquals is a package right?

if so might be good to tell @mpocinek which one.

cant find it in out of the box nodes (have it in a couple of packages i have installed though).

Packages i know that have it. Rhythm, GeniusLoci

Yes,

I had to google it and found it in EvolveLAB_Beaker package

Thank you

Apologies for not providing the name of the package for that node, bad assumptions on my part. Glad you were able to find it.
BTW, if you don’t have the Rhythm nor GeniusLoci packages installed, I would recommend getting them. They both have very good nodes, that will help you with a lot of processes.

To answer your question, I am quite new to Dynamo, so when I do some process like this, I usually get the ID’s first and then work with them through out the whole process, but I am sure there is a easier way.

No worries. End result is the same, but less data looping is better and cleaner. There will be trial and error throughout and you will get a lot of feedback from the group with tips, tricks and shortcuts. Don’t take any of the feedback as criticism.

No worries. I will surely have a look at them. Thank you.

Yes, this group is very helpful, I mostly find the solution here without creating a new topic, but when I do, I always get a great advise.

I am very happy for this forum and the way it works