Vex: how to get the name of a node into a string

   5876   3   1
User Avatar
Member
1010 posts
Joined: 4月 2017
Offline
Hi!

Lets say I wanted to get the name of the previous node and set it into a string attribute. Is there a function that would allow that?

-Olivier
User Avatar
Member
459 posts
Joined: 10月 2011
Offline
Hi
In your wrangle, reference a parameter on the wrangle node like this:
s@prev_node_name = chs('node_name');
Then write this expression into the 'node_name' parm:
opinput('.',0)
That will set s@prev_node_name to the name of the previous node.

Bonsak
Edited by bonsak - 2020年12月23日 15:07:26

Attachments:
opinput.hiplc (89.3 KB)

http://www.racecar.no [www.racecar.no]
User Avatar
Member
22 posts
Joined: 5月 2020
Offline
Hi!

In a wrangle write:

s@nodename = chs("nodename");

then press the button right next to the text field under the down arrow to create a spare parameter.

That will create a text field, in there you can write a hscript expression by putting it in brackets,
so to get the name of the previous node you'd write:

`opinput(".",0)`

that will return the name of the node in your first input;

Hope that helped,
cheers
User Avatar
Member
1010 posts
Joined: 4月 2017
Offline
Ohh! That's cool!

Thanks for the reply! I'll test it out soon.

-Olivier
  • Quick Links