Small bugfixes in Draft

+ Draft point is now disabled when no document is open
+ Fix in Draft DXF import
This commit is contained in:
Yorik van Havre 2012-03-10 20:09:56 -03:00
parent 5496acdcf1
commit 1ba8d73933
2 changed files with 9 additions and 3 deletions

View File

@ -3604,6 +3604,12 @@ class Point:
return {'Pixmap' : 'Draft_Point',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_Point", "Point"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_Point", "Creates a point object")}
def IsActive(self):
if FreeCADGui.ActiveDocument:
return True
else:
return False
def Activated(self):
self.view = FreeCADGui.ActiveDocument.ActiveView

View File

@ -1085,11 +1085,11 @@ def processdxf(document,filename):
if fmt.makeBlocks:
addToBlock(s,lay)
else:
newob = doc.addObject("Part::Feature","Hatch")
newob.Shape = s
newob = addObject(s,"Hatch",lay)
if gui:
fmt.formatObject(newob,hatch)
else:
newob = Draft.makeWire(points)
if newob:
locateLayer(lay).addObject(newob)
if gui:
fmt.formatObject(newob,hatch)