Select Elements in REVIT by the IDs

Hi,

I’m a beginner with Dynamo and I have a selection problem.
I readed a script which select all ID element of elbow 45°. After that I would like to Select all these elbows in my REVIT Workspace to display and change a loss pressure parameter.
I tried to change directly this parameter in dynamo but loss pressure parameter can’t be change easily.
I also tried to use CAAD_RWTH nodes and it doesn’t work.
I’m on REVIT 2016 and Dynamo 1.1.0.0

Here my script

and here the result that I would like. (On this screenshot i selected manually all the elbow)

Thanks to your help

Hi,

you can use this:

the select in Revit is from springs

Thank you ! This method works very well and very easily !

Hello
Do you or any other kind fellow know where this node went (“Springs.SelectInRevit”)? WOuld very much appreciate having it or any equivalent in my toolbox.

1 Like
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

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

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import ToProtoType, ToRevitType geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)

# Import DSCore nodes in Dynamo
clr.AddReference('DSCoreNodes')
import DSCore
from DSCore import *

# Import python library
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
import os
import shutil
import math
# Import math library
from math import *

#Import Data and Time
from datetime import datetime
now = datetime.now()

#Import System Library
import System
from System.Collections.Generic import *
from System.IO import Directory, Path

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIDocument

#Preparing input from dynamo to revit
element = UnwrapElement(IN[0])
ids = List[ElementId]()
#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for ele in element:
	ids.Add(ele.Id)
TransactionManager.Instance.TransactionTaskDone()

#Final output
OUT = uidoc.Selection.SetElementIds(ids)

Believe this code can work with what you want

1 Like