Filter out element(family types) that doesnt have keynote paramaeter

Hello Forum :slight_smile:

What im trying to do here is part off script, where i can avoid “nearly” using excel to generate my keynote text

right now im taking all the element from all levels of the model into dynamo (maybe not ideal) and then trying to filter out the element that dosent have a keynote parameter (curves, area, room etc)

But right now im getting the error “asked too convert non convertebel type” because the node is told to get a parameter from a element that dosent have the parameter.

what i would like too ask is:
1: is it possible to filter out the element with no keynote paramater this way or something similar ?

2: what consequence does this error give? cause the rest of the data goes trough fine as it seems?

3: is this approch to get element into a script, a wrong way off dealing data in general?

You’re hiding an input but I assume you’re converting the element instances to their types with the GetParameterValueByName node. You probably have a few instances that do not have Element or Family Types and these are returning empty values which are in turn causing errors with your ParameterByName node. Try filtering those elements out before moving on to the next step.

Hej Nick your right:)

Maybe i wasent specifik enough :smiley:

What im trying to do here is determin what ever or not a element/Element´s type contain a Keynote parameter.

and there after use the true false value to filter out the element i dont want.

The reason this is giving me trouble is because im getting all element at a level at once, and therefor im picking up model curves, rooms etc :slight_smile:

What im trying to figure out is if i cant filter out all these element at once kinda like

Kinda like

Filter if

Element dosent have paramater “Keynote” :joy: “pretend that i didnt write that :smiley:

You need to filter out the elements that do not have types.

In my example, the element instances at index 108, 109, and 110 do not have element or family types.

GetParameterValueByName and ParameterByName will return empty values or nulls if the parameter does not exist, but will error if the element does not exist. This is why your graph is failing later on. Once the empty “types” have been removed you can continue to filter for parameters with values.

@Nick_Boyts Thank you so much, i already where in bed when i saw your message :slight_smile: rushed up to check if it did as intended :smiley: it did thanks alot :smiley:

do you know if it would actally have any impact leaving an error like “asked too convert non convertebel type” in the workflow?

Null and empty values usually won’t break your graph. However, not dealing with them may cause other nodes to break down the line. Dynamo also has problems handling null and empty values at the beginning of a list, so while it may not break anything this time, it may completely fail for a different project.

You would also just use the Element.ParameterExists node from Clockwork.

@SeanP that is from clockwork right?

that might be the same thing we just did above just with a simple node correct?

that lead me to another question :smiley: since im still a student my experience with doing scripts for a company is not there yet :smiley:
but i talk too a guy where i had a intership, and he seamed a little nervous about using imported packages (dont know if he refered to clockwork exaclty.)

can you tell me if there any thing you should consider before using not standard nodes for a dynamo workflow? (the company i was working in had 500 employes and was new to using dynamo)

hope you understand the question, and are able to help :smiley:

Yes, that is from the Clockwork Package. There are several discussion on here if you search related to using packages over OOTB nodes etc. Really it boils down to the viability of the packages and which ones. As you can see from the image below, Clockwork is one of the most downloaded packages on the forum.

That is usually a good indicator on whether you should use it or not. The other nice thing about this package and that node specifically is that it is a custom node which means you can dive (double click) into it and check out what is going on “under the hood” to verify there isn’t anything malicious. I would venture a guess that above 90% of the folks out there doing major Dynamo efforts are using nodes from one or more packages. Just like anything, common sense prevails and if all else fails ask here on the forums and you will usually get help.

Hej sean
I will check that out :smiley:
Sorry for the late reply :slight_smile: