Grasshopper

algorithmic modeling for Rhino

Hi

Since Giulio Piacentinos 'textlines' component is deprecated. I wondered how to bake text at all.

I tried

     TextEntity text = new TextEntity();
      
      text.Plane = pl;
      text.TextHeight = size;
      text.FontIndex = doc.Fonts.FindOrCreate(face, bold, italics);
      text.Text = mystring;
      
      Curve[] crvs = text.Explode();

      for(int i = 0;i < crvs.Length;i++) Print(crvs[i].GetLength() + "");

Guess what? It always prints '0' length, though the number of curves correspond to the amount of letters set by 'mystring'. Is there a way to get that working? Anyways, I don't get, why there is an object available in Rhino.Geometry namespace but cannot be used within GH.

Any hints appreciated.

Views: 705

Replies to This Discussion

Your code is fine. When I copy-paste it into a c# component and write the line "A = crvs" at the end, the curves representing the exploded text come out.

Could you share your ghx? In my case the curves also came out but didn't show up because of their invalid geometry ie a curve with zero length doesn't exist. Do you see the letters? And..what GH version did you try?

thx

Thomas

Ok..im finally puzzled right now. You're right, it works. What the...mh..anyway. Thx :D

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service