I ended up starting on some modifications to the dynamic spacebar code for technical drawing and threw this in as well, if anyone is interested here are the changes for /scripts/addons/space_view3d_spacebar_menu.py to produce a quick copy-angle-to-clipboard function on the dynamic spacebar menu (takes the cursor as the centerpoint and the angle between two selected objects - only works along the X/Y axis and ignores Z):
def copyAngleToClipboard(context, operator):
from math import fabs, pi, pow, sqrt
if len(context.selected_objects) != 2:
operator.report({'ERROR'}, "Two objects must be selected")
return None
obj = context.selected_objects[0]
obj2 = context.selected_objects[1]
if (obj.type != "CURVE"):
operator.report({'ERROR'}, "Both selected objects must be curves")
return None
if (obj2.type != "CURVE"):
operator.report({'ERROR'}, "Both selected objects must be curves")
return None
cx = context.scene.cursor_location[0]
cy = context.scene.cursor_location[1]
p1x = obj.location[0]
p1y = obj.location[1]
p2x = obj2.location[0]
p2y = obj2.location[1]
a1 = point2dAngle(cx, cy, p1x, p1y) * (180 / math.pi)
a2 = point2dAngle(cx, cy, p2x, p2y) * (180 / math.pi)
a = a2 - a1
if a1 > a2:
a = a1 - a2
operator.report({'INFO'}, str(a))
context.window_manager.clipboard = str(a)
return
class VIEW3D_OT_CopyAngleToClipboard(bpy.types.Operator):
"Copies the angle centered at the cursor between two selected objects to the clipboard"
bl_idname = "view3d.copy_angle_to_clipboard"
bl_label = "Copy Angle to Clipboard"
@classmethod
def poll(cls, context):
if len(context.selected_objects) != 2:
return None
obj = context.selected_objects[0]
obj2 = context.selected_objects[1]
return obj != None and obj2 != None
def execute(self, context):
copyAngleToClipboard(context, self)
return {'FINISHED'}
Then inside of VIEW3D_MT_CursorMenu and VIEW3D_MT_EditCursorMenu add the following two lines at the end (or wherever you want in the list):
layout.separator()
layout.operator("view3d.copy_angle_to_clipboard",
text="Copy Angle to Clipboard")