Draft: Reorganizing DraftEdit and future Draft command modules
This commit is contained in:
@@ -64,9 +64,6 @@ class ArchWorkbench(Workbench):
|
||||
FreeCADGui.addCommand('Arch_RebarTools', RebarGroupCommand())
|
||||
self.archtools[2] = "Arch_RebarTools"
|
||||
|
||||
# setup Draft_Edit command
|
||||
import DraftEdit
|
||||
FreeCADGui.addCommand('Draft_Edit',DraftEdit.Edit())
|
||||
|
||||
# draft tools
|
||||
self.drafttools = ["Draft_Line","Draft_Wire","Draft_Circle","Draft_Arc","Draft_Ellipse",
|
||||
|
||||
@@ -27,16 +27,24 @@ __title__="FreeCAD Draft Edit Tool"
|
||||
__author__ = "Yorik van Havre, Werner Mayer, Martin Burbaum, Ken Cline, Dmitry Chigrin"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
import FreeCAD, FreeCADGui, Draft, DraftTools, math
|
||||
import FreeCAD
|
||||
import Draft
|
||||
import math
|
||||
|
||||
from FreeCAD import Vector
|
||||
from DraftTrackers import *
|
||||
|
||||
from PySide import QtCore
|
||||
from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
from DraftTools import translate
|
||||
# Do not import GUI-related modules if GUI is not there
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
import DraftTools
|
||||
from DraftTrackers import *
|
||||
from PySide import QtCore
|
||||
from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
from DraftTools import translate
|
||||
|
||||
|
||||
class Edit():
|
||||
|
||||
"The Draft_Edit FreeCAD command definition"
|
||||
|
||||
def __init__(self):
|
||||
@@ -1125,3 +1133,9 @@ class Edit():
|
||||
self.obj.TagPosition = self.invpl.multVec(v)
|
||||
else:
|
||||
self.obj.Group[self.editing-1].Placement.Base = self.invpl.multVec(v)
|
||||
|
||||
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
# setup command
|
||||
FreeCADGui.addCommand('Draft_Edit', Edit())
|
||||
|
||||
@@ -46,6 +46,12 @@ from DraftSnap import *
|
||||
from DraftTrackers import *
|
||||
from pivy import coin
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Commands that have been migrated to their own modules
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
import DraftEdit
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Preflight stuff
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
@@ -65,7 +65,6 @@ class DraftWorkbench(Workbench):
|
||||
# Import Draft tools, icons
|
||||
try:
|
||||
import os, Draft_rc, DraftTools, DraftGui
|
||||
import DraftEdit
|
||||
from DraftTools import translate
|
||||
FreeCADGui.addLanguagePath(":/translations")
|
||||
FreeCADGui.addIconPath(":/icons")
|
||||
@@ -73,9 +72,6 @@ class DraftWorkbench(Workbench):
|
||||
print(inst)
|
||||
FreeCAD.Console.PrintError("Error: Initializing one or more of the Draft modules failed, Draft will not work as expected.\n")
|
||||
|
||||
# setup commands
|
||||
FreeCADGui.addCommand('Draft_Edit', DraftEdit.Edit())
|
||||
|
||||
# setup menus
|
||||
self.cmdList = ["Draft_Line", "Draft_Wire", "Draft_Circle",
|
||||
"Draft_ArcTools", "Draft_Ellipse",
|
||||
|
||||
Reference in New Issue
Block a user