Vous êtes sur la page 1sur 39

Sub DailyKML()

Dim oRange As Range, aCell As Range, bCell As Range


Dim wsNCS As Worksheet
Dim SearCHString As String
Dim FoundAt As String
Dim wsidea As Worksheet
Set wsidea = Worksheets("Sheet2")

'Dim wsresult As Worksheet


'Set wsresult = Worksheets("Sheet5")
Dim wsresult As Worksheet
Set wsresult = Worksheets("Daily-Monitor")

Dim wsideaC As Worksheet


Set wsideaC = Worksheets("Charts")

Dim wsSheet7 As Worksheet


Set wsSheet7 = Worksheets("Sheet2")

Dim wsSheet9 As Worksheet


Set wsSheet9 = Worksheets("Charts")

Dim SaveToDirectory As String

SaveToDirectory = ActiveWorkbook.Path & "\Charts\"

date1 = UserForm1.TextBox2.Text
date2 = UserForm1.TextBox3.Text
date1 = Replace(date1, "/", "-")
date2 = Replace(date2, "/", "-")

'sFilePath = SaveToDirectory & "DCR1NewSheetsP44FASMRR.kml"


' Set objFSOs = CreateObject("scripting.filesystemobject")
'
' Set objTFs = objFSOs.readtextfile(sFilePath, True, False)
'
strFile_Path = SaveToDirectory & "Gaza_Cells_Full_KPI_Analysis_" & date1 & "_" &
date2 & ".kml"
'
'Opening the text file for Append with FileNumber as 1.
Open strFile_Path For Append As #1

Print #1, "<Folder>"


' Print #1, " <name>"
' Print #1, DDL
' Print #1, "</name>"
Print #1, " <name> Daily Monitor </name>"
Print #1, " <open>0</open>"

'Folder TCH Drop rate:


Print #1, " <Folder>"
Print #1, " <name>TCH Drop</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("F" & RowTOP).Value) >= 1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("F" & RowTOP).Value >= 0.5 And wsresult.Range("F" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("F" & RowTOP).Value >= 0.3 And wsresult.Range("F" &
RowTOP).Value < 0.5 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If
Print #1, "<MultiGeometry>"
Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"


' For Loop CSSR Folders
*************************************************************************

Print #1, " <Folder>"


Print #1, " <name>CSSR</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("I" & RowTOP).Value) >= 1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("I" & RowTOP).Value >= 0.5 And wsresult.Range("I" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("I" & RowTOP).Value >= 0.3 And wsresult.Range("I" &
RowTOP).Value < 0.5 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop HOSR Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>HOSR</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("L" & RowTOP).Value) >= 1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("L" & RowTOP).Value >= 0.5 And wsresult.Range("L" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("L" & RowTOP).Value >= 0.3 And wsresult.Range("L" &
RowTOP).Value < 0.5 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop SQI Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>SQI Bad</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("O" & RowTOP).Value) >= 1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("O" & RowTOP).Value >= 0.5 And wsresult.Range("O" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("O" & RowTOP).Value >= 0.3 And wsresult.Range("O" &
RowTOP).Value < 0.5 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop EDGE Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>DL EDGE</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("R" & RowTOP).Value) >= 20 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("R" & RowTOP).Value >= 15 And wsresult.Range("R" &
RowTOP).Value < 20 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("R" & RowTOP).Value >= 10 And wsresult.Range("R" &
RowTOP).Value < 15 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop Traffic Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>Traffic</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("U" & RowTOP).Value) >= 1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("U" & RowTOP).Value >= 0.5 And wsresult.Range("U" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("U" & RowTOP).Value >= 0.3 And wsresult.Range("U" &
RowTOP).Value < 0.5 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop NQI Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>NQI</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("X" & RowTOP).Value) >= 10 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("X" & RowTOP).Value >= 8 And wsresult.Range("X" &
RowTOP).Value < 10 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("X" & RowTOP).Value >= 5 And wsresult.Range("X" &
RowTOP).Value < 8 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"
Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop SDCCH Esatablishment Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>SDCCH Esatablishmen</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("AA" & RowTOP).Value) >= 10 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("AA" & RowTOP).Value >= 8 And wsresult.Range("AA" &
RowTOP).Value < 10 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("AA" & RowTOP).Value >= 5 And wsresult.Range("AA" &
RowTOP).Value < 8 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

'' For Loop Paging SR Folders


