[Part] Section Cut: also handle normal Link objects
Link objects within App::Part containers were already handled but not Link objects outside
This commit is contained in:
@@ -328,7 +328,7 @@ void SectionCut::startCutting(bool isInitial)
|
||||
// those that have a solid shape
|
||||
std::vector<App::DocumentObject*> ObjectsListCut;
|
||||
for (it = ObjectsListVisible.begin(); it != ObjectsListVisible.end(); ++it) {
|
||||
// we need all Link objects in App::Parts for example for Assembly 4
|
||||
// we need all Link objects in App::Part for example for Assembly 4
|
||||
if (it->getObject()->getTypeId() == Base::Type::fromName("App::Part")) {
|
||||
App::Part* pcPart = static_cast<App::Part*>(it->getObject());
|
||||
bool isLinkAssembly = false;
|
||||
@@ -363,6 +363,13 @@ void SectionCut::startCutting(bool isInitial)
|
||||
&& it->getObject()->getTypeId() != Base::Type::fromName("App::Part"))
|
||||
ObjectsListCut.push_back(it->getObject());
|
||||
}
|
||||
// get Links that are derived from Part objects
|
||||
if (it->getObject()->getTypeId() == Base::Type::fromName("App::Link")) {
|
||||
App::Link* pcLink = static_cast<App::Link*>(it->getObject());
|
||||
auto linkedObject = doc->getObject(pcLink->LinkedObject.getObjectName());
|
||||
if (linkedObject && linkedObject->getTypeId().isDerivedFrom(Base::Type::fromName("Part::Feature")))
|
||||
ObjectsListCut.push_back(it->getObject());
|
||||
}
|
||||
}
|
||||
|
||||
// sort out objects that are part of Part::Boolean, Part::MultiCommon, Part::MultiFuse,
|
||||
|
||||
Reference in New Issue
Block a user