Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
println units
hervé_pipon
Member Posts: 60 ✭✭
Hello
Here is a small piece of code:
var sketchPlane = evOwnerSketchPlane(context, { "entity" : definition.selectedEdge });
var n = 100;
var samples = evEdgeTangentLines(context, { "edge" : definition.selectedEdge, "parameters" : range(0, 1, n) });
var origin = worldToPlane(sketchPlane, samples[0].origin);
println(origin * centimeter );
It prints :
(0 meter^2, 0 meter^2)
I want to display centimeter : what is wrong ?
Tagged:
0
Comments
println(origin / centimeter );
This will print "origin = 3.25 cm" or whatever. You round to not display 3.250000000001 or some floating point value.
Usually this isn't needed, but if there are a ton of things printing it can be nice to label them with strong concatenation.