@ -94,6 +94,7 @@ class TechDrawExtensions:
def _do_repaint ( self ) :
from ahb_raster_view import RasterView
import Draft
workbench = Gui . getWorkbench ( " AssemblyHandbookWorkbench " ) #: :type workbench: AssemblyHandbookWorkbench
@ -133,44 +134,28 @@ class TechDrawExtensions:
overlay_frame_name = view . Label + " _frame "
overlay_frame = doc . getObject ( overlay_frame_name )
if overlay_frame is None :
import Draft
'''
points = [ App . Vector ( 0.0 , 0.0 , 0.0 ) , App . Vector ( 1.01 , 0 , 0 ) ]
obj1 = Draft . makeWire ( points , closed = False , face = False , support = None )
points = [ App . Vector ( 200.0 , 0.0 , 0.0 ) , App . Vector ( 201.01 , 0 , 0 ) ]
obj2 = Draft . makeWire ( points , closed = False , face = False , support = None )
#overlay_frame = Draft.upgrade([], delete=True)
#overlay_frame.Label = overlay_frame_name
overlay_frame = App . ActiveDocument . addObject ( " Part::Part2DObjectPython " , overlay_frame_name )
Draft . Block ( overlay_frame )
overlay_frame . Components = [ obj1 , obj2 ]
Draft . ViewProviderDraftPart ( overlay_frame . ViewObject )
doc . removeObject ( obj1 . Name )
doc . removeObject ( obj2 . Name ) '''
#overlay_frame = Draft.makeWire(points, closed=False, face=False, support=None)
overlay_frame = App . ActiveDocument . addObject ( " Part::Part2DObjectPython " , overlay_frame_name )
Draft . Wire ( overlay_frame )
pos = raster_view . projectImageViewPointTo3D ( App . Vector ( 0 , 0 , 0 ) )
pos2 = raster_view . projectImageViewPointTo3D ( App . Vector ( 0.001 , 0.001 , 1 ) )
overlay_frame . Points = [ pos , pos2 ]
Draft . ViewProviderWire ( overlay_frame . ViewObject )
overlay_frame . recompute ( )
if overlay_frame is not None :
doc . removeObject ( overlay_frame . Name )
#overlay_frame = Draft.makeWire(points, closed=False, face=False, support=None)
overlay_frame = doc . addObject ( " Part::Part2DObjectPython " , overlay_frame_name )
Draft . Wire ( overlay_frame )
pos = raster_view . projectImageViewPointTo3D ( App . Vector ( 0 , 0 , 0 ) )
pos2 = raster_view . projectImageViewPointTo3D ( App . Vector ( 0.001 , 0.001 , 1 ) )
overlay_frame . Points = [ pos , pos2 ]
Draft . ViewProviderWire ( overlay_frame . ViewObject )
overlay_frame . recompute ( )
overlay_frame2_name = view . Label + " _frame2 "
overlay_frame2 = doc . getObject ( overlay_frame2_name )
if overlay_frame2 is None :
overlay_frame2 = App . ActiveDocument . addObject ( " Part::Part2DObjectPython " , overlay_frame2_name )
Draft . Wire ( overlay_frame2 )
pos = raster_view . projectImageViewPointTo3D ( App . Vector ( 1 , 1 , 0 ) )
pos2 = raster_view . projectImageViewPointTo3D ( App . Vector ( 1.001 , 1.001 , 1 ) )
overlay_frame2 . Points = [ pos , pos2 ]
Draft . ViewProviderWire ( overlay_frame2 . ViewObject )
overlay_frame2 . recompute ( )
if overlay_frame2 is not None :
doc . removeObject ( overlay_frame2 . Name )
overlay_frame2 = doc . addObject ( " Part::Part2DObjectPython " , overlay_frame2_name )
Draft . Wire ( overlay_frame2 )
pos = raster_view . projectImageViewPointTo3D ( App . Vector ( 1 , 1 , 0 ) )
pos2 = raster_view . projectImageViewPointTo3D ( App . Vector ( 1.001 , 1.001 , 1 ) )
overlay_frame2 . Points = [ pos , pos2 ]
Draft . ViewProviderWire ( overlay_frame2 . ViewObject )
overlay_frame2 . recompute ( )
overlay . Source = [ overlay_frame , overlay_frame2 ]