Select Pinned Elements

Hi @Jordan_Billingsley - I already have a very simple Python script that accomplishes supplying a boolean output for whether or not elements are pinned are not, which I will provide below. You can use this inputting your wall elements, then using Filter.ByBoolMask with its output.

To encourage you to understand how the script works & to further learn using Python with the Revit API I will provide an explanation on how it works. if you look at the API Docs that @Nick_Boyts referenced above you will see that “Pinned” property is a Boolean. You are on the right track by seeking a resolution to retrieving pinned elements by looking at the Element.SetPinnedStatus node’s Python code.

for i in items:
	try:
		i.Pinned = IN[1]

These lines in that code are essentially saying, for each element in the input list of element, set “true” for “Pinned”. Understanding this will help to understand the code I am providing below, that determines if elements are pinned or not:

import clr
import System
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

elems = UnwrapElement(IN[0])
elementlist = list()

for elem in elems:
	try:
		elementlist.append(elem.Pinned)
	except:
		elementlist.append(False)
OUT = elementlist
7 Likes