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.
can you create a subroutine?
billy2
Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,068 PRO
Let's say I want to format the output for a vector
How do I call the function?
function printVector(v) {<br> println("vector :"~roundToPrecision(v[0], 4)*1000~", "~roundToPrecision(v[1], 4)*1000~", "~roundToPrecision(v[2], 4)*1000); } <br>
How do I call the function?
printVector(v);
0
Comments
If your function is stored in another studio, you will need to place "export" before the function. Then you can import that studio into your current studio to use it like you normally would.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
It's seems simple but I can't find any reference to functions or subroutines, I have seen other code where guys are passing the context into functions outside the "function action area" and was wondering if there is something printed in the manuals about this simple concept.
chadstoltzfus@premiercb.com
chadstoltzfus@premiercb.com