this is a question for the C++ gurus out there i think *hust* Werner *hust*
I'm developing a new property type called PropertySet ( https://github.com/yorikvanhavre/FreeCA ... t?expand=1 ). It's basically a property that can contain any number of other properties. It would be pretty useful for dealing with IFC files, where objects can have any number of custom properties grouped under property sets. This would allow us to recreate that structure without clogging the property editor with an enormous amount of properties...
So I basically created a new class called PropertySet, derived from Property. And, since we need tools to add/remove additional properties from these property sets, I also created a special python object with add/remove methods.
Problem: When adding an App::PropertySet to a python feature, then trying to access that property from python:
Code: Select all
o = App.ActiveDocument.addObject("App::FeaturePython","test")
I immediately get a crash with: virtual PyObject* Base::BaseClass::getPyObject(): Assertion `0' failed.
That is, I suppose, because the base Property class has a virtual getPyObject() that must be reimplemented in the derived classes. Which I didn't do, because I thought that the .xml + .PyImp.cpp system took care of doing all that automatically. Do I need to explicitly implement this function? How does it work with the .xml+.PyImp.cpp duo then?