Best practices in hierarchical parameters

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
jb-workshop
Posts: 9
Joined: Fri Oct 23, 2020 6:11 am

Best practices in hierarchical parameters

Post by jb-workshop »

G'Day everyone,

suppose I'd like to create ER collets in FreeCAD. As you might know, there are several classes of ER collets:
  • ER-11,
  • ER-16,
  • ER-20,
  • ER-25,
  • ER-32,
  • ER-40 and
  • ER-50.
The outer form of each collet in each class is identical, but the range of the bore diameters differs from class to class.

I'd love to avoid a single selection list, i.e. something like
  • ER11-...,
  • ER11-7,0,
  • ER11-7,5,
  • ER11-8,0,
  • ER16-1,0,
  • ER16-1,5,
  • ...
as that list would be gigantic and would make it hard to find the desired collet. Furthermore, having split the selection process on two hierarchical lists may help the later decision on choosing the correct collet block and collet nuts for that collet.

Therefore, I'd need to two property selectors for my parts: one to choose the ER class (ER-11 to ER-50) and, depending on the class, a second list of bore diameters, which is specific for that class.

What is the best way to achieve this multiple parametric behaviour?

My first idea was to spread the data onto multiple spreadsheets. The first spreadsheet will be used to select the desired ER class. This spreadsheet could very well be used to define (more or less) the (outer) geometry of the collets. Next I'd say, I'll define a spreadsheet for each ER class, which contains the list of bore diameters to be chosen in that specific ER collet class. This list could also contain geometric parameters, which might depend on the diameter of the bore. In my eyes, this would have the benefit, that the data is neatly organized and cleanly structured. Chances to mix up different data are very low, as the data of one class is well separated from other class data.

Another idea might be, to use put in the data of the different spreadsheets into on (bigger) spreadsheet, spread across multiple blocks.

So, what would be the best way to tackle this problem?

Thanks in advance

Jan
Last edited by Kunda1 on Mon Jun 27, 2022 8:38 pm, edited 2 times in total.
Reason: fixed typo in thread title
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Best practise in hierarchical paramaters

Post by Kunda1 »

Moved to Help subforum
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Workshop_Notes
Posts: 588
Joined: Wed Sep 29, 2021 8:35 am

Re: Best practise in hierarchical parameters

Post by Workshop_Notes »

Please have a look in the Expressions wiki, https://wiki.freecadweb.org/Expressions . There is a very brief mention that you can use lists and tuples in expressions (and thus spreadsheets).

These seem to be ideal for what you need. Use the ER-series number as the index of the list to retrieve the body value/geometric parameter that is at that index (remembering that lists are zero-indexed). Similarly, use the diameter (perhaps multiplied by two, to eliminate the half-measurements) as the index to another list, to retrieve the bore value/geometric parameter.

You would have to see if it is possible, but you could try a list of lists, with the inner list containing permitted diameter options for the outer ER-series choice.

You might have to put some sanity checks into it using conditional logic, so you do not try to make an ER8 collet to accomodate a 20mm dia. tool.

RegoFix' website contains a lot of dimensional info. on the collets. They define a standard range of diameters, but more and more today, you can buy oversize collets (e.g. 22mm in ER32) so please take that into consideration. Also, some manufacturers produce ER collets in true imperial sizes so it would be nice to cater for these.
Post Reply