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.

How to create different types of a master data by changing the variables

baumarbaumar OS Professional Posts: 67 PRO
The learning video "Storing Master data" greatly shows the advantages of separating the master data from further design to make it reusable in various documents. 

What I'm still looking for is this: Imagine you want to create different models from the same master sketch. The most simple use case is creating different sizes of a product, like a tennis racket that comes in sizes small, medium and large (for kids, juniors and adults). In this simple case the proportions of the product remain the same, only the size is changing. The more complex case is when the proportions will change too. 

By defining all variables before the first sketch, it is possible to use them in the sketch as driving features. And by adding a scale factor of 1 and mupliply it to each variable I could scale the entire sketch. But to scale the product, which should be done outside of the master sketch, you need more driving variables. 

They could also be added to the variables in the master sketch, but when I want to create another type, I must change the master. However the master should remain untouched from its children variations. 

The solution might be to move the variables to another document and import from there to the master. is this possible? Maybe by adding from a feature studio?

And still this is only half of the solution: It will be necessary to select the variable set in the final document - the "child" of the master. Only if you tell there which variable set (like small medium and large) to be used, the implementation remains independant from the master. 

Any hints welcome how this can be achieved.


Comments

  • eric_pestyeric_pesty Member Posts: 219 PRO
    Not sure if that quite solves what you are trying to do but one option is to use configuration variables in the master, which you can then drive from a "child".
    We have done this where the master is "infinitely" configurable and the child has a list input with just the "valid" values. The downside is that the "logic" of which valid options are has to be in the child.

    If you just need to scale the master, this should work fine: have the scale factor be a configuration variable and when you use the master you can input whatever scale factor you want without ever having to change the master, but you can't restrict it to specific ones...
  • baumarbaumar OS Professional Posts: 67 PRO
    Hi Eric, thank you for the input! Is there an example for this?
  • tim_hess427tim_hess427 Member Posts: 648 PRO
    I don't know about examples for the previous suggestion, but this is a pretty straightforward setup once you get comfortable with configurations (and more specifically, "configuration variables"). You use configurations when modeling your "layout" sketch in the first part studio. Then, use the "derive" feature in a new part study to pull in a copy of the original sketch with all the configurations set how you want them. 
    1. Create "configuration variables" in your main part studio.  (Alternatively, you can create other types of configurations, like a drop-down menu that changes the values of "regular" variables.)
    2. Create your layout sketch and reference the variables and other configurations from Step 1 as appropriate. 
    3. Create your new part studio and "derive" the sketch from step 2. When you derive this sketch into the new part studio, you'll be able to change any configuration that you set up previously. Note: this does not change anything in the original part studio. 
    4. Continue with your modeling in the new part studio with your derived and configured layout sketch. 
    Configurations (onshape.com)
  • baumarbaumar OS Professional Posts: 67 PRO
    Hi Tim, Thank you for the update. I tried to create a first document with only driving variables and tried to add the ones that will likely change as Configuration variables. Unfortunately I did not found the selection yet, i can only create plain variables. I still tried to create a new document and derive the first document with the variables, but I could also not derive the master data document... Trying to contact support to find out why

  • eric_pestyeric_pesty Member Posts: 219 PRO
    Hi @baumar
    Sorry I missed your question before. I made a simple example of what I was talking about. It's a simple block with a "master" that has configuration variables for width, length and height. I then created two examples part studios of how it can be used, one derives it in with the width and length fixed so that only the height it configured and the other configures all three parameters in one table to create "standard sizes" (which I think is pretty close to your example of a tennis racket), you could add new sizes to this without changing the master.

    Obviously there are a lots of variations on this theme possible depending on what you are trying to achieve including using configuration variables in the "derived" studio for continuous adjustment or having multiple configuration tables to adjust the parameters separately to set values, etc...

    https://cad.onshape.com/documents/46a326b4a97bd99579866e64/w/98aff52f023b0b23139beb54/e/a699a4775463f98ce0b0d693
  • eric_pestyeric_pesty Member Posts: 219 PRO
    baumar said:
    Hi Tim, Thank you for the update. I tried to create a first document with only driving variables and tried to add the ones that will likely change as Configuration variables. Unfortunately I did not found the selection yet, i can only create plain variables. I still tried to create a new document and derive the first document with the variables, but I could also not derive the master data document... Trying to contact support to find out why

    I'm not quite sure I understand what problem your are running into, but it looks like you are using "regular" variables rather than configuration variables. It can be a bit confusing but configuration variables are created from the configuration panel rather than as  "feature" (but are then "used" the same way).

    Hopefully the example above helps...


  • baumarbaumar OS Professional Posts: 67 PRO
    Hi Eric, thanks a lot for your input.

    I had a different idea in my mind, but when looking at your example I found inspiration for another approach. My original problem with configurable variables was that I could not calculate with them. 

    The use case I have in mind is this

    Imagine you want 4 types of building long, wide, tall and cube buildings. Before you build the original size, you want to create a model. And if maybe somebody comes and wants exactly the same type but bigger (which already happened). So I want to scale up and down and keep but keep the original values defining the types. That worked with another scale factor. And instead of using directly the config vars width, length and heigth I created vars scaledWidth = ScaleFactor * Width. That seems to work fine. 
    https://cad.onshape.com/documents/d0bffd57e46d5bf814f3276b/w/436e62223fb87fcfe3bea99a/e/999478c7ac4e3926a7fe71b7

    So thanks again for your input!

    Best regards

    Markus 
  • eric_pestyeric_pesty Member Posts: 219 PRO
    @baumar
    Glad that helped, setting up a scale factor is a good way to do this. This general approach of a master with "infinite configurability" and deriving it into other part studios to create subsets is quite powerful. 
    Note that you could have the scale factor as a separate variable so that you could have your different standard "shapes" and be able to scale them by some arbitrary factor as well like this:
    https://cad.onshape.com/documents/d2d3382aa18189471db96624/w/bfdb4819bc7e743e462a92ad/e/3cabd1adc41fd25c9e4a9ec9

Sign In or Register to comment.