Grasshopper

algorithmic modeling for Rhino

hello, I would appreciate any insight into formatting list of data.

i have a list of <list of 1 item>:shown in top box.  i'm trying to create a text tag in the model space to read "Fx" where x is my item in the list.

my formatting function is :

Format("F {0}", x)

 

but this gives the String "F{x}" not "Fx" as you can see on the bottom box.

it seems like it's due to x being a list - is there a way i can output the value only?

 

Format("F {{0}}", x)  didn't work.

thanks,

 

kat

Views: 2222

Replies to This Discussion

Hi kat,

 

x appears to be "{0}". Is x of type data-path? Anyway, I think you're confused since both the data of x and the formatting mask use curly brackets and it's not obvious which of those actually end up in the "F {0}" result.

 

If you want to remove the curly brackets, you can perform a string find/replace step, where you replace "{" with an empty string ("").

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

you're right -  x is indeed of type date-path and that explains it :/

thank you, David!

 

cheers,

 

kat

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service