Function string like %<Area("600c3c95-1725-46cf-a344-fadcec3c28ea")>%

Hi there
I have function string like %<Area(“600c3c95-1725-46cf-a344-fadcec3c28ea”)>%
So how to get the value in python script, please help!
Thanks you

Welcome to the forum! Can you please explain more about where the string comes from and what you want to accomplish with it?

Hi
It’s Attribute User Text (key, value) in Object Properties
And i set value is a Text Fields (fx).
Example set Attribute User Text to object_fx: key = “keyfx” and value = (fx of Area)
When i print: object_fx.Attributes.GetUserString(“keyfx”) in Rhino Python Editor
The result is: %<Area(“600c3c95-1725-46cf-a344-fadcec3c28ea”)>%
So i want get result from %<Area(“600c3c95-1725-46cf-a344-fadcec3c28ea”)>% → 9326.518 meters

Ok, we’re getting closer. Can you post the code that you use to create the user string before you put it in the object properties?
Also, can you say more about what you’re trying to do?

Hi
I have an object_fx contains Attribute User Text, it was set by manual.
→ key = “keyfx” and value = (fx of Area)

import rhinoscriptsyntax as rs
import Rhino
import scriptcontext

obj = rs.GetObject("Select object")
if obj:
    object = scriptcontext.doc.Objects.Find(obj)
    
    for eachKey in rs.GetUserText(obj):
        print(eachKey + ": " + rs.GetUserText(obj, eachKey))
        #result is: keyfx: %<Area("600c3c95-1725-46cf-a344-fadcec3c28ea")>%
        #i want result is: keyfx: 9326.518 instead

This problem is solved. Using: Rhino.RhinoApp.ParseTextField
Thanks all

1 Like

Excellent - I also was about to write the same solution.