This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to make basic macro loop?

I have never made a macro before but I have a command want to repeat with a loop. All i need to do is add 500 ft in x direction each time. Can anyone tell me why this wouldn't work ?? 

Sub main

Dim startPoint As MbePoint
Dim point As MbePoint, point2 As MbePoint

' Coordinates are in master units
startPoint.x = 1131371.644684#
startPoint.y = 97271.924289#
startPoint.z = 0.000000#

i=0

Do while i < 200

point.x = startPoint.x +500.000000*i
point.y = startPoint.y
point.z = startPoint.z
point2.x = point.x + 300.000000#
point2.y = point.y - 80.000000#
point2.z = point.z
MbeSendDragPoints point, point2, 1%

' Start a command
MbeSendCommand "MeasureArea ICON "

point.x = startPoint.x + 650.000000*i
point.y = startPoint.y + 0.000000#
point.z = startPoint.z
MbeSendDataPoint point, 1%

point.x = startPoint.x + 650.000000*i
point.y = startPoint.y - 105.000000#
point.z = startPoint.z
MbeSendDataPoint point, 1%

' Send a reset to the current command
MbeSendReset

i = i+1

Loop

End Sub