Grasshopper

algorithmic modeling for Rhino

Hi Everyone,

I searched around for a post but nothing I found attempted to try this specifically.

I would like to wrap text into multiple lines.

Right now i have a long list of tweets and I am would like to to tag them to a point. The result is a very long line of text starting form the point. If there is some component in grasshopper that can put a limit on the amount of words per line and appropriately start a new line.

Thank you for your help.

Views: 1695

Attachments:

Replies to This Discussion

In case anyone missed it there is an attachment that better explains what i am going after.

Nothing in standard Gh I think. You can break apart a string of characters at spaces and end up with a list of words. But how you are supposed to recombine them into lines that do not exceed X characters I don't know. Are you just looking to limit at a fixed number of characters or are you actually looking to layout the text in a fixed width container?

At least the fixed character splitting would be trivial to do in C# or Python.

Thank you for the reply.

How would one go about he fixed width container method?

In that case you need to also specify the font you want, because different fonts will require different widths for a specific piece of text.

In that case you'll definitely need to resort to scripting (I can help out with C#, not python) because string measuring methods are definitely not available through regular GH/Rhino channels.

I am not familiar with writing C#, any help you can give will be greatly appreciated. Many thanks.

Well, hope this works.

Attachments:

I have an old script for this lying around that I stole from somewhere off the internet and dropped into a C# node. Has worked pretty well for me! 

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service