Hi, this may seem a bit silly but I am trying to find a way to select all of the walls in a view that are pinned. I found Rhythm’s Element.SetPinnedStatus node (python below) but I am totally new to Python. I feel like I am frustratingly close but would appreciate some help. The goal is to select all of the pinned walls and then override them in a view to graphically highlight to other users that the elements have been pinned. Thank you!
#Copyright(c) 2017, john pierson # @60secondrevit, http://sixtysecondrevit.com import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * # Import ToDSType(bool) extension method clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) # Import DocumentManager and TransactionManager clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager from System.Collections.Generic import * # Import RevitAPI clr.AddReference("RevitAPI") import Autodesk doc = DocumentManager.Instance.CurrentDBDocument uiapp = DocumentManager.Instance.CurrentUIApplication app = uiapp.Application #The inputs to this node will be stored as a list in the IN variable. dataEnteringNode = IN #unwrap all elements to use with API items = UnwrapElement(IN) TransactionManager.Instance.EnsureInTransaction(doc) #SEt pinned status over list typelist = list() for i in items: try: i.Pinned = IN except: typelist.append(list()) # "End" the transaction TransactionManager.Instance.TransactionTaskDone() #Assign your output to the OUT variable OUT = IN