But I can think of lots of cases where I would want to create a Pocket without being able to sketch it on an existing face. E.g. cutting a keyway out of a shaft. If the sketch is not sketched onto a solid but onto a datum plane, then the Pad has no way of finding out what to fuse with except by looking at the Body it belongs to.Pad can retrieve the feature it has fuse to by the basis of the Sketch.
I think our different views on this subject stem from the fact that you use CATIA and I used Pro/Engineer. Modelling philosophies are very different... e.g. in Pro/E it is standard practice to have "single body" designs, where ALL features are strictly sequential, building upon one another. Sketching on faces is even considered bad modeling practice by many Pro/E people, because the model gets unstable when the faces are moved after editing the underlying feature.
IMHO FreeCAD should allow both philosophies. So inside a Body, features should be strictly sequential, with each feature building upon the preceding features. SketchBased features using sketches made on datum planes should be allowed. Multiple bodies and booleans between bodies then give us all the advantages of the CATIA philosophy on top of that (I hope I understood the CATIA philosophy correctly).
Can you give a specific example?Using the Body history leads to all kind of problems. e.g. when you relocate the sketch on an other face...
It shouldn't be possible to relocate the sketch to a face that is created AFTER the Pad which consumes the sketch, of course. Pro/E doesn't allow you to do that.
The getBody() in Pad doesn't look for the "Active Body" (sorry my comment in the code was outdated). It looks at all Bodies in the Document and finds out which Body the Pad belongs to.Also if you have more then one Body in document and recalculate all bodies at once, there is no active Body.
Your code already issues a warning to the user about that and tells him to use a conversion function (which I think needs to be implemented still). Actually I think automatic conversion can easily be done on loading a legacy document (we have a FileVersion property now )That allow also to load old projects (which has no Body) and use the PartDesign features without Body.