From 0273391211e46e7f85bf8a1e377c39fdb74b6be0 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Mon, 22 Jul 2024 12:21:59 +0200 Subject: [PATCH] Assembly: BOM tool: Do not list Groups. --- src/Mod/Assembly/App/BomObject.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/Mod/Assembly/App/BomObject.cpp b/src/Mod/Assembly/App/BomObject.cpp index 2467f39505..1e966e5ed0 100644 --- a/src/Mod/Assembly/App/BomObject.cpp +++ b/src/Mod/Assembly/App/BomObject.cpp @@ -46,9 +46,6 @@ #include "AssemblyObject.h" -#include "BomGroup.h" -#include "JointGroup.h" -#include "ViewGroup.h" #include "BomObject.h" #include "BomObjectPy.h" @@ -188,8 +185,8 @@ void BomObject::addObjectChildrenToBom(std::vector objs, } } - if (child->isDerivedFrom() || child->isDerivedFrom() - || child->isDerivedFrom()) { + if (!child->isDerivedFrom() && !child->isDerivedFrom() + && !(child->isDerivedFrom() && !onlyParts.getValue())) { continue; } @@ -213,21 +210,15 @@ void BomObject::addObjectChildrenToBom(std::vector objs, } } - if (child->isDerivedFrom() - || child->isDerivedFrom() || child->isDerivedFrom() - || (child->isDerivedFrom() && !onlyParts.getValue())) { + std::string sub_index = index + std::to_string(sub_i); + ++sub_i; - std::string sub_index = index + std::to_string(sub_i); - ++sub_i; + addObjectToBom(child, row, sub_index); + ++row; - addObjectToBom(child, row, sub_index); - ++row; - - if (child->isDerivedFrom() - || (child->isDerivedFrom() && detailSubAssemblies.getValue()) - || (child->isDerivedFrom() && detailParts.getValue())) { - addObjectChildrenToBom(child->getOutList(), row, sub_index); - } + if ((child->isDerivedFrom() && detailSubAssemblies.getValue()) + || (child->isDerivedFrom() && detailParts.getValue())) { + addObjectChildrenToBom(child->getOutList(), row, sub_index); } } }