Ticket #3391 - #ERR getting Material properties dictionary values in spreadsheet cells

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!
silopolis
Posts: 59
Joined: Thu Oct 20, 2016 10:06 pm

Ticket #3391 - #ERR getting Material properties dictionary values in spreadsheet cells

Postby silopolis » Mon Feb 12, 2018 7:52 am

Hi,

Keeping on working on my parametric cabinet master design, I'd like to get some parts material properties in spreadsheet cells but get an #ERR whatever syntax I try.

Could someone please tell me if this is possible at all and, if so, what's the appropriate way to do that ?

Thank you in advance for your help and have a nice week

Bests
Jérémie
Last edited by Kunda1 on Sat Nov 09, 2019 12:38 pm, edited 1 time in total.
Reason: Added ticket number to thread title
triplus
Posts: 9136
Joined: Mon Dec 12, 2011 4:45 pm

Re: #ERR getting Material properties dictionary values in spreadsheet cells

Postby triplus » Mon Feb 12, 2018 8:12 pm

Hi Jérémie.

Could you give an example (or maybe a file) on how you have assigned a material to a part. And explain further what values you would like to have in a spreadsheet. This effort AFAIK wasn't completed yet:

https://forum.freecadweb.org/viewtopic.php?f=10&t=16714

Therefore i am guessing we are talking about some Arch/FEM related features utilizing current material support FreeCAD has?
silopolis
Posts: 59
Joined: Thu Oct 20, 2016 10:06 pm

Re: #ERR getting Material properties dictionary values in spreadsheet cells

Postby silopolis » Tue Feb 13, 2018 2:13 pm

Hi,
triplus wrote:
Mon Feb 12, 2018 8:12 pm
Could you give an example (or maybe a file) on how you have assigned a material to a part. And explain further what values you would like to have in a spreadsheet.

...

Therefore i am guessing we are talking about some Arch/FEM related features utilizing current material support FreeCAD has?
I'm talking about Arch Materials. These can be assigned to Arch objects which can be created directly or from standard parts and/or sketches. I use mainly Arch Panels as wood panel pieces to design cabinets and furnitures.

If you look at the attached file, I've created a spreadsheet to hold the cutlist for the cabinet. I'm almost there (still have to find some way to handle arrays to be able to use them in my designs) but need to get some of the following dictionary values in cells:

Code: Select all

>>> print App.ActiveDocument.Panel014.Material.Material
{'StandardCode': u'', 'Description': u'', 'Density': u'700 kg/m^3', 'DiffuseColor': u'(0.6666666666666666, 0.3333333333333333, 0.0)', 'Father': u'Aggregate', 'ProductURL': u'http://en.wikipedia.org/wiki/Wood', 'YoungsModulus': u'12000 MPa', 'Name': u'MDF-19mm', 'CardName': u'Standard Wood Material', 'PoissonRatio': u'0.05', 'AuthorAndLicense': u'(c) 2015 Bernd Hahnebach (CC-BY 3.0)'}
Thanks for the post pointer and for caring
Attachments
LAM-STU-Modele_Caisson-v02c.fcstd
(66.5 KiB) Downloaded 12 times
triplus
Posts: 9136
Joined: Mon Dec 12, 2011 4:45 pm

Re: #ERR getting Material properties dictionary values in spreadsheet cells

Postby triplus » Tue Feb 13, 2018 2:38 pm

Code: Select all

Panel014.Material.Material.<<get("Density")>>
triplus
Posts: 9136
Joined: Mon Dec 12, 2011 4:45 pm

Re: #ERR getting Material properties dictionary values in spreadsheet cells

Postby triplus » Tue Feb 13, 2018 3:41 pm

Note that i detected a small issue for this use case. And hopefully a fix or a working solution will be provided soon:

https://forum.freecadweb.org/viewtopic. ... 32#p214832
silopolis
Posts: 59
Joined: Thu Oct 20, 2016 10:06 pm

Re: #ERR getting Material properties dictionary values in spreadsheet cells

Postby silopolis » Wed Feb 14, 2018 5:40 am

Good morning !

Thanks a lot for teaching me this syntax I didn't knew :)
triplus wrote:
Tue Feb 13, 2018 3:41 pm
Note that i detected a small issue for this use case. And hopefully a fix or a working solution will be provided soon:

https://forum.freecadweb.org/viewtopic. ... 32#p214832
Hopefully indeed ! This could be a great way to integrate FreeCAD in our process. Also discovered three things:
* All material properties fields are not created if you don't select an existing material to start from or open the ad-hoc window
* I can't multiply the obtained density because it comes as a string with unit
* User defined fields can be created which is just grrrreat... if only I could use them in spreadsheets ! ;-)

Thanks a lot for your help, will skim over the last pointed thread, could learn a couple of other things...

Have a nice day
Jérémie
triplus
Posts: 9136
Joined: Mon Dec 12, 2011 4:45 pm

Re: #ERR getting Material properties dictionary values in spreadsheet cells

Postby triplus » Wed Feb 14, 2018 1:50 pm

You're welcome. And indeed hopefully it will get sorted out in a way you will be able to achieve what you are after.
User avatar
Kunda1
Posts: 6434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #3391 - #ERR getting Material properties dictionary values in spreadsheet cells

Postby Kunda1 » Sat Nov 09, 2019 12:40 pm

Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features