*************************************************************************
' Print #1, " <Folder>"
' Print #1, " <name>Paging SR</name>"
''
''Print #1, " <Folder>"
'' Print #1, " <name> Daily Monitor </name>"
'' Print #1, " <visibility>0</visibility> "
'
'
'' For Loop Folders
''Dim RowTOP As Integer
'RowTOP = 4
'Do Until (wsresult.Range("CH" & RowTOP) = "")
'
'
'If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then
'
'
'
''Site Name
' Print #1, "<Placemark>"
' Print #1, "<name>"
' Print #1, (wsresult.Range("CK" & RowTOP))
' Print #1, "</name>"
' Print #1, "<visibility>0</visibility> "
' Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
' Print #1, " <Point>"
''
'' wsresult.Range ("CH" & RowTOP)
' Print #1, " <coordinates>"
' Print #1, wsresult.Range("CI" & RowTOP)
' Print #1, ","
' Print #1, wsresult.Range("CH" & RowTOP)
'Print #1, ", 20"
' Print #1, " </coordinates>"
' Print #1, " </Point>"
' Print #1, " </Placemark>"
'End If
'
'' Cell Name
' Print #1, "<Placemark>"
' Print #1, "<name>"
' Print #1, (wsresult.Range("C" & RowTOP))
' Print #1, "</name>"
' Print #1, " <visibility>0</visibility>"
'
' If (wsresult.Range("F" & RowTOP).Value) >= 1 Then
' Print #1, " <styleUrl>#Cell_Red</styleUrl>"
''
' ElseIf wsresult.Range("F" & RowTOP).Value >= 0.5 And wsresult.Range("F" &
RowTOP).Value < 1 Then
' Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
''
' ElseIf wsresult.Range("F" & RowTOP).Value >= 0.3 And wsresult.Range("F" &
RowTOP).Value < 0.5 Then
' Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
' Else
' Print #1, " <styleUrl>#Cell_Green</styleUrl>"
' End If
'
'
' Print #1, "<MultiGeometry>"
' Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"
'
' Print #1, " <LinearRing><coordinates>"
'
'
'
'Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),
0.001, wsresult.Range("CJ" & RowTOP)))
' Print #1, "</coordinates>"
' Print #1, " </LinearRing>"
' Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"
'
'
' Print #1, "</Placemark>"
'
'
'
' RowTOP = RowTOP + 1
'Loop
'
'Print #1, "</Folder>"

' For Loop SQI Good Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>SQI Good </name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If
' Cell Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("AG" & RowTOP).Value) >= 2 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("AG" & RowTOP).Value >= 1 And wsresult.Range("AG" &
RowTOP).Value < 2 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("AG" & RowTOP).Value >= 0.6 And wsresult.Range("AG" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop SDCCH Drop Rate Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>SDCCH Drop Rate</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("AJ" & RowTOP).Value) >= 1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("AJ" & RowTOP).Value >= 0.5 And wsresult.Range("AJ" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("AJ" & RowTOP).Value >= 0.3 And wsresult.Range("AJ" &
RowTOP).Value < 0.5 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"


Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),
0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop RACH Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>RACH</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("AM" & RowTOP).Value) >= 1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("AM" & RowTOP).Value >= 0.5 And wsresult.Range("AM" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("AM" & RowTOP).Value >= 0.3 And wsresult.Range("AM" &
RowTOP).Value < 0.5 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop NQI_EDGE Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>NQI_EDGE</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("F" & RowTOP).Value) >= 10 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("F" & RowTOP).Value >= 7 And wsresult.Range("F" &
RowTOP).Value < 10 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("F" & RowTOP).Value >= 5 And wsresult.Range("F" &
RowTOP).Value < 7 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"


Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),
0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"


' For Loop UL EDGE Throughput Folders
*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>UL EDGE Throughput</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("AS" & RowTOP).Value) >= 10 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("AS" & RowTOP).Value >= 7 And wsresult.Range("AS" &
RowTOP).Value < 10 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("AS" & RowTOP).Value >= 5 And wsresult.Range("AS" &
RowTOP).Value < 7 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"


' For Loop PDCH Congestion Folders
*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>DCH Congestion </name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then


'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("AV" & RowTOP).Value) >= 0.1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
''
' ElseIf wsresult.Range("AV" & RowTOP).Value >= 0.5 And wsresult.Range("AV" &
RowTOP).Value < 1 Then
' Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
''
' ElseIf wsresult.Range("AV" & RowTOP).Value >= 0.3 And wsresult.Range("AV" &
RowTOP).Value < 0.5 Then
' Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"
Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

' For Loop PDCH Drop Rate Folders


