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.

Looking for a UI to control variable values.

daniel_morrisdaniel_morris Member Posts: 1 ✭✭
I am building a model and need to experiment with various combinations of sizes (e.g. width, length, diameter etc.)  Does anyone know of an app or other means by which I can control these variable values with a UI?  For example I would like to have the ability to move a slider control to adjust the length and girth of my model to see the resulting changes without navigating to the sketch and adjusting the value each time.

Thanks in advance for your input.
Daniel

Answers

  • mahirmahir Member, Developers Posts: 1,309 ✭✭✭✭✭
    edited October 2016
    I don't know of a pre-existing solution, but in theory you could write a FeatureScript whose sole purpose is to create a set of global variables that will then be used by later features/dimensions. Each dimension would require two inputs - a name and a value. I'm not sure if you need to do anything special to include the Final button in your FS, but if you click it while editing it, then you should be able to see changes to the model in real time as you edited individual dimensions.
  • mbattistellombattistello Member, Developers Posts: 51 ✭✭
    @daniel_morris are you looking to do this within OS or in another page/web app?

    You can change variables via the API. Ive been playing with this via an integration with Google Sheets that lets build a spreadsheet to drive these parameters. It iterates thru the variants and updates the model.


  • mbattistellombattistello Member, Developers Posts: 51 ✭✭
    Another approach might be to setup the variables as arrays and then drive with a single variable.

    Setup a single variable that then drives the other variables. The other variables will be setup as arrays. #variable = [1,10,100][#variant_number]


  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,475 PRO
    edited October 2016
    As @mahir and @mbattistello wrote there are several 'hacks' for this but I think Onshape needs built-in dialog for controlling variables / dimension tables which could have also possibility for sliders you mentioned.
    //rami
Sign In or Register to comment.