MaterialEditor.py

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:

MaterialEditor.py

Post by bernd »

What is the best way to start the MaterialEditor? Is it possible from inside FreeCAD or only from outside directly by pyhton?

If I try it from outside FreeCAD in a terminal by

Code: Select all

$ python MaterialEditor.py
it gives No mudule named FreeCAD. Sure the very first line is "import FreeCAD"

A path could be added by

Code: Select all

import sys
sys.path.append('the_path_to_FeeCAD_module')
Which path do I need to add for the python module FreeCAD for ubuntu ppa?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: MaterialEditor.py

Post by bernd »

Found it myself :) , inside FreeCAD

Code: Select all

import MaterialEditor
MaterialEditor.openEditor()
BTW (may be as a hint fo myself):
on my self compiled Debian to import FreeCAD inside python the path to lib is needed

Code: Select all

>>> import sys
>>> sys.path.append('/home/hugo/Documents/projekte--ifc/freecad/development/snapshot/free-cad-code/build/lib')
>>> import FreeCAD
FreeCAD 0.15, Libs: 0.15R4107 (Git)
Post Reply