Text field key value for Page Name

Hello, I am trying to get the text of the key value text field.
Anybody knows how to get the value of the text field ?
I would like to retrieve Page 1 instead of %<PageName(id)>%

post your file

here are the files,
Page-name=value-text.3dm|attachment (102.6 KB) Page-name-value-text.gh (13.3 KB)

Not sure what’s the problem here.

I re-assigned the user attribute to the objects on your layout Page 1 and clicked Update on the Reference by Layer component

Is your Elefront up to date?

Thanks for looking at this,
I updated Elefront to 422.
I got the same here as before.
How do you re-assigne the user attribute ?

I selected the objects, deleted the existing user attribute and added a new one with the +


Ok I understand. I am using TextField function. My goal is to sort text by Page Name in grasshopper.
And have the output value show the page name in grasshopper (not the function)…

Sorry can’t help. I get the same problem when retrieving the user text with a python script.

a output should be Page 1 and not %<Page…

@Trav ? What’s the problem here?

Thanks !

@martinsiegrist You’re on the right track you’re just only half way there. Once you’ve retrieved the stored text function you’ll now need to parse it if you want the results.

You’ll need to make a call to RhinoApp.ParseTextField if you want the computed results of a stored function.

Thanks Travis.

I found another reply for the same issue :slight_smile:

1 Like

Thank you soo much ! I cannot believe it was there and I couln’t find it.
It works exacly like I wished !

1 Like

Solution found here:

1 Like

@martinsiegrist hah! I’ve had a lot of Mt. Dew since then and totally forgot I had posted that. With that said, here’s the c# script flavor for the gh posted by @s11.

I added an overload method to PageName at some point a few months ago so that it can accept blank entries (no guids). When this happens on an object the active layout page number is returned.

So you can have %<PageName(“Guid”)>% to reference a specific layout or %<PageName()>% to reference whatever the active layout is.

Page-name-value-text-fixed.gh (10.3 KB)

1 Like