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

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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