Hello
I am trying to automatically modify a dimension that we have just entered so that it becomes the closest to a multiple of a number that we have previously chosen in an equation.
Example: I want my odds to be a multiple of 24. I go back to 2000 and it changes me to 1992 (24x83)
Does anyone have an idea?
Thank you
1 Like
Hello
To do this kind of thing, I'll go through a property form or global values for the value to be entered, then the dimension at the model level you need to define a formula :=int( (" Dimension entered "/24))*24
To be more specific:
Create the global variable or property " a "
The user will change the value of the global variable or, via a custom property form, and enter the value 2000.
The model dimension would have the formula: =int( (" a "/24))*24
5 Likes
you would have to see that with the configurations and an excel table with formula
Hello
Look at the equations...
Create a variable where you enter your value: 2000
Create another variable that calculates it and assign this variable to your side...
1 Like
This is also what I would have said at first glance: equations! Far too often forgotten / underestimated
Hello
That's what I did. I created 2 ribs:
D1 = int( (D2/24))*24 which controls the length of my part.
and D2 the dimension that I am modifying.
This saves me from opening the equation manager
I can't think of anything better.
To avoid needing to open the equation manager:
You can bind the seed value to a custom property.
No need to open the equation manager, nor the sketch to change the dimension.
It's almost magical
1 Like
@ a_eriaud,
How do you edit this property without opening anything?
1 - Have or create a custom property that will contain the starting side (2000 in your example)
2 - create a variable that points to this property (see previous screenshot)
3 - Create a variable that does the calculation
4 - In the sketch, select the dimension: delete the value, press " = " and choose global variable and then the variable created in " 3 " and validate
If all goes well, when you change the value of your property, everything will follow...
4 Likes
You can create a sketch entity to which you attach a dimension, and that dimension will be called by the formula to drive the final feature.
This can be in the feature sketch or in a separate sketch placed at the beginning of the tree (handy if you have several driving dimensions).