From 2214a01e99079a3bfb6d8f15393f0bb870dd0958 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 1 Mar 2016 16:37:28 +0300 Subject: [PATCH] Rectangle feature: coincidence debug: 1. lines should not be updated in execute because it is performed in attributeChanges [wrong case: create rectangle with coincidence to axis, solver move lines, but execute returns them back to rectangle's points]. 2. we need to flush created for coincidence[wrong case: after the first modification only one line is moved to axis, others are not moved] --- src/PartSet/PartSet_WidgetPoint2d.cpp | 2 +- src/PythonAddons/macros/rectangle/feature.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 03cd49c32..813741c88 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -418,7 +418,7 @@ void PartSet_WidgetPoint2D::setConstraintWith(const ObjectPtr& theObject) ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_B())); aRef2->setObject(theObject); - aFeature->execute(); + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED)); } void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) diff --git a/src/PythonAddons/macros/rectangle/feature.py b/src/PythonAddons/macros/rectangle/feature.py index aaa65512a..3679577c8 100644 --- a/src/PythonAddons/macros/rectangle/feature.py +++ b/src/PythonAddons/macros/rectangle/feature.py @@ -106,8 +106,8 @@ class SketchPlugin_Rectangle(model.Feature): aRefAttrB.setAttr(aLine.attribute("StartPoint")) # Flags which show horizontal or vertical constraint is build for correponding line self.__isHV = [False, False, False, False] - # Update coordinates of created lines - self.updateLines() + # Update coordinates of created lines + self.updateLines() # Add horizontal and vertical constraint for the lines which already have result for i in range (0, aNbLines): if self.__isHV[i]: -- 2.39.2