DeepSOIC wrote: ↑Sat Aug 24, 2019 12:42 am
After thinking about it a bit, I think that everything having a Shape is a harmful change. Like, I think I used the presence of Shape attribute as a validity test too. Now, such a validity test is being bypassed, and a null shape is then fed to the algorithm instead. Which is very likely to crash, as I think there are still holes in our API that may let null shape pass to OCC algos, which usually crash then.
I'll modify PropertyContainerPy to return the Shape if it is not null. If there is really a property called Shape, the code in PropertyContainerPy will not be reached, and it just returns whatever is inside. If there isn't, it uses Part.getShape() to obtain shape, so you can now simply use App.Link, App.Part, or even plain group to do modeling if you want, for Python code that is. C++ code such as PartDesign still need modification. But I have already modified Part to work with it.
On the other hand, you may also want to know that I have modified all PropertyContainer object to be able to accept dynamic property. Adding a Shape property is of course possible, so you might as well check for null when using the shape. I imagine this extended dynamic property to be especially useful for container type of objects, so that the container can inject any type of property to its children for various purpose. To avoid name conflict, you can form the property name by prepend it with the container's internal name.