From 53445a818411b3b71e3457f5e2e97c5f23d69cb7 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 18 Dec 2018 09:50:01 +0300 Subject: [PATCH] Finalization of the sketch drawer "Create dimensions" flag implemented --- src/SketchPlugin/Test/TestSketchDrawer.py | 28 +++++++++++++----- .../doc/images/SketchDrawer_panel.png | Bin 4522 -> 5153 bytes src/SketchPlugin/doc/sketchDrawer.rst | 5 ++++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/SketchPlugin/Test/TestSketchDrawer.py b/src/SketchPlugin/Test/TestSketchDrawer.py index b90c9489c..351adabeb 100644 --- a/src/SketchPlugin/Test/TestSketchDrawer.py +++ b/src/SketchPlugin/Test/TestSketchDrawer.py @@ -44,19 +44,31 @@ SketchConstraintRadius_2 = Sketch_1.setRadius(SketchCircle_1.results()[1], 5) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchCircle_1_2r")], model.selection(), 10, 0) model.do() -# create a drawer feature of the extrusion and upper face -Drawer = Part_1_doc.addFeature("SketchDrawer") -Drawer.selection("base_shape").setValue(Extrusion_1.feature(), None) +# create a drawer feature of the extrusion and upper face, without dimensions +Drawer1 = Part_1_doc.addFeature("SketchDrawer") +Drawer1.selection("base_shape").setValue(Extrusion_1.feature(), None) +Drawer1.boolean("add_dimensions").setValue(False) PlaneSelection = model.selection("FACE", "Extrusion_1_1/To_Face") -PlaneSelection.fillAttribute(Drawer.selection("plane")) +PlaneSelection.fillAttribute(Drawer1.selection("plane")) +model.do() +# create a drawer feature of the extrusion and upper face, with dimensions +Drawer2 = Part_1_doc.addFeature("SketchDrawer") +Drawer2.selection("base_shape").setValue(Extrusion_1.feature(), None) +Drawer2.boolean("add_dimensions").setValue(True) +PlaneSelection = model.selection("FACE", "Extrusion_1_1/To_Face") +PlaneSelection.fillAttribute(Drawer2.selection("plane")) model.end() # check that a sketch is created with valid elements -assert(Part_1_doc.size("Construction") == 2) # two sketches: base of extrusion and this new one +assert(Part_1_doc.size("Construction") == 3) # three sketches: base of extrusion and drawer's two from ModelAPI import * aFactory = ModelAPI_Session.get().validators() -Sketch = objectToFeature(Part_1_doc.object("Features", 2)) # created sketch feature -assert(aFactory.validate(Sketch)) -assert(len(Sketch.results()) == 1) +Sketch1 = objectToFeature(Part_1_doc.object("Features", 2)) # the first created sketch feature +assert(aFactory.validate(Sketch1)) +assert(len(Sketch1.results()) == 1) + +Sketch2 = objectToFeature(Part_1_doc.object("Features", 3)) # the second created sketch feature +assert(aFactory.validate(Sketch2)) +assert(len(Sketch2.results()) == 1) diff --git a/src/SketchPlugin/doc/images/SketchDrawer_panel.png b/src/SketchPlugin/doc/images/SketchDrawer_panel.png index 8b786503df9652695d63377c2d26db4f609c78eb..6d7db60b7163268fde92165cef8176e0155415e5 100644 GIT binary patch literal 5153 zcmbVQXIK;6wjPy^1(4oBk)}jYsx&Fm2@s?kq!%ed5DZlm1*8O&-l8-Cg#gk?0BNB| zf`B4LAoLzUAhZ*|?>YB7Kkhw0?vL5CXZG4_mwDg4-ZjxihFTZsIOzZYxS*r0VFCbW zK;(J~4HdaWcw8JL-zZ$}8r%hd3IzR;9VPjh_OZ4l3;-^+{<+Sui0D2ezvT4OwD5y? zJNpIL`8okcc5YsN5{8?Nw7QL^j_0M{0ScN_!%i&4eC%y0^iTZ%&G*=ZS~ zYH2yQnfTk=E*^BKtgTNp4L?vCmL9$}k-?}Rz0rS=m0s3xf8q_E&nwv~C*yOrFf9Oh zsCUK8dQYj4S0?@p4FG0m;b(wX5eqn~#jUoWoy8NLE8}~z!Y<_w{2-tuA)(PH*(wF} z9u9NinpPg*SY_{`2X0=yZd;jP7&aj>sj}7##>D%T*{rgTH^8$EtN0k@Noj8l53|QF zGz=e>P7Q3-#~l*VEQq-tuif3<6-`2eO0F?>ePn)-9Z*z84KQR|@)_<<*(!&njFjmP zW!&$7UNdrg;&9!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