Porting to python3
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Porting to python3
I can't reproduce that error either... Do you have the BIM WB installed twice?
Re: Porting to python3
I think this is related to Python 3, ActiveView doesn't display the list of available properties and methods in the python console
when typing the dot :
when typing the dot :
Code: Select all
FreeCADGui.ActiveDocument.ActiveView
Code: Select all
>>> FreeCADGui.ActiveDocument.ActiveView.__dir__()
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: __dir__
Code: Select all
OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15548 (Git) AppImage
Build type: Release
Branch: master
Hash: df3853738ebe5f91e3768c47c5db5594809ffeb7
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
Re: Porting to python3
Fixed.bitacovir wrote: ↑Mon Jan 21, 2019 7:02 pmYes. I reinstalled it and now the message with error of Fasteners has gone.
But now I have this message:nCode: Select all
During initialization the error "'BIMWorkbench' already exists." occurred in C:\Users\Rafael\AppData\Roaming\FreeCAD\Mod\BIM.bak\InitGui.py Please look into the log file for further informatio
I manually deleted all BIM Folders in AppData folder and reinstalled them via Addon Manager. No more messages about BIMWorkbench.
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)
Canal Youtube Grupo Telegram de FreeCAD Español
My personal web site
My GitHub repository
Mini Airflow Tunnel Project
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)
Canal Youtube Grupo Telegram de FreeCAD Español
My personal web site
My GitHub repository
Mini Airflow Tunnel Project
Re: Porting to python3
Yes I saw that too but couldn't nail down exactly what's happening. But it is only the rendering of the contents to the console, for ex.
Code: Select all
FreeCAD.ActiveDocument.ActiveView.getSceneGraph()
Re: Porting to python3
Just a general question: I build freecad from master with qt5 and py3 but it is unusable. Basically no geometry is shown and it can not made visible:
Are such errors and behaviour to be expected when building with py3 or should it work but my build configuration is wrong?
Code: Select all
Traceback (most recent call last):
File "<string>", line 1, in <module>
<class 'AttributeError'>: 'Gui.ViewProviderDocumentObject' object has no attribute 'Visibility'
Re: Porting to python3
Once we have finally moved to python3 we have to work on auto-completion anyway:I think this is related to Python 3, ActiveView doesn't display the list of available properties and methods in the python console
https://forum.freecadweb.org/viewtopic. ... 10#p206336
I have no idea why it is not working.
Re: Porting to python3
Maybe a hint from pycxx [1]:
[1] http://cxx.sourceforge.net/PyCXX-Python ... nsion_type
searching for "View3DInventorViewerPy::init_type()" seems to give only one occurrence. So this is never called.Do not forget to add the call range::init_type() to some module's init function. You will want a method in some module that can create range objects, too.
[1] http://cxx.sourceforge.net/PyCXX-Python ... nsion_type
Re: Porting to python3
btw: There are also crashes because of the way how freecad tries to autocomplete:
I guess this feature has to be aligned with the standard python way to do this. Maybe the easiest way is to rewrite the FreeCAD-console in python. There are some examples available: eg.: ipython-qt-console
btw.: auto-completing also doesn't work for activeView in jupyter-qt-console.
Code: Select all
Program received signal SIGSEGV, Segmentation fault.
#0 /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f0c40663f20]
#1 0x7f0c42b36168 in Gui::CallTipsList::extractTipsFromObject(Py::Object&, Py::List&, QMap<QString, Gui::CallTip>&) const from /home/lo/conda/envs/freecad_gcc7/bin/../lib/libFreeCADGui.so+0x2d8
#2 0x7f0c42b38da6 in Gui::CallTipsList::extractTips(QString const&) const from /home/lo/conda/envs/freecad_gcc7/bin/../lib/libFreeCADGui.so+0xb26
#3 0x7f0c42b3961b in Gui::CallTipsList::showTips(QString const&) from /home/lo/conda/envs/freecad_gcc7/bin/../lib/libFreeCADGui.so+0x20b
#4 0x7f0c42b48084 in Gui::PythonConsole::keyPressEvent(QKeyEvent*) from /home/lo/conda/envs/freecad_gcc7/bin/../lib/libFreeCADGui.so+0x554
#5 0x7f0c4125af77 in QWidget::event(QEvent*) from /home/lo/conda/envs/freecad_gcc7/bin/../lib/libQt5Widgets.so.5+0x7e7
#6 0x7f0c413334ae in QFrame::event(QEvent*) from /home/lo/conda/envs/freecad_gcc7/bin/../lib/libQt5Widgets.so.5+0x1e
btw.: auto-completing also doesn't work for activeView in jupyter-qt-console.
Re: Porting to python3
https://github.com/FreeCAD/FreeCAD/blob ... n.cpp#L425looo wrote: ↑Tue Feb 05, 2019 6:36 pm Maybe a hint from pycxx [1]:
searching for "View3DInventorViewerPy::init_type()" seems to give only one occurrence. So this is never called.Do not forget to add the call range::init_type() to some module's init function. You will want a method in some module that can create range objects, too.
[1] http://cxx.sourceforge.net/PyCXX-Python ... nsion_type
Re: Porting to python3
wmayer wrote: ↑Tue Feb 12, 2019 2:36 pmhttps://github.com/FreeCAD/FreeCAD/blob ... n.cpp#L425looo wrote: ↑Tue Feb 05, 2019 6:36 pm Maybe a hint from pycxx [1]:
searching for "View3DInventorViewerPy::init_type()" seems to give only one occurrence. So this is never called.Do not forget to add the call range::init_type() to some module's init function. You will want a method in some module that can create range objects, too.
[1] http://cxx.sourceforge.net/PyCXX-Python ... nsion_type
I see, thanks. Any ideas how to debug this behavior? (missing auto-completion)