Get X,Y,Z coordinates from GetPoint

Discussion in 'AutoCAD' started by KCGalloway, Jun 4, 2004.

  1. KCGalloway

    KCGalloway Guest

    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
     
    KCGalloway, Jun 4, 2004
    #1
  2. KCGalloway

    KCGalloway Guest

    Never mind I figured it out today.
     
    KCGalloway, Jun 7, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.