Code Block expression help

Hello,

I found this code block expression for Categories.
image

Is there one for view types. “Revit.ViewType.ByName”?? I tried to Google it with no luck.
I would like a code block expression wherein I can bunch multiple view types. ex. Drafting Views. Sections Views etc.

Thank you in advance.

There is not. You would have to filter a list of all view types.

for API specific questions make sure to bookmark API Docs it is for more than Revit as well.

Was saving some of this for a potential rainy day AU course, but if it helps you can look this over.

Using OOTB nodes it’s not as simple, but it is certainly doable:

Note the element queries methods can be found here: DynamoRevit/ElementQueries.cs at Revit2017 · DynamoDS/DynamoRevit · GitHub. They consist of the following:
ElementQueries.OfFamilyType(famtype);
ElementQueries.OfElementType(elemtype);
ElementQueries.OfCategory(categ);
ElementQueries.AtLevel(lvl);
Some other useful OOTB Design Script tools are gets FamilyTypes, Families, and Categories by name.
FamilyType.ByName(“60" x 30"”);
Family.ByName(“Desk”);
Category.ByName(“Furniture”);

And lastly, if you have a package which uses zero touch nodes you can call those functions and methods in the same way as you do the OOTB nodes. This means that we can call upon the power of the larger Dynamo community to expand the feature set of Design Script beyond that which comes with the initial install. Thanks to @Konrad_K_Sobon’s execellant Archi-lab package we can leverage this little number:
image

However note that this will require an extra line of documentation and confirmation that the function is in the noted package (hence the comment on the first line of the node).

7 Likes

Thank you guys. This has been a big help!