I would like to create a multidimensional array but I don't know what the size should be. The size of each dimension will be different and the number of dimensions will depend on a variable defined earlier in the code.
Initially, I thought that I could create a create an array of arrays, but this hasn't seemed to work.
Here is my code.
Initially, I thought that I could create a create an array of arrays, but this hasn't seemed to work.
Here is my code.
Code:
'Find members to load rate
Range("A1").End(xlDown).Select
size = Selection.Count - 1
ReDim membernames(size)
ReDim member_lengths(size)
i = 0
Do While i <= size
membernames(i) = Range("A" & i + 1).Value
i = i + 1
Loop
i = 0
'calculate the length of each member
Do While i <= size
'get names of points
ret = SapModel.FrameObj.GetPoints(membernames(i), Point1, Point2)
ret = SapModel.PointObj.GetCoordCartesian(Point1, x1, y1, z1)
ret = SapModel.PointObj.GetCoordCartesian(Point2, x2, y2, z2)
Length = ((x1 - x2) ^ 2 + (y1 - y2) ^ 2 + (z1 - z2) ^ 2) ^ (1 / 2)
member_lengths(i) = Length
Loop
'determine number of sections for each member
'members will be broken into pieces that are less than one foot in length
ReDim number_sections(size)
i = 0
Do While i <= size
number_sections(i) = WorksheetFunction.Ceiling(member_lengths(i), 1)
i = i + 1
Loop
'break members into sections
ReDim section_size(size)
i = 0
Do While i <= size
section_size(i) = member_lengths(i) / number_sections(i)
i = i + 1
Loop
i = 0
'create array denoting member points of interest
ReDim divided_members(size)
Do While i <= size
j = 0
ReDim temp(number_sections(i))
Do While j <= number_sections(i)
temp(j) = j * section_size(i)
j = j + 1
Loop
divided_members(i) = temp
i = i + 1
Loop