Get the name of a node

How can I get the name of a node used?

I want to get its name by string

out of curiosity what do you plan on doing with this bit of information? Have you tried anything?

1 Like

The name is stored in the dyn, so t he simple route would be to read the file as a txt and parse the data you want from there.

2 Likes

I do not want to write it manually as a string. My end goal is to export this data to excel.

This will do it for DynamoRevit:

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
5 Likes

Many thanks @john_pierson, I was looking for that and specifically get the name of nodes as input in the Python script, I mean get the name of the nodes feeded into the node script