Issue: Enhanced Text Fields do not display document user data anymore

Hi there,

I used to be able to set a value for document user data and use that value as an enhanced text field. However it does now display “####”

Can anyone help me out?

Thanks,
Tim

I use snippet below to set the value. Then from the textEditor I select the value as an anhanced text field (screenshots). I am using version 7 sr24

import rhinoscriptsyntax as rs
rs.SetDocumentData("mySection", "fieldName", 'FieldValue')

image

image

I’ve found a solution:

manually changing the key string to r"mySection\fieldName" or “mySection\fieldName” to escape the backslash solves the missing reference.
image

This makes sense to me, however I still would expect the “enhanced text field dialog” to fill out a working string for me.

best regards,
Tim

The trick here is to not use any of the escape characters for the fieldname, see for example:

so any fieldname that starts with lowercase f, n, r will have the same issue.

Not sure if this is a bug or something unavoidable

hi @anon96452003,

thanks for your response. Like I said: using raw strings or replacing “\” by “\\” works for me.

However, the issue remains that the broken reference (using escape char ‘\’) was generated by Rhino’s native “text field” dialog (screenshot). I think this is not intended behavior

cheers,
Tim

@anon96452003,

nice to meet a fellow Brabander on McNeels forum by the way :hugs:

1 Like

I know, it can be considered a bug but I’m not sure if it can or will be changed. In the meantime, by avoiding f,n,r for Fieldnames or using capitals will prevent you from having to edit it manually.

RH-72065 Textfields break when Fieldname starts with an escape character

fyi: my @ name is @Gijs