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

Naming driven dimensions

joseph_newcomerjoseph_newcomer Member Posts: 90 ✭✭✭
I have a variable called #Keypad_width, which is 61mm

I have a drawing and I dimension from one edge to the other.  The distance is 37mm

I want the drawing to be centered on the space of #Keypad_width, but I can't see a way to give a name to the driven dimension, so the offset from the edge is
(#Keypad_width - #MyDrivenDimension)/2

One nice feature of Inventor was that every dimension was given a name.  So I could create the formula by clicking
( <click on dimension 1> - <click on dimension 2>) / 2

If dimension 1 was set to 61, I get 61.  If it was set to #Keypad_width, I would get #Keypad_width.  Then I would type a minus sign, click on the driven dimension, and get its implicit name, e.g.

(#Keypad_width - d211) / 2

and it was done.

So take this as a suggestion for a new feature.  But I still need a way to name a driven dimension.

Comments

  • Options
    chandra_harshachandra_harsha Member Posts: 15 ✭✭
    @joseph_newcomer

    I don't know inventor, never worked with it. But in Onshape, you can use custom measuring tools available on Onshape to drive your dimensions. you won't see them by default, you can add them by clicking the links to respective documents. 

    https://cad.onshape.com/documents/572b968ce4b07aad125dbaaf/v/6cdbbe0e7f24b6c78ed27e97/e/b1f5ab07bb8056d230959ebe  - "Measure Distance" tool. This is pretty basic. Measures distance between two entities, and assigns the value to a variable. You can use this variable to drive your dimensions.

    https://cad.onshape.com/documents/77baa8153589a7fc5f289829/v/781913e28307acfbc543920d/e/181cb871f3008e6b885df46a  - "Measure Distance Extended" tool. I mostly use this. It has ability to measure diameters, perimeters, area, volume, etc. and assign the value to a variable. Then you use this variable to drive your dimensions.


  • Options
    joseph_newcomerjoseph_newcomer Member Posts: 90 ✭✭✭
    Well, I saw that, but if the dimension changes, it did not seem to update the variable.  So if I measured the distance from point A to point B and it was 10cm, I could get a variable that had the value 100mm.  But if I did something that changed the model so the distance was now 120mm, my variable still said 100mm.  If I had a driven dimension, the driven dimension now says 120mm, and if I could name that driven dimension, then I should see the variable now has the dimension 120mm.  Unless I have done something wrong in the measurement; it could have been a "procedural error" in how I did the measurement.
  • Options
    chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 133 PRO
    Without seeing the document it's hard to know for sure, but it does matter when that variable is created. As a parametric CAD system, a feature will only have information that comes before it. Variables created using features are under the same ruleset, so if you use Measure Value, then perform an Extrude/Move Face on the entity that was measure, Measure Value will not update, because the entity was changed after the feature was used. If it's not already there, dragging the Measure Value feature to the very end of your feature tree, and see if the variable is being set to the updated value then.
    Applications Developer at Premier Custom Built
    chadstoltzfus@premiercb.com
  • Options
    john_mcclaryjohn_mcclary Member, Developers Posts: 3,902 PRO
    edited January 2022
    What he said ^

    But measure value is the only way to do this right now. I use it all the time and can verify it works very well

    Here is an example of creating a complex double bend on a sheet metal part and using measure value to determine the flat pattern





  • Options
    romeograhamromeograham Member, csevp Posts: 657 PRO
    ...and Measure Value is quite nice becuase it gives you a easy-to-see variable feature in the Feature List for that "named dimension". With SolidWorks, dimension names are hidden and not as easy to discover. (I think they're easy to reference, if you remember the @name of the Dimension).
    With the more complete version of Measure Value - you can also have other types of values as your 'driven' dimension: volume, perimeter of several edges, distance between two vertices in a sketch or on your model geometry etc. Much more powerful than referencing a driven dimension from inside a sketch.


  • Options
    john_mcclaryjohn_mcclary Member, Developers Posts: 3,902 PRO
    Here is basically the same thing, but this is maintained by Onshape staff and could potentially end up as a standard feature.
    Play with this and submit your feedback on the thread below if there is something you find lacking
    Measure to Variable feature — Onshape
  • Options
    chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 133 PRO
    Keep in mind that you can also use the Variable Table on the right side of the screen to keep track of and even update certain variables. One thing I like about the variable table is that you can tell which features are created by custom features and which are created using Onshape's variable feature. It also prevents you from editing the custom feature variables but it lets you edit variables created by the native variable feature so there's some evaluation needed when deciding which way is best. 


    Applications Developer at Premier Custom Built
    chadstoltzfus@premiercb.com
  • Options
    joseph_newcomerjoseph_newcomer Member Posts: 90 ✭✭✭
    @john_mcclary: it is going by so fast I cannot follow what is really going on.
    @chadstoltzfus: I see the variable table (I use it a lot), but I do not see how those different types were created.

    If you can reference one of the OnShape videos so I can follow along with what is going on that would help a lot

    Also a problem: I have a part that is currently 1cm thick.  It may not remain 1cm thick.  But I can't reference its dimension in a drawing that depends on that thickness (e.g., I need to separate two parts by however thick the part from a completely different part file is.  And I can't get that from the part file).  I can't use variables from a part document in my assembly
Sign In or Register to comment.