Results 1 to 3 of 3

Thread: LISP for surveying plans

  1. #1
    Member
    Join Date
    2011-11
    Posts
    17
    Login to Give a bone
    0

    Default LISP for surveying plans

    Can anyone assist in helping me adjust our LISP

    We currently prepare subdivision plans which require a number of scribed bearings and distances on a plan to be offset neatly from a line at a set offset, the neatness is critical. Currently we manually use the distance lisp below and then manually move the distance to tidy up the plan, then we use the bearing lisp and complete the same task to create our plan.

    We are hoping to merge or recreate our LISP so that when we click from one end point on a line to another endpoint the LISP will create a distance with the bearing below at a set height, style and offset from the line based on the current scale of the drawing. Can anyone assist as we have little knowledge of LISP writing.

    Bearing LISP
    (defun c:b1-2015()
    (setq pt (getpoint "choose lot centre:"))
    (command "-boundary" pt "")
    (command "area" "e" "l")
    (command "-layer" "m" "area" "c" "1" "" "")
    (setq a (getvar "area"))
    (setq b (* 4 (getvar "dimscale")))
    (command "text" "s" "arial" "j" "m" pt b 90 (strcat (rtos a 2 0) "m%%178"))

    )


    Distance (defun c:d2-2002() (command "osnap" "end")
    (setq pt1 (getpoint "1st end:"))
    (setvar "lastpoint" pt1)
    (setq pt2 (getpoint "2nd end:"))
    (command "osnap" "")
    (setq dist (rtos (distance pt1 pt2) 2 1))
    (setq ang (- 90.0 (/ (* (angle pt1 pt2) 180.0) pi)))
    (setq pt1 (getpoint "mid point of text:"))
    (setq b (* 3 (getvar "dimscale")))
    (command "-layer" "m" "DISTANCE" "c" "3" "" "")
    (command "text" "m" pt1 b ang dist)
    (princ)
    )

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: LISP for surveying plans

    Lots of suggestions re coding the first rule is that brg dist is always based on the direction of the two pick points, this way no need for pick mid as this is implied and always out. The text point is from the middle plus a fudge factor times the text height use txt middle centre this way appears neatly. The text angle needs to be checked to ensure read from bottom or right.

    Code:
    This line can cause problems if you imply radians for any reason it will stuff up.
    (setq ang (- 90.0 (/ (* (angle pt1 pt2) 180.0) pi)))
    
    (setq oldsnap (getvar 'osmode)) remember old setting
    (command "osnap" "")
    (setvar 'osmode 0) better than command method
    
    Use a layer table search rather than make layer everytime this way done once, better still have this layer in your template.
    
    Re the angle of the text if you look into these variables 
    Aunits
    Angdir 
    you can work out which quadrant your in and check the angle so always right& up
    
    Check out using polar (polar (polar pt1 ang (/ dist 2.0)) (+ (/pi 2.0) (* b 2)) 
    note the 90 angle needs to be checked
    
    As much as I would like to post its copyrited.

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: LISP for surveying plans


Similar Threads

  1. Surveying Bearing/Distance LISP Routine
    By BoarsNest01 in forum AutoLISP
    Replies: 59
    Last Post: 2017-03-02, 10:19 PM
  2. Northing & Easting Miss Surveying Lisp routine
    By amazingb2003 in forum AutoLISP
    Replies: 6
    Last Post: 2008-04-23, 06:45 PM
  3. Surveying Input*
    By av.33771 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2005-07-23, 11:27 PM
  4. surveying dimensions
    By ermbjf in forum ACA General
    Replies: 3
    Last Post: 2004-07-12, 03:59 PM

Posting Permissions

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