PD: fixes #6000: auto-generated Body not placed under existing Part
This commit is contained in:
@@ -258,12 +258,23 @@ private:
|
||||
{
|
||||
if (!activeBody) {
|
||||
activeBody = PartDesignGui::getBody( /* messageIfNot = */ true );
|
||||
if (!activeBody) {
|
||||
if (activeBody) {
|
||||
tryAddNewBodyToActivePart();
|
||||
}
|
||||
else {
|
||||
throw RejectException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tryAddNewBodyToActivePart()
|
||||
{
|
||||
App::Part *activePart = PartDesignGui::getActivePart();
|
||||
if (activePart) {
|
||||
activePart->addObject(activeBody);
|
||||
}
|
||||
}
|
||||
|
||||
void handleIfSupportOutOfBody(App::DocumentObject* selectedObject)
|
||||
{
|
||||
if (!activeBody->hasObject(selectedObject)) {
|
||||
@@ -498,12 +509,23 @@ private:
|
||||
if (!activeBody) {
|
||||
App::Document* appdocument = guidocument->getDocument();
|
||||
activeBody = PartDesignGui::makeBody(appdocument);
|
||||
if (!activeBody) {
|
||||
if (activeBody) {
|
||||
tryAddNewBodyToActivePart();
|
||||
}
|
||||
else {
|
||||
throw RejectException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tryAddNewBodyToActivePart()
|
||||
{
|
||||
App::Part *activePart = PartDesignGui::getActivePart();
|
||||
if (activePart) {
|
||||
activePart->addObject(activeBody);
|
||||
}
|
||||
}
|
||||
|
||||
void findAndSelectPlane()
|
||||
{
|
||||
App::Document* appdocument = guidocument->getDocument();
|
||||
|
||||
Reference in New Issue
Block a user