From: mpv Date: Wed, 7 Sep 2016 13:56:42 +0000 (+0300) Subject: Fix for the dump to python for model from the issue #1739 X-Git-Tag: V_2.5.0~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fa96e988fcff7caf36ead00e027021fda402fdc3;p=modules%2Fshaper.git Fix for the dump to python for model from the issue #1739 --- diff --git a/src/Model/Model_SelectionNaming.cpp b/src/Model/Model_SelectionNaming.cpp index 3b2cfba31..567d4a867 100644 --- a/src/Model/Model_SelectionNaming.cpp +++ b/src/Model/Model_SelectionNaming.cpp @@ -75,8 +75,13 @@ std::string Model_SelectionNaming::getShapeName( int aDepth = anObjL.Depth(); if (aDepth == 5 || aDepth == 7) { ObjectPtr anObj = theDoc->objects()->object(anObjL); - if (anObj) { - aName = anObj->data()->name() + "/" + aName; + if (anObj.get()) { + ResultPtr aRes = std::dynamic_pointer_cast(anObj); + if (aRes.get()) { + if (aRes && !aRes->shape()->impl().IsEqual(theShape)) { + aName = anObj->data()->name() + "/" + aName; + } + } } } }