Conecting Strings

Discussion in 'AutoCAD' started by Nick Haury, Jan 31, 2004.

  1. Nick Haury

    Nick Haury Guest

    I really don't know if the subject is the right one, but the situation is
    this. I have a userform that asks for input of surveyor distance and angle.
    Each box has a definite function, i.e. the first text box you put in the
    first bearing = N, the second asks for Degrees = 31, the next asks for
    minutes = 30, and the next asks for Seconds = 00, next for the last compass
    bearing = E, and finally for the distance = 435'. OK, what I'm trying to do
    is have these text boxes be able to come up with a distance and bearing. The
    following is the command line for input after you have selected the line
    command and picked a start point; @435'<N31d30'00"E , so the question is
    how do I get the values, that are input into the text boxes, into one string
    like that which I've shown?
     
    Nick Haury, Jan 31, 2004
    #1
  2. Nick Haury

    Ben Guest

    Dim AllTogether as String

    AllTogether = TextBox1.Value & TextBox2.Value & TextBox3.Value

    etc...., etc..., etc....

    Let me know if you need soemthing more specific than that.

    Hint: To add spaces, use TextBox1.Value & " " & TextBox2.Value
     
    Ben, Jan 31, 2004
    #2
  3. Nick Haury

    Jeff Mishler Guest

    strCommand = "@" & distBox.value & "'<" & northBox.value & degBox.value & _
    "d" & minBox.value & "'" & secBox.value & """" &
    eastBox.value

    HTH,
    Jeff
     
    Jeff Mishler, Jan 31, 2004
    #3
  4. Nick Haury

    Nick Haury Guest

    Thanks guys, but this brought up another question, do I need anything
    special to make sure the degrees, minutes, and seconds come out a (d, ', ")
    and the distance as feet?
    Nick
     
    Nick Haury, Jan 31, 2004
    #4
  5. Nick Haury

    Nick Haury Guest

    OOPS didn't see this post, sorry
     
    Nick Haury, Jan 31, 2004
    #5
  6. Hi Nick,

    For the angle, standard AutoCAD has no other option it understands for angle
    format.

    I also suspect that you will need to ensure that AutoCAD is working in
    Surveyor's units for this to work.

    For the distance - when you draw in AutoCAD, you draw in AutoCAD drawing
    units. If you have a drafting convention that 1 drawing unit = one foot,
    then that it what you'll get.

    Usually, this type of work would be done with Land Desktop which understands
    angles in the format DDD.MMSS rather than DDDdMM'SS"

    Lastly, it looks as though you may be trying to draw a line with the Send
    command option. You would be better of to use your data to calculate the
    ends of the line and use the end coordinates to draw the line.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Feb 1, 2004
    #6
  7. Nick Haury

    Nick Haury Guest

    OK, how would I do this, if given only the information that is provided on a
    plat? I.E. a property boundary that on one side is 435.5' long with a
    bearing angle of it starting at a particular point an traveling along the
    angle set forth by the surveyor i.e. N65d15'35"W. It would seem to me that
    I would have to input that information, reference it to the start point, and
    then somehow convert that info into a useful angle, relative to the start
    point and then get the end point, so I could polar the command! Please
    correct me if I'm wrong, but if this the right approach, then how would I go
    about doing it?
    Nick
     
    Nick Haury, Feb 1, 2004
    #7
  8. Nick Haury

    Ben Guest

    Ready for a little math? :D

    Ok, here are some conversion functions that are useful when trying to
    make AutoCAD understand where to draw the line. It does a lot of the
    calculations for you, but AutoCAD still wants to make sure you
    understand them.

    We'll start here with an example bearing point and distance.

    45.50' N45d00'00"E

    We'll save the distance aside for later, break it off, or put it into
    some other variable to begin with.

    Now, you need to break down your bearing point string. Mainly, take
    off the compass bearings (N, S, E, W) and that can allow you to break
    it down into four quadrants. Northeast, Northwest, Southeast, and
    Southwest. You can use the Left and Right functions within VBA to do
    this, and then run a comparison to see which quadrant you are in.

    Leaving us with:

    45d0'0"

    Since AutoCAD only does the math we need later on with doubles, and
    that is certainly not a double, we need to convert it. Not a problem

    Use the following.

    Dim EndAngle as Double

    EndAngle = ThisDrawing.Utility.AngleToReal(YourString,
    acDegreeMinuteSeconds)

    This leaves us with a Double containing the radians equivelant of the
    bearing point you started out with.

    (It will be a long number)

    Ready for the math? The formula differs by quadrant, make sure to
    determine which one you are in properly.

    Northeast quadrant:
    Change in X = Distance * sin(bearing)
    Change in Y = Distance * cos(bearing)

    Northwest quadrant:
    Change in X = Distance * sin (bearing) * -1
    Change in Y = Distance * cos (bearing)

    Southeast quadrant:
    Change in X = Distance * sin (bearing)
    Change in Y = Distance * cos (bearing) * -1

    Southwest quadrant:
    Change in X = Distance * sin (bearing) * -1
    Change in Y = Dsitance * cos (bearing) * -1

    That will give you the x, and y distance from the endpoint of the last
    line that you need to go. Take the value of X and add it to the X value
    of your starting point, and the same with Y. Then use AddLine to draw
    your line, giving it the starting point, and your newly created end
    point.

    Or you could just use the SendCommand. :)
     
    Ben, Feb 1, 2004
    #8
  9. Nick Haury

    rforjzis Guest

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.