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

Trying to use "R=∞" as string in python but get error

$
0
0

Hi, I struggle with using infinity symbol in python.
I can paste/type it directly into a text object in rhino with out problems, but python seems to struggle with it, does anybody know a workaround?

I explode a curve and checks the parts and then adds text that I later on move into position.
(Right now I use two o’s as infinity)

        partradius = rs.CurveRadius(parts[i],midpoint)
        
        # Add text
        # If curve segment is straight then CurveRadius return None
        if partradius:
            text = rs.AddText("R="+str(int(round(partradius,0))), (0,0,0), 2.25, 'Verdana', 0, 2)
            
        else:
            text = rs.AddText("R=oo", (0,0,0), 2.25, 'Verdana', 0, 2)

8 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 4153

Trending Articles