*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>PDCH Drop Rate</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("F" & RowTOP).Value) >= 1 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
ElseIf wsresult.Range("F" & RowTOP).Value >= 0.5 And wsresult.Range("F" &
RowTOP).Value < 1 Then
Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
'
ElseIf wsresult.Range("F" & RowTOP).Value >= 0.3 And wsresult.Range("F" &
RowTOP).Value < 0.5 Then
Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"

RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"


' For Loop IP Latency Folders
*************************************************************************
Print #1, " <Folder>"
Print #1, " <name>IP Latency</name>"
'
'Print #1, " <Folder>"
' Print #1, " <name> Daily Monitor </name>"
' Print #1, " <visibility>0</visibility> "

' For Loop Folders


'Dim RowTOP As Integer
RowTOP = 4
Do Until (wsresult.Range("CH" & RowTOP) = "")

If wsresult.Range("CK" & RowTOP) <> wsresult.Range("CK" & RowTOP + 1) Then

'Site Name
Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("CK" & RowTOP))
Print #1, "</name>"
Print #1, "<visibility>0</visibility> "
Print #1, " <styleUrl>#sh_shaded_dot</styleUrl>"
Print #1, " <Point>"
'
' wsresult.Range ("CH" & RowTOP)
Print #1, " <coordinates>"
Print #1, wsresult.Range("CI" & RowTOP)
Print #1, ","
Print #1, wsresult.Range("CH" & RowTOP)
Print #1, ", 20"
Print #1, " </coordinates>"
Print #1, " </Point>"
Print #1, " </Placemark>"
End If

' Cell Name


Print #1, "<Placemark>"
Print #1, "<name>"
Print #1, (wsresult.Range("C" & RowTOP))
Print #1, "</name>"
Print #1, " <visibility>0</visibility>"

If (wsresult.Range("F" & RowTOP).Value) >= 30 Then


Print #1, " <styleUrl>#Cell_Red</styleUrl>"
'
' ElseIf wsresult.Range("F" & RowTOP).Value >= 0.5 And wsresult.Range("F" &
RowTOP).Value < 1 Then
' Print #1, " <styleUrl>#Cell_Orange</styleUrl>"
''
' ElseIf wsresult.Range("F" & RowTOP).Value >= 0.3 And wsresult.Range("F" &
RowTOP).Value < 0.5 Then
' Print #1, " <styleUrl>#Cell_Yellow</styleUrl>"
Else
Print #1, " <styleUrl>#Cell_Green</styleUrl>"
End If

Print #1, "<MultiGeometry>"


Print #1, "
<Polygon><extrude>1</extrude><altitudeMode>relativeToGround</altitudeMode><outerBou
ndaryIs>"

Print #1, " <LinearRing><coordinates>"

Print #1, (Polygon(wsresult.Range("CI" & RowTOP), wsresult.Range("CH" & RowTOP),


0.001, wsresult.Range("CJ" & RowTOP)))
Print #1, "</coordinates>"
Print #1, " </LinearRing>"
Print #1, " </outerBoundaryIs> </Polygon></MultiGeometry>"

Print #1, "</Placemark>"


RowTOP = RowTOP + 1
Loop

Print #1, "</Folder>"

'Finish Folder Daily Monitor

Print #1, "</Folder>"

Close #1

End Sub

Private Function Polygon(x As Double, y As Double, r As Double, Angle As Integer)


As String
' Dim Angle As Double
Dim Coords As String
Coords = ""
' Angle = 2 * 3.141592654 / n
'
'60 * pi / 180

' px11 = r * Sin(Angle * i) + x


' py11 = r * Cos(Angle * i) + y
' Coords = Coords & px11 & "," & py11 & ",20 "
Coords = Coords & x & "," & y & ",20 "
' For i = 1 To n - 1
' px = r * Sin(Angle * i) + x
' py = r * Cos(Angle * i) + y
' Coords = Coords & px & "," & py & ",20 "
' Next i

'Point 1
Const pi = 3.14159265358979
Dim val1 As Double
' Convert 60 degrees to radians by multiplying by pi/180.
val1 = Sin(60 * pi / 180)

'MsgBox "r " & r


'MsgBox "Sin(30) " & Sin(30)
'MsgBox "Sin(( 30 * (Pi / 180)) " & Sin((Angle + 30) * (pi / 180))
'MsgBox "Sin((30) * (pi / 180)) small " & Sin((30) * (pi / 180))
'MsgBox "x " & x

'Point 1

px1 = r * Sin((Angle + 30) * (pi / 180)) + x


py1 = r * Cos((Angle + 30) * (pi / 180)) + y

' px1 = r * Sin(360 - Angle + 30) + x


' py1 = r * Cos(360 - Angle + 30) + y
'' px1 = r * Sin(360 - Angle + 30) + x
' py1 = r * Cos(360 - Angle + 30) + y

