From: dbv Date: Thu, 18 Aug 2016 13:26:48 +0000 (+0300) Subject: Issue #1648: Dump Python in the High Level Parameterized Geometry API X-Git-Tag: V_2.5.0~137^2~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cb939ec24d05de2dd83f7d2489feb807368464b5;p=modules%2Fshaper.git Issue #1648: Dump Python in the High Level Parameterized Geometry API Tests fix --- diff --git a/src/Model/Model_Expression.cpp b/src/Model/Model_Expression.cpp index 73484f328..7082bd60c 100644 --- a/src/Model/Model_Expression.cpp +++ b/src/Model/Model_Expression.cpp @@ -108,7 +108,7 @@ Model_ExpressionDouble::Model_ExpressionDouble(TDF_Label& theLabel) void Model_ExpressionDouble::setValue(const double theValue) { - if (!myIsInitialized) { + if (!myIsInitialized || myReal.IsNull()) { myReal = TDataStd_Real::Set(myText->Label(), theValue); myIsInitialized = true; } else if (value() != theValue) { @@ -149,7 +149,7 @@ Model_ExpressionInteger::Model_ExpressionInteger(TDF_Label& theLabel) void Model_ExpressionInteger::setValue(const int theValue) { - if (!myIsInitialized) { + if (!myIsInitialized || myInteger.IsNull()) { myInteger = TDataStd_Integer::Set(myText->Label(), theValue); myIsInitialized = true; } else if (value() != theValue) { diff --git a/src/PythonAPI/examples/MakeBrick1.py b/src/PythonAPI/examples/MakeBrick1.py index 74ce79686..2e0c10cab 100644 --- a/src/PythonAPI/examples/MakeBrick1.py +++ b/src/PythonAPI/examples/MakeBrick1.py @@ -35,26 +35,32 @@ mybase.setParallel(l2, l4) mybase.setPerpendicular(l1, l4) +mybase.setVertical(l1) +mybase.setFixed(l1.startPoint()) + mywidth = mybase.setLength(l1, 50) mylength = mybase.setDistance(l1.startPoint(), l3, 50) # Creating the extrusion mybox = model.addExtrusion(mypart, mybase.selectFace(), 50) +model.do() # Creating a cylinder on a face of the box thisface = "Extrusion_1_1/Generated_Face_2" -thisxmin = "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2" -thisxmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1" -thiszmin = "Sketch_1/Edge5_1" +thisxmax = "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2" thiszmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1" mystand = model.addSketch(mypart, thisface) c1 = mystand.addCircle(0, 25, 5) -mystand.setDistance(c1.center(), mystand.addLine(thisxmin), 10) -mystand.setDistance(c1.center(), mystand.addLine(thiszmax), 10) +l1 = mystand.addLine(thisxmax) +l2 = mystand.addLine(thiszmax) +model.do() +mystand.setDistance(c1.center(), l1, 10) +mystand.setDistance(c1.center(), l2, 10) +model.do() myboss = model.addExtrusion(mypart, mystand.selectFace(), -5) @@ -69,6 +75,7 @@ model.end() model.begin() mybase.setValue(mylength, 100) +model.do() mybox.setSize(80) model.end()