From 0b6957d1436d25b1e8baa5bf0e11eac3f875c586 Mon Sep 17 00:00:00 2001 From: mbs Date: Wed, 11 Sep 2024 18:29:33 +0100 Subject: [PATCH] [GITHUB #2] problem in export dialog - difference in STEP vs BREP When selecting a feature, the context is a Feature and not a Result. Therefore, the result pointer is NULL and causes a SIGSEGV on Linux. On Windows, the exception is caught in Model_Update::executeFeature(). --- src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp index 651b1b401..a02cf6809 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp @@ -142,9 +142,12 @@ bool STEPExport(const std::string& theFileName, getAttributes(*aResult, anAttrs); exportShape(*aShape, anAttrs, GeomShapePtr(), aNullLab); } - else { // whole result selection + else if (aResult->get()) { // whole result selection putResult(*aResult, GeomShapePtr(), aNullLab, anAttrs); } + else { // feature selection => export simple shape + exportShape(*aShape, anAttrs, GeomShapePtr(), aNullLab); + } } // store the XCAF document to STEP file try { -- 2.39.2