LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Adding to a Collection

Kind of Complicated But:

I have a collection of areas of type areaClass. The areaClass has a
collection of points of type PolyPoint as a property. I am trying to add
points to certain objects in the areaClass which can only be identified by
their key property. As you can see from the following code that there can be
multiple objects of quad1. I am trying to add points pts1.x and pts1.y to
quad1 key "1". If it is possible to add per a reference number that would be
fine also I just need to keep track of which points are applied to which
areas.

I appreciate any help on this!!

Dim tri1 As New AreaClass
tri1.Shape = tri
tri1.Key = CStr(areakeynum)
areas.Add tri1.Shape, tri1.Key
areakeynum = areakeynum + 1

For i = 1 To TierNum - 1
If i = 0 Then
i = 1
End If

Dim quad1 As New AreaClass
quad1.Shape = quad
quad1.Key = CStr(areakeynum)
'Quantity of Identical roof areas includes
the area just created
quad1.QuantityIdentical = 4
quad1.QuantityMirror = 0
areas.Add quad1.Shape, quad1.Key
areakeynum = areakeynum + 1
Next i



For j = 1 To TierNum

TierScale = Sheets("Defaults").Cells(223 +
TierNum, 2 + j).Value
rad = radius * TierScale

For i = 3 * sideNum * j - (3 * sideNum - 1)
To 3 * sideNum * j - 2 Step 3
wsPlot.Cells(i, 1).Value = 0
wsPlot.Cells(i, 2).Value = 0
Next i

z = sideNum * (j - 1)

For i = 3 * sideNum * j - (3 * sideNum - 2)
To 3 * sideNum * j - 1 Step 3
wsPlot.Cells(i, 1).Value = rad * Cos(0.5
* (i + z) * theta)
wsPlot.Cells(i, 2).Value = rad * Sin(0.5
* (i + z) * theta)
wsPlot.Cells(i + 1, 1).Value = rad *
Cos((0.5 * (i + z) + 2) * theta)
wsPlot.Cells(i + 1, 2).Value = rad *
Sin((0.5 * (i + z) + 2) * theta)



If TierNum 1 Then

For P = 1 To 4

If i = 3 * sideNum * j - (3 *
sideNum - 2) Then

Dim pts1 As New PolyPoint
pts1.x = rad * Sin(0.5 * (i
+ z) * theta)
pts1.y = 0
pts1.Key = P
'PROBLEM AREA<<<<<<<<<<<<

End If

Next P

End If

z = z + 1

Next i

Next j



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Unique Items to a Collection WJ Excel Discussion (Misc queries) 2 June 12th 07 03:46 PM
Adding a collection to a wksht CLamar Excel Discussion (Misc queries) 1 June 23rd 06 04:31 PM
Collection Todd Huttenstine Excel Programming 4 December 17th 04 09:41 PM
Adding Range to Worksheet Names Collection Keith Willshaw Excel Programming 2 March 5th 04 09:17 AM
calculating and adding a range to a collection marola20[_2_] Excel Programming 2 March 1st 04 03:24 PM


All times are GMT +1. The time now is 10:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"