martijnberger / pyslapi

Python bindings for the official Sketchup API
237 stars 134 forks source link

Problem building extension #30

Open randfb opened 5 years ago

randfb commented 5 years ago

I have spent many hours trying to build the cython sketchup extension with the "python setup.py build_ext" command. I finally got it to successfully build the sketchup.cp36-win_amd64.pyd file which I renamed to sketchup.pyd (263KB). When I import it in python, I get these functions >>> dir(sketchup) ['Camera', 'Component', 'Edge', 'Entities', 'Entity', 'Face', 'Group', 'Instance', 'Layer', 'LoopInput', 'Material', 'Model', 'Plane3D', 'Point2D', 'Point3D', 'RenderingOptions', 'Scene', 'Texture', 'Vector3D', 'builtins', 'doc', 'file', 'loader', 'name', 'package', 'pyx_unpickle_defaultdict', 'spec', 'test__', 'defaultdict', 'get_API_version', 'keep_offset']

As you can see, only a subset of what I was expecting. No SUInitialize or others.

I would like to use the python extension to build sketchup files.

Please advise. thanks Rand Batchelder

LorenzWieseke commented 4 years ago

How did you manage to build it ? (Apart from installing cython and running the setup) I'm trying to get the blender 2.8 branch running but all I get is :

building 'sketchup' extension C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iheaders -IC:\Users\wiese\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\wiese\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" /EHsc /Tpsketchup.cpp /Fobuild\temp.win32-3.8\Release\sketchup.obj /Zp8 sketchup.cpp C:\Users\wiese\AppData\Local\Programs\Python\Python38-32\include\pyconfig.h(59): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "io.h": No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe' failed with exit status 2 PS C:\3D Animation\Lib\Scripts\pyslapi>