Message 1 of 2
Get X,Y,Z coordinates from GetPoint
Not applicable
06-04-2004
10:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
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