def Activated(self): import pipeCmd, frameCmd from Part import Plane refFace = [f for f in frameCmd.faces() if type(f.Surface) == Plane][0] FreeCAD.activeDocument().openTransaction('Lay-down the pipe') for b in frameCmd.beams(): if pipeCmd.isPipe(b): pipeCmd.laydownTheTube(b, refFace) FreeCAD.activeDocument().recompute() FreeCAD.activeDocument().commitTransaction()
def Activated (self): import pipeCmd, frameCmd from Part import Plane refFace=[f for f in frameCmd.faces() if type(f.Surface)==Plane][0] FreeCAD.activeDocument().openTransaction('Lay-down the pipe') for b in frameCmd.beams(): if pipeCmd.isPipe(b): pipeCmd.laydownTheTube(b,refFace) FreeCAD.activeDocument().recompute() FreeCAD.activeDocument().commitTransaction()
def Activated (self): import pipeCmd, frameCmd from Part import Plane selex=FreeCADGui.Selection.getSelectionEx() for sx in selex: sxFaces=[f for f in frameCmd.faces([sx]) if type(f.Surface)==Plane] if len(sxFaces)>0: refFace=sxFaces[0] support=sx.Object FreeCAD.activeDocument().openTransaction('Raise-up the support') for b in frameCmd.beams(): if pipeCmd.isPipe(b): pipeCmd.laydownTheTube(b,refFace,support) break FreeCAD.activeDocument().recompute() FreeCAD.activeDocument().commitTransaction()