Arch/Draft: Fixed bugs in non-GUI mode

This commit is contained in:
Yorik van Havre
2018-06-11 21:44:23 -03:00
parent 2f18182b6d
commit 0fcb378f02
2 changed files with 17 additions and 14 deletions

View File

@@ -629,23 +629,26 @@ class Component:
def hideSubobjects(self,obj,prop):
"Hides subobjects when a subobject lists change"
if prop in ["Additions","Subtractions"]:
if hasattr(obj,prop):
for o in getattr(obj,prop):
if (Draft.getType(o) != "Window") and (not Draft.isClone(o,"Window",True)):
if (Draft.getType(obj) == "Wall"):
if (Draft.getType(o) == "Roof"):
continue
if FreeCAD.GuiUp:
if prop in ["Additions","Subtractions"]:
if hasattr(obj,prop):
for o in getattr(obj,prop):
if (Draft.getType(o) != "Window") and (not Draft.isClone(o,"Window",True)):
if (Draft.getType(obj) == "Wall"):
if (Draft.getType(o) == "Roof"):
continue
o.ViewObject.hide()
elif prop in ["Mesh"]:
if hasattr(obj,prop):
o = getattr(obj,prop)
if o:
o.ViewObject.hide()
elif prop in ["Mesh"]:
if hasattr(obj,prop):
o = getattr(obj,prop)
if o:
o.ViewObject.hide()
def processSubShapes(self,obj,base,placement=None):
"Adds additions and subtractions to a base shape"
import Draft,Part
#print("Processing subshapes of ",obj.Label, " : ",obj.Additions)

View File

@@ -47,11 +47,11 @@ __url__ = "http://www.freecadweb.org"
'''The Draft module offers a range of tools to create and manipulate basic 2D objects'''
import FreeCAD, math, sys, os, DraftVecUtils, Draft_rc, WorkingPlane
import FreeCAD, math, sys, os, DraftVecUtils, WorkingPlane
from FreeCAD import Vector
if FreeCAD.GuiUp:
import FreeCADGui
import FreeCADGui, Draft_rc
from PySide import QtCore
from PySide.QtCore import QT_TRANSLATE_NOOP
gui = True