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!
Post Reply
User avatar
silopolis
Posts: 74
Joined: Thu Oct 20, 2016 10:06 pm

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

Post by silopolis »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

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

Post by triplus »

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?
User avatar
silopolis
Posts: 74
Joined: Thu Oct 20, 2016 10:06 pm

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

Post by silopolis »

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 61 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

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

Post by triplus »

Code: Select all

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

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

Post by triplus »

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

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

Post by silopolis »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

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

Post by triplus »

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
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

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

Post by Kunda1 »

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
Post Reply