''Point 2
px2 = r * Sin((Angle + 25) * (pi / 180)) + x
py2 = r * Cos((Angle + 25) * (pi / 180)) + y

'
''point 3
px3 = r * Sin((Angle + 20) * (pi / 180)) + x
py3 = r * Cos((Angle + 20) * (pi / 180)) + y
'
''point 4

px4 = r * Sin((Angle + 15) * (pi / 180)) + x


py4 = r * Cos((Angle + 15) * (pi / 180)) + y

'point 5
px5 = r * Sin((Angle + 10) * (pi / 180)) + x
py5 = r * Cos((Angle + 10) * (pi / 180)) + y

px6 = r * Sin((Angle + 5) * (pi / 180)) + x


py6 = r * Cos((Angle + 5) * (pi / 180)) + y

'Point 6 Center

px7 = r * Sin((Angle) * (pi / 180)) + x


py7 = r * Cos((Angle) * (pi / 180)) + y

'point 7

px8 = r * Sin((Angle - 5) * (pi / 180)) + x


py8 = r * Cos((Angle - 5) * (pi / 180)) + y

'point 8

px9 = r * Sin((Angle - 10) * (pi / 180)) + x


py9 = r * Cos((Angle - 10) * (pi / 180)) + y

'point 9

px10 = r * Sin((Angle - 15) * (pi / 180)) + x


py10 = r * Cos((Angle - 15) * (pi / 180)) + y
'point 10

px11 = r * Sin((Angle - 20) * (pi / 180)) + x


py11 = r * Cos((Angle - 20) * (pi / 180)) + y

'point 11

px12 = r * Sin((Angle - 25) * (pi / 180)) + x


py12 = r * Cos((Angle - 25) * (pi / 180)) + y

'point 12

px13 = r * Sin((Angle - 30) * (pi / 180)) + x


py13 = r * Cos((Angle - 30) * (pi / 180)) + y

'point 13 as the same start coordinates.

Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " &
px3 & "," & py3 & ",20" & " " & px4 & "," & py4 & ",20" & " " & px5 & "," & py5 &
",20" & " " & px6 & "," & py6 & ",20" & " " & px7 & "," & py7 & ",20" & " " & px8 &
"," & py8 & ",20" & " " & px9 & "," & py9 & ",20" & " " & px10 & "," & py10 & ",20"
& " " & px11 & "," & py11 & ",20" & " " & px12 & "," & py12 & ",20" & " " & x & ","
& y & ",20"
' Coords = Coords & px1 & "," & py1 & ",20" & " " & px3 & "," & py3 & ",20" & px5
& "," & py5 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " &
px3 & "," & py3 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & " " & px2 & "," & py2 & ",20" & " " & x & ","
& y & ",20"

Polygon = Coords
End Function

Private Function PolygonP2(x As Double, y As Double, r As Double, Angle As Integer)


As String
' Dim Angle As Double
Dim Coords As String
Coords = ""
' Angle = 2 * 3.141592654 / n
'
'60 * pi / 180

' px11 = r * Sin(Angle * i) + x


' py11 = r * Cos(Angle * i) + y
' Coords = Coords & px11 & "," & py11 & ",0 "
Coords = Coords & x & "," & y & ",20 "
' For i = 1 To n - 1
' px = r * Sin(Angle * i) + x
' py = r * Cos(Angle * i) + y
' Coords = Coords & px & "," & py & ",0 "
' Next i

'Point 1
Const pi = 3.14159265358979
Dim val1 As Double
' Convert 60 degrees to radians by multiplying by pi/180.
val1 = Sin(60 * pi / 180)

'MsgBox "r " & r


'MsgBox "Sin(30) " & Sin(30)
'MsgBox "Sin(( 30 * (Pi / 180)) " & Sin((Angle + 30) * (pi / 180))
'MsgBox "Sin((30) * (pi / 180)) small " & Sin((30) * (pi / 180))
'MsgBox "x " & x

'Point 1

px1 = r * Sin((Angle + 30) * (pi / 180)) + x


py1 = r * Cos((Angle + 30) * (pi / 180)) + y

' px1 = r * Sin(360 - Angle + 30) + x


' py1 = r * Cos(360 - Angle + 30) + y
'' px1 = r * Sin(360 - Angle + 30) + x
' py1 = r * Cos(360 - Angle + 30) + y

''Point 2
px2 = r * Sin((Angle + 25) * (pi / 180)) + x
py2 = r * Cos((Angle + 25) * (pi / 180)) + y

