Select all elements of a type via Code Block using DS

Hi everyone,

I would like to select all the elements from the class “Element Types” (Autodesk.Revit.DB.ElementType) by using DS within a code block. However I have never used the code block for this, but I know that it can be possible. Does anyone have a suggestion about how to do it?

Thanks in advanced. I really appreciate it :slight_smile:

Kind regards,
Alejandro Mata

From what I know, it may not be possible yet to do so with Design Script alone.
You’re looking for something on these lines?..

1 Like

Hi Vikram,

Thanks a lot for your reply. I really appreciate it!

It really interesting what you showed, getting access to element properties by using DS :slight_smile: However what I’m interested was in replace the drop down “elment types” nodes by using DS in a code block to avoid finding the wished type in a really long list. For example I tried with the “categories” nodes and it worked, but I haven’t succeed with the “element types” node. But maybe I’m trying something that is not possible, I don’t know.

Also another reason, why I would like to get access to element types by using DS is for having access to more possibilities within revit API. For example with “Element Types” nodes only you can have access to elements placed in certain classes, however if we look at Revit API there are additional classes that contains more elements types not comprised by this node, such as class “Autodes.Revit.DB.Element” where you can have access to all the elements placed in the model at the same time. That’s why, it would be really good to select element types by using DS, because you can customize the selection according your needs at the same time than you are making sure that nobody will switch the element type from the drop down list. However maybe this approach is only possible via Python or C#.

Thanks for participating in the discussion.

Kind Regards,
Alejandro Mata

1 Like

See if the Design Script Documentation helps

5 Likes

Thanks a lot for the manual. It’s really instructive. Let’s see if I manage to do this approach.

Kind regards,
Alejandro Mata

2 Likes

Have you managed this issue? I have the same question.

1 Like

@grigorii.ivanov
Is this what you are after I came across it the other day via @john_pierson /TheRevitKid (52mins in) https://www.youtube.com/watch?v=jRTAse0aY3g&list=UU6TtKCInvnoU7vLNACZRFrQ

4 Likes

And I learned it from here! :grin: Code Block For View Drafting

5 Likes