@MP,
mytwocents
I think there's a flipside to your solution. Most, if any, Acad functions don't accept UDT's.
This can be a problem converting a point in WCS to UCS coordinates or vicaversa for instance.
using Doublearrays and variants won't have that problem.
Oh and an addition for copying initialized indexed arrays... the hard way. Use this if you can't avoid it.
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, Source As Any, ByVal numBytes As Long)
Sub Test()
Dim P1(2) As Double
Dim P2(2) As Double
'P1(0) = 1: P1(1) = 2: P1(2) = 3
CopyArray P1, P2
MsgBox (P2(2))
End Sub
Sub CopyArray(Source() As Double, Target() As Double)
Dim NumOfBytes As Long
On Error GoTo NoElements
NumOfBytes = (UBound(Source) + 1) * LenB(Source(0))
ReDim Target(UBound(Source)) 'no need for a diffrent number of items to be a
'true copy and save checking if the target is large enough...
CopyMemory Target(0), Source(0), NumOfBytes
NoElements:
MsgBox "Empty Source array in Sub CopySourceArray() at " & Format$(Now(), "hh:nn ss"), vbCritical + vbOKOnly + vbMsgBoxSetForeground, "Void Array."
On Error GoTo 0
Exit Sub
End Sub