Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5745

Rs.AddText() cannot alter justification for short text

$
0
0

@Edmark wrote:

I've would like to change the justification of a 1 or 2 character word, and am finding that I can't get it to work. As soon as I go to three characters or more it works fine. Here's the code (note: "131074" should center the text left/right and top/bottom):

import rhinoscriptsyntax as rs
point = rs.GetPoint("Pick point")
if point: rs.AddText("Hello Rhino!", point, 1, "Arial", 0, 131074) # works fine
point = rs.GetPoint("Pick point")
if point: rs.AddText("He", point, 1, "Arial", 0, 131074) # does not work
point = rs.GetPoint("Pick point")
if point: rs.AddText(" He ", point, 1, "Arial", 0, 131074)

I've tried various workarounds, like adding spaces around the text, but it doesn't work. Any ideas?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5745

Trending Articles