diff --git a/src/Mod/OpenSCAD/OpenSCADCommands.py b/src/Mod/OpenSCAD/OpenSCADCommands.py index 93b9f8d92e..5d85395d06 100644 --- a/src/Mod/OpenSCAD/OpenSCADCommands.py +++ b/src/Mod/OpenSCAD/OpenSCADCommands.py @@ -199,6 +199,8 @@ class AddSCADTask: FreeCAD.Console.PrintError(unicode(translate('OpenSCAD','Running OpenSCAD failed'))+u'\n') class AddOpenSCADElement: + def IsActive(self): + return not FreeCADGui.Control.activeDialog() def Activated(self): panel = AddSCADTask() FreeCADGui.Control.showDialog(panel) diff --git a/src/Mod/OpenSCAD/importCSG.py b/src/Mod/OpenSCAD/importCSG.py index d6c34ceb6c..39b520c5a9 100644 --- a/src/Mod/OpenSCAD/importCSG.py +++ b/src/Mod/OpenSCAD/importCSG.py @@ -539,7 +539,10 @@ def p_linear_extrude_with_twist(p): print "Linear Extrude With Twist" h = float(p[3]['height']) print "Twist : ",p[3] - t = float(p[3]['twist']) + if 'twist' in p[3]: + t = float(p[3]['twist']) + else: + t = 0 if (len(p[6]) > 1) : obj = fuse(p[6],"Linear Extrude Union") else : @@ -862,7 +865,7 @@ def p_square_action(p) : mysquare = doc.addObject('Part::Plane',p[1]) mysquare.Length=x mysquare.Width=y - if p[9]=='true' : + if p[3]['center']=='true' : center(mysquare,x,y,0) p[0] = [mysquare] diff --git a/src/Mod/OpenSCAD/replaceobj.py b/src/Mod/OpenSCAD/replaceobj.py index 54185734c2..f5e50fedf7 100644 --- a/src/Mod/OpenSCAD/replaceobj.py +++ b/src/Mod/OpenSCAD/replaceobj.py @@ -11,14 +11,15 @@ def replaceobj(parent,oldchild,newchild): setattr(parent,propname,newchild) print propname, parent.getPropertyByName(propname) #else: print propname,propvalue + parent.touch() def replaceobjfromselection(objs): assert(len(objs)==3) - if objs[0] in objs[1].InList: parent, oldchild, newchild = objs + if objs[2] in objs[0].InList: oldchild, newchild, parent = objs + elif objs[0] in objs[1].InList: parent, oldchild, newchild = objs elif objs[0] in objs[2].InList: parent, newchild, oldchild = objs elif objs[1] in objs[0].InList: oldchild, parent, newchild = objs elif objs[1] in objs[2].InList: newchild, parent, oldchild = objs - elif objs[2] in objs[0].InList: oldchild, newchild, parent = objs elif objs[2] in objs[1].InList: newchild, oldchild, parent = objs else: assert(False) replaceobj(parent,oldchild,newchild)