'
''point 3
px3 = r * Sin((Angle + 20) * (pi / 180)) + x
py3 = r * Cos((Angle + 20) * (pi / 180)) + y
'
''point 4

px4 = r * Sin((Angle + 15) * (pi / 180)) + x


py4 = r * Cos((Angle + 15) * (pi / 180)) + y

'point 5
px5 = r * Sin((Angle + 10) * (pi / 180)) + x
py5 = r * Cos((Angle + 10) * (pi / 180)) + y

px6 = r * Sin((Angle + 5) * (pi / 180)) + x


py6 = r * Cos((Angle + 5) * (pi / 180)) + y

'Point 6 Center

px7 = r * Sin((Angle) * (pi / 180)) + x


py7 = r * Cos((Angle) * (pi / 180)) + y

'point 7

px8 = r * Sin((Angle - 5) * (pi / 180)) + x


py8 = r * Cos((Angle - 5) * (pi / 180)) + y

'point 8
px9 = r * Sin((Angle - 10) * (pi / 180)) + x
py9 = r * Cos((Angle - 10) * (pi / 180)) + y

'point 9

px10 = r * Sin((Angle - 15) * (pi / 180)) + x


py10 = r * Cos((Angle - 15) * (pi / 180)) + y

'point 10

px11 = r * Sin((Angle - 20) * (pi / 180)) + x


py11 = r * Cos((Angle - 20) * (pi / 180)) + y

'point 11

px12 = r * Sin((Angle - 25) * (pi / 180)) + x


py12 = r * Cos((Angle - 25) * (pi / 180)) + y

'point 12

px13 = r * Sin((Angle - 30) * (pi / 180)) + x


py13 = r * Cos((Angle - 30) * (pi / 180)) + y

'point 13 as the same start coordinates.

Coords = px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " & px3 & ","
& py3 & ",20" & " " & px4 & "," & py4 & ",20" & " " & px5 & "," & py5 & ",20" & " "
& px6 & "," & py6 & ",20" & " " & px7 & "," & py7 & ",20" & " " & px8 & "," & py8 &
",20" & " " & px9 & "," & py9 & ",20" & " " & px10 & "," & py10 & ",20" & " " &
px11 & "," & py11 & ",20" & " " & px1 & "," & py1 & ",20" ' & " " & px11 & "," &
py11 & ",20" & " " & x & "," & y & ",20"

'Coords = px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " & px3 &
"," & py3 & ",20" & " " & px4 & "," & py4 & ",20" & " " & px5 & "," & py5 & ",20" &
" " & px6 & "," & py6 & ",20" & " " & px7 & "," & py7 & ",20" & " " & px8 & "," &
py8 & ",20" & " " & px9 & "," & py9 & ",20" & " " & px10 & "," & py10 & ",20" & " "
& px11 & "," & py11 & ",20" & " " & px12 & "," & py12 & ",20" & " " & px1 & "," &
py1 & ",20" ' & " " & px11 & "," & py11 & ",20" & " " & x & "," & y & ",20"
' Coords = Coords & px1 & "," & py1 & ",20" & " " & px3 & "," & py3 & ",20" & px5
& "," & py5 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " &
px3 & "," & py3 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & " " & px2 & "," & py2 & ",20" & " " & x & ","
& y & ",20"

PolygonP2 = Coords
End Function

Private Function PolygonP3(x As Double, y As Double, r As Double, Angle As Integer)


As String
' Dim Angle As Double
Dim Coords As String
Coords = ""
' Angle = 2 * 3.141592654 / n
'
'60 * pi / 180

' px11 = r * Sin(Angle * i) + x


' py11 = r * Cos(Angle * i) + y
' Coords = Coords & px11 & "," & py11 & ",0 "
Coords = Coords & x & "," & y & ",20 "
' For i = 1 To n - 1
' px = r * Sin(Angle * i) + x
' py = r * Cos(Angle * i) + y
' Coords = Coords & px & "," & py & ",0 "
' Next i

'Point 1
Const pi = 3.14159265358979
Dim val1 As Double
' Convert 60 degrees to radians by multiplying by pi/180.
val1 = Sin(60 * pi / 180)

'MsgBox "r " & r


'MsgBox "Sin(30) " & Sin(30)
'MsgBox "Sin(( 30 * (Pi / 180)) " & Sin((Angle + 30) * (pi / 180))
'MsgBox "Sin((30) * (pi / 180)) small " & Sin((30) * (pi / 180))
'MsgBox "x " & x

