From 46d404fab4bcaba11e1fcef9c0593e594332c3cf Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 2 May 2012 10:55:35 +0000 Subject: [PATCH] IPAL22904: TC6.5.0: order of python commands is wrong after dump study --- src/GEOMImpl/GEOMImpl_IShapesOperations.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index 01cd12806..8577ac995 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -2052,7 +2052,21 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetSharedShapes // Make a Python command anAsciiList.Trunc(anAsciiList.Length() - 1); - GEOM::TPythonDump pd (aMainShape, /*append=*/true); + // IPAL22904: TC6.5.0: order of python commands is wrong after dump study + Handle(TColStd_HSequenceOfTransient) anObjects = new TColStd_HSequenceOfTransient; + for( it = theShapes.begin(); it != theShapes.end(); it++ ) + { + Handle(GEOM_Object) anObj = *it; + if( !anObj.IsNull() ) + anObjects->Append( anObj ); + } + + // Get the function of the latest published object + Handle(GEOM_Function) aFunction = GEOM::GetCreatedLast( anObjects )->GetLastFunction(); + if( aFunction.IsNull() ) // just in case + aFunction = aMainShape; + + GEOM::TPythonDump pd (aFunction, /*append=*/true); pd << "[" << anAsciiList.ToCString() << "] = geompy.GetSharedShapesMulti(["; -- 2.39.2