Draft Namespace Reference

Classes

class  AngularDimension
class  Block
class  BSpline
class  Circle
class  Dimension
class  DrawingView
class  Polygon
class  Rectangle
class  Shape2DView
class  ViewProviderAngularDimension
class  ViewProviderBlock
class  ViewProviderBSpline
class  ViewProviderDimension
class  ViewProviderDraft
class  ViewProviderRectangle
class  ViewProviderWire
class  Wire

Functions

def array
def cut
def dimSymbol
def draftify
def extrude
def formatObject
def fuse
def getGroupContents
def getGroupNames
def getParam
def getParamType
def getRealName
def getrgb
def getSelection
def getSVG
def getType
def makeAngularDimension
def makeBlock
def makeBSpline
def makeCircle
def makeCopy
def makeDimension
def makeDrawingView
def makeLine
def makePolygon
def makeRectangle
def makeShape2DView
def makeText
def makeWire
def move
def offset
def precision
def rotate
def scale
def select
def setParam
def shapify
def tolerance
def typecheck
def ungroup

Variables

string __author__ = "Yorik van Havre, Werner Mayer, Martin Burbaum, Ken Cline, Dmitry Chigrin"
string __title__ = "FreeCAD Draft Workbench"
string __url__ = "http://free-cad.sourceforge.net"

Function Documentation

def Draft::array (   objectslist,
  arg1,
  arg2,
  arg3,
  arg4 = None 
)
array(objectslist,xvector,yvector,xnum,ynum) for rectangular array, or
array(objectslist,center,totalangle,totalnum) for polar array: Creates an array
of the objects contained in list (that can be an object or a list of objects)
with, in case of rectangular array, xnum of iterations in the x direction
at xvector distance between iterations, and same for y direction with yvector
and ynum. In case of polar array, center is a vector, totalangle is the angle
to cover (in degrees) and totalnum is the number of objects, including the original.

Definition at line 636 of file Draft.py.

def Draft::cut (   object1,
  object2 
)
cut(oject1,object2): returns a cut object made from
the difference of the 2 given objects.

Definition at line 576 of file Draft.py.

def Draft::dimSymbol (  ) 

Definition at line 177 of file Draft.py.

def Draft::draftify (   objectslist  ) 
draftify(objectslist): turns each object of the given list
(objectslist can also be a single object) into a Draft parametric
wire

Definition at line 879 of file Draft.py.

def Draft::extrude (   obj,
  vector 
)
makeExtrusion(object,vector): extrudes the given object
in the direction given by the vector. The original object
gets hidden.

Definition at line 545 of file Draft.py.

def Draft::formatObject (   target,
  origin = None 
)
formatObject(targetObject,[originObject]): This function applies
to the given target object the current properties 
set on the toolbar (line color and line width),
or copies the properties of another object if given as origin.
It also places the object in construction group if needed.

Definition at line 220 of file Draft.py.

def Draft::fuse (   object1,
  object2 
)
fuse(oject1,object2): returns an object made from
the union of the 2 given objects. If the objects are
coplanar, a special Draft Wire is used, otherwise we use
a standard Part fuse.

Definition at line 557 of file Draft.py.

def Draft::getGroupContents (   objectslist  ) 
getGroupContents(objectlist): if any object of the given list
is a group, its content is appened to the list, which is returned

Definition at line 209 of file Draft.py.

def Draft::getGroupNames (  ) 

Definition at line 161 of file Draft.py.

def Draft::getParam (   param  ) 

Definition at line 110 of file Draft.py.

def Draft::getParamType (   param  ) 

Definition at line 94 of file Draft.py.

def Draft::getRealName (   name  ) 

Definition at line 139 of file Draft.py.

def Draft::getrgb (   color  ) 

Definition at line 907 of file Draft.py.

def Draft::getSelection (  ) 

Definition at line 270 of file Draft.py.

def Draft::getSVG (   obj,
  modifier = 100,
  textmodifier = 100,
  linestyle = "continuous",
  fillstyle = "shape color",
  direction = None 
)
getSVG(object,[modifier],[textmodifier],[linestyle],[fillstyle],[direction]):
returns a string containing a SVG representation of the given object. the modifier attribute
specifies a scale factor for linewidths in %, and textmodifier specifies
a scale factor for texts, in % (both default = 100). You can also supply
an arbitrary projection vector.

Definition at line 914 of file Draft.py.

def Draft::getType (   obj  ) 
def Draft::makeAngularDimension (   center,
  angles,
  p3 
)
makeAngularDimension(center,[angle1,angle2],p3): creates an angular Dimension
from the given center, with the given list of angles, passing through p3.

Definition at line 366 of file Draft.py.

def Draft::makeBlock (   objectslist  ) 
makeBlock(objectslist): Creates a Draft Block from the given objects

Definition at line 534 of file Draft.py.

def Draft::makeBSpline (   pointslist,
  closed = False,
  placement = None,
  face = True,
  support = None 
)
makeBSpline(pointslist,[closed],[placement]): Creates a B-Spline object
from the given list of vectors. If closed is True or first
and last points are identical, the wire is closed. If face is
true (and wire is closed), the wire will appear filled. Instead of
a pointslist, you can also pass a Part Wire.

Definition at line 444 of file Draft.py.

def Draft::makeCircle (   radius,
  placement = None,
  face = True,
  startangle = None,
  endangle = None,
  support = None 
)
makeCircle(radius,[placement,face,startangle,endangle]): Creates a circle
object with given radius. If placement is given, it is
used. If face is False, the circle is shown as a
wireframe, otherwise as a face. If startangle AND endangle are given
(in degrees), they are used and the object appears as an arc.

Definition at line 282 of file Draft.py.

def Draft::makeCopy (   obj  ) 
makeCopy(object): returns an exact copy of an object

Definition at line 494 of file Draft.py.

def Draft::makeDimension (   p1,
  p2,
  p3 = None,
  p4 = None 
)
makeDimension(p1,p2,[p3]) or makeDimension(object,i1,i2,p3)
or makeDimension(objlist,indices,p3): Creates a Dimension object with
the dimension line passign through p3.The current line width and color
will be used. There are multiple  ways to create a dimension, depending on
the arguments you pass to it:
- (p1,p2,p3): creates a standard dimension from p1 to p2
- (object,i1,i2,p3): creates a linked dimension to the given object,
measuring the distance between its vertices indexed i1 and i2
- (object,i1,mode,p3): creates a linked dimension
to the given object, i1 is the index of the (curved) edge to measure,
and mode is either "radius" or "diameter".

Definition at line 324 of file Draft.py.

def Draft::makeDrawingView (   obj,
  page,
  lwmod = None,
  tmod = None 
)
makeDrawingView(object,page,[lwmod,tmod]) - adds a View of the given object to the
given page. lwmod modifies lineweights (in percent), tmod modifies text heights
(in percent). The Hint scale, X and Y of the page are used.

Definition at line 1113 of file Draft.py.

def Draft::makeLine (   p1,
  p2 
)
makeLine(p1,p2): Creates a line between p1 and p2.

Definition at line 439 of file Draft.py.

def Draft::makePolygon (   nfaces,
  radius = 1,
  inscribed = True,
  placement = None,
  face = True,
  support = None 
)
makePolgon(nfaces,[radius],[inscribed],[placement],[face]): Creates a
polygon object with the given number of faces and the radius.
if inscribed is False, the polygon is circumscribed around a circle
with the given radius, otherwise it is inscribed. If face is True,
the resulting shape is displayed as a face, otherwise as a wireframe.

Definition at line 414 of file Draft.py.

def Draft::makeRectangle (   length,
  height,
  placement = None,
  face = True,
  support = None 
)
makeRectangle(length,width,[placement],[face]): Creates a Rectangle
object with length in X direction and height in Y direction.
If a placement is given, it is used. If face is False, the
rectangle is shown as a wireframe, otherwise as a face.

Definition at line 305 of file Draft.py.

def Draft::makeShape2DView (   baseobj,
  projectionVector = None 
)
makeShape2DView(object,[projectionVector]) - adds a 2D shape to the document, which is a
2D projection of the given object. A specific projection vector can also be given.

Definition at line 1130 of file Draft.py.

def Draft::makeText (   stringslist,
  point = Vector(0,0,
  screen = False 
)
makeText(strings,[point],[screen]): Creates a Text object at the given point,
containing the strings given in the strings list, one string by line (strings
can also be one single string). The current color and text height and font
specified in preferences are used.
If screen is True, the text always faces the view direction.

Definition at line 471 of file Draft.py.

def Draft::makeWire (   pointslist,
  closed = False,
  placement = None,
  face = True,
  support = None 
)
makeWire(pointslist,[closed],[placement]): Creates a Wire object
from the given list of vectors. If closed is True or first
and last points are identical, the wire is closed. If face is
true (and wire is closed), the wire will appear filled. Instead of
a pointslist, you can also pass a Part Wire.

Definition at line 385 of file Draft.py.

def Draft::move (   objectslist,
  vector,
  copy = False 
)
move(objects,vector,[copy]): Moves the objects contained
in objects (that can be an object or a list of objects)
in the direction and distance indicated by the given
vector. If copy is True, the actual objects are not moved, but copies
are created instead.he objects (or their copies) are returned.

Definition at line 588 of file Draft.py.

Referenced by CmdSandboxMeshLoaderBoost::activated(), Gui::StatusWidget::adjustPosition(), Gui::MainWindow::loadWindowSettings(), Gui::Flag::mouseMoveEvent(), App::DocumentPy::moveObject(), and PartGui::ViewProviderMirror::unsetEdit().

def Draft::offset (   obj,
  delta,
  copy = False,
  bind = False,
  sym = False,
  occ = False 
)
offset(object,Vector,[copymode],[bind]): offsets the given wire by
applying the given Vector to its first vertex. If copymode is
True, another object is created, otherwise the same object gets
offsetted. If bind is True, and provided the wire is open, the original
and the offsetted wires will be bound by their endpoints, forming a face
if sym is True, bind must be true too, and the offset is made on both
sides, the total width being the given delta length.

Definition at line 762 of file Draft.py.

def Draft::precision (  ) 

Definition at line 131 of file Draft.py.

def Draft::rotate (   objectslist,
  angle,
  center = Vector(0,0,
  axis = Vector(0,0,
  copy = False 
)
rotate(objects,angle,[center,axis,copy]): Rotates the objects contained
in objects (that can be a list of objects or an object) of the given angle
(in degrees) around the center, using axis as a rotation axis. If axis is
omitted, the rotation will be around the vertical Z axis.
If copy is True, the actual objects are not moved, but copies
are created instead. The objects (or their copies) are returned.

Definition at line 670 of file Draft.py.

Referenced by KDL::svd_eigen_Macie().

def Draft::scale (   objectslist,
  delta,
  center = Vector(0,0,
  copy = False 
)
scale(objects,vector,[center,copy]): Scales the objects contained
in objects (that can be a list of objects or an object) of the given scale
factors defined by the given vector (in X, Y and Z directions) around
given center. If copy is True, the actual objects are not moved, but copies
are created instead. The objects (or their copies) are returned.

Definition at line 705 of file Draft.py.

def Draft::select (   objs  ) 
def Draft::setParam (   param,
  value 
)

Definition at line 121 of file Draft.py.

def Draft::shapify (   obj  ) 
shapify(object): transforms a parametric shape object into
non-parametric and returns the new object

Definition at line 195 of file Draft.py.

def Draft::tolerance (  ) 
def Draft::typecheck (   args_and_types,
  name = "?" 
)

Definition at line 85 of file Draft.py.

def Draft::ungroup (   obj  ) 

Definition at line 170 of file Draft.py.


Variable Documentation

string Draft::__author__ = "Yorik van Havre, Werner Mayer, Martin Burbaum, Ken Cline, Dmitry Chigrin"

Definition at line 27 of file Draft.py.

string Draft::__title__ = "FreeCAD Draft Workbench"

Definition at line 26 of file Draft.py.

string Draft::__url__ = "http://free-cad.sourceforge.net"

Definition at line 28 of file Draft.py.


Generated on Wed Nov 23 19:01:53 2011 for FreeCAD by  doxygen 1.6.1