G'day All,
Am having a crack at this VBA thing and have gone alright today. Iam trying to create a polyline
where the user can select as many points as they want and when they finish they type T to finish.
But I have two problems:
Cheers for any help,
- The way I have done it is to have a varible for the first point, the second point, and a variable to take all the other points picked by the user (varTendonPoint). But on my first go into my loop it wont have a value for use to draw a line from last point. I tried testing it to nothing but that doesnt seem to work...Is there a more elegant way?
- If I type T at the command line it doesnt terminate the polyline it just says invalid option....I thought that if I typed T it would produce an error and I could get out....hmmm lost with using this error stuff in VBA any pointers. It seems pretty clunky.
Scott
Code:On error resume next ThisDrawing.Utility.InitializeUserInput 128, "T t" Do Until Err.Number <> 0 'If this is the first point after the second point then use the second point to draw the previous line from If varTendonPoint = Nothing Then varTendonPoint = ThisDrawing.Utility.GetPoint(varSecondTendonPoint, "Specify next tendon point or [<T>erminate tendon]:") 'Otherwise use the last point that was picked to draw the previous line from Else varTendonPoint = ThisDrawing.Utility.GetPoint(varTendonPoint, "Specify next tendon point or [<T>erminate tendon]:") End If ReDim Preserve dblTendonPoints(UBound(dblTendonPoints) + 2) dblTendonPoints(UBound(dblTendonPoints) - 1) = varTendonPoint(0): dblTendonPoints(UBound(dblTendonPoints)) = varTendonPoint(1) Loop