Using Autocad VBA ediyor...
Dim item1 As AcadObject
Dim ustsx(2), altsx(2) as double 'or variant 'both not working
Dim vector1 As Variant
...
vector1 = item1.Coordinates
If vector1(0) > vector1(4) Then
ustsx(0) = vector1(0)
altsx(0) = vector1(4)
Else
ustsx(0) = vector1(4)
altsx(0) = vector1(0)
End If
If vector1(1) > vector1(3) Then
ustsx(1) = vector1(1)
altsx(1) = vector1(3)
Else
ustsx(1) = vector1(3)
altsx(1) = vector1(1)
End If
ustsx(2) = 0#
altsx(2) = 0#
MyAcad.ZoomWindow ustsx, altsx '(error)
........
Run Time error '-2147024809 (80070057)
Invalid argument LowerLeft in ZoomWindow
Error...
After some search on internet i found an explanation for this type of errors. It may be good to learn for other members:
I find such description:
I corrected my code as follows:
Dim p1, p2 As Variant
Dim utilObj As Object ' late bind the Utility object
Set utilObj = ThisDrawing.Utility
utilObj.CreateTypedArray p1, vbDouble, ustsx(0), ustsx(1), ustsx(2)
utilObj.CreateTypedArray p2, vbDouble, altsx(0), altsx(1), altsx(2)
MyAcad.ZoomWindow p1, p2