PR#2862: Configuration Table using Spreadsheet

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kuzma30
Posts: 163
Joined: Wed Oct 24, 2018 11:50 am
Location: Ukraine

Re: PR#2862: Configuration Table using Spreadsheet

Post by Kuzma30 »

I started to implement a parametric CNC machine project. In it I use a lot of files for machine parts. First I created parameter tables in each file. Then, due to the need to manually update the details after changing the top-level parameters (such as the dimensions of the working field, etc.), it was decided to transfer all the tables to one file. For simple parameters of length, width, radii, etc., this went without problems. Problems arose when trying to create a Configuration.Enum that is defined in an external file (ТаблицаПараметров.FCStd). I couldn't do it. Is it possible at all?


https://github.com/Kuzma30/FREECAD_CNC my project. File where I have problem is "ПроставкаY.FCStd". File with tables is "ТаблицаПараметров.FCStd".

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.30870 (Git)
Build type: Release
Branch: LinkDaily
Hash: ed30f75cf752508a3c544b907b036118f07d65b9
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.6.0
Locale: Ukrainian/Ukraine (uk_UA)
RealThunder's A3 Wiki translation, join the project https://crowdin.com/project/freecad-asm3-wiki
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: PR#2862: Configuration Table using Spreadsheet

Post by Shalmeneser »

Can you provide a MWE (minimal working example) ?
User avatar
Kuzma30
Posts: 163
Joined: Wed Oct 24, 2018 11:50 am
Location: Ukraine

Re: PR#2862: Configuration Table using Spreadsheet

Post by Kuzma30 »

In the process of creating an example, I came to understand what I was doing wrong.
I provide example files
Attachments
test2.FCStd
(4.52 KiB) Downloaded 96 times
test.FCStd
(5.22 KiB) Downloaded 112 times
RealThunder's A3 Wiki translation, join the project https://crowdin.com/project/freecad-asm3-wiki
User avatar
Kuzma30
Posts: 163
Joined: Wed Oct 24, 2018 11:50 am
Location: Ukraine

Re: PR#2862: Configuration Table using Spreadsheet

Post by Kuzma30 »

Another questions. Is it possible to add more that one configuration table to Body? For example one configuration table for external length, second table for holes in part, third table for pad size.
RealThunder's A3 Wiki translation, join the project https://crowdin.com/project/freecad-asm3-wiki
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by realthunder »

Kuzma30 wrote: Fri Mar 11, 2022 11:46 am In the process of creating an example, I came to understand what I was doing wrong.
I provide example files
So you've solved the problem yourself right? I tried your file and it seems fine.
Kuzma30 wrote: Fri Mar 11, 2022 2:15 pm Another questions. Is it possible to add more that one configuration table to Body? For example one configuration table for external length, second table for holes in part, third table for pad size.
Sure it's possible. When you create the table, just select a new property for configuration.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
Kuzma30
Posts: 163
Joined: Wed Oct 24, 2018 11:50 am
Location: Ukraine

Re: PR#2862: Configuration Table using Spreadsheet

Post by Kuzma30 »

Test file for realthunder.
Attachments
test5.FCStd
(36.01 KiB) Downloaded 99 times
RealThunder's A3 Wiki translation, join the project https://crowdin.com/project/freecad-asm3-wiki
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by realthunder »

If you can make sure those secondary tables having the same number of configurations, then you can drive those tables with the first main table.

Type the following commands in Python console

Code: Select all

App.ActiveDocument.Pocket.setExpression('Configuration', 'hiddenref(Body.configuration.Value)')
App.ActiveDocument.LinearPattern.setExpression('Configuration', 'hiddenref(Body.configuration.Value)')
By right, you can do this through property editor, by right clicking the 'Configuration' and choose 'Expression...', but there is a bug causing crash if you set expression on enumeration property. Oops!
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR#2862: Configuration Table using Spreadsheet

Post by chennes »

Just a brief note that the final few commits of this PR have now been merged and will be part of the 0.20 release -- thanks again to @realthunder and to all the testers for helping get this reviewed and merged.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: PR#2862: Configuration Table using Spreadsheet

Post by Kunda1 »

awesome!
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
skintigh
Posts: 14
Joined: Mon Mar 28, 2022 3:56 pm

Re: PR#2862: Configuration Table using Spreadsheet

Post by skintigh »

How should one make a copy of a parametric gear that uses a configuration table? I see the videos hurriedly click though something about elements but I'm not sure that applies to me, however I can't tell what menus they are in so I'm not sure. Lots of Youtube videos explain how to make one, no more.

I have a table of parameters for dozens of gears. I want to add 12 of those gears to my design. So I made one, typed in links to all the parameters and copied it. That worked, but it made an independent table that doesn't update with changes to the original table.

I tried copying just the gear and having multiple gears use the same table. That didn't work at all.

I tried copying the gear and spreadsheet and then binding the new spreadsheet to the original spreadsheet . That worked, but is it me or does that start to slow down FreeCAD? I also made the mistake of binding just the data I needed, then when I had to add a column I had to go back and manually rebind every copy.

...Which is usually a hint that I'm doing things wrong, so is there a smarter way for me to do this? Thanks!
Post Reply