Fem: Do not allow selection of external objects for analysis objects - fixes #23834

This commit is contained in:
marioalexis
2025-09-16 00:24:21 -03:00
committed by Chris Hennes
parent a85f53d0bb
commit df82e7b71c
13 changed files with 129 additions and 28 deletions

View File

@@ -119,9 +119,16 @@ void TaskFemConstraintFixed::addToSelection()
QMessageBox::warning(this, tr("Selection error"), tr("Selected object is not a part!"));
return;
}
std::vector<std::string> subNames = it.getSubNames();
App::DocumentObject* obj =
ConstraintView->getObject()->getDocument()->getObject(it.getFeatName());
App::DocumentObject* obj = it.getObject();
if (obj->getDocument() != pcConstraint->getDocument()) {
QMessageBox::warning(this,
tr("Selection error"),
tr("External object selection is not supported"));
return;
}
const std::vector<std::string>& subNames = it.getSubNames();
for (const auto& subName : subNames) { // for every selected sub element
bool addMe = true;
for (auto itr = std::ranges::find(SubElements, subName); itr != SubElements.end();