[PartDesign DuplicateSelected] do not put duplicated feature into active body if it is already in another body -- addresses issue #6278
This commit is contained in:
committed by
Yorik van Havre
parent
d15722863c
commit
5b6e886a3c
@@ -30,6 +30,7 @@
|
||||
#endif
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <App/GeoFeatureGroupExtension.h>
|
||||
#include <App/Origin.h>
|
||||
#include <App/Part.h>
|
||||
#include <Base/Console.h>
|
||||
@@ -635,8 +636,12 @@ void CmdPartDesignDuplicateSelection::activated(int iMsg)
|
||||
|
||||
for (auto feature : newFeatures) {
|
||||
if (PartDesign::Body::isAllowed(feature)) {
|
||||
FCMD_OBJ_CMD(pcActiveBody,"addObject(" << getObjectCmd(feature) << ")");
|
||||
FCMD_OBJ_HIDE(feature);
|
||||
// if feature already is in a body, then we don't put it into the active body issue #6278
|
||||
auto body = App::GeoFeatureGroupExtension::getGroupOfObject(feature);
|
||||
if (!body) {
|
||||
FCMD_OBJ_CMD(pcActiveBody,"addObject(" << getObjectCmd(feature) << ")");
|
||||
FCMD_OBJ_HIDE(feature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user