See the top rated post in this thread. Click here

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: LOOKING FOR A LISP ROUTINE

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

    Default Re: LOOKING FOR A LISP ROUTINE

    Glad you all found a use for it.

  2. #12
    All AUGI, all the time CADDmanVA's Avatar
    Join Date
    2006-12
    Location
    New Orleans, LA
    Posts
    881
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    After seeing what you can do with LISP, when are you going to start teaching Cab? I'd sign up for a series of classes if you taught them. I've always wanted to learn, but the books I've found don't seem to do it.
    I loved the NCS so much, I joined the committee!

    "Truth suffers from too much analysis"
    I remember AutoCAD R10

    When will Autodesk port AutoCAD to Linux?

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

    Default Re: LOOKING FOR A LISP ROUTINE

    Thanks for the kind words.
    There are lots of folks here that can teach lisp. I find I learn best by doing. Start a lisp & you will
    get plenty of help & tips on how to compose your routine.
    Be sure to read the two sticky topics in this forum. Lot of good stuff there.

  4. #14
    Member ron_09812001's Avatar
    Join Date
    2007-10
    Location
    Abu dhabi / Philippines
    Posts
    22
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    Quote Originally Posted by CAB2k View Post
    ............. run perpendicular to a line between the first
    and second picked points this will return an elevation for the third picked point.

    .
    if you picked a point that is non collinear with the first 2 points, does it assume the elevation of the point of intersection or does it have a slope also based on the first slope calculated?

    cab, what if my 3rd point which is running perpendicular between the first and second picked points has a different slope from the point of intersection?this would be useful in my routine. elevations in roads are given in road center but what im after is the elevation above my water pipeline, there is a change in slope because the road center is always higher compared to areas near the curb/gutter.

    -wizman07

  5. #15
    Member ron_09812001's Avatar
    Join Date
    2007-10
    Location
    Abu dhabi / Philippines
    Posts
    22
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    here's a simple drawing with regards to my query above..thanks
    Attached Files Attached Files

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

    Default Re: LOOKING FOR A LISP ROUTINE

    This is an image for my routine above.
    Attached Images Attached Images

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

    Default Re: LOOKING FOR A LISP ROUTINE

    Quote Originally Posted by ron_09812001 View Post
    if you picked a point that is non collinear with the first 2 points, does it assume the elevation of the point of intersection or does it have a slope also based on the first slope calculated?

    cab, what if my 3rd point which is running perpendicular between the first and second picked points has a different slope from the point of intersection?this would be useful in my routine. elevations in roads are given in road center but what im after is the elevation above my water pipeline, there is a change in slope because the road center is always higher compared to areas near the curb/gutter.

    -wizman07
    See if this will work for your needs.

    Code:
    ;;  CAB 11.3.07
    ;;  This one allows for a side slope
    ;;  Pick Start & End points of main run & enter elevations.
    ;;  Enter Lateral slope percentage. Example -2 = down 2%
    ;;  Pick lateral point & routine calculates the elevation at that point
    
    (defun c:SideSlope (/ p1 p2 p3 p4 el1 el2 el3 el4 d12 vecs tmpPt deltaE deltaE3
                   slope slo LatDis)
      (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 slope (getdist "\nEnter lateral slope %. Example -2 = down 2%"))
           (setq deltaE (- el2 el1)
                 d12    (distance p1 p2)
                 slo    (/ slope 100.)
           )
           (while (setq p3 (getpoint "\nPick point for elevation: "))
             (redraw)
             (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))
             )
             (setq LatDis (distance p3 p4) ; lateral Distance
                   el4    (+ (* LatDis slo) el3)
             )
             (grvecs (list 1 p1 p2 p3 p4))
             (print (strcat "Elevation at intercept is " (rtos el3 2)))
             (print (strcat "Elevation at point is " (rtos el4 2)))
           )
      )
      (princ)
    )
    Last edited by CAB2k; 2007-11-06 at 07:09 PM. Reason: Fixed a bug in the lisp

  8. #18
    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

    Forgot to attach my picture.
    Attached Images Attached Images

  9. #19
    Member ron_09812001's Avatar
    Join Date
    2007-10
    Location
    Abu dhabi / Philippines
    Posts
    22
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    i'll run few samples tomorrow, i'll let you know of my feedback,

    many thanks CAB

  10. #20
    Member ron_09812001's Avatar
    Join Date
    2007-10
    Location
    Abu dhabi / Philippines
    Posts
    22
    Login to Give a bone
    0

    Default Re: LOOKING FOR A LISP ROUTINE

    i ran a quick math here cab and its perfect..thank you very much.its a great use for me.

    but on the other hand, not all roads are straight, some having loops and round abouts, i may still do it manually when it comes to those portions or if u have any idea about that..

    more power.

Page 2 of 3 FirstFirst 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
  •