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

Is there anyway to search the entire onshape codebase at once for examples

daniel_cravensdaniel_cravens Member Posts: 29
I often would like to find an examples of how a particular syntax is used but I do not know which file will contain that example.  Is there a way to grep / search the entire codebase to find examples of "clickedbutton", as just one example? 

Comments

  • Options
    Caden_ArmstrongCaden_Armstrong Member Posts: 65 PRO
    Within the Onshape standard code  you can click the "Search Feature Studios" button at the top right of your screen.
    That will open a search window and let you do a search across the standard FeatureScript library.

    But you aren't going to find any "click button" type code. The FeatureScript UI doesn't have a button option. 
    A lot of FeatureScript happens on the backend of Onshape.
    The closest you might get to is either a boolean parameter that is used in conjunction with editing logic, or an array type parameter.

    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
  • Options
    daniel_cravensdaniel_cravens Member Posts: 29
    edited July 8
    Thank you for answering kindly what turned about to be a pretty stupid question! The search is going to be a big help for me going forward.  In terms of "clickedButton", this is mentioned in the editing logic documentation. But perhaps the documentation is out of date. Again thank you for your very helpful reply.

    "Any (or all) of the remaining three arguments may be omitted, but those that remain must appear in the same order relative to each other. Omitting unused arguments may result in better performance.

    • The isCreating boolean is set to true if the feature is being created and false if it is being edited, having been committed at least once. Note: If isCreating is omitted, the editing logic function will only be called when the feature is being created.
    • The specifiedParameters map indicates which parameters have been set by the user since the feature dialog opened. The ids of those parameters that have been specified map to true and those that have not map to false.
    • The hiddenBodies query evaluates to all of the bodies have been hidden by the user (that information is not accessible from the context). It is used for example to avoid automatically adding invisible bodies to an extrude merge scope.
    • The <b>clickedButton</b> string indicates which button parameter was clicked to trigger the editing logic function. If no button was clicked, <b>clickedButton</b> is the empty string."
  • Options
    Caden_ArmstrongCaden_Armstrong Member Posts: 65 PRO
    oh sweet, we're getting buttons! No more will we need to make a checkbox that auto checks itself.
    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
  • Options
    Jacob_CorderJacob_Corder Member Posts: 131 PRO
    I saw isButton but did not see clickedButton. . nice @daniel_cravens.  Exploiting now :smile:

Sign In or Register to comment.