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.
FeatureScript beginner questions
hendrik_kueck
Member Posts: 13 ✭✭
Hi!
I am just starting to dive into FeatureScript and have a few beginner questions.
Quick background: I am a hobbyist OnShape user, experienced software developer but brand new to FeatureScript.
I watched the (very good!) videos in the FeatureScrip Fundaments course, but haven't written anything yet.
My motivation for getting into FeatureScript is that I found the "Board Corner Joint" custom feature (https://cad.onshape.com/documents/efc963b657ec24bd8613fb51/v/2f1d6538b8ee5e65e875c06d/e/daec011899356d6d6cfceaa4) and was excited to use it in a wood CNC project. However unfortunately I found it to not work as expected most of the time, so I want to debug and hopefully fix / improve it (I saw that the original author sadly has passed away).
My initial questions:
How do I open the imports used in a FeatureScript? For example the "Digital Joints Utils" imported into the FS linked above. I expected Cmd + mouse click to open the linked file. But it does not. I tried other modifier keys and right clicking, but have not found any way to open the linked file.
In the editor, when I Cmd-click on a symbol defined in the same file I get taken to the definition. Is there a keyboard shortcut to take me back to my previous location in the code afterwards?
My understanding based on the videos is that debugging relies primarily on printf style debugging (using debug() and println()), so no breakpoints, stepping through code, watching variables etc. Is that correct? Or are there more advanced interactive debugging tools available?
Also if anybody is interested in helping to update/fix this CNC joint script, that'd be great.
I am just starting to dive into FeatureScript and have a few beginner questions.
Quick background: I am a hobbyist OnShape user, experienced software developer but brand new to FeatureScript.
I watched the (very good!) videos in the FeatureScrip Fundaments course, but haven't written anything yet.
My motivation for getting into FeatureScript is that I found the "Board Corner Joint" custom feature (https://cad.onshape.com/documents/efc963b657ec24bd8613fb51/v/2f1d6538b8ee5e65e875c06d/e/daec011899356d6d6cfceaa4) and was excited to use it in a wood CNC project. However unfortunately I found it to not work as expected most of the time, so I want to debug and hopefully fix / improve it (I saw that the original author sadly has passed away).
My initial questions:
How do I open the imports used in a FeatureScript? For example the "Digital Joints Utils" imported into the FS linked above. I expected Cmd + mouse click to open the linked file. But it does not. I tried other modifier keys and right clicking, but have not found any way to open the linked file.
In the editor, when I Cmd-click on a symbol defined in the same file I get taken to the definition. Is there a keyboard shortcut to take me back to my previous location in the code afterwards?
My understanding based on the videos is that debugging relies primarily on printf style debugging (using debug() and println()), so no breakpoints, stepping through code, watching variables etc. Is that correct? Or are there more advanced interactive debugging tools available?
Also if anybody is interested in helping to update/fix this CNC joint script, that'd be great.
0
Comments
-
Here is the linked doc: https://cad.onshape.com/documents/b87bd42fd83b1d5213125d14/w/ffbee838e10137fa67082512/e/73d4c58bd5eb90aa15f3fee6
Because regeneration is "real-time" there are no step through or watch debug options.Senior Director, Technical Services, EMEA0 -
@NeilCooke Thanks for the link. But is there a shortcut in the editor to open imported files? And if not, how would I find and open the linked document myself based on a given import statement in the code?
0 -
If you click on the blue text with the doc name, it will show the doc id (which is the first string of characters), then copy and paste that onto the end of https://cad.onshape.com/documents/

Senior Director, Technical Services, EMEA2

