Select insertion pt in multi page tab userform

Discussion in 'AutoCAD' started by john coon, Feb 14, 2005.

  1. john coon

    john coon Guest

    Hi gang,

    I'm looking for help with retrieving insertion points selected onscreen in a
    multi page or tab userform.

    I need to be able to store the coords so that I can recall them in other sub
    sections of the routine. My problem is I'm not sure how to save these values
    so I can use them later. All the routines I've written normally select one
    or two points grab the point locations do something then end sub, My issue
    is in a multi page userforms.
    Currently I have to create new (points) getpoint for each page in the form.
    I know this is a bonehead move but I just can't see how to use the same
    getpoint calls for each page using the same Pt1 & Pt2 values.

    do I create an array to hold them? do I save them to another module or
    function? Does anyone have samples of these operations or comments on which
    method to
    use.

    My form has 5 page tabs with different text values inserted depending on a
    combox selection. these text values are use to create geometry using
    the insertion point locations.

    Have a great day.
    John Coon

    public Sub CommandButton2_Click()
    hide
    Dim varDataPnt2 As Variant
    Dim dblnorthing As Double
    Dim dbleasting As Double
    Dim dbldir As Double

    varDataPnt2 = ThisDrawing.Utility.GetPoint(, "Select Right End Runway point:
    ")
    Dim insertionPnt2(0 To 2) As Double
    insertionPnt2(0) = varDataPnt2(0) 'x
    insertionPnt2(1) = varDataPnt2(1) 'y
    varDataPnt2(2) = 0 'z

    MsgBox "The Northing Easting Point Location:" & vbCrLf & _
    " Northing: " & varDataPnt2(1) & vbCrLf & _
    " Easting: " & varDataPnt2(0) & vbCrLf & vbCrLf & _
    " Direction: " & dbldir, vbInformation, "Right R/W End Coordinate
    Data"
    Dim Pt2 As Variant
    Pt2 = varDataPnt2 ' x,y,z, of pick point
    UserForm1.TextBox4.Text = varDataPnt2(0) 'textbox4 = (x) from second pick
    point
    UserForm1.TextBox3.Text = varDataPnt2(1) 'textbox3 = (y) from second pick
    point

    'runway length calc from
    Dim x, y, dist As Double
    x = TextBox2 - varDataPnt2(0) 'textbox2 = (x) from first pick point
    y = TextBox1 - varDataPnt2(1) 'textbox2 = (y) from first pick point
    dist = Sqr(x ^ 2 + y ^ 2)

    UserForm1.TextBox5.Text = dist

    Dim distformat As String
    distformat = "#0.00"
    Dim rwdist As String
    rwdist = Format(dist, distformat)

    UserForm1.TextBox5.Text = rwdist ' displays runway dist replaces dblsta with
    new format
    Show ' show user form
    End Sub
     
    john coon, Feb 14, 2005
    #1
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.