This bit of python can be added to the python console def auto_alias(spreadsheet_name="Spreadsheet"): doc = FreeCAD.ActiveDocument ss = doc.getObject(spreadsheet_name) # Iterate over the rows empty_limit = 3 empty = 0 for row_id in range(2, 100): label_cell_ref = f'A{row_id}' label_val_ref = f'B{row_id}' try: name = ss.get(label_cell_ref) value = ss.get(label_val_ref) except ValueError as err: empty += 1 if empty_limit >= 2: break continue print(f"{label_val_ref}: {name} ... {value}") ss.setAlias(label_val_ref, name) doc.recompute() aa=auto_alias aa() This will apply the label in column 'a' as the alias for the value or expression result in column 'b'. I'm looking for a way to add it automatically at launch. It stops as soon as it finds an empty row.
Hello, thanks for this video! I give you a little trick ... At 2m47s you make a diagonal with 2 lines and several constraints !!! An easier way to center the rectangle, is to constraint the two corners and the origin with a symmetry constraint ! (Yes a point can be a center of symmetry between 2 others points in FreeCad) Procedure: With [Ctrl] hold, select the two corners points and after, the origin point, then just apply the symmetry constraint !
Great tutorial! This seems very useful! Also, I found that aliases can be used for calculations in the spreadsheet as well. When calculating the area, the equation "=width * length" can be used instead of "=B1 * B2".
Also note that = is the shortcut to enter formulae in fields too, not just the spreadsheet. They use the same expression engine (wiki.freecadweb.org/Expressions ). Incidentally, the button is f(x) for "function of variable", not a sine wave.
I wish I knew of this about 5 hours ago when I started to redesign a cartridge holder for my 2600. Retyping the numbers for certain dimensions was a pain. And when you can throw formulas at a spreadsheet.. man... LIKE!
Thanks! This is a game changing feature, especially for someone who doesn't have any other CAD experience. I run Linux on all my computers at home and have been teaching myself FreeCAD for the past several years, ever since I bought a 3D printer.
Loved this tutorial. Clear explanations, short and direct to the point. You are assumed to know just the very basics. Suggestion: Use less associated-keystrokes/keyboard-shortcuts and more visually explicit cues (like icons and menus) as many of us newbies are not as familiar with the associated keystrokes/keyboard-shortcuts and visual cues are more consistent with a visually-dominant media like videos.
You can center a rectangle on a point simply by selecting 2 opposite points and then the center point and applying symmetry constraint. But that's only a small detail. Tis channel is awesome! ❤👏👍
Another great video from you. I want to thank you for pointing out the case sensitivity on your functions. It was helpful to see you type in pi as a constant and not a function like I believe Excel treats it. However, you did not cover units. I wanted to be able to specify my values in inches (sorry). I put in 0.75 then specified a unit string of in, and it showed a value of 0.03. I don't know how it got that. But overall, you cover what needs to be said, and usually is not covered. A thousand thank yous.
Great straight forward tutorial. I am a relative newcomer to FreeCAD but when I was working I used quite complex spreadsheets extensively. This therefore opens up a whole new realm of possibilities for me. I also find your display theme most pleasing - can you give me a pointer tow where I can find how to set this up. Thanks.
Thanks for the comment. I enjoy the 'black'n'green' display. I've done this display not within FreeCAD, but rather on the operating system. I'm running Ubuntu 16.04 and installed the noobslab obsidian theme, which changes the appearance of FreeCAD. Hope that helps
That was great. I'm trying to figure out how to make a parametric tool for making boxes and lids out of sheet metal for bending on a brake, and your videos are helping a lot.
When I do spreadsheets (and internal naming of constraints) I use a system like this 1. all lower case is a calculated value 2. Capitalized is a User Entered Value (dimensions) 3) All-Caps is a Value that used to determine a whole host of results (like a system Variable) example: VOLUME is the desired volume of an object which will in turn be used to calculate dimensional values to get it. Height or ExitHole1_Diameter, etc would be values u want the user to give. While 'wall1_thickness' is a value set by calculation OR by reference The reason for this is so that in spreadsheets and while digging thru files I can recognize those constraints that are due to human error and hose that are done automatically.
Older post but very useful. Thanks. The questions are numerous but let’s say you want to prepare a box for a pack of cards with lid, can this spreadsheet dimensions be used?
at 3:07 you draw a diagonal line inorder to constraint this appear in bleu but how under freecad change the look of this line for a bleu tacts line ? i am a catia V5 user since a long time and not be able to have a construct line with tacts or a symetry with dots and tacts damage a lot my brain ! thanks for your help !
@@JokoEngineeringhelp thanks for your reply Joko yes with this button i can toggle from construction to other type of line, i can do it directly from the task tab too but ... the line style is still the same (plain line and color are still white, green or bleu) no tact / dash/ dot line style and this is not compliant with our cad conventions for axes lines , construction lines ... as freecad use python i am pretty sure that some wherere we can change this line style to be compliant with drawing habits. Have a nice day !
Excellent! Thank you. Is there a way to reference a previously, automatically-defined constraint (e.g.: Constraint12) in the definition of a second constraint. (without defining a "spreadsheet")? I'm looking for something like: "=Constraints.Constraint12 + 2mm". Blessings.
Thanks. I have not found a way to do that, but there might be something in the freecad expressions documentation that makes it possible wiki.freecad.org/Expressions
Thank you for the video. I've missed a detail about using polylines to constrain the frame sides. When I add a polyline from corner-to-centre-to-corner the polyline isn't attached to the frame. So when I "E" to equal their lengths, my frame dimensions don't change. FreeCAD moves the polyline's centre point away from the frame's centre point instead.
Very useful video and comments! Quick question here: How do you do the reverse? read values from cad data?, For example I need to read dynamically the dimension of an edge or constrain in the sketch in my spreadsheet
Love your videos they have helped me immensely. However how can someone use inches in the spreadsheet? Example. I want to have a width and length that can be changed. If the width is 1 than BoxTopWidth is 2.5" (width * 2.5) and the BoxBottomWidth is 2.375" ((width * 2.5) - .125) so that I can assign Spreadsheet.BoxTopWidth and Spreadsheet.BoxBottomWidth to a sketch? Every video I watch assumes metric and it's kinda frustrating.
Hi Doug; I'm an inch man myself too, that's my preferred unit. It seems like when I run inches, there is an error in getting an accurate dimension to the part. I think the development side made the sheet only support metric, but that's only speculation on my end. What I've settled for is creating the user input on the spreadsheet to be inches, then converting the user input by a factor of 25.4 for a metric part. I haven't been able to get inches to work in any other way so far. Hope that helps
@@JokoEngineeringhelp That's what I was afraid of. I was considering just doing a conversion like you suggested but wanted to know if there was another way. Thanks for your help and quick response. Keep up the awesome videos
What sort of error do you get? There should be nearly 16 digits of precision in the calculations (double precision floating point). Inches are literally defined by the metric system, as 25.4mm, but the binary numbers do cause small rounding errors and there may be places those aren't hidden. Notably those errors occur for metric values too, since decimal fractions don't match binary fractions exactly. They just rarely grow to sizes that matter. Also, FreeCAD's internal unit conversion means you can enter values in a variety of units. Just put e.g. "2 in" or "5 cm", doesn't matter what your display or default units are (which can be selected in Edit - Preferences - General - Units). Including the unit inside your spreadsheet will help ensure values are used for appropriate fields.
Can I ask a really basic question .. sorry for being a pita , i have made three parts in three separate files , and can open them all from the separate tabs at the bottom of the main window , in freecad 1.8 , but how on earth do i get the three parts into the same window so i can join them to each other ,,, I know this is probably so easy but I cant find a video or anything about how to do it I know its basic day one stuff to you , but a pointer would be appreciated . thanks in advance t
You would join the parts in an assembly. I use the A2+ workbench as my preferred one though there are other options. You can find more information here: th-cam.com/video/gV7jK0c7m40/w-d-xo.html If you have trouble adding workbenches I have a video on the addon manager that can help. Best
@@JokoEngineeringhelp hi , i can add work benches ,,ill go watch the video , its got me stumped , but thanks for the time youve taken to reply , ill let you know how it goes
@@JokoEngineeringhelp yep seen it , i just cant get the bits from two bottom tabs into the same place ,,, say i make a nut as one piece , , and a washer as a totally separate piece , and have two bottom tabs open , one called nut , and one called washer , for the love of me I cant seem to work out how to get the nut and the washer into the same picture ,,, sorry for being dim .
@@tomthompson7400 If you're in the A2+ workbench, click the button 'add a part from an external file' and that allows for putting multiple parts in the same environment
Is there really no way to automatically assign the alias to a whole range of numbers by refering to the cell immediately to the left, like you can in Excel? That seems a really glaring omission because the process you show lends itself to errors and inconsistencies, as well as being really time consuming.
I found a bug - my design file is in inches, I put an inch dimension in the spreadsheet, and FreeCAD interprets it as millimeters. Anyone else see this problem?
You video has been referenced on the FreeCad Wiki on a page: '''[wiki.freecadweb.org/Best_Practices_with_SpreadSheets Best Practices with SpreadSheets - FreeCAD Documentation ]'''. Your or your viewers may want to take a look at that page and read/evaluate/learn from it. It is a wiki so you can change the page, or comment in its discussion tab. You can message me, the guy who made this comment.
This bit of python can be added to the python console
def auto_alias(spreadsheet_name="Spreadsheet"):
doc = FreeCAD.ActiveDocument
ss = doc.getObject(spreadsheet_name)
# Iterate over the rows
empty_limit = 3
empty = 0
for row_id in range(2, 100):
label_cell_ref = f'A{row_id}'
label_val_ref = f'B{row_id}'
try:
name = ss.get(label_cell_ref)
value = ss.get(label_val_ref)
except ValueError as err:
empty += 1
if empty_limit >= 2:
break
continue
print(f"{label_val_ref}: {name} ... {value}")
ss.setAlias(label_val_ref, name)
doc.recompute()
aa=auto_alias
aa()
This will apply the label in column 'a' as the alias for the value or expression result in column 'b'. I'm looking for a way to add it automatically at launch. It stops as soon as it finds an empty row.
I'm not a python wizard, but I pinned this in case someone else can support that. Thanks for the handy code here.
WOW. I wish other channels were like this. No discourse. Straight up quick basic and essential instruction. Subbed.
Hello, thanks for this video!
I give you a little trick ... At 2m47s you make a diagonal with 2 lines
and several constraints !!! An easier way to center the rectangle, is to
constraint the two corners and the origin with a symmetry constraint !
(Yes a point can be a center of symmetry between 2 others points in
FreeCad)
Procedure: With [Ctrl] hold, select the two corners points and after,
the origin point, then just apply the symmetry constraint !
2:47
Great tutorial! This seems very useful! Also, I found that aliases can be used for calculations in the spreadsheet as well. When calculating the area, the equation "=width * length" can be used instead of "=B1 * B2".
THIS.
Also note that = is the shortcut to enter formulae in fields too, not just the spreadsheet. They use the same expression engine (wiki.freecadweb.org/Expressions ). Incidentally, the button is f(x) for "function of variable", not a sine wave.
I wish I knew of this about 5 hours ago when I started to redesign a cartridge holder for my 2600. Retyping the numbers for certain dimensions was a pain. And when you can throw formulas at a spreadsheet.. man... LIKE!
Thanks! This is a game changing feature, especially for someone who doesn't have any other CAD experience. I run Linux on all my computers at home and have been teaching myself FreeCAD for the past several years, ever since I bought a 3D printer.
Linux is king. Good luck with your projects
THIS is a game changer my sir
Loved this tutorial. Clear explanations, short and direct to the point. You are assumed to know just the very basics.
Suggestion: Use less associated-keystrokes/keyboard-shortcuts and more visually explicit cues (like icons and menus) as many of us newbies are not as familiar with the associated keystrokes/keyboard-shortcuts and visual cues are more consistent with a visually-dominant media like videos.
Great video! This short explanation of parameterization was exactly what I was looking for
Thank you! I loved it when I learned that
You can center a rectangle on a point simply by selecting 2 opposite points and then the center point and applying symmetry constraint. But that's only a small detail. Tis channel is awesome! ❤👏👍
Another great video from you. I want to thank you for pointing out the case sensitivity on your functions. It was helpful to see you type in pi as a constant and not a function like I believe Excel treats it. However, you did not cover units. I wanted to be able to specify my values in inches (sorry). I put in 0.75 then specified a unit string of in, and it showed a value of 0.03. I don't know how it got that. But overall, you cover what needs to be said, and usually is not covered. A thousand thank yous.
When I'm trying to change values in spreadsheet after 4:11 it doesn't change the sketch - it throws "Recompute Failed" for some reason.
Great straight forward tutorial.
I am a relative newcomer to FreeCAD but when I was working I used quite complex spreadsheets extensively. This therefore opens up a whole new realm of possibilities for me.
I also find your display theme most pleasing - can you give me a pointer tow where I can find how to set this up. Thanks.
Thanks for the comment. I enjoy the 'black'n'green' display. I've done this display not within FreeCAD, but rather on the operating system. I'm running Ubuntu 16.04 and installed the noobslab obsidian theme, which changes the appearance of FreeCAD. Hope that helps
That was great. I'm trying to figure out how to make a parametric tool for making boxes and lids out of sheet metal for bending on a brake, and your videos are helping a lot.
Awesome.. I always hated to have MS Office installed just to do this in SolidWorks.. thanks for another great vid!
You're right, I've run into issues with excel and design tables in SolidWorks too. Thanks
When I do spreadsheets (and internal naming of constraints) I use a system like this
1. all lower case is a calculated value
2. Capitalized is a User Entered Value (dimensions)
3) All-Caps is a Value that used to determine a whole host of results (like a system Variable)
example: VOLUME is the desired volume of an object which will in turn be used to calculate dimensional values to get it.
Height or ExitHole1_Diameter, etc would be values u want the user to give.
While 'wall1_thickness' is a value set by calculation OR by reference
The reason for this is so that in spreadsheets and while digging thru files I can recognize those constraints that are due to human error and hose that are done automatically.
Great explanation, thanks very much!
Merci beaucoup c’a m'a permis de faire ce que je voulais !! Thanks you from France.
Thank you very much, I was able to use the formulas feature in dimensions with the constraints.
helped me a lot.
Older post but very useful. Thanks. The questions are numerous but let’s say you want to prepare a box for a pack of cards with lid, can this spreadsheet dimensions be used?
It can be used indeed, but it shouldn't be necessary unless you would like your container to change dimensions frequently
at 3:07 you draw a diagonal line inorder to constraint this appear in bleu but how under freecad change the look of this line for a bleu tacts line ? i am a catia V5 user since a long time and not be able to have a construct line with tacts or a symetry with dots and tacts damage a lot my brain ! thanks for your help !
There is a button in the ribbon that toggles construction geometry, the button has a white square with a blue dotted line square behind it.
@@JokoEngineeringhelp thanks for your reply Joko yes with this button i can toggle from construction to other type of line, i can do it directly from the task tab too but ... the line style is still the same (plain line and color are still white, green or bleu) no tact / dash/ dot line style and this is not compliant with our cad conventions for axes lines , construction lines ... as freecad use python i am pretty sure that some wherere we can change this line style to be compliant with drawing habits. Have a nice day !
Excellent! Thank you. Is there a way to reference a previously, automatically-defined constraint (e.g.: Constraint12) in the definition of a second constraint. (without defining a "spreadsheet")? I'm looking for something like: "=Constraints.Constraint12 + 2mm". Blessings.
Thanks. I have not found a way to do that, but there might be something in the freecad expressions documentation that makes it possible
wiki.freecad.org/Expressions
I'm curious if this Spreadsheet feature can use relative references like R2C[-1] in Excel.
Thank you for the video. I've missed a detail about using polylines to constrain the frame sides. When I add a polyline from corner-to-centre-to-corner the polyline isn't attached to the frame. So when I "E" to equal their lengths, my frame dimensions don't change. FreeCAD moves the polyline's centre point away from the frame's centre point instead.
Does this help?
th-cam.com/video/suFp5-SWSA4/w-d-xo.html
@@JokoEngineeringhelp thanks. That did indeed do the trick. Do you still use PolyLine to "square-off" your boxes?
Very useful video and comments! Quick question here: How do you do the reverse? read values from cad data?, For example I need to read dynamically the dimension of an edge or constrain in the sketch in my spreadsheet
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html .💐
Love your videos they have helped me immensely. However how can someone use inches in the spreadsheet? Example. I want to have a width and length that can be changed. If the width is 1 than BoxTopWidth is 2.5" (width * 2.5) and the BoxBottomWidth is 2.375" ((width * 2.5) - .125) so that I can assign Spreadsheet.BoxTopWidth and Spreadsheet.BoxBottomWidth to a sketch? Every video I watch assumes metric and it's kinda frustrating.
Hi Doug;
I'm an inch man myself too, that's my preferred unit. It seems like when I run inches, there is an error in getting an accurate dimension to the part. I think the development side made the sheet only support metric, but that's only speculation on my end.
What I've settled for is creating the user input on the spreadsheet to be inches, then converting the user input by a factor of 25.4 for a metric part. I haven't been able to get inches to work in any other way so far.
Hope that helps
@@JokoEngineeringhelp That's what I was afraid of. I was considering just doing a conversion like you suggested but wanted to know if there was another way. Thanks for your help and quick response. Keep up the awesome videos
What sort of error do you get? There should be nearly 16 digits of precision in the calculations (double precision floating point). Inches are literally defined by the metric system, as 25.4mm, but the binary numbers do cause small rounding errors and there may be places those aren't hidden. Notably those errors occur for metric values too, since decimal fractions don't match binary fractions exactly. They just rarely grow to sizes that matter.
Also, FreeCAD's internal unit conversion means you can enter values in a variety of units. Just put e.g. "2 in" or "5 cm", doesn't matter what your display or default units are (which can be selected in Edit - Preferences - General - Units). Including the unit inside your spreadsheet will help ensure values are used for appropriate fields.
Thank you for this straight forward video!
Can I ask a really basic question .. sorry for being a pita , i have made three parts in three separate files , and can open them all from the separate tabs at the bottom of the main window , in freecad 1.8 , but how on earth do i get the three parts into the same window so i can join them to each other ,,, I know this is probably so easy but I cant find a video or anything about how to do it I know its basic day one stuff to you , but a pointer would be appreciated . thanks in advance t
You would join the parts in an assembly. I use the A2+ workbench as my preferred one though there are other options. You can find more information here:
th-cam.com/video/gV7jK0c7m40/w-d-xo.html
If you have trouble adding workbenches I have a video on the addon manager that can help.
Best
@@JokoEngineeringhelp hi , i can add work benches ,,ill go watch the video , its got me stumped , but thanks for the time youve taken to reply , ill let you know how it goes
@@JokoEngineeringhelp yep seen it , i just cant get the bits from two bottom tabs into the same place ,,, say i make a nut as one piece , , and a washer as a totally separate piece , and have two bottom tabs open , one called nut , and one called washer , for the love of me I cant seem to work out how to get the nut and the washer into the same picture ,,, sorry for being dim .
@@tomthompson7400 If you're in the A2+ workbench, click the button 'add a part from an external file' and that allows for putting multiple parts in the same environment
@@JokoEngineeringhelp off I go again to play ,, many many thanks .
Thanks makes freecad fun to work with
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html .💐
Is there really no way to automatically assign the alias to a whole range of numbers by refering to the cell immediately to the left, like you can in Excel? That seems a really glaring omission because the process you show lends itself to errors and inconsistencies, as well as being really time consuming.
crème de la crème of parametric design, big kudos!
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html .💐
I found a bug - my design file is in inches, I put an inch dimension in the spreadsheet, and FreeCAD interprets it as millimeters. Anyone else see this problem?
Uh, that's really neat!
In your equations you can use the aliases as well.
Fantastic. I didn't know about this.
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html .💐
Great video.
Super!
Very useful, nice video!
great video, thanks
it seems to be changed with version .19
Thank you so much!!!
wonderful
Very usefull, thank you
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html .💐
outstanding
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html .💐
Thanks for this video sir
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html .💐.
I swear I learned this from another of your videos. You can use the alias in the spreadsheet. area = length * width.
Thank you very very much
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html ..💐
👍
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html .💐
You video has been referenced on the FreeCad Wiki on a page: '''[wiki.freecadweb.org/Best_Practices_with_SpreadSheets Best Practices with SpreadSheets - FreeCAD Documentation ]'''.
Your or your viewers may want to take a look at that page and read/evaluate/learn from it. It is a wiki so you can change the page, or comment in its discussion tab. You can message me, the guy who made
this comment.
Hey thanks I would not have seen this! That's really neat
you indonesia people
th-cam.com/video/vFDMaHQ4kW8/w-d-xo.html ..💐
Thank you so much