'Point 1
px1 = r * Sin((Angle + 32) * (pi / 180)) + x
py1 = r * Cos((Angle + 32) * (pi / 180)) + y
' px1 = r * Sin((Angle + 30) * (pi / 180)) + x
' py1 = r * Cos((Angle + 30) * (pi / 180)) + y
'
' px1 = r * Sin(360 - Angle + 30) + x
' py1 = r * Cos(360 - Angle + 30) + y
'' px1 = r * Sin(360 - Angle + 30) + x
' py1 = r * Cos(360 - Angle + 30) + y

''Point 2
px2 = r * Sin((Angle + 35) * (pi / 180)) + x
py2 = r * Cos((Angle + 35) * (pi / 180)) + y

'
'px2 = r * Sin((Angle + 25) * (pi / 180)) + x
' py2 = r * Cos((Angle + 25) * (pi / 180)) + y

'
''point 3
px3 = r * Sin((Angle + 20) * (pi / 180)) + x
py3 = r * Cos((Angle + 20) * (pi / 180)) + y
'
''point 4

px4 = r * Sin((Angle + 15) * (pi / 180)) + x


py4 = r * Cos((Angle + 15) * (pi / 180)) + y

'point 5
px5 = r * Sin((Angle + 10) * (pi / 180)) + x
py5 = r * Cos((Angle + 10) * (pi / 180)) + y
px6 = r * Sin((Angle + 5) * (pi / 180)) + x
py6 = r * Cos((Angle + 5) * (pi / 180)) + y

'Point 6 Center

px7 = r * Sin((Angle) * (pi / 180)) + x


py7 = r * Cos((Angle) * (pi / 180)) + y

'point 7

px8 = r * Sin((Angle - 5) * (pi / 180)) + x


py8 = r * Cos((Angle - 5) * (pi / 180)) + y

'point 8

px9 = r * Sin((Angle - 10) * (pi / 180)) + x


py9 = r * Cos((Angle - 10) * (pi / 180)) + y

'point 9

px10 = r * Sin((Angle - 15) * (pi / 180)) + x


py10 = r * Cos((Angle - 15) * (pi / 180)) + y

'point 10

px11 = r * Sin((Angle - 20) * (pi / 180)) + x


py11 = r * Cos((Angle - 20) * (pi / 180)) + y

'point 11

px12 = r * Sin((Angle - 25) * (pi / 180)) + x


py12 = r * Cos((Angle - 25) * (pi / 180)) + y

'point 12

px13 = r * Sin((Angle - 30) * (pi / 180)) + x


py13 = r * Cos((Angle - 30) * (pi / 180)) + y

'point 13 as the same start coordinates.

'Coords =

'Coords = px2 & "," & py2 & ",20" & " " & px3 & "," & py3 & ",20" & " " & px4 &
"," & py4 & ",20" & " " & px5 & "," & py5 & ",20" & " " & px6 & "," & py6 & ",20" &
" " & px7 & "," & py7 & ",20" & " " & px8 & "," & py8 & ",20" & " " & px9 & "," &
py9 & ",20" & " " & px10 & "," & py10 & ",20" & " " & px11 & "," & py11 & ",20"

' & " " & px11 & "," & py11 & ",20" & " " & px12 & "," & py12 & ",20" & " " & x &
"," & y & ",20"
' Coords = Coords & px1 & "," & py1 & ",20" & " " & px3 & "," & py3 & ",20" & px5
& "," & py5 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " &
px3 & "," & py3 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & " " & px2 & "," & py2 & ",20" & " " & x & ","
& y & ",20"
Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " & x
& "," & y & ",20"

PolygonP3 = Coords
End Function

Private Function PolygonP4(x As Double, y As Double, r As Double, Angle As Integer)


As String
' Dim Angle As Double
Dim Coords As String
Coords = ""
' Angle = 2 * 3.141592654 / n
'
'60 * pi / 180

' px11 = r * Sin(Angle * i) + x


' py11 = r * Cos(Angle * i) + y
' Coords = Coords & px11 & "," & py11 & ",0 "
Coords = Coords & x & "," & y & ",20 "
' For i = 1 To n - 1
' px = r * Sin(Angle * i) + x
' py = r * Cos(Angle * i) + y
' Coords = Coords & px & "," & py & ",0 "
' Next i

'Point 1
Const pi = 3.14159265358979
Dim val1 As Double
' Convert 60 degrees to radians by multiplying by pi/180.
val1 = Sin(60 * pi / 180)

'MsgBox "r " & r


'MsgBox "Sin(30) " & Sin(30)
'MsgBox "Sin(( 30 * (Pi / 180)) " & Sin((Angle + 30) * (pi / 180))
'MsgBox "Sin((30) * (pi / 180)) small " & Sin((30) * (pi / 180))
'MsgBox "x " & x

