How to set parameters for different parts? (beginner)

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
Jelle
Posts: 3
Joined: Mon Mar 17, 2014 9:40 am

How to set parameters for different parts? (beginner)

Post by Jelle »

Hi there,

Is it possible to set some parameters somewhere and use those in the parts I create later on (in the gui)?
Specifically, I'm using a lasercutter to cut a 3D printer housing from plywood. I wish to keep my models as parametric as possible, so in my openscad files I use a lot of parameters that define the size of the machine, the thickness of the plywood used etc. Is there a similar way to do that with FreeCAD? Or would that banish me to 'programming your CAD models' again?

Trying to use 'tools->edit parameters' and then trying to use such a parameter does not seem to work (could be the gui is rejecting non-nummeric values as input).
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How to set parameters for different parts? (beginner)

Post by jmaustpc »

Hi Jelle
welcome here.

I deleted you other post because I thought it was an accidental duplication. If I am wrong about that then please feel free to post again.

Please always post you Help about FreeCAD data, so we know what versions we are talking about...there are big differences. Look in your FreeCAD Help menu, click the copy to clipboard button and then paste it into your topics here.

You would appear to be a user of OpenSCAD, the OpenSCAD workbench in FreeCAD has changed a lot in recent times. If you want to import you OpenSCAD stuff you will probably want a very recent FreeCAD development version.

Forget the Edit Parameters ....that is parameters for the FreeCAD application ...things like icon size to be displayed.....most normal users would not want to adjust anything in there ... well not mostly anyway.

FreeCAD is fully parametric but it does not yet have a way of conveniently setting a value in the GUI that you can refer to in the various parameters of items. Unless you write a Python script, you will have to type the numerical value into a parameter somewhere....


Jim
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: How to set parameters for different parts? (beginner)

Post by NormandC »

What about that method using LibreOffice and python-uno that kwahooo used on his freecad-tutorial blog? (Sorry don't have time to dig it up ATM)

A spreadsheet to control important parameters might be an alternative, but it would still require some scripting.
Jelle
Posts: 3
Joined: Mon Mar 17, 2014 9:40 am

Re: How to set parameters for different parts? (beginner)

Post by Jelle »

jmaustpc wrote:Hi Jelle
welcome here.

I deleted your other post because I thought it was an accidental duplication. If I am wrong about that then please feel free to post again.
it was intentional, as it was another question. I thought it might be a good idea not to bury any good answers in a heap of questions.
Please always post you Help about FreeCAD data, so we know what versions we are talking about...there are big differences. Look in your FreeCAD Help menu, click the copy to clipboard button and then paste it into your topics here.
I agree that would be helpful for bug reports and questions about specific behaviour. You gave a good answer without it.
You would appear to be a user of OpenSCAD, the OpenSCAD workbench in FreeCAD has changed a lot in recent times. If you want to import you OpenSCAD stuff you will probably want a very recent FreeCAD development version.
actually I'm trying to get away from openscad. It works, but not very fast and I can't say i'm very happy with it after ~1200 lines.
Forget the Edit Parameters ....that is parameters for the FreeCAD application ...things like icon size to be displayed.....most normal users would not want to adjust anything in there ... well not mostly anyway.
ok, clear.
FreeCAD is fully parametric but it does not yet have a way of conveniently setting a value in the GUI that you can refer to in the various parameters of items. Unless you write a Python script, you will have to type the numerical value into a parameter somewhere....
Please excuse me for barging in and asking lots of questions, but why is that? A limitation of the gui or just the way it has grown?
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: How to set parameters for different parts? (beginner)

Post by ulrich1a »

Jelle wrote:Please excuse me for barging in and asking lots of questions, but why is that? A limitation of the gui or just the way it has grown?
FreeCAD is an ongoing project and far from finished. There is the idea of an integrated spreadsheet in FreeCAD. A prototype is working, but as far as I know, it can be used to get numbers out of your model, not the other way around. There is a new approach for the spreadsheet functionality, which may also work the other way(let you use numbers from the spreadsheet into your model). Only the author has limited time to finish it, so unfortunatly this feature is not in FreeCAD master yet.

Regards
Ulrich
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: How to set parameters for different parts? (beginner)

Post by NormandC »

Yes,

The developers have big plans for FreeCAD, but they are few and only work in their spare time. Still, FreeCAD has improved tremendously since I've been following the project!
lanyjie
Posts: 1
Joined: Thu Feb 16, 2017 10:02 am

Re: How to set parameters for different parts? (beginner)

Post by lanyjie »

Hi, this is now possible through expressions in property editor. Create a spreadsheet inside FreeCAD (on the spreadsheet workbench of course) and give a cell an alias, then you can refer to the value of that cell by the alias in an expression like this: mydata.deskLength (suppose you have named the spreadsheet "mydata" wherein an cell is given the alias of "deskLength"). For more details, see wiki here:

https://www.freecadweb.org/wiki/Expressions

Hopefully this may help somebody who come by later on as well.
Post Reply