add new material cards

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

add new material cards

Post by bernd »

I tried to add new material cards. If they where added to the installation path of FreeCAD, everything is fine.
On windows
C:\Program Files\FreeCAD 0.14\data\Mod\Material\StandardMaterial

I was not able to add them to the user path. On Windows the path FreeCAD.ConfigGet('UserAppData') is:
C:\Users\bhb\AppData\Roaming\FreeCAD

so I copied one of the card of FreeCAD to
C:\Users\bhb\AppData\Roaming\FreeCAD\data\Mod\Material\StandardMaterial\wood.FCMat
but FreeCAD does not recognise the MaterialCard

I wonder if it is generally possible to save MaterialCards somewhere in the path FreeCAD.ConfigGet('UserAppData')
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: add new material cards

Post by yorik »

It depends for what you want to use them I think?
But indeed there aren't many options yet for materials...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: add new material cards

Post by bernd »

yorik wrote:It depends for what you want to use them I think?
But indeed there aren't many options yet for materials...
They can be used in the FemWB allready ... Found it for FemWB there. The FemWB only reads the Cards from the AppPath.
https://github.com/FreeCAD/FreeCAD_sf_m ... aterial.py line 218

Code: Select all

 dirname = FreeCAD.ConfigGet("AppHomePath")+"data/Mod/Material/StandardMaterial" 
It's easy to change to UserAppData, but more smart would be if both path would be read like for Workbenches. Mhh nevermind, I don't hava any idea how to do that. :?

Code: Select all

dirname =  FreeCAD.ConfigGet("UserAppData")+"data/Mod/Material/StandardMaterial" 
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: add new material cards

Post by yorik »

Ideally there should be a preference option to store one's own materials path...
But if you write new material cards, please put them in the standard place, and share them with us ;) I'll be happy to merge them in the source code
Post Reply