Select Model Element vs Pick Model Element returns different results

I am getting different results when using different methods to select elements and getting their categories from there. If you view the image, you can see when I use the “Categories” node or “Select Model Element” node the “Element.GetCategory” node only produces the category. When using the “Pick Model Elements” node, the “Element.GetCategory” node produces a list, which is causing the “Isolated Pick Model Elements” to return a null value. Any have any thoughts on this? Both custom nodes are from the Rhythm package.

Hi @SeanP,

At a glance, it appears that the isolated get category node doesn’t take a list (I could be wrong). If you flatten the list before plugging into categories or use the “use levels” “@L1” by clicking on the > arrow of catergories input that should fix it.

Cheers,
Dan

@SeanP ,Isolated category node will only take on item. You can also use a first item before the node to pick the category. It was created to use the “Categories” drop down node as input.

@john_pierson I figured it would only take one item, and as you can see in the nodes I pulled off tot he top, even when feeding it one item it still doesn’t work as I would like. I feel like the actual problem is how the “category” is being output from the “Pick Model Elements” to “Element.GetCategory” nodes. If you look at that in the image, then it is creating the list there even though it only has one item in it. I would use the “Select Model Element” node, but it won’t run when using the dynamo player. Thoughts?

This will do it. Even when a list is only one item, as long as that item has an index, it is considered a list. First item takes care of this.

And to break down the logic further

@john_pierson this worked perfectly. Thank you.

1 Like

Thank you! I will revise the node to work this way too.

@john_pierson I’ve found a typo in yout ‘Pick Model Elements’ node while I was struggling to make my renumbering script work. Once fixed, everything works like a charm.

Please check the line #34 (GitHub source):

for i in el_ref:
try:
	typelist.append(doc.GetElement(i.ElementId))
except:
	typelist.apped(list())

The ‘n’ letter is missing (‘appe-n-d’).

1 Like

Thanks for letting me know. This is fixed, although this wouldn’t have an effect on your selection because that portion handles when there are errors. (Can’t get the items in Revit)

1 Like