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

daniel_cravens
daniel_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

  • Caden_Armstrong
    Caden_Armstrong Member Posts: 472 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 --- Renaissance --- Kestrel -- SmartLink
    Experts in Onshape Automation - Custom Features and Integrated Applications
  • daniel_cravens
    daniel_cravens Member Posts: 29 ✭
    edited July 2024
    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."
  • Caden_Armstrong
    Caden_Armstrong Member Posts: 472 PRO
    oh sweet, we're getting buttons! No more will we need to make a checkbox that auto checks itself.
    www.smartbenchsoftware.com --- Renaissance --- Kestrel -- SmartLink
    Experts in Onshape Automation - Custom Features and Integrated Applications
  • Jacob_Corder
    Jacob_Corder Member Posts: 141 PRO
    I saw isButton but did not see clickedButton. . nice @daniel_cravens.  Exploiting now :smile: