Get node name as string


#1

Hi everyone,

I would like to retrieve the names of the nodes I used in my definition. Specially those which had been renamed to new names.

Is there any way to get them as a String?

 

 

Thank you!

 

MS


#2

Since you can read the text of a .dyn you should be able to retrieve Node IDS and node names.


#3
  1. Select the node
  2. Right click on the canvas (not on the node)
  3. Select Node to Code
You can undo the operation once the required information is obtained.

#4

For what I want to do, The way JohnP said is the way to go.

I didn’t know DYN files were XML!

The attribute I need is called “NickName”.

More to follow as I dig into this!

 

MS


#5

Looking forward to the results! Check out the nodes file.frompath and file.readtext. I also just remembered that Bakery might have some stuff for this.


#6

I wish I had something like doc.name referencing Dyn document instead of Revit one…


#7

This might be doable, I’ll see if I can do some digging as well.


#8

Until now, I have learn that there is an attribute of the items in <Elements> called “Nickname” of every node in the script. This is the name we see as header in the nodes.

I’m still figuring out how to separate the “renamed” ones from the rest.

 

All this goes because I want to write a script to auto-generate the presets file (JSON format) for Dynobrowser, without or very few human intervention!

 

Stay tuned!

 

MS