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 drive dimensions from other dimensions

mitchel_palmermitchel_palmer Member Posts: 20 ✭✭
In Solidworks you can use dimensions to drive other dimensions. The process is you use "=" then click on the dimension you want to reference, you can add a formula if you want as well. Eg:  = "D1@Sketch1"*2"  (this makes this dimensions 2 times bigger than D1)
How do you do this in OnShape (this is a feature we use regularly in SW)?


thanks in advance.

Mitch




Best Answer

Answers

  • brian_bradybrian_brady Member, Developers Posts: 505 EDU
    Sadly, you cannot. 
  • robert_morrisrobert_morris OS Professional, Developers Posts: 166 PRO
    Currently the only way to relate two different dimensions like that is to create a variable in the Feature Tree before the sketch and use that for your dimensions.

    For example, in the sketch you have shown, you could create a variable called #height in the Feature Tree. Then in the sketch you would set D1 to be "#height" and then set D2 to be "#height * 2".
  • brian_bradybrian_brady Member, Developers Posts: 505 EDU
    This works, but is not as nice and easy as "on the fly" referencing. 
  • robert_morrisrobert_morris OS Professional, Developers Posts: 166 PRO
    @brian_brady

    Totally Agree. It would be nice to be able to do it all within the sketch.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,310
    You can workaround simple relations by using construction lines and equal length constraints. 
    Senior Director, Technical Services, EMEAI
  • mitchel_palmermitchel_palmer Member Posts: 20 ✭✭
    Hi Neil 

    how would that would if i wanted to make a line say 2/3 of the other dimension?

    cheers.



  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,310
    Senior Director, Technical Services, EMEAI
  • brian_bradybrian_brady Member, Developers Posts: 505 EDU
    NeilCooke said:
    @NeilCooke

    There are a lot of cool old drafting tricks that one could use inside a CAD program. However, I expect a fully modern system to have better and more tools so we don't have to resort to old tricks. I do teach a number of hand-drawing tricks still when I teach an engineering graphics course, but I preface it by saying that not everyone will have access to a fully-featured CAD system when they get a job. I kind of expect Onshape to fit into the "fully featured CAD system" category. 

    In this case, I would love to see every sketch receive a system generated variable name, i.e. d1, that can be referenced when creating a new dimension by simply clicking or right-clicking on an existing dimension. This would not preclude nor interfere with the use of custom (user created) variables. 
  • chon_chanchon_chan Member Posts: 4 EDU
    I think this feature can be easily achieved by a small addition to the recently introduced "configuration variable"  feature. (i.e. it is still not possible now)

    Currently, after defining a Configuration Variable, we can enter its value in the Configurations panel on the upper left corner. If we can refer to an existing dimension instead of a manual input, it can then be used to drive other dimensions from a reference dimension.

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,890 PRO
    edited June 2018
    @konstantin_shiriazdanov has a good featurescript called 'measure value'

    I would link it but I can't get a url from the android app. And it wont open in a mobile browser yor some reason.

    It works by creating a feature that is a parameteric variable. Set to one of many measurement types. Like distance between 2 points; perimeter, etc.

    It is not as simple as Solidwork's solution. But it is more powerfull as you can select many different measurment options. 

    I've used it to calculate flat patterns of sheetmetal helix parts before onshape released cylidrical sheetmetal bends.
    It is worth a try

    EDIT:
    Here is the link to the feature script
    https://cad.onshape.com/documents/77baa8153589a7fc5f289829/w/cffd0f2a7077380d5378a885/e/181cb871f3008e6b885df46a

  • chon_chanchon_chan Member Posts: 4 EDU
    I think this feature can be easily achieved by a small addition to the recently introduced "configuration variable"  feature. (i.e. it is still not possible now)

    Currently, after defining a Configuration Variable, we can enter its value in the Configurations panel on the upper left corner. If we can refer to an existing dimension instead of a manual input, we can then use this definition for any calculation/ if-condition. This is exactly what we are requesting for in this post.


  • NICKANDERSONCONICKANDERSONCO Member Posts: 1
    I'm a long time Inventor user and am currently evaluating OnShape over Fusion 360 for a new company, and the inability to reference dimensions in sketches and other features is killing me. For example if you need to place an array of vent openings that get 10% closer together over a distance. You have to manually do that math to figure out the spacing between each one (in OnShape). In inventor/Fusion/Solidworks you can place the first opening at a distance, place the second opening at a distance from the first, reference the first distance by clicking on it and multiply it by 0.9, and then keep doing that to get a consistent and parametric array of spacing. For example d1 = 12 mm, d2 = d1 * 0.90, d3 = d2 * 0.9, etc, etc. I guess this can be accomplished in OnShape by jumping out of the sketch and defining all of these variables ahead of time, but it really kills the flow of experimenting with a design.

    Here's an even fancier example where I have d1 as a driven dimension and with d2-d6 as 90% of the value next to it, and have the spacing from the left and right driving everything. In true parametric style, I can adjust the overall dimensions of the outside square and everything will maintain this relationship.


    Here you can see I changed the overall width from 120 to 90 and everything rearranged itself naturally.


    Is there any plan to mimic these features? I don't just use this for goofy aesthetic things, but also for calculating physical features based on a host of parameters. It's kind of the definition of parametric 
  • mlaflecheCADmlaflecheCAD Member, Onshape Employees, Developers Posts: 179
    edited May 2019
    @NICKANDERSONCO . thanks for raising this point with us.  I like how Inventor and some other systems do this.  In Onshape we can currently create dimensions with math operators, so in the use case above and below, the dimension scales by 90% for every instance, but I have to type the dimension in for each one and multiply times .9.  I can see the benefit of how some the other CAD tools accomplish this for sure.

    Another work method, accomplished by features referencing a variable there are very powerful things that can be done, as shown in the awesome document that @NeilCooke put together.  Look at how variables can be used in features themselves:  https://cad.onshape.com/documents/9a3f64ab744a96da45b27081/w/4ba0dec5b3e40ceaf77c9dfc/e/8d1382e0cf2f467c2f2e1d87



    And the simple sketch based approach mentioned above that has previous dimension multipled by .9



    Thanks for sharing this with us.
    Regards,
    Mike LaFleche   @mlaflecheCAD
  • brian_bradybrian_brady Member, Developers Posts: 505 EDU
    @mlaflecheCAD  This issue has been brought time and again in conversions and feature requests and has gone nowhere. The current state of variable usage is okay, but barely. Since dimensions are trapped in the feature tree instead of in their own list, you have to pre-define variables before starting a sketch which is so very counterproductive. If variables existed in their own list you could possibly make a variable on the fly, assign it to a dimension and then do math with it for other dimensions. That would be much more productive and match how most of us think. Another method is what is illustrated here by Nick; each sketch dimension gets assigned an implicit variable name when created. Right click on it (or some other method) to find out what it is and then it can be used to calculate another dimension. I know Creo uses implicit variable names for every dimension (sketch dimensions, extrude depths, etc) and they can be toggled on and changed to something more descriptive if desired. Why not do the same, but better in Onshape? That is what we have come to expect from Onshape. However, this is one area where they didn't do it better, just different and more painful.

    Brian
  • mlaflecheCADmlaflecheCAD Member, Onshape Employees, Developers Posts: 179
    @brian_brady I agree with you 100%.  We can do better here.  To make sure we know the impact of this request, if you or anybody else would like more from us on this, please create a support ticket in your Onshape account asking for better dimension and equation UI and any ideas that you have so that we can prioritize when work should begin on this, as that is part of how we plan our development work.  Once again, thanks fore your response above, this is really helpful.  
    Regards,
    Mike LaFleche   @mlaflecheCAD
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    edited May 2019
    Howdy and thanks for jumping into the thread.

    I wonder if a slightly different approach is warranted to IR's?  We do raise IR's and some of them get implemented.  The system works.  However we're told that thousands of companies use Onshape, and there are probably a hundred or so regular posters on the forum, so that forum hit rate aint great.  If we then add in that we can only vote yes to an IR, not apply any sort of ranking then I question it's overall effectiveness.

    I hate it when I'm bombarded with junk mail from vendors but in this case I'd like to solicit contact. B)   I'd welcome a monthly dialogue from Onshape devs stating something like, here are 50 things that we're thinking of investing time in.  Please pick the one you'd like to see most, the five  when you'd liketime allows, and any that you'd not care for.  Add in a comment section for suggestions of how we'd like features to function, and maybe what we like and dislike in the competitors products.

    I'd be happy to devote 15-30 minutes a month to give meaningful feedback.

    Cheers, Owen S.

    Business Systems and Configuration Controller
    HWM-Water Ltd
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,310
    Hi @owen_sparks - we get an order of magnitude more IRs direct through "Contact Support" than we do on the forum, so that might explain the disparity between customer count and forum visitors / IR votes. If it looks like some forum-voted IRs are not getting implemented it may be because the volume of requests for a particular feature has come directly through support and is not shown on the forum. Forum votes get added to the support votes, but not the other way around. This is not an excuse for not implementing IRs, just a fact. If you speak with your customer success manager about more contact I'm sure they would jump at the chance  :)
    Senior Director, Technical Services, EMEAI
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Hi Neil, thanks for the info.  I've tended to raise forum IR's as I'd assumed that if something was available to be voted on it was more likely to be implemented than a "Contact Support" with just the single user asking.
    Thanks for your time,
    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • brian_bradybrian_brady Member, Developers Posts: 505 EDU
    @brian_brady I agree with you 100%.  We can do better here.  To make sure we know the impact of this request, if you or anybody else would like more from us on this, please create a support ticket in your Onshape account asking for better dimension and equation UI and any ideas that you have so that we can prioritize when work should begin on this, as that is part of how we plan our development work.  Once again, thanks fore your response above, this is really helpful.  
    I thought that's why there is the Improvement Request area that we are always pointed towards? This has been brought up in the past and nothing has changed or been improved. Why keep banging may head against the same tree?
  • tom_augertom_auger Member Posts: 115 ✭✭
    I'm just trolling these older posts that talk about driving dimensions to provide updates to others who are coming to the topic in more recent years. While we don't have direct referencing of other dimensions like you have in F360 and SW, the new on-the-fly variable creation method which has been in place since Dec. 2020 is a step in the right direction for sure!

    https://forum.onshape.com/discussion/15006/improvements-to-onshape-december-10th-2020/p1
Sign In or Register to comment.