|
|
|
@ -150,6 +150,18 @@ class TechDrawExtensions:
|
|
|
|
|
cursor.setViewPos(App.Vector(selected_balloons[0].OriginX, selected_balloons[0].OriginY)) |
|
|
|
|
cursor.setVisible(True) |
|
|
|
|
|
|
|
|
|
def refreshView(self, view): |
|
|
|
|
doc = view.Document |
|
|
|
|
page = self.getViewPage(view) |
|
|
|
|
for balloon in page.Views: |
|
|
|
|
if balloon.TypeId == 'TechDraw::DrawViewBalloon' and "Assembly_handbook_PartName" in balloon.PropertiesList and balloon.SourceView == view: |
|
|
|
|
obj = doc.getObject(balloon.Assembly_handbook_PartName) |
|
|
|
|
balloonColor = (0.0, 0.0, 0.0) |
|
|
|
|
if obj is None or not obj in view.XSource: |
|
|
|
|
balloonColor = (1.0, 0.0, 0.0) |
|
|
|
|
balloon.ViewObject.Color = balloonColor |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def toggleEditViewSourceParts(self, view): |
|
|
|
|
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") #: :type workbench: AssemblyHandbookWorkbench |
|
|
|
|
|
|
|
|
@ -272,8 +284,16 @@ class TechDrawExtensions:
|
|
|
|
|
return None |
|
|
|
|
|
|
|
|
|
def forceRedrawPage(self, page, callback = None): |
|
|
|
|
for view in page.Views: |
|
|
|
|
if view.TypeId == 'TechDraw::DrawViewPart' and 'Assembly_handbook_PreviousStepView' in view.PropertiesList: |
|
|
|
|
self.refreshView(view) |
|
|
|
|
|
|
|
|
|
if page.KeepUpdated: |
|
|
|
|
for view in page.Views: |
|
|
|
|
if view.TypeId != 'TechDraw::DrawViewPart': |
|
|
|
|
view.recompute() |
|
|
|
|
for view in page.Views: |
|
|
|
|
if view.TypeId == 'TechDraw::DrawViewPart': |
|
|
|
|
view.recompute() |
|
|
|
|
if callback is not None: |
|
|
|
|
callback() |
|
|
|
|