'Point 1
px1 = r * Sin((Angle - 27) * (pi / 180)) + x
py1 = r * Cos((Angle - 27) * (pi / 180)) + y
' px1 = r * Sin((Angle + 30) * (pi / 180)) + x
' py1 = r * Cos((Angle + 30) * (pi / 180)) + y
'
' px1 = r * Sin(360 - Angle + 30) + x
' py1 = r * Cos(360 - Angle + 30) + y
'' px1 = r * Sin(360 - Angle + 30) + x
' py1 = r * Cos(360 - Angle + 30) + y

''Point 2
px2 = r * Sin((Angle - 30) * (pi / 180)) + x
py2 = r * Cos((Angle - 30) * (pi / 180)) + y

'px2 = r * Sin((Angle + 25) * (pi / 180)) + x


' py2 = r * Cos((Angle + 25) * (pi / 180)) + y

'
''point 3
px3 = r * Sin((Angle + 20) * (pi / 180)) + x
py3 = r * Cos((Angle + 20) * (pi / 180)) + y
'
''point 4

px4 = r * Sin((Angle + 15) * (pi / 180)) + x


py4 = r * Cos((Angle + 15) * (pi / 180)) + y

'point 5
px5 = r * Sin((Angle + 10) * (pi / 180)) + x
py5 = r * Cos((Angle + 10) * (pi / 180)) + y

px6 = r * Sin((Angle + 5) * (pi / 180)) + x


py6 = r * Cos((Angle + 5) * (pi / 180)) + y

'Point 6 Center

px7 = r * Sin((Angle) * (pi / 180)) + x


py7 = r * Cos((Angle) * (pi / 180)) + y

'point 7

px8 = r * Sin((Angle - 5) * (pi / 180)) + x


py8 = r * Cos((Angle - 5) * (pi / 180)) + y

'point 8

px9 = r * Sin((Angle - 10) * (pi / 180)) + x


py9 = r * Cos((Angle - 10) * (pi / 180)) + y

'point 9

px10 = r * Sin((Angle - 15) * (pi / 180)) + x


py10 = r * Cos((Angle - 15) * (pi / 180)) + y

'point 10

px11 = r * Sin((Angle - 20) * (pi / 180)) + x


py11 = r * Cos((Angle - 20) * (pi / 180)) + y

'point 11

px12 = r * Sin((Angle - 25) * (pi / 180)) + x


py12 = r * Cos((Angle - 25) * (pi / 180)) + y
'point 12

px13 = r * Sin((Angle - 30) * (pi / 180)) + x


py13 = r * Cos((Angle - 30) * (pi / 180)) + y

'point 13 as the same start coordinates.

'Coords =

'Coords = px2 & "," & py2 & ",20" & " " & px3 & "," & py3 & ",20" & " " & px4 &
"," & py4 & ",20" & " " & px5 & "," & py5 & ",20" & " " & px6 & "," & py6 & ",20" &
" " & px7 & "," & py7 & ",20" & " " & px8 & "," & py8 & ",20" & " " & px9 & "," &
py9 & ",20" & " " & px10 & "," & py10 & ",20" & " " & px11 & "," & py11 & ",20"

' & " " & px11 & "," & py11 & ",20" & " " & px12 & "," & py12 & ",20" & " " & x &
"," & y & ",20"
' Coords = Coords & px1 & "," & py1 & ",20" & " " & px3 & "," & py3 & ",20" & px5
& "," & py5 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " &
px3 & "," & py3 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " &
x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " &
px3 & "," & py3 x & "," & y & ",20"
Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " & x
& "," & y & ",20"
PolygonP4 = Coords
End Function

' if need to change Style of lines and poly Lines


'<Style id="style">
' <LineStyle>
' <color>ff000000</color>
' <width>3</width>
' </LineStyle>
' <PolyStyle>
' <color>800000ff</color>
' </PolyStyle>
' </Style>
' <Style id="style0">
' <LineStyle>
' <color>ff000000</color>
' <width>3</width>
' </LineStyle>
' <PolyStyle>
' <color>800000ff</color>
' </PolyStyle>
' </Style>
' <StyleMap id="stylemap_id2">
' <Pair>
' <key>normal</key>
' <styleUrl>#style0</styleUrl>
' </Pair>
' <Pair>
' <key>highlight</key>
' <styleUrl>#style</styleUrl>
' </Pair>
' </StyleMap>
Private Function PolygonT(x As Double, y As Double, r As Double, Angle As Integer)
As String
' Dim Angle As Double
Dim Coords As String
Coords = ""
' Angle = 2 * 3.141592654 / n
'
'60 * pi / 180

