Get X,Y,Z coordinates from GetPoint

Get X,Y,Z coordinates from GetPoint

Anonymous
Not applicable
366 Views
1 Reply
Message 1 of 2

Get X,Y,Z coordinates from GetPoint

Anonymous
Not applicable
Hello,

I just started learning VB with AutoCAD last week, and am currently trying to create some programs for practice.

The program I am working on creates a rectangle by asking the user to define a starting point and entering the Length and Width of the rectangle.

So the first question is how do I create the StartPoint array ( the X,Y,Z coordinates) from the GetPoint method. This is what I have so far
____________________________
Public Sub InsertPt()

Dim pt1 As Variant
Dim dblStartPt(0 To 2) As Double

pt1 = ThisDrawing.Utility.GetPoint(, "Pick the Starting point: ")

dblStartPt(0) = pt1(0): dblStartPt(1) = pt1(1): dblStartPt(2) = pt1(2)

End Sub
___________________________

The second question is where should I place this code in the program. Can I insert this in the commandbutton code that draws the box? Currently, when I do this, the user is not prompted to select a starting point. The program automatically asks for the rectangle dimensions. Do I insert the code in a standard module and specify it as public like I did above? If so, will the code in the commandbutton be able to retrieve the starting point information.

Thank you.

Best,

Kevin
0 Likes
367 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Never mind I figured it out today.
0 Likes