-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInterrogateCurtainWalls.py
More file actions
83 lines (67 loc) · 2.7 KB
/
InterrogateCurtainWalls.py
File metadata and controls
83 lines (67 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#-----------------------------------------------------------------------------------+
def GetCellWidth(Curve):
#Grab the curves running in a positive X direction only
direction = XYZ(1,0,0)
width = 0
for c in Curve:
if c.Direction.IsAlmostEqualTo(direction):
width += c.Length
return width * 304.8 #<---<< Convert ft to mm
#-----------------------------------------------------------------------------------+
def GetCellHeight(Curve):
#Grab the curves running in a positive Z direction only
direction = XYZ(0,0,1)
height = 0
for c in Curve:
if c.Direction.IsAlmostEqualTo(direction):
height += c.Length
return height * 304.8 #<---<< Convert ft to mm
#-----------------------------------------------------------------------------------+
# Add function to find smallest curve edge length and therefor the smallest cell
#-----------------------------------------------------------------------------------+
def GetCellWidthAndHeight(aCell):
curves = aCell.CurveLoops
for curve in curves:
for edge in curve:
ft = edge.Length
mm = (ft * 304.8)+0.
#Re-write this function to use the two functions above to grab the width & height
return result
#-----------------------------------------------------------------------------------+
def AnalyzeCurtainWallCell(aCell):
result = True
curves = aCell.CurveLoops
for curve in curves:
for edge in curve:
ft = edge.Length
mm = (ft * 304.8)+0.5
if mm < minSize: result = False
return result
#-----------------------------------------------------------------------------------+
def AnalyzeCurtainWall(cw):
print 'Analyzing Curtai Wall:', cw.Id
x = lines = cw.CurtainGrid.GetUGridLineIds().Count + 1
y = lines = cw.CurtainGrid.GetVGridLineIds().Count + 1
counter = 0
#Get the list of cells
theCells = cw.CurtainGrid.GetCurtainCells()
#Cycle through them
for i in range(x):
for j in range(y):
aCell = theCells[counter]
result = AnalyzeCurtainWallCell(aCell)
if False == result:
print 'Bad Cell in Curtain Wall ' + cw.Id.ToString() + ' at Cell [' + (j+1).ToString() + ',' + (i+1).ToString() + ']'
counter += 1
#-----------------------------------------------------------------------------------+
minSize = 100
minSizeft = minSize / 304.8
wall = selection[0]
grid = wall.CurtainGrid
cells = grid.GetCurtainCells()
print 'This Wall has ' + cells.Count.ToString() + ' Cells'
print 'ULines = ' + grid.NumULines.ToString()
print 'VLines = ' + grid.NumVLines.ToString()
print 'with the following panels:'
for p in grid.GetPanelIds():
print p.ToString() + ' - ' + Element.Name.GetValue(doc.GetElement(p))