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

[Question][Tuto] How to create an app ?

quentin_moutyquentin_mouty Member, Developers Posts: 13
Hello everybody,
I am new in Onshape but I found this product already amazing. I have however a question regarding the app.
My understanding is that everybody can create an app a propose it to the community but I do not understand how to create an app.
I have been on this page :https://dev-portal.onshape.com/oauthApps but from what I saw I need to developed an app first, then fill this form.
I am wrong ?
If yes can someone explain me how to create an app ? It do not have clear idea of want I want to do but I wanted to try the possibility of such development.

Thank you
Quentin.

Best Answer

Answers

  • Options
    philip_thomasphilip_thomas Member, Moderator, Onshape Employees, Developers Posts: 1,381
    @quentin_mouty - Thank you for your question about writing an 'app'. While it is entirely possible to write an app (check out the app store for examples) the process is a little more involved than writing a 'custom feature'. Before we go down the other path, can we double check what you're trying to do? Does your idea create/modify geometry in a part studio? If yes, then you may well be wanting to write a custom feature - this is a capability unlike anything before in CAD. A custom feature is written in the same language that our developers use for every feature in Onshape (and we have open sourced our source code to get you going). Here is a great jumping off point for using and writing custom features -
    www.onshape.com/featurescript

    Let me know if that meets your needs.
    Philip Thomas - Onshape
  • Options
    quentin_moutyquentin_mouty Member, Developers Posts: 13
    philip_thomas - Thank you for your answer.
    I am aware of the feature system which seems really nice but I want to see what can we do with feature and what can we do with App.
    It is not clear at least for me what are the possibilities from the App and from the feature. In what cases I will need an App and in other a feature.
    After reading you, my understanding is that for 3D purpose the feature do well but for other thing like data transformation App is more pertinent.
    Am I right ?
  • Options
    quentin_moutyquentin_mouty Member, Developers Posts: 13
    Yes I better understand thank you.
  • Options
    arick_gomesarick_gomes Member Posts: 8
    @quentin_mouty - YES! :)
    A custom feature is best for any situation where you are creating geometry just as any other feature in Onshape.
    If your need is to 'get' or 'set' things in a document or interact with the outside world in a way that is not part of the regeneration of a part studio, then an app may be more appropriate.
    Perhaps looking at the apps in the app store and comparing them to custom features offered may help you decide

    https://appstore.onshape.com/?sort=featured

    www.onshape.com/featurescript

    and if you want to register as a developer and have access to the api (dont worry - completely free), go here

    https://dev-portal.onshape.com/signin

    I hope this helps :)


    Thank you for your information sir,  When deciding between custom features and apps in Onshape, consider your task's nature. Custom features are for geometry creation, while apps handle external interactions.
  • Options
    john_carter851john_carter851 Member Posts: 2
    Hello everybody,
    I am new in Onshape but I found this product already amazing. I have however a question regarding the app.
    My understanding is that everybody can create an app a propose it to the community but I do not understand how to create an app.
    I have been on this page :https://dev-portal.onshape.com/oauthApps but from what I saw I need to developed an app first, then fill this form.
    I am wrong ?
    If yes can someone explain me how to create an app ? It do not have clear idea of want I want to do but I wanted to try the possibility of such development.

    Thank you
    Quentin.

    First, set up a developer account, then access the developer resources and test your app. After, checking the app you may submit the app. 
  • Options
    mahnoor_malik117mahnoor_malik117 Member Posts: 2

    Hi Quentin,

    Welcome to Onshape! It's great to hear that you're finding the product amazing. Creating an app for Onshape can indeed be a fantastic way to enhance your experience and contribute to the community.

    You're on the right track with visiting the dev portal. Developing an app first before filling out the form is typically the process. The dev portal provides resources, documentation, and tools to help you get started with app development for Onshape.

    If you're new to app development or unsure where to begin, I recommend starting with the documentation and tutorials provided on the dev portal. They can give you a clear understanding of the steps involved and the tools available for creating an app.

  • Options
    phill_jonesphill_jones Member Posts: 2
    It's great to hear that you find Onshape amazing! Creating an app for Onshape involves several steps, and you're correct that you need to develop the app first before filling out the form on the OAuth Apps page. Here's a more detailed explanation of how to get started with creating an app for Onshape:

    ### Steps to Create an App for Onshape

    1. **Understand the Onshape Developer Platform:**
       - Familiarize yourself with the Onshape API and the capabilities it offers. The [Onshape Developer Portal](https://dev-portal.onshape.com/) is a good starting point.

    2. **Set Up Your Development Environment:**
       - Choose a programming language and framework you are comfortable with. Onshape's API can be accessed using RESTful calls, so any language that can make HTTP requests will work (e.g., Python, JavaScript, Java).

    3. **Register as a Developer:**
       - You need to sign up as a developer on the Onshape Developer Portal. This will give you access to necessary tools and resources.

    4. **Create a New OAuth App:**
       - Once you have an idea of what you want to build, go to the [OAuth Apps page](https://dev-portal.onshape.com/oauthApps) to create a new app. You will need to provide information such as the app name, description, and callback URL.

    5. **Develop Your App:**
       - Start by setting up the OAuth 2.0 authentication to allow your app to access Onshape data. You can follow the [OAuth 2.0 Guide](https://dev-portal.onshape.com/oauth2) for detailed instructions.
       - Use the Onshape API to interact with Onshape documents, parts, assemblies, etc. The [API Documentation](https://cad.onshape.com/glassworks/explorer/) will be very helpful.
       - Develop the core functionality of your app based on what you want it to do.

    6. **Test Your App:**
       - Thoroughly test your app to ensure it works as expected and handles errors gracefully.
       - You can use Onshape’s sandbox environment for testing without affecting real user data.

    7. **Submit Your App:**
       - After development and testing, return to the [OAuth Apps page](https://dev-portal.onshape.com/oauthApps) and submit your app for review.
       - Fill out the form with all the necessary details about your app.

    ### Example Scenario

    Suppose you want to create a simple app that retrieves and lists all parts in a document. Here’s a high-level outline:

    1. **Set Up OAuth 2.0:**
       - Register your app to get client ID and client secret.
       - Implement OAuth 2.0 flow to authenticate users and get access tokens.

    2. **API Calls:**
       - Use the access token to make API calls.
       - For example, call the `GET /api/documents/:documentId/parts` endpoint to get a list of parts in a document.

    3. **User Interface:**
       - Develop a user interface to display the retrieved parts.
       - This could be a web application using HTML/CSS and JavaScript.

    ### Resources


    ### Final Tips

    - **Start Small:** Begin with a simple project to get familiar with the API and the development process.
    - **Leverage Community:** Onshape has a developer forum where you can ask questions and get help from other developers.
    - **Iterate and Improve:** Based on your initial experiments, refine your app idea and gradually add more features.

    By following these steps, you should be able to start developing your own Onshape app and contribute to the community. Good luck!
Sign In or Register to comment.