Pick Model Elements


NOTE: This node has been removed from Rhythm. More info here

Use this python as a replacement:

import clr

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitAPIUI")
from  Autodesk.Revit.UI import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#offer the user the selection
elementReferences = uidoc.Selection.PickObjects(Selection.ObjectType.Element, 'Pick model elements')

#our list to append selection results to
elements = []

#obtain the elements via the id
for i in elementReferences:	
	try:
		elements.append(doc.GetElement(i.ElementId))
	except:
		elements.append([])
		
OUT = elements

Pick Model Elements

Dynamo Hierarchy: Rhythm>Revit>Selection>Pick Model Elements

Description:

This node offers a pick method for selecting elements in Revit.

Inputs:

refresh : bool

Outputs:

elements : Element

One thought on “Pick Model Elements

  1. hi how do you input those code? i tried the python script and paste it all the exact same, but nothing happens,

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.