get node name dynamo revit 1

get node name dynamo revit

import clr
# Adding the DynamoRevitDS.dll module to work with the Dynamo API
clr.AddReference('DynamoRevitDS')
import Dynamo 

# access to the current Dynamo instance and workspace
dynamoRevit = Dynamo.Applications.DynamoRevit()
currentWorkspace = dynamoRevit.RevitDynamoModel.CurrentWorkspace

nodeNames = []

for i in currentWorkspace.Nodes:
	nodeNames.append(i.Name)

OUT = nodeNames

Here is what the above code is Doing:
1. Importing the clr module to work with the Dynamo API
2. Adding the DynamoRevitDS.dll module to work with the Dynamo API
3. Accessing the current Dynamo instance and workspace
4. Creating an empty list to store the node names
5. Looping through the nodes in the workspace and appending the node names to the list
6. Outputting the list of node names

Similar Posts