Loading

MakerBot Print is our newest print-prepration software, which supports native CAD files and STL assemblies,
allows you to interact with all your printers via the Cloud, and many other exciting new features.

Download Now

Can I convert a numerical variable into text ?

Please Login to Comment

basically what it says. Is it possible to take a numerical variable and convert it into a text variable. IE:

var1=30;
var2=50 ;
text1="30x50";

Is there a way to create text1 automatically from var1 & var2 ?
I'm guessing this is where the string theory comes in. Have yet to get my head around strings :-)

Answered it myself - why the manual has to complicate things by adding echo crap to the actual commands, I'll never understand.
Anyway this is what i ended up with and, by all the gods it works perfectly :-)

text1=str(var1,"x",var2);

var1 = 30;
var2 = 50;

text1 = str(var1 , " x ", var2);

linear_extrude(height=5) {
text(text = text1, size = 100, halign="center", valign="center", $fn=20);
}

you can align text ?
Cheers - did not know that, yet more useful stuff :-)