Remove unused modules and variables
This commit is contained in:
@@ -7,9 +7,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Measure
|
||||
import TechDraw
|
||||
|
||||
import os
|
||||
|
||||
@@ -37,7 +34,7 @@ def DHatchTest():
|
||||
#make Views
|
||||
view1 = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart','View')
|
||||
FreeCAD.ActiveDocument.View.Source = [box]
|
||||
rc = page.addView(view1)
|
||||
page.addView(view1)
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
#make hatch
|
||||
@@ -46,7 +43,7 @@ def DHatchTest():
|
||||
hatch.Source = (view1,["Face0"])
|
||||
hatch.HatchPattern = hatchFileSpec #comment out to use default from preferences
|
||||
print("adding hatch to page")
|
||||
rc = page.addView(hatch)
|
||||
page.addView(hatch)
|
||||
print("finished hatch")
|
||||
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Measure
|
||||
import TechDraw
|
||||
import os
|
||||
|
||||
def DLeaderTest():
|
||||
@@ -29,7 +26,7 @@ p, li { white-space: pre-wrap; }
|
||||
FreeCAD.ActiveDocument=FreeCAD.getDocument("TDLead")
|
||||
|
||||
#make source feature
|
||||
box = FreeCAD.ActiveDocument.addObject("Part::Box","Box")
|
||||
FreeCAD.ActiveDocument.addObject("Part::Box","Box")
|
||||
|
||||
#make a page
|
||||
page = FreeCAD.ActiveDocument.addObject('TechDraw::DrawPage','Page')
|
||||
@@ -58,7 +55,7 @@ p, li { white-space: pre-wrap; }
|
||||
leaderObj.StartSymbol = 0
|
||||
leaderObj.EndSymbol = 4
|
||||
print("adding leader to page")
|
||||
rc = page.addView(leaderObj)
|
||||
page.addView(leaderObj)
|
||||
leaderObj.X = 5
|
||||
leaderObj.Y = 5
|
||||
print("finished leader")
|
||||
@@ -66,7 +63,7 @@ p, li { white-space: pre-wrap; }
|
||||
#make RTA
|
||||
print("making RTA")
|
||||
blockObj = FreeCAD.ActiveDocument.addObject('TechDraw::DrawRichAnno','DrawRichAnno')
|
||||
rc = page.addView(blockObj)
|
||||
page.addView(blockObj)
|
||||
blockObj.AnnoParent = leaderObj
|
||||
blockObj.X = 5
|
||||
blockObj.Y = 5
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Measure
|
||||
import TechDraw
|
||||
import os
|
||||
|
||||
def DProjGroupTest():
|
||||
@@ -52,12 +49,12 @@ def DProjGroupTest():
|
||||
doc.openTransaction("Create Proj Group")
|
||||
groupName = 'ProjGroup'
|
||||
group = FreeCAD.ActiveDocument.addObject('TechDraw::DrawProjGroup', groupName)
|
||||
rc = page.addView(group)
|
||||
page.addView(group)
|
||||
print("Group created")
|
||||
group.Source = [fusion]
|
||||
|
||||
print("adding views")
|
||||
frontView = group.addProjection("Front") ##need an Anchor
|
||||
group.addProjection("Front") ##need an Anchor
|
||||
print("added Front")
|
||||
|
||||
#update group
|
||||
@@ -71,19 +68,19 @@ def DProjGroupTest():
|
||||
print("Front/Anchor recomputed")
|
||||
|
||||
print("adding left")
|
||||
leftView = group.addProjection("Left")
|
||||
group.addProjection("Left")
|
||||
print("added Left")
|
||||
topView = group.addProjection("Top")
|
||||
group.addProjection("Top")
|
||||
print("added Top")
|
||||
rightView = group.addProjection("Right")
|
||||
group.addProjection("Right")
|
||||
print("added Right")
|
||||
rearView = group.addProjection("Rear")
|
||||
group.addProjection("Rear")
|
||||
print("added Rear")
|
||||
BottomView = group.addProjection("Bottom")
|
||||
group.addProjection("Bottom")
|
||||
print("added Bottom")
|
||||
|
||||
#remove a view from projection group
|
||||
iv = group.removeProjection("Left")
|
||||
group.removeProjection("Left")
|
||||
print("removed Left")
|
||||
|
||||
##test getItemByLabel method
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Measure
|
||||
import TechDraw
|
||||
import os
|
||||
|
||||
def DVAnnoSymImageTest():
|
||||
@@ -35,7 +32,7 @@ def DVAnnoSymImageTest():
|
||||
sl.append(s)
|
||||
anno.Text = sl
|
||||
anno.TextStyle = 'Bold'
|
||||
rc = page.addView(anno)
|
||||
page.addView(anno)
|
||||
anno.X = 30.0
|
||||
anno.Y = 150.0
|
||||
|
||||
@@ -45,14 +42,14 @@ def DVAnnoSymImageTest():
|
||||
svg = f.read()
|
||||
f.close()
|
||||
sym.Symbol = svg
|
||||
rc = page.addView(sym)
|
||||
page.addView(sym)
|
||||
sym.X = 220.0
|
||||
sym.Y = 150.0
|
||||
|
||||
#image
|
||||
img = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewImage','TestImage')
|
||||
img.ImageFile = imageFileSpec
|
||||
rc = page.addView(img)
|
||||
page.addView(img)
|
||||
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
rc = False
|
||||
|
||||
@@ -9,9 +9,6 @@ from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
from FreeCAD import Units
|
||||
import Part
|
||||
import Measure
|
||||
import TechDraw
|
||||
import os
|
||||
|
||||
def DVBalloonTest():
|
||||
@@ -24,8 +21,8 @@ def DVBalloonTest():
|
||||
FreeCAD.ActiveDocument=FreeCAD.getDocument("TDBalloon")
|
||||
|
||||
#make source feature
|
||||
box = FreeCAD.ActiveDocument.addObject("Part::Box","Box")
|
||||
sphere = FreeCAD.ActiveDocument.addObject("Part::Sphere","Sphere")
|
||||
FreeCAD.ActiveDocument.addObject("Part::Box","Box")
|
||||
FreeCAD.ActiveDocument.addObject("Part::Sphere","Sphere")
|
||||
|
||||
#make a page
|
||||
page = FreeCAD.ActiveDocument.addObject('TechDraw::DrawPage','Page')
|
||||
@@ -38,12 +35,12 @@ def DVBalloonTest():
|
||||
#make Views
|
||||
view1 = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart','View')
|
||||
FreeCAD.ActiveDocument.View.Source = [FreeCAD.ActiveDocument.Box]
|
||||
rc = page.addView(view1)
|
||||
page.addView(view1)
|
||||
view1.X = Units.Quantity(30.0,Units.Length)
|
||||
view1.Y = Units.Quantity(150.0,Units.Length)
|
||||
view2 = FreeCAD.activeDocument().addObject('TechDraw::DrawViewPart','View001')
|
||||
FreeCAD.activeDocument().View001.Source = [FreeCAD.activeDocument().Sphere]
|
||||
rc = page.addView(view2)
|
||||
page.addView(view2)
|
||||
view2.X = Units.Quantity(220.0,Units.Length)
|
||||
view2.Y = Units.Quantity(150.0,Units.Length)
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
@@ -59,7 +56,7 @@ def DVBalloonTest():
|
||||
balloon1.X=balloon1.OriginY + Units.Quantity(20.0,Units.Length)
|
||||
|
||||
print("adding balloon1 to page")
|
||||
rc = page.addView(balloon1)
|
||||
page.addView(balloon1)
|
||||
|
||||
balloon2 = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewBalloon','Balloon2')
|
||||
balloon2.SourceView=view2
|
||||
@@ -71,7 +68,7 @@ def DVBalloonTest():
|
||||
balloon2.X=balloon2.OriginY + Units.Quantity(20.0,Units.Length)
|
||||
|
||||
print("adding balloon2 to page")
|
||||
rc = page.addView(balloon2)
|
||||
page.addView(balloon2)
|
||||
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Measure
|
||||
import TechDraw
|
||||
import os
|
||||
|
||||
def DVDimensionTest():
|
||||
@@ -23,8 +20,8 @@ def DVDimensionTest():
|
||||
FreeCAD.ActiveDocument=FreeCAD.getDocument("TDDim")
|
||||
|
||||
#make source feature
|
||||
box = FreeCAD.ActiveDocument.addObject("Part::Box","Box")
|
||||
sphere = FreeCAD.ActiveDocument.addObject("Part::Sphere","Sphere")
|
||||
FreeCAD.ActiveDocument.addObject("Part::Box","Box")
|
||||
FreeCAD.ActiveDocument.addObject("Part::Sphere","Sphere")
|
||||
|
||||
#make a page
|
||||
page = FreeCAD.ActiveDocument.addObject('TechDraw::DrawPage','Page')
|
||||
@@ -37,12 +34,12 @@ def DVDimensionTest():
|
||||
#make Views
|
||||
view1 = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart','View')
|
||||
FreeCAD.ActiveDocument.View.Source = [FreeCAD.ActiveDocument.Box]
|
||||
rc = page.addView(view1)
|
||||
page.addView(view1)
|
||||
view1.X = 30
|
||||
view1.Y = 150
|
||||
view2 = FreeCAD.activeDocument().addObject('TechDraw::DrawViewPart','View001')
|
||||
FreeCAD.activeDocument().View001.Source = [FreeCAD.activeDocument().Sphere]
|
||||
rc = page.addView(view2)
|
||||
page.addView(view2)
|
||||
view2.X = 220
|
||||
view2.Y = 150
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
@@ -57,7 +54,7 @@ def DVDimensionTest():
|
||||
subObjs.append("Edge1")
|
||||
dim1.References2D=[(view1, 'Edge1')]
|
||||
print("adding dim1 to page")
|
||||
rc = page.addView(dim1)
|
||||
page.addView(dim1)
|
||||
print("finished length dimension")
|
||||
|
||||
#make radius dimension
|
||||
@@ -66,7 +63,7 @@ def DVDimensionTest():
|
||||
dim2.Type = "Radius"
|
||||
dim2.MeasureType = "Projected"
|
||||
dim2.References2D=[(view2, 'Edge0')]
|
||||
rc = page.addView(dim2)
|
||||
page.addView(dim2)
|
||||
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Measure
|
||||
import TechDraw
|
||||
import os
|
||||
|
||||
def DVPartTest():
|
||||
@@ -20,7 +17,7 @@ def DVPartTest():
|
||||
FreeCAD.setActiveDocument("TDPart")
|
||||
FreeCAD.ActiveDocument=FreeCAD.getDocument("TDPart")
|
||||
|
||||
box = FreeCAD.ActiveDocument.addObject("Part::Box","Box")
|
||||
FreeCAD.ActiveDocument.addObject("Part::Box","Box")
|
||||
|
||||
page = FreeCAD.ActiveDocument.addObject('TechDraw::DrawPage','Page')
|
||||
FreeCAD.ActiveDocument.addObject('TechDraw::DrawSVGTemplate','Template')
|
||||
@@ -31,7 +28,7 @@ def DVPartTest():
|
||||
print("page created")
|
||||
|
||||
view = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart','View')
|
||||
rc = page.addView(view)
|
||||
page.addView(view)
|
||||
|
||||
FreeCAD.ActiveDocument.View.Source = [FreeCAD.ActiveDocument.Box]
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Measure
|
||||
import TechDraw
|
||||
import os
|
||||
|
||||
def DVSectionTest():
|
||||
|
||||
Reference in New Issue
Block a user