Dynamo CodeBlock Element Types / Categories / Etc

Hello Everyone,

I am trying to hard code certain information from designated “Element Types, Elements, Familys, Family Types, And Categories” for codeblock use. For example instead of using the selection tool for Categories, you can designate a specific category by the following:

Categories

Is there ways of doing the same with the types I mentioned above? Here is an example of what I would want to hard code / code block:

Thank you team!

Sincerely,
Kevin

Hi Kevin,

This should return a list of Project Information elements:

project_info = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_ProjectInformation).WhereElementIsNotElementType().ToElements()

Hey Tom!

I am unfortunately still getting an error with the input provided. Please see the below. Thank you for all your help.

Create a Python Script node with no inputs:

2 Likes

Thank you so much Tom! Huge Help :slight_smile:

hello!

I was looking for a similar issue and found this post.
I tried to tweak the code so it shows Reference Plane but getting an error

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(‘RevitServices’)

import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

reference_plane = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_ReferencePlane).WhereElementIsNotElementType().ToElements()

OUT = project_info[0]

could you let me know what the problem is if you got a moment please?
I appreciate it!
Thanks