Quantcast
Viewing all articles
Browse latest Browse all 5776

Sprintf Equivalent

Hello, I finally took a deep dive into RhinoScript. I am slowly finding my way after looking at sample scripts. However, I am having a bit of trouble formatting a string, which in turn writes to a file. I used to C program back in the days and often used Sprintf. Is there something that is equivalent in Rhinoscript ?

for example I have -

arrCurveStart = Rhino.CurveStartPoint(strObject)
strPoint = CStr(arrCurveStart(0))&" " & CStr(arrCurveStart(1))&" " & CStr(arrCurveStart(2)) 
objStream.WriteLine(strPoint)

which comes out as
“2.50213545249695 -2.49806545041767 0”

Is there a function in Rhinoscript, smiliar to C/C++ sprintf that would format a string to like this ?
“2.502 -2.498 0.000”

Thank you for reading.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5776

Trending Articles