All Elements Of Category in a Code Block

codeblock
designscript
#1

Does anyone know how to follow up the definition of a codeblock that defines categories, with the codeblock equivalent of All Elements Of Category? For instance:

[Category.ByName(“OST_Walls”);] - [“All Elements Of Category” node]

I can obviously plug this in to the “All Elements Of Category” node, but I’m looking for an all CB way of doing this. Any ideas or thoughts would be appreciated!

0 Likes

How could I get TextNotes in Dynamo1.2.1
#2

You can’t do it. DS currently doesn’t support that node!

0 Likes

#3

Bummer. Thank you for the feedback!

0 Likes

#4

As stated above, “All Elements of Category” can’t be used as a function. Tho you can do the next best thing and wrap it inside a custom node. That way you could do something like the below:

1 Like

#5

Thank you, Dimitar! I’ll take a look at applying this next chance I get.

0 Likes

#6

@Ryan_C I’d have done this :slight_smile:

2 Likes

#7

But what if you need to embed the AEOC node in an imperative block? :smiling_imp:

0 Likes

#8

:laughing:
A solution to this is imperative, eh?

1 Like

#9

Thanks again @Dimitar_Venkov.

1 Like

#10

deleted by the author

0 Likes

#11

This method worked just fine!

However, I tryed to do it in an if-condition and it did not work.

0 Likes

#12

I wrote this quite a while ago. You can actually streamline this further, by using the underlying ZT method ElementQueries.OfCategory (for Dynamo 2+). It should also work in imperative code:

image

6 Likes

#13

Yes, it worked!

Thank you.

1 Like