Grasshopper

algorithmic modeling for Rhino

Is there a way (easy or hard) to force a text to justified-right?

Please see the attached image.

I have tags that are placed radially around a circle.

The text to the left of the circle becomes upside down.

My solution was to calculate the angle of the planes used to place the text and a basic X vector, and rotate the planes on the left half of the sphere 90 degrees. That worked ok.

The problem, as seen in the image, is that this rotate text would need to be right justified...

Any known work around?

If I could at least get the width of the text, I could move them outwards....

Views: 4760

Replies to This Discussion

Edit: My solution was to calculate the angle of the planes used to place the text and a basic X vector, and rotate the planes on the left half of the sphere 180 degrees. That worked ok.

The problem, as seen in the image, is that this rotateD text would need to be right justified...


Thanks!

Where's the image?

Image

Attachments:

You can select all the text objects you want to justify after baking them and justify them all at once, but if it's a hassle to select them manually, you can use this script:

 

Dim textjust As textjustification = textjustification.left

If z Then textjust = TextJustification.Right

doc.Objects.AddText(x, y, 2, "Arial", False, False, textjust)

owner.Locked = True

 

Place that code into a VB component. Connect the list of strings to the x input, the list of planes to the y input and a list of boolean values to the z input. In this last list false means justified to the left, true to the right. To bake the text right click on the component and select 'enable'. You won't be able to preview the text in the viewport until you bake it.

 

To change other text attributes, change the line that contains '2,"Arial",false,false'. These values correspond in that order to 'text height,font,bold,italic'.

Thank you so much Vicente...

Unfortunately, I couldn't get it to work...

See attached.

Attachments:

What's the problem exactly?

Does it bake text objects when you right click on it and select 'enable'?

It does bake the text objects but all are still justified to the left?

 

If it's the second option i'd like to see 3 panel components that show the vb input data.

Here it is.

It bakes ok, but not aligned. Baked geometry is shown in RED in in the screenshot.

At first the VB only showed X and Y. I added Z through the input manager.

Attachments:

I want to see what data is going through the wires into the VB component.

EDIT: Sketchup, LOL

hehe. what's wrong with sketchup. I use it for model+renderings

: ) I have enough love for all programs.

New Screenshot

Attachments:

That's strange, it should work.

Can you post the file, or at least that part? If so, internalize any geometry/data so that you only need the .gh file.

Here is the entire thing.

I also welcome any comments you may have about the definition.

(The original one pulls the data from an excel file through gHowl)

Thanks!

Attachments:

Everything is correct, the problem is that it only works with Rhino 5.0. I guess you are working with 4.0? If it's a posibilty try switching.

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