From 068f02c4b786bc425b44b7f8eec77ea6beab7f61 Mon Sep 17 00:00:00 2001 From: Uwe Date: Tue, 8 Mar 2022 06:25:35 +0100 Subject: [PATCH] [Part] Section Cut: also handle normal Link objects Link objects within App::Part containers were already handled but not Link objects outside --- src/Mod/Part/Gui/SectionCutting.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/Gui/SectionCutting.cpp b/src/Mod/Part/Gui/SectionCutting.cpp index 6b9c28f4fb..0d053f8094 100644 --- a/src/Mod/Part/Gui/SectionCutting.cpp +++ b/src/Mod/Part/Gui/SectionCutting.cpp @@ -328,7 +328,7 @@ void SectionCut::startCutting(bool isInitial) // those that have a solid shape std::vector 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(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(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,