workflow to handle parameters and measures

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
cunfusu
Posts: 12
Joined: Sat Jan 25, 2020 11:23 am

workflow to handle parameters and measures

Post by cunfusu »

I'm looking for recommendations on a good workflow to deal with measures.

The reason is that when I initially started using FreeCAD I was manually inserting the sizes in each sketch. I've quickly realized this is not a felxible and scalable solution.

After some time I've discovered the expressions and the spreadsheet workbench.

What I currently do is trying to keep all my measures in spreadsheet called "sizes". I assign aliases to all the values so that I can easily refer to them in my sketches setting expression such as "= sizes.alias_name"

aliases are really helpful because I can do all my math in the spreadsheet using expressions.
I organize all the values as follow:
I keep few pairs of columns (description/value)
The first is used for real world measures that I never edit (unless I realize I've made a mistake)
In the Second I keep a list of parameters such as: tollerances, wall thickness, these are the values that I edit when I want to tweak my parts
finally I keep one or more columns with sizes that are obtained with expressions from the first 2 pair of columns.

to help me distinguish the different type of values sometimes I color cells with different colors:
red: meaning this is a measure that is better not to touch
green: this is a parameter (feel free to tweak it)
yellow: this is an expression obtained from combination of other values

So far this works decently but for complex parts that contain subparts it can easily become challenging. (especially managing many aliases)
but the good thing is that you can have all your values accessible in one place.

Is there a better workflow or an improvement I could do on my current workflow?
how do you handle your sizes.

Do you have suggestions on how to name aliases?
I haven't yet experimented with macros but I was thinking to use them to make the process of creating aliases more convenient.

Also I was thinking It would be nice to have a graphical reference instead of only looking at numbers and descriptions in a spreadsheet.
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: workflow to handle parameters and measures

Post by chrisb »

Your approach is probably the one creating the most stable models as far as late changes to early steps are concerned.
On big models there is a drawback to this method as a change to any of the entries will cause a recompute of alldependent constructs, which seems to be in your case the whole model. You could avoid this by creating more than one spreadsheet.
cunfusu wrote: Sun Feb 16, 2020 3:15 pm Also I was thinking It would be nice to have a graphical reference instead of only looking at numbers and descriptions in a spreadsheet.
A more typical approach is using references to external geometry in your sketches. They provide immediate visual feedback. As mentioned on this page, especially the paragraph about creating stable models you should avoid using edges and vertices of solids and rather reference sketches instead. This has turned out to be very stable too; you can still have your model break, if you add or delete geometric elements in a referenced sketch.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
dxp.dev
Posts: 280
Joined: Tue Dec 11, 2018 12:57 pm

Re: workflow to handle parameters and measures

Post by dxp.dev »

cunfusu wrote: Sun Feb 16, 2020 3:15 pm Do you have suggestions on how to name aliases?
Hi,

Usually, I name them [part name]_[parameter], so if you have an axle and a wheel, and your spreadsheet named "sizes", it goes like :


sizes.axle_radius
sizes.axle_length
sizes.wheel_radius
sizes.wheel_width



So you can handle as many radius as you need without naming them radius1, radius2, ...

And for the expression writing as parameter, it's easier because you know which part you're defining, and so (saying your "sizes" spreadsheet is in the "master" file :

master#sizes.axle_ autocompletion will give you all the parameters you wrote for the axle.

And you're sure not to assign the radius of one part to another by mistaking one radius alias with another if you use radius1, radius2, ...

Like that you can handle a lot of parts and subparts.
Find your user.cfg and system.cfg files : Macro_findConfigFiles

Imperial system makes no sense, go metric ! ! !
Post Reply