' px11 = r * Sin(Angle * i) + x


' py11 = r * Cos(Angle * i) + y
' Coords = Coords & px11 & "," & py11 & ",20 "
Coords = Coords & x & "," & y & ",10 "
' For i = 1 To n - 1
' px = r * Sin(Angle * i) + x
' py = r * Cos(Angle * i) + y
' Coords = Coords & px & "," & py & ",20 "
' Next i

'Point 1
Const pi = 3.14159265358979
Dim val1 As Double
' Convert 60 degrees to radians by multiplying by pi/180.
val1 = Sin(60 * pi / 180)

'MsgBox "r " & r


'MsgBox "Sin(30) " & Sin(30)
'MsgBox "Sin(( 30 * (Pi / 180)) " & Sin((Angle + 30) * (pi / 180))
'MsgBox "Sin((30) * (pi / 180)) small " & Sin((30) * (pi / 180))
'MsgBox "x " & x

'Point 1

px1 = r * Sin((Angle + 30) * (pi / 180)) + x


py1 = r * Cos((Angle + 30) * (pi / 180)) + y

' px1 = r * Sin(360 - Angle + 30) + x


' py1 = r * Cos(360 - Angle + 30) + y
'' px1 = r * Sin(360 - Angle + 30) + x
' py1 = r * Cos(360 - Angle + 30) + y

''Point 2
px2 = r * Sin((Angle + 25) * (pi / 180)) + x
py2 = r * Cos((Angle + 25) * (pi / 180)) + y

'
''point 3
px3 = r * Sin((Angle + 20) * (pi / 180)) + x
py3 = r * Cos((Angle + 20) * (pi / 180)) + y
'
''point 4

px4 = r * Sin((Angle + 15) * (pi / 180)) + x


py4 = r * Cos((Angle + 15) * (pi / 180)) + y

'point 5
px5 = r * Sin((Angle + 10) * (pi / 180)) + x
py5 = r * Cos((Angle + 10) * (pi / 180)) + y
px6 = r * Sin((Angle + 5) * (pi / 180)) + x
py6 = r * Cos((Angle + 5) * (pi / 180)) + y

'Point 6 Center

px7 = r * Sin((Angle) * (pi / 180)) + x


py7 = r * Cos((Angle) * (pi / 180)) + y

'point 7

px8 = r * Sin((Angle - 5) * (pi / 180)) + x


py8 = r * Cos((Angle - 5) * (pi / 180)) + y

'point 8

px9 = r * Sin((Angle - 10) * (pi / 180)) + x


py9 = r * Cos((Angle - 10) * (pi / 180)) + y

'point 9

px10 = r * Sin((Angle - 15) * (pi / 180)) + x


py10 = r * Cos((Angle - 15) * (pi / 180)) + y

'point 10

px11 = r * Sin((Angle - 20) * (pi / 180)) + x


py11 = r * Cos((Angle - 20) * (pi / 180)) + y

'point 11

px12 = r * Sin((Angle - 25) * (pi / 180)) + x


py12 = r * Cos((Angle - 25) * (pi / 180)) + y

'point 12

px13 = r * Sin((Angle - 30) * (pi / 180)) + x


py13 = r * Cos((Angle - 30) * (pi / 180)) + y

'point 13 as the same start coordinates.

Coords = Coords & px1 & "," & py1 & ",10" & " " & px2 & "," & py2 & ",10" & " " &
px3 & "," & py3 & ",10" & " " & px4 & "," & py4 & ",10" & " " & px5 & "," & py5 &
",10" & " " & px6 & "," & py6 & ",10" & " " & px7 & "," & py7 & ",10" & " " & px8 &
"," & py8 & ",10" & " " & px9 & "," & py9 & ",10" & " " & px10 & "," & py10 & ",10"
& " " & px11 & "," & py11 & ",10" & " " & px12 & "," & py12 & ",10" & " " & x & ","
& y & ",10"
' Coords = Coords & px1 & "," & py1 & ",20" & " " & px3 & "," & py3 & ",20" & px5
& "," & py5 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & ",20" & " " & px2 & "," & py2 & ",20" & " " &
px3 & "," & py3 & ",20" & " " & x & "," & y & ",20"
'Coords = Coords & px1 & "," & py1 & " " & px2 & "," & py2 & ",20" & " " & x & ","
& y & ",20"

PolygonT = Coords
End Function

Vous aimerez peut-être aussi