See the top rated post in this thread. Click here

Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: LOOKING FOR A LISP ROUTINE

  1. #1
    Member
    Join Date
    2003-04
    Posts
    19
    Login to Give a bone
    0

    Default LOOKING FOR A LISP ROUTINE

    I am currently working with LDD. I'm not sure if one exists, or how to go about creating one, but I'm looking for a lisp routine that will interpolate an elevation. It would need to work as such: You would be promted to select a point, input an elevation for that point, select a second point, then input an elevation for that point. The lisp would calculate the slope based upon the 2 elevations and the distance obtained from the 2 selection points. Then you would be promted to select a point in between those 2 original points, and the lisp would calculate the elevation for you based upon the obtained slope. This routine would be a tremendous help in obtaining proposed spot grades for a proposed grading plan.

    Thank You,
    Chris Bird

  2. #2
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,541
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    Do you want to do this without creating LDT points?
    Last edited by rkmcswain; 2007-10-22 at 05:40 PM. Reason: edit
    R.K. McSwain | CAD Panacea |

  3. #3
    Member
    Join Date
    2003-04
    Posts
    19
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    Yes if at all possible. If not, then I will find a work around.

  4. #4
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,541
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    Do you want to pick 2 actual POINT entities?
    Could you pick a single 3d LINE entity instead?

    Is your 3rd point always going to be on the line defined by the first two points, or will the 3rd point form a triangle?
    Are curves a factor, or will this always be three points on a line?
    R.K. McSwain | CAD Panacea |

  5. #5
    Member
    Join Date
    2003-04
    Posts
    19
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    -I do not want to pick 2 point entities.
    -I could pick a single 3d line instead if it gave me the option to input the elevation for each end of the line.
    -The 3rd point will always be on the line and not form a triangle.
    -It would be nice if it could work with curves as well, such as a 3d polyline with a curve. But I know that adding curves tends to complicate things. So to keep it simple and easy a straight line would work.

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    8,401
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    Quote Originally Posted by INTELLIBIRD2 View Post
    -I do not want to pick 2 point entities.
    -I could pick a single 3d line instead if it gave me the option to input the elevation for each end of the line.
    -The 3rd point will always be on the line and not form a triangle.
    -It would be nice if it could work with curves as well, such as a 3d polyline with a curve. But I know that adding curves tends to complicate things. So to keep it simple and easy a straight line would work.
    3D Polylines do not have curves.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #7
    All AUGI, all the time CAB2k's Avatar
    Join Date
    2016-01
    Location
    Brandon, Florida
    Posts
    687
    Login to Give a bone
    1

    Default Re: LOOKING FOR A LISP ROUTINE

    Assuming the elevation changes are linear and run perpendicular to a line between the first
    and second picked points this will return an elevation for the third picked point.

    Code:
    (defun c:test (/ p1 p2 p3 p4 el1 el2 el3 d12 vecs tepPt deltaE deltaE3)
      (and  (setq p1 (getpoint "\nPick First point: "))
            (setq el1 (getdist "\nEnter elevation."))
            (setq p2 (getpoint p1 "\nPick Second point: "))
            (setq el2 (getdist "\nEnter elevation."))
            (setq deltaE (- el2 el1)
                  d12 (distance p1 p2))
            (while (setq p3 (getpoint "\nPick point for elevation: "))
              (redraw)
              (grvecs (list 1 p1 p3 p3 p2))
              (setq tmpPt (polar p3 (+ (/ pi 2) (angle p1 p2)) 10.0))
              (setq p4 (inters p1 p2 p3 tmpPt nil))
              (setq deltaE3 (*(/ (distance p1 p4) (distance p1 p2))deltaE))
              (if (> (distance p2 p4) d12)
                (setq el3 (- el1 deltaE3))
                (setq el3 (+ el1 deltaE3))
              )
              (print (strcat "Elevation at point is " (rtos el3)))
            )
            )
      (princ)
    )
    PS Use at your own risk. Testing is recommended.
    Last edited by CAB2k; 2007-10-25 at 08:51 PM.

  8. #8
    Member
    Join Date
    2003-04
    Posts
    19
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    Thank you, Thank you, Thank you.
    Works Great!

  9. #9
    100 Club
    Join Date
    2006-10
    Location
    Chicagoland
    Posts
    154
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    I have to agree, this is a great little routine.

    I never thought of doing this, but it will definitely save me time. I like working smarter, not harder.

  10. #10
    100 Club
    Join Date
    2005-05
    Location
    IL
    Posts
    101
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    Cab, when I first saw the question I thought this would be a simple answer of using the 3d lines commands with the transition command or something like that but I thought I'd try out the list anyways......actually it is pretty useful. I'd still probably use 3d lines for most of my proposed grading design since they are needed for building surfaces anyway but this could come in handy when "playing around" with a design and trying to come up with better ideas.

    Thanks for your work.
    Mike Pollock
    Project Designer
    Farnsworth Group, Inc.
    **Infrastructure Design Suite 2014 **Navisworks **ArcMAP **Revit **

Page 1 of 3 123 LastLast

Similar Threads

  1. Calling up LISP routine from within another LISP
    By jimmy_goodall in forum AutoLISP
    Replies: 4
    Last Post: 2013-08-21, 05:56 AM
  2. NEED HELP WITH LISP ROUTINE - PURGE linetype lisp
    By ECASAOL350033 in forum AutoLISP
    Replies: 6
    Last Post: 2013-06-21, 01:13 AM
  3. Help with a lisp routine to add a 12" line to this routine
    By Orbytal.edge341183 in forum AutoLISP
    Replies: 3
    Last Post: 2012-11-14, 10:33 PM
  4. Combine three lisp routine into one routine.
    By BrianTFC in forum AutoLISP
    Replies: 1
    Last Post: 2012-02-08, 12:14 PM
  5. Replies: 9
    Last Post: 2012-01-21, 07:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •