예제 #1
0
 def Activated(self):
   import polarUtilsCmd as puc
   import FreeCAD
   doc=FreeCAD.activeDocument()
   sketch=doc.addObject("Sketcher::SketchObject","imported")
   sketch.Placement = FreeCAD.Placement(FreeCAD.Vector(0.000000,0.000000,0.000000),FreeCAD.Rotation(0.000000,0.000000,0.000000,1.000000))
   puc.disegna(sketch,puc.getFromFile())
예제 #2
0
 def Activated(self):
   import polarUtilsCmd as puc
   import FreeCAD, FreeCADGui
   from PySide import QtGui as qg
   if (FreeCADGui.Selection.countObjectsOfType('Sketcher::SketchObject')==0):
     qg.QMessageBox().information(None,'Incorrect input','First select at least one sketch.')
   else:
     n=int(qg.QInputDialog.getText(None,"draw a Polygon","Number of sides?")[0])
     R=float(qg.QInputDialog.getText(None,"draw a Polygon","Radius of circumscribed circle?")[0])
     for sk in FreeCADGui.Selection.getSelection():
       if sk.TypeId=="Sketcher::SketchObject":
         puc.disegna(sk,puc.cerchio(R,n))