Made Draft objects properties translatable - issue #2524

This commit is contained in:
Yorik van Havre 2016-10-07 21:55:26 -03:00
parent dabccc40b6
commit 17a24a4b27

View File

@ -50,8 +50,12 @@ from FreeCAD import Vector
if FreeCAD.GuiUp:
import FreeCADGui, WorkingPlane
from PySide import QtCore
from PySide.QtCore import QT_TRANSLATE_NOOP
gui = True
else:
def QT_TRANSLATE_NOOP(ctxt,txt):
return txt
#print("FreeCAD Gui not present. Draft module will have some features disabled.")
gui = False
@ -3338,10 +3342,8 @@ class _ViewProviderDraft:
from DraftTools import translate
vobj.Proxy = self
self.Object = vobj.Object
vobj.addProperty("App::PropertyEnumeration","Pattern",
"Draft","Defines a hatch pattern")
vobj.addProperty("App::PropertyFloat","PatternSize",
"Draft","Sets the size of the pattern")
vobj.addProperty("App::PropertyEnumeration","Pattern","Draft",QT_TRANSLATE_NOOP("App::Property","Defines a hatch pattern"))
vobj.addProperty("App::PropertyFloat","PatternSize","Draft",QT_TRANSLATE_NOOP("App::Property","Sets the size of the pattern"))
vobj.Pattern = ["None"]+list(svgpatterns().keys())
vobj.PatternSize = 1
@ -3478,14 +3480,14 @@ class _Dimension(_DraftObject):
"The Draft Dimension object"
def __init__(self, obj):
_DraftObject.__init__(self,obj,"Dimension")
obj.addProperty("App::PropertyVectorDistance","Start","Draft","Startpoint of dimension")
obj.addProperty("App::PropertyVectorDistance","End","Draft","Endpoint of dimension")
obj.addProperty("App::PropertyVector","Normal","Draft","the normal direction of this dimension")
obj.addProperty("App::PropertyVector","Direction","Draft","the normal direction of this dimension")
obj.addProperty("App::PropertyVectorDistance","Dimline","Draft","Point through which the dimension line passes")
obj.addProperty("App::PropertyLink","Support","Draft","The object measured by this dimension")
obj.addProperty("App::PropertyLinkSubList","LinkedGeometry","Draft","The geometry this dimension is linked to")
obj.addProperty("App::PropertyLength","Distance","Draft","The measurement of this dimension")
obj.addProperty("App::PropertyVectorDistance","Start","Draft",QT_TRANSLATE_NOOP("App::Property","Startpoint of dimension"))
obj.addProperty("App::PropertyVectorDistance","End","Draft",QT_TRANSLATE_NOOP("App::Property","Endpoint of dimension"))
obj.addProperty("App::PropertyVector","Normal","Draft",QT_TRANSLATE_NOOP("App::Property","the normal direction of this dimension"))
obj.addProperty("App::PropertyVector","Direction","Draft",QT_TRANSLATE_NOOP("App::Property","the normal direction of this dimension"))
obj.addProperty("App::PropertyVectorDistance","Dimline","Draft",QT_TRANSLATE_NOOP("App::Property","Point through which the dimension line passes"))
obj.addProperty("App::PropertyLink","Support","Draft",QT_TRANSLATE_NOOP("App::Property","The object measured by this dimension"))
obj.addProperty("App::PropertyLinkSubList","LinkedGeometry","Draft",QT_TRANSLATE_NOOP("App::Property","The geometry this dimension is linked to"))
obj.addProperty("App::PropertyLength","Distance","Draft",QT_TRANSLATE_NOOP("App::Property","The measurement of this dimension"))
obj.Start = FreeCAD.Vector(0,0,0)
obj.End = FreeCAD.Vector(1,0,0)
obj.Dimline = FreeCAD.Vector(0,1,0)
@ -3529,19 +3531,19 @@ class _Dimension(_DraftObject):
class _ViewProviderDimension(_ViewProviderDraft):
"A View Provider for the Draft Dimension object"
def __init__(self, obj):
obj.addProperty("App::PropertyLength","FontSize","Draft","Font size")
obj.addProperty("App::PropertyInteger","Decimals","Draft","The number of decimals to show")
obj.addProperty("App::PropertyLength","ArrowSize","Draft","Arrow size")
obj.addProperty("App::PropertyLength","TextSpacing","Draft","The spacing between the text and the dimension line")
obj.addProperty("App::PropertyEnumeration","ArrowType","Draft","Arrow type")
obj.addProperty("App::PropertyString","FontName","Draft","Font name")
obj.addProperty("App::PropertyFloat","LineWidth","Draft","Line width")
obj.addProperty("App::PropertyColor","LineColor","Draft","Line color")
obj.addProperty("App::PropertyDistance","ExtLines","Draft","Length of the extension lines")
obj.addProperty("App::PropertyBool","FlipArrows","Draft","Rotate the dimension arrows 180 degrees")
obj.addProperty("App::PropertyBool","ShowUnit","Draft","Show the unit suffix")
obj.addProperty("App::PropertyVectorDistance","TextPosition","Draft","The position of the text. Leave (0,0,0) for automatic position")
obj.addProperty("App::PropertyString","Override","Draft","Text override. Use $dim to insert the dimension length")
obj.addProperty("App::PropertyLength","FontSize","Draft",QT_TRANSLATE_NOOP("App::Property","Font size"))
obj.addProperty("App::PropertyInteger","Decimals","Draft",QT_TRANSLATE_NOOP("App::Property","The number of decimals to show"))
obj.addProperty("App::PropertyLength","ArrowSize","Draft",QT_TRANSLATE_NOOP("App::Property","Arrow size"))
obj.addProperty("App::PropertyLength","TextSpacing","Draft",QT_TRANSLATE_NOOP("App::Property","The spacing between the text and the dimension line"))
obj.addProperty("App::PropertyEnumeration","ArrowType","Draft",QT_TRANSLATE_NOOP("App::Property","Arrow type"))
obj.addProperty("App::PropertyString","FontName","Draft",QT_TRANSLATE_NOOP("App::Property","Font name"))
obj.addProperty("App::PropertyFloat","LineWidth","Draft",QT_TRANSLATE_NOOP("App::Property","Line width"))
obj.addProperty("App::PropertyColor","LineColor","Draft",QT_TRANSLATE_NOOP("App::Property","Line color"))
obj.addProperty("App::PropertyDistance","ExtLines","Draft",QT_TRANSLATE_NOOP("App::Property","Length of the extension lines"))
obj.addProperty("App::PropertyBool","FlipArrows","Draft",QT_TRANSLATE_NOOP("App::Property","Rotate the dimension arrows 180 degrees"))
obj.addProperty("App::PropertyBool","ShowUnit","Draft",QT_TRANSLATE_NOOP("App::Property","Show the unit suffix"))
obj.addProperty("App::PropertyVectorDistance","TextPosition","Draft",QT_TRANSLATE_NOOP("App::Property","The position of the text. Leave (0,0,0) for automatic position"))
obj.addProperty("App::PropertyString","Override","Draft",QT_TRANSLATE_NOOP("App::Property","Text override. Use $dim to insert the dimension length"))
obj.FontSize = getParam("textheight",0.20)
obj.TextSpacing = getParam("dimspacing",0.05)
obj.FontName = getParam("textfont","")
@ -3879,14 +3881,14 @@ class _AngularDimension(_DraftObject):
"The Draft AngularDimension object"
def __init__(self, obj):
_DraftObject.__init__(self,obj,"AngularDimension")
obj.addProperty("App::PropertyAngle","FirstAngle","Draft","Start angle of the dimension")
obj.addProperty("App::PropertyAngle","LastAngle","Draft","End angle of the dimension")
obj.addProperty("App::PropertyVectorDistance","Dimline","Draft","Point through which the dimension line passes")
obj.addProperty("App::PropertyVectorDistance","Center","Draft","The center point of this dimension")
obj.addProperty("App::PropertyVector","Normal","Draft","The normal direction of this dimension")
obj.addProperty("App::PropertyLink","Support","Draft","The object measured by this dimension")
obj.addProperty("App::PropertyLinkSubList","LinkedGeometry","Draft","The geometry this dimension is linked to")
obj.addProperty("App::PropertyAngle","Angle","Draft","The measurement of this dimension")
obj.addProperty("App::PropertyAngle","FirstAngle","Draft",QT_TRANSLATE_NOOP("App::Property","Start angle of the dimension"))
obj.addProperty("App::PropertyAngle","LastAngle","Draft",QT_TRANSLATE_NOOP("App::Property","End angle of the dimension"))
obj.addProperty("App::PropertyVectorDistance","Dimline","Draft",QT_TRANSLATE_NOOP("App::Property","Point through which the dimension line passes"))
obj.addProperty("App::PropertyVectorDistance","Center","Draft",QT_TRANSLATE_NOOP("App::Property","The center point of this dimension"))
obj.addProperty("App::PropertyVector","Normal","Draft",QT_TRANSLATE_NOOP("App::Property","The normal direction of this dimension"))
obj.addProperty("App::PropertyLink","Support","Draft",QT_TRANSLATE_NOOP("App::Property","The object measured by this dimension"))
obj.addProperty("App::PropertyLinkSubList","LinkedGeometry","Draft",QT_TRANSLATE_NOOP("App::Property","The geometry this dimension is linked to"))
obj.addProperty("App::PropertyAngle","Angle","Draft",QT_TRANSLATE_NOOP("App::Property","The measurement of this dimension"))
obj.FirstAngle = 0
obj.LastAngle = 90
obj.Dimline = FreeCAD.Vector(0,1,0)
@ -3907,18 +3909,18 @@ class _AngularDimension(_DraftObject):
class _ViewProviderAngularDimension(_ViewProviderDraft):
"A View Provider for the Draft Angular Dimension object"
def __init__(self, obj):
obj.addProperty("App::PropertyLength","FontSize","Draft","Font size")
obj.addProperty("App::PropertyInteger","Decimals","Draft","The number of decimals to show")
obj.addProperty("App::PropertyString","FontName","Draft","Font name")
obj.addProperty("App::PropertyLength","ArrowSize","Draft","Arrow size")
obj.addProperty("App::PropertyLength","TextSpacing","Draft","The spacing between the text and the dimension line")
obj.addProperty("App::PropertyEnumeration","ArrowType","Draft","Arrow type")
obj.addProperty("App::PropertyFloat","LineWidth","Draft","Line width")
obj.addProperty("App::PropertyColor","LineColor","Draft","Line color")
obj.addProperty("App::PropertyBool","FlipArrows","Draft","Rotate the dimension arrows 180 degrees")
obj.addProperty("App::PropertyBool","ShowUnit","Draft","Show the unit suffix")
obj.addProperty("App::PropertyVectorDistance","TextPosition","Draft","The position of the text. Leave (0,0,0) for automatic position")
obj.addProperty("App::PropertyString","Override","Draft","Text override. Use 'dim' to insert the dimension length")
obj.addProperty("App::PropertyLength","FontSize","Draft",QT_TRANSLATE_NOOP("App::Property","Font size"))
obj.addProperty("App::PropertyInteger","Decimals","Draft",QT_TRANSLATE_NOOP("App::Property","The number of decimals to show"))
obj.addProperty("App::PropertyString","FontName","Draft",QT_TRANSLATE_NOOP("App::Property","Font name"))
obj.addProperty("App::PropertyLength","ArrowSize","Draft",QT_TRANSLATE_NOOP("App::Property","Arrow size"))
obj.addProperty("App::PropertyLength","TextSpacing","Draft",QT_TRANSLATE_NOOP("App::Property","The spacing between the text and the dimension line"))
obj.addProperty("App::PropertyEnumeration","ArrowType","Draft",QT_TRANSLATE_NOOP("App::Property","Arrow type"))
obj.addProperty("App::PropertyFloat","LineWidth","Draft",QT_TRANSLATE_NOOP("App::Property","Line width"))
obj.addProperty("App::PropertyColor","LineColor","Draft",QT_TRANSLATE_NOOP("App::Property","Line color"))
obj.addProperty("App::PropertyBool","FlipArrows","Draft",QT_TRANSLATE_NOOP("App::Property","Rotate the dimension arrows 180 degrees"))
obj.addProperty("App::PropertyBool","ShowUnit","Draft",QT_TRANSLATE_NOOP("App::Property","Show the unit suffix"))
obj.addProperty("App::PropertyVectorDistance","TextPosition","Draft",QT_TRANSLATE_NOOP("App::Property","The position of the text. Leave (0,0,0) for automatic position"))
obj.addProperty("App::PropertyString","Override","Draft",QT_TRANSLATE_NOOP("App::Property","Text override. Use 'dim' to insert the dimension length"))
obj.FontSize = getParam("textheight",0.20)
obj.FontName = getParam("textfont","")
obj.TextSpacing = getParam("dimspacing",0.05)
@ -4220,13 +4222,13 @@ class _Rectangle(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"Rectangle")
obj.addProperty("App::PropertyDistance","Length","Draft","Length of the rectangle")
obj.addProperty("App::PropertyDistance","Height","Draft","Height of the rectange")
obj.addProperty("App::PropertyLength","FilletRadius","Draft","Radius to use to fillet the corners")
obj.addProperty("App::PropertyLength","ChamferSize","Draft","Size of the chamfer to give to the corners")
obj.addProperty("App::PropertyBool","MakeFace","Draft","Create a face")
obj.addProperty("App::PropertyInteger","Rows","Draft","Horizontal subdivisions of this rectange")
obj.addProperty("App::PropertyInteger","Columns","Draft","Vertical subdivisions of this rectange")
obj.addProperty("App::PropertyDistance","Length","Draft",QT_TRANSLATE_NOOP("App::Property","Length of the rectangle"))
obj.addProperty("App::PropertyDistance","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the rectange"))
obj.addProperty("App::PropertyLength","FilletRadius","Draft",QT_TRANSLATE_NOOP("App::Property","Radius to use to fillet the corners"))
obj.addProperty("App::PropertyLength","ChamferSize","Draft",QT_TRANSLATE_NOOP("App::Property","Size of the chamfer to give to the corners"))
obj.addProperty("App::PropertyBool","MakeFace","Draft",QT_TRANSLATE_NOOP("App::Property","Create a face"))
obj.addProperty("App::PropertyInteger","Rows","Draft",QT_TRANSLATE_NOOP("App::Property","Horizontal subdivisions of this rectange"))
obj.addProperty("App::PropertyInteger","Columns","Draft",QT_TRANSLATE_NOOP("App::Property","Vertical subdivisions of this rectange"))
obj.MakeFace = getParam("fillmode",True)
obj.Length=1
obj.Height=1
@ -4302,18 +4304,17 @@ class _Rectangle(_DraftObject):
class _ViewProviderRectangle(_ViewProviderDraft):
def __init__(self,vobj):
_ViewProviderDraft.__init__(self,vobj)
vobj.addProperty("App::PropertyFile","TextureImage",
"Draft","Defines a texture image (overrides hatch patterns)")
vobj.addProperty("App::PropertyFile","TextureImage","Draft",QT_TRANSLATE_NOOP("App::Property","Defines a texture image (overrides hatch patterns)"))
class _Circle(_DraftObject):
"The Circle object"
def __init__(self, obj):
_DraftObject.__init__(self,obj,"Circle")
obj.addProperty("App::PropertyAngle","FirstAngle","Draft","Start angle of the arc")
obj.addProperty("App::PropertyAngle","LastAngle","Draft","End angle of the arc (for a full circle, give it same value as First Angle)")
obj.addProperty("App::PropertyLength","Radius","Draft","Radius of the circle")
obj.addProperty("App::PropertyBool","MakeFace","Draft","Create a face")
obj.addProperty("App::PropertyAngle","FirstAngle","Draft",QT_TRANSLATE_NOOP("App::Property","Start angle of the arc"))
obj.addProperty("App::PropertyAngle","LastAngle","Draft",QT_TRANSLATE_NOOP("App::Property","End angle of the arc (for a full circle, give it same value as First Angle)"))
obj.addProperty("App::PropertyLength","Radius","Draft",QT_TRANSLATE_NOOP("App::Property","Radius of the circle"))
obj.addProperty("App::PropertyBool","MakeFace","Draft",QT_TRANSLATE_NOOP("App::Property","Create a face"))
obj.MakeFace = getParam("fillmode",True)
def execute(self, obj):
@ -4336,11 +4337,11 @@ class _Ellipse(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"Ellipse")
obj.addProperty("App::PropertyAngle","FirstAngle","Draft","Start angle of the arc")
obj.addProperty("App::PropertyAngle","LastAngle","Draft","End angle of the arc (for a full circle, give it same value as First Angle)")
obj.addProperty("App::PropertyLength","MinorRadius","Draft","The minor radius of the ellipse")
obj.addProperty("App::PropertyLength","MajorRadius","Draft","The major radius of the ellipse")
obj.addProperty("App::PropertyBool","MakeFace","Draft","Create a face")
obj.addProperty("App::PropertyAngle","FirstAngle","Draft",QT_TRANSLATE_NOOP("App::Property","Start angle of the arc"))
obj.addProperty("App::PropertyAngle","LastAngle","Draft",QT_TRANSLATE_NOOP("App::Property","End angle of the arc (for a full circle, give it same value as First Angle)"))
obj.addProperty("App::PropertyLength","MinorRadius","Draft",QT_TRANSLATE_NOOP("App::Property","The minor radius of the ellipse"))
obj.addProperty("App::PropertyLength","MajorRadius","Draft",QT_TRANSLATE_NOOP("App::Property","The major radius of the ellipse"))
obj.addProperty("App::PropertyBool","MakeFace","Draft",QT_TRANSLATE_NOOP("App::Property","Create a face"))
obj.MakeFace = getParam("fillmode",True)
def execute(self, obj):
@ -4373,17 +4374,17 @@ class _Wire(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"Wire")
obj.addProperty("App::PropertyVectorList","Points","Draft","The vertices of the wire")
obj.addProperty("App::PropertyBool","Closed","Draft","If the wire is closed or not")
obj.addProperty("App::PropertyLink","Base","Draft","The base object is the wire is formed from 2 objects")
obj.addProperty("App::PropertyLink","Tool","Draft","The tool object is the wire is formed from 2 objects")
obj.addProperty("App::PropertyVectorDistance","Start","Draft","The start point of this line")
obj.addProperty("App::PropertyVectorDistance","End","Draft","The end point of this line")
obj.addProperty("App::PropertyLength","Length","Draft","The length of this line")
obj.addProperty("App::PropertyLength","FilletRadius","Draft","Radius to use to fillet the corners")
obj.addProperty("App::PropertyLength","ChamferSize","Draft","Size of the chamfer to give to the corners")
obj.addProperty("App::PropertyBool","MakeFace","Draft","Create a face if this object is closed")
obj.addProperty("App::PropertyInteger","Subdivisions","Draft","The number of subdivisions of each edge")
obj.addProperty("App::PropertyVectorList","Points","Draft",QT_TRANSLATE_NOOP("App::Property","The vertices of the wire"))
obj.addProperty("App::PropertyBool","Closed","Draft",QT_TRANSLATE_NOOP("App::Property","If the wire is closed or not"))
obj.addProperty("App::PropertyLink","Base","Draft",QT_TRANSLATE_NOOP("App::Property","The base object is the wire is formed from 2 objects"))
obj.addProperty("App::PropertyLink","Tool","Draft",QT_TRANSLATE_NOOP("App::Property","The tool object is the wire is formed from 2 objects"))
obj.addProperty("App::PropertyVectorDistance","Start",QT_TRANSLATE_NOOP("App::Property","Draft","The start point of this line"))
obj.addProperty("App::PropertyVectorDistance","End",QT_TRANSLATE_NOOP("App::Property","Draft","The end point of this line"))
obj.addProperty("App::PropertyLength","Length","Draft",QT_TRANSLATE_NOOP("App::Property","The length of this line"))
obj.addProperty("App::PropertyLength","FilletRadius","Draft",QT_TRANSLATE_NOOP("App::Property","Radius to use to fillet the corners"))
obj.addProperty("App::PropertyLength","ChamferSize","Draft",QT_TRANSLATE_NOOP("App::Property","Size of the chamfer to give to the corners"))
obj.addProperty("App::PropertyBool","MakeFace","Draft",QT_TRANSLATE_NOOP("App::Property","Create a face if this object is closed"))
obj.addProperty("App::PropertyInteger","Subdivisions","Draft",QT_TRANSLATE_NOOP("App::Property","The number of subdivisions of each edge"))
obj.MakeFace = getParam("fillmode",True)
obj.Closed = False
@ -4536,9 +4537,9 @@ class _ViewProviderWire(_ViewProviderDraft):
"A View Provider for the Wire object"
def __init__(self, obj):
_ViewProviderDraft.__init__(self,obj)
obj.addProperty("App::PropertyBool","EndArrow","Draft","Displays a dim symbol at the end of the wire")
obj.addProperty("App::PropertyLength","ArrowSize","Draft","Arrow size")
obj.addProperty("App::PropertyEnumeration","ArrowType","Draft","Arrow type")
obj.addProperty("App::PropertyBool","EndArrow","Draft",QT_TRANSLATE_NOOP("App::Property","Displays a dim symbol at the end of the wire"))
obj.addProperty("App::PropertyLength","ArrowSize","Draft",QT_TRANSLATE_NOOP("App::Property","Arrow size"))
obj.addProperty("App::PropertyEnumeration","ArrowType","Draft",QT_TRANSLATE_NOOP("App::Property","Arrow type"))
obj.ArrowSize = getParam("arrowsize",0.1)
obj.ArrowType = arrowtypes
obj.ArrowType = arrowtypes[getParam("dimsymbol",0)]
@ -4611,12 +4612,12 @@ class _Polygon(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"Polygon")
obj.addProperty("App::PropertyInteger","FacesNumber","Draft","Number of faces")
obj.addProperty("App::PropertyLength","Radius","Draft","Radius of the control circle")
obj.addProperty("App::PropertyEnumeration","DrawMode","Draft","How the polygon must be drawn from the control circle")
obj.addProperty("App::PropertyLength","FilletRadius","Draft","Radius to use to fillet the corners")
obj.addProperty("App::PropertyLength","ChamferSize","Draft","Size of the chamfer to give to the corners")
obj.addProperty("App::PropertyBool","MakeFace","Draft","Create a face")
obj.addProperty("App::PropertyInteger","FacesNumber","Draft",QT_TRANSLATE_NOOP("App::Property","Number of faces"))
obj.addProperty("App::PropertyLength","Radius","Draft",QT_TRANSLATE_NOOP("App::Property","Radius of the control circle"))
obj.addProperty("App::PropertyEnumeration","DrawMode","Draft",QT_TRANSLATE_NOOP("App::Property","How the polygon must be drawn from the control circle"))
obj.addProperty("App::PropertyLength","FilletRadius","Draft",QT_TRANSLATE_NOOP("App::Property","Radius to use to fillet the corners"))
obj.addProperty("App::PropertyLength","ChamferSize","Draft",QT_TRANSLATE_NOOP("App::Property","Size of the chamfer to give to the corners"))
obj.addProperty("App::PropertyBool","MakeFace","Draft",QT_TRANSLATE_NOOP("App::Property","Create a face"))
obj.MakeFace = getParam("fillmode",True)
obj.DrawMode = ['inscribed','circumscribed']
obj.FacesNumber = 0
@ -4661,15 +4662,15 @@ class _DrawingView(_DraftObject):
"The Draft DrawingView object"
def __init__(self, obj):
_DraftObject.__init__(self,obj,"DrawingView")
obj.addProperty("App::PropertyVector","Direction","Shape View","Projection direction")
obj.addProperty("App::PropertyFloat","LineWidth","View Style","The width of the lines inside this object")
obj.addProperty("App::PropertyLength","FontSize","View Style","The size of the texts inside this object")
obj.addProperty("App::PropertyLength","LineSpacing","View Style","The spacing between lines of text")
obj.addProperty("App::PropertyColor","LineColor","View Style","The color of the projected objects")
obj.addProperty("App::PropertyLink","Source","Base","The linked object")
obj.addProperty("App::PropertyEnumeration","FillStyle","View Style","Shape Fill Style")
obj.addProperty("App::PropertyEnumeration","LineStyle","View Style","Line Style")
obj.addProperty("App::PropertyBool","AlwaysOn","View Style","If checked, source objects are displayed regardless of being visible in the 3D model")
obj.addProperty("App::PropertyVector","Direction","Shape View",QT_TRANSLATE_NOOP("App::Property","Projection direction"))
obj.addProperty("App::PropertyFloat","LineWidth","View Style",QT_TRANSLATE_NOOP("App::Property","The width of the lines inside this object"))
obj.addProperty("App::PropertyLength","FontSize","View Style",QT_TRANSLATE_NOOP("App::Property","The size of the texts inside this object"))
obj.addProperty("App::PropertyLength","LineSpacing","View Style",QT_TRANSLATE_NOOP("App::Property","The spacing between lines of text"))
obj.addProperty("App::PropertyColor","LineColor","View Style",QT_TRANSLATE_NOOP("App::Property","The color of the projected objects"))
obj.addProperty("App::PropertyLink","Source","Base",QT_TRANSLATE_NOOP("App::Property","The linked object"))
obj.addProperty("App::PropertyEnumeration","FillStyle","View Style",QT_TRANSLATE_NOOP("App::Property","Shape Fill Style"))
obj.addProperty("App::PropertyEnumeration","LineStyle","View Style",QT_TRANSLATE_NOOP("App::Property","Line Style"))
obj.addProperty("App::PropertyBool","AlwaysOn","View Style",QT_TRANSLATE_NOOP("App::Property","If checked, source objects are displayed regardless of being visible in the 3D model"))
obj.FillStyle = ['shape color'] + list(svgpatterns().keys())
obj.LineStyle = ['Solid','Dashed','Dotted','Dashdot']
obj.LineWidth = 0.35
@ -4731,9 +4732,9 @@ class _BSpline(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"BSpline")
obj.addProperty("App::PropertyVectorList","Points","Draft", "The points of the b-spline")
obj.addProperty("App::PropertyBool","Closed","Draft","If the b-spline is closed or not")
obj.addProperty("App::PropertyBool","MakeFace","Draft","Create a face if this spline is closed")
obj.addProperty("App::PropertyVectorList","Points","Draft", QT_TRANSLATE_NOOP("App::Property","The points of the b-spline"))
obj.addProperty("App::PropertyBool","Closed","Draft",QT_TRANSLATE_NOOP("App::Property","If the b-spline is closed or not"))
obj.addProperty("App::PropertyBool","MakeFace","Draft",QT_TRANSLATE_NOOP("App::Property","Create a face if this spline is closed"))
obj.MakeFace = getParam("fillmode",True)
obj.Closed = False
obj.Points = []
@ -4741,7 +4742,7 @@ class _BSpline(_DraftObject):
def assureProperties(self, obj): # for Compatibility with older versions
if not hasattr(obj, "Parameterization"):
obj.addProperty("App::PropertyFloat","Parameterization","Draft","Parameterization factor")
obj.addProperty("App::PropertyFloat","Parameterization","Draft",QT_TRANSLATE_NOOP("App::Property","Parameterization factor"))
obj.Parameterization = 1.0
self.knotSeq = []
@ -4806,15 +4807,11 @@ class _BezCurve(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"BezCurve")
obj.addProperty("App::PropertyVectorList","Points","Draft",
"The points of the Bezier curve")
obj.addProperty("App::PropertyInteger","Degree","Draft",
"The degree of the Bezier function")
obj.addProperty("App::PropertyIntegerList","Continuity","Draft",
"Continuity")
obj.addProperty("App::PropertyBool","Closed","Draft",
"If the Bezier curve should be closed or not")
obj.addProperty("App::PropertyBool","MakeFace","Draft","Create a face if this curve is closed")
obj.addProperty("App::PropertyVectorList","Points","Draft",QT_TRANSLATE_NOOP("App::Property","The points of the Bezier curve"))
obj.addProperty("App::PropertyInteger","Degree","Draft",QT_TRANSLATE_NOOP("App::Property","The degree of the Bezier function"))
obj.addProperty("App::PropertyIntegerList","Continuity","Draft",QT_TRANSLATE_NOOP("App::Property","Continuity"))
obj.addProperty("App::PropertyBool","Closed","Draft",QT_TRANSLATE_NOOP("App::Property","If the Bezier curve should be closed or not"))
obj.addProperty("App::PropertyBool","MakeFace","Draft",QT_TRANSLATE_NOOP("App::Property","Create a face if this curve is closed"))
obj.MakeFace = getParam("fillmode",True)
obj.Closed = False
obj.Degree = 3
@ -4934,7 +4931,7 @@ class _Block(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"Block")
obj.addProperty("App::PropertyLinkList","Components","Draft","The components of this block")
obj.addProperty("App::PropertyLinkList","Components","Draft",QT_TRANSLATE_NOOP("App::Property","The components of this block"))
def execute(self, obj):
import Part
@ -4952,13 +4949,13 @@ class _Shape2DView(_DraftObject):
"The Shape2DView object"
def __init__(self,obj):
obj.addProperty("App::PropertyLink","Base","Draft","The base object this 2D view must represent")
obj.addProperty("App::PropertyVector","Projection","Draft","The projection vector of this object")
obj.addProperty("App::PropertyEnumeration","ProjectionMode","Draft","The way the viewed object must be projected")
obj.addProperty("App::PropertyIntegerList","FaceNumbers","Draft","The indices of the faces to be projected in Individual Faces mode")
obj.addProperty("App::PropertyBool","HiddenLines","Draft","Show hidden lines")
obj.addProperty("App::PropertyBool","Tessellation","Draft","Tessellate Ellipses and BSplines into line segments")
obj.addProperty("App::PropertyFloat","SegmentLength","Draft","Length of line segments if tessellating Ellipses or BSplines into line segments")
obj.addProperty("App::PropertyLink","Base","Draft",QT_TRANSLATE_NOOP("App::Property","The base object this 2D view must represent"))
obj.addProperty("App::PropertyVector","Projection","Draft",QT_TRANSLATE_NOOP("App::Property","The projection vector of this object"))
obj.addProperty("App::PropertyEnumeration","ProjectionMode","Draft",QT_TRANSLATE_NOOP("App::Property","The way the viewed object must be projected"))
obj.addProperty("App::PropertyIntegerList","FaceNumbers","Draft",QT_TRANSLATE_NOOP("App::Property","The indices of the faces to be projected in Individual Faces mode"))
obj.addProperty("App::PropertyBool","HiddenLines","Draft",QT_TRANSLATE_NOOP("App::Property","Show hidden lines"))
obj.addProperty("App::PropertyBool","Tessellation","Draft",QT_TRANSLATE_NOOP("App::Property","Tessellate Ellipses and BSplines into line segments"))
obj.addProperty("App::PropertyFloat","SegmentLength","Draft",QT_TRANSLATE_NOOP("App::Property","Length of line segments if tessellating Ellipses or BSplines into line segments"))
obj.Projection = Vector(0,0,1)
obj.ProjectionMode = ["Solid","Individual Faces","Cutlines","Cutfaces"]
obj.HiddenLines = False
@ -5089,20 +5086,20 @@ class _Array(_DraftObject):
def __init__(self,obj):
_DraftObject.__init__(self,obj,"Array")
obj.addProperty("App::PropertyLink","Base","Draft","The base object that must be duplicated")
obj.addProperty("App::PropertyEnumeration","ArrayType","Draft","The type of array to create")
obj.addProperty("App::PropertyVector","Axis","Draft","The axis direction")
obj.addProperty("App::PropertyInteger","NumberX","Draft","Number of copies in X direction")
obj.addProperty("App::PropertyInteger","NumberY","Draft","Number of copies in Y direction")
obj.addProperty("App::PropertyInteger","NumberZ","Draft","Number of copies in Z direction")
obj.addProperty("App::PropertyInteger","NumberPolar","Draft","Number of copies")
obj.addProperty("App::PropertyVectorDistance","IntervalX","Draft","Distance and orientation of intervals in X direction")
obj.addProperty("App::PropertyVectorDistance","IntervalY","Draft","Distance and orientation of intervals in Y direction")
obj.addProperty("App::PropertyVectorDistance","IntervalZ","Draft","Distance and orientation of intervals in Z direction")
obj.addProperty("App::PropertyVectorDistance","IntervalAxis","Draft","Distance and orientation of intervals in Axis direction")
obj.addProperty("App::PropertyVectorDistance","Center","Draft","Center point")
obj.addProperty("App::PropertyAngle","Angle","Draft","Angle to cover with copies")
obj.addProperty("App::PropertyBool","Fuse","Draft","Specifies if copies must be fused (slower)")
obj.addProperty("App::PropertyLink","Base","Draft",QT_TRANSLATE_NOOP("App::Property","The base object that must be duplicated"))
obj.addProperty("App::PropertyEnumeration","ArrayType","Draft",QT_TRANSLATE_NOOP("App::Property","The type of array to create"))
obj.addProperty("App::PropertyVector","Axis","Draft",QT_TRANSLATE_NOOP("App::Property","The axis direction"))
obj.addProperty("App::PropertyInteger","NumberX","Draft",QT_TRANSLATE_NOOP("App::Property","Number of copies in X direction"))
obj.addProperty("App::PropertyInteger","NumberY","Draft",QT_TRANSLATE_NOOP("App::Property","Number of copies in Y direction"))
obj.addProperty("App::PropertyInteger","NumberZ","Draft",QT_TRANSLATE_NOOP("App::Property","Number of copies in Z direction"))
obj.addProperty("App::PropertyInteger","NumberPolar","Draft",QT_TRANSLATE_NOOP("App::Property","Number of copies"))
obj.addProperty("App::PropertyVectorDistance","IntervalX","Draft",QT_TRANSLATE_NOOP("App::Property","Distance and orientation of intervals in X direction"))
obj.addProperty("App::PropertyVectorDistance","IntervalY","Draft",QT_TRANSLATE_NOOP("App::Property","Distance and orientation of intervals in Y direction"))
obj.addProperty("App::PropertyVectorDistance","IntervalZ","Draft",QT_TRANSLATE_NOOP("App::Property","Distance and orientation of intervals in Z direction"))
obj.addProperty("App::PropertyVectorDistance","IntervalAxis","Draft",QT_TRANSLATE_NOOP("App::Property","Distance and orientation of intervals in Axis direction"))
obj.addProperty("App::PropertyVectorDistance","Center","Draft",QT_TRANSLATE_NOOP("App::Property","Center point"))
obj.addProperty("App::PropertyAngle","Angle","Draft",QT_TRANSLATE_NOOP("App::Property","Angle to cover with copies"))
obj.addProperty("App::PropertyBool","Fuse","Draft",QT_TRANSLATE_NOOP("App::Property","Specifies if copies must be fused (slower)"))
obj.ArrayType = ['ortho','polar']
obj.NumberX = 1
obj.NumberY = 1
@ -5191,12 +5188,12 @@ class _PathArray(_DraftObject):
def __init__(self,obj):
_DraftObject.__init__(self,obj,"PathArray")
obj.addProperty("App::PropertyLink","Base","Draft","The base object that must be duplicated")
obj.addProperty("App::PropertyLink","PathObj","Draft","The path object along which to distribute objects")
obj.addProperty("App::PropertyLinkSubList","PathSubs","Draft","Selected subobjects (edges) of PathObj")
obj.addProperty("App::PropertyInteger","Count","Draft","Number of copies")
obj.addProperty("App::PropertyVectorDistance","Xlate","Draft","Optional translation vector")
obj.addProperty("App::PropertyBool","Align","Draft","Orientation of Base along path")
obj.addProperty("App::PropertyLink","Base","Draft",QT_TRANSLATE_NOOP("App::Property","The base object that must be duplicated"))
obj.addProperty("App::PropertyLink","PathObj","Draft",QT_TRANSLATE_NOOP("App::Property","The path object along which to distribute objects"))
obj.addProperty("App::PropertyLinkSubList","PathSubs",QT_TRANSLATE_NOOP("App::Property","Draft","Selected subobjects (edges) of PathObj"))
obj.addProperty("App::PropertyInteger","Count","Draft",QT_TRANSLATE_NOOP("App::Property","Number of copies"))
obj.addProperty("App::PropertyVectorDistance","Xlate","Draft",QT_TRANSLATE_NOOP("App::Property","Optional translation vector"))
obj.addProperty("App::PropertyBool","Align","Draft",QT_TRANSLATE_NOOP("App::Property","Orientation of Base along path"))
obj.Count = 2
obj.PathSubs = []
obj.Xlate = FreeCAD.Vector(0,0,0)
@ -5353,9 +5350,9 @@ class _Point(_DraftObject):
"The Draft Point object"
def __init__(self, obj,x=0,y=0,z=0):
_DraftObject.__init__(self,obj,"Point")
obj.addProperty("App::PropertyDistance","X","Draft","Location").X = x
obj.addProperty("App::PropertyDistance","Y","Draft","Location").Y = y
obj.addProperty("App::PropertyDistance","Z","Draft","Location").Z = z
obj.addProperty("App::PropertyDistance","X","Draft",QT_TRANSLATE_NOOP("App::Property","X Location")).X = x
obj.addProperty("App::PropertyDistance","Y","Draft",QT_TRANSLATE_NOOP("App::Property","Y Location")).Y = y
obj.addProperty("App::PropertyDistance","Z","Draft",QT_TRANSLATE_NOOP("App::Property","Z Location")).Z = z
mode = 2
obj.setEditorMode('Placement',mode)
@ -5391,8 +5388,8 @@ class _Clone(_DraftObject):
def __init__(self,obj):
_DraftObject.__init__(self,obj,"Clone")
obj.addProperty("App::PropertyLinkList","Objects","Draft","The objects included in this scale object")
obj.addProperty("App::PropertyVector","Scale","Draft","The scale vector of this object")
obj.addProperty("App::PropertyLinkList","Objects","Draft",QT_TRANSLATE_NOOP("App::Property","The objects included in this scale object"))
obj.addProperty("App::PropertyVector","Scale","Draft",QT_TRANSLATE_NOOP("App::Property","The scale vector of this object"))
obj.Scale = Vector(1,1,1)
def execute(self,obj):
@ -5482,11 +5479,10 @@ class _ShapeString(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"ShapeString")
obj.addProperty("App::PropertyString","String","Draft","Text string")
obj.addProperty("App::PropertyFile","FontFile","Draft","Font file name")
obj.addProperty("App::PropertyLength","Size","Draft","Height of text")
obj.addProperty("App::PropertyLength","Tracking","Draft",
"Inter-character spacing")
obj.addProperty("App::PropertyString","String","Draft",QT_TRANSLATE_NOOP("App::Property","Text string"))
obj.addProperty("App::PropertyFile","FontFile","Draft",QT_TRANSLATE_NOOP("App::Property","Font file name"))
obj.addProperty("App::PropertyLength","Size","Draft",QT_TRANSLATE_NOOP("App::Property","Height of text"))
obj.addProperty("App::PropertyLength","Tracking","Draft",QT_TRANSLATE_NOOP("App::Property","Inter-character spacing"))
def execute(self, obj):
import Part
@ -5615,7 +5611,7 @@ class _Facebinder(_DraftObject):
"The Draft Facebinder object"
def __init__(self,obj):
_DraftObject.__init__(self,obj,"Facebinder")
obj.addProperty("App::PropertyLinkSubList","Faces","Draft","Linked faces")
obj.addProperty("App::PropertyLinkSubList","Faces","Draft",QT_TRANSLATE_NOOP("App::Property","Linked faces"))
def execute(self,obj):
pl = obj.Placement