Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Options

Recommend making a tutorial for debug

jason_bennett190jason_bennett190 Member, Developers Posts: 17
Hi,

I have been learning Feature Script for the past few days. It took me a while to know that debug existed and about 30 minutes to figure out how to use it. Since learning how to use debug, my learning rate has accelerated significantly.

I would recommend making a 30-60 second video tutorial of how to use debug and include it among the Feature Script Tutorials.
Tagged:

Comments

  • Options
    cody_armstrongcody_armstrong Moderator, Onshape Employees, Developers, csevp Posts: 213
    @jason_bennett190  Very good idea
  • Options
    viruviru Member, Developers Posts: 619 ✭✭✭✭
  • Options
    papawopapawo Member, Developers Posts: 206 PRO
    so can somebody tell us/show us how to use debug ?
  • Options
    jason_bennett190jason_bennett190 Member, Developers Posts: 17
    Most often when I am using debug my workflow is:

    1. Add "debug(context, query);" to my code where the query is targeting some geometric feature that I am trying to work with.
    2. Open the Create Part studio.
    3. Create an instance of myFeature.
    4. Edit the instance of myFeature (At this point the feature or features are highlighted in red).
    5. Click on "FeatureScript notices" which opens an output display at the bottom which gives: a count of the bodies selected by debug, the results of any println() calls in your code, and any errors.
    6. Realize that my query does not select the features I wanted
    7. Rewrite the query, and repeat as neeeded.

    How do other people typically use debug?
  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,379
    @jason_bennett190 - that's exactly how I use it and how it is intended to be used. Also, if you input a vector into debug it will show you the vector on screen which is useful for debugging, but can be used for user feedback during feature creation (see the measure distance tool on the featurescript web page https://cad.onshape.com/documents/572b968ce4b07aad125dbaaf/v/08093fef6c4d4f330f24dd19/e/b40df94c5081948fe8195e81)

    Senior Director, Technical Services, EMEAI
Sign In or Register to comment.