I am currently working on a Projekt to get data from FreeCAD to use in an external script.
My FreeCAD installation:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
And have problems to import this to a python script.
I am using Python 3.7.4
My Source code:
import sys
# Path to FreeCAD
FREECADPATH = 'C:\FreeCAD 0.18\bin'
def import_freecad(path_freecad):
"""Try to import FreeCAD on path_freecad"""
sys.path.append(path_freecad)
try:
import FreeCAD
except:
print("Could not import FreeCAD")
import_freecad(FREECADPATH)
This code always raises the expection. I followed a tutorial pdf you easily can find when google for it.
Anyone has an idea on how to solve this? Or solved the problem themself?