See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Northing & Easting Miss Surveying Lisp routine

  1. #1
    Member
    Join Date
    2007-08
    Posts
    3
    Login to Give a bone
    0

    Smile Northing & Easting Miss Surveying Lisp routine

    I am looking for a SURVEYING lisp routine titled "NE-CLC". What it does, is insert two lines of Dtext into a drawing, listing the Northing (Y), and Easting (X) distance between a calculated point and a located point. It prompted you to select the calculated point, then the located point, and then ask you if you wanted the text to be inserted into the drawing.

    It takes the pulled distance between a calcuated point location and the actual field located point:

    Command: '_dist Specify first point: Specify second point:
    Distance = 0.20, Angle in XY Plane = 69d19'7.9", Angle from XY Plane =
    0d0'0.0"
    Delta X = 0.07, Delta Y = 0.19, Delta Z = 0.00


    The text would appear like this:

    0.19'S
    0.07'W

    Can anyone help?

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

    Default Re: Northing & Easting Miss Surveying Lisp routine

    Here's a quick solution. There is no to very little error checking. It does not adjust any system variables. It utilizes the current text style, text size. If the current style does not have a height specified, it will see what the TEXTSIZE system variable has. If that equals 0.0 then it asks the user for the text size. All variables are local.
    Code:
    (defun c:NE-CLC	(/		  ACTUALPOINT	   CALCPOINT
    		 DIFFERENCEEASTING		   DIFFERENCENORTHING
    		 STREASTING	  STRLIST	   STRNORTHING
    		 TEXT		  TEXTPLACEMENT	   TEXTSIZE
    		)
      (setq	CalcPoint   (getpoint "\nSpecify Calculated Point: ")
    	ActualPoint (getpoint "\nSpecify Actual Point: ")
      )
      (setq	DifferenceNorthing (- (car CalcPoint) (car ActualPoint))
    	DifferenceEasting  (- (cadr CalcPoint) (cadr ActualPoint))
      )
      (list DifferenceNorthing DifferenceEasting)
      (if (minusp DifferenceNorthing)
        (setq strNorthing "'N")
        (setq strNorthing "'S")
      )
      (if (minusp DifferenceEasting)
        (setq strEasting "'E")
        (setq strEasting "'W")
      )
      (setq	strNorthing (strcat
    		      (rtos (abs DifferenceNorthing) 2 (getvar "luprec"))
    		      strNorthing
    		    )
    	strEasting  (strcat (rtos (abs DifferenceEasting) 2 (getvar "luprec"))
    			    strEasting
    		    )
      )
      (setq strList (list strNorthing strEasting))
      (setq	TextPlacement
    	 (getpoint
    	   "\nSpecify text insertion or <Enter> to exit: "
    	 )
      )
      (if (= (type TextPlacement) 'LIST)
        (progn
          (if
    	(or (null textsize)
    	    (= (cadr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE"))))
    	       0.0
    	    )
    	)
    	 (if (= (getvar "TEXTSIZE") 0.0)
    	   (while
    	     (null (setq textsize (getreal "\nSpecify Text Height: ")))
    	   )
    	   (setq textsize (getvar "TEXTSIZE"))
    	 )
    	 (setq textsize
    		(cadr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE")))
    		)
    	 )
          )
          (foreach n strList
    	(progn
    	  (setq	TEXT (list (cons 0 "TEXT")
    			   (cons 7 (getvar "TEXTSTYLE"))
    			   (cons 8 (getvar "CLAYER"))
    			   (cons 10 TextPlacement)
    			   (cons 11 TextPlacement)
    			   (cons 40 textsize)
    			   (cons 72 0)
    			   (cons 1 N)
    			   (cons 50 0.0)
    			   (cons 51 0.0)
    		     )
    	  )
    	  (entmake TEXT)
    	  (setq	TextPlacement
    		 (polar	TextPlacement
    			4.71239
    			(* 0.3428571428571425 (/ textsize 0.20))
    		 )
    	  )
    	)
          )
        )
      )
    )
    Post back any problems.
    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

  3. #3
    Member
    Join Date
    2007-08
    Posts
    3
    Login to Give a bone
    0

    Thumbs up Re: Northing & Easting Miss Surveying Lisp routine

    Thank you so much Opie!

    It works beautifully ... exactly what I was looking for!!!

    Just one problem though. It's giving me flopped quadrants.

    In one check, it said: 0.41'N, 0.08'W when it should be 0.08'N, 0.41'W

    in the second it said 0.38'N, 0.10'E when it should be 0.10'N, 0.38'E.

    Seriously ... I will weep tears of Joy if you can get this working properly.

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

    Default Re: Northing & Easting Miss Surveying Lisp routine

    Quote Originally Posted by amazingb2003 View Post
    Thank you so much Opie!

    It works beautifully ... exactly what I was looking for!!!

    Just one problem though. It's giving me flopped quadrants.

    In one check, it said: 0.41'N, 0.08'W when it should be 0.08'N, 0.41'W

    in the second it said 0.38'N, 0.10'E when it should be 0.10'N, 0.38'E.

    Seriously ... I will weep tears of Joy if you can get this working properly.
    Try this.

    Code:
    (defun c:NE-CLC	(/		  ACTUALPOINT	   CALCPOINT
    		 DIFFERENCEEASTING		   DIFFERENCENORTHING
    		 STREASTING	  STRLIST	   STRNORTHING
    		 TEXT		  TEXTPLACEMENT	   TEXTSIZE
    		)
      (setq	CalcPoint   (getpoint "\nSpecify Calculated Point: ")
    	ActualPoint (getpoint "\nSpecify Actual Point: ")
      )
      (setq	DifferenceEasting (- (car CalcPoint) (car ActualPoint))
    	DifferenceNorthing  (- (cadr CalcPoint) (cadr ActualPoint))
      )
      (list DifferenceNorthing DifferenceEasting)
      (if (minusp DifferenceNorthing)
        (setq strNorthing "'N")
        (setq strNorthing "'S")
      )
      (if (minusp DifferenceEasting)
        (setq strEasting "'E")
        (setq strEasting "'W")
      )
      (setq	strNorthing (strcat
    		      (rtos (abs DifferenceNorthing) 2 (getvar "luprec"))
    		      strNorthing
    		    )
    	strEasting  (strcat (rtos (abs DifferenceEasting) 2 (getvar "luprec"))
    			    strEasting
    		    )
      )
      (setq strList (list strNorthing strEasting))
      (setq	TextPlacement
    	 (getpoint
    	   "\nSpecify text insertion or <Enter> to exit: "
    	 )
      )
      (if (= (type TextPlacement) 'LIST)
        (progn
          (if
    	(or (null textsize)
    	    (= (cadr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE"))))
    	       0.0
    	    )
    	)
    	 (if (= (getvar "TEXTSIZE") 0.0)
    	   (while
    	     (null (setq textsize (getreal "\nSpecify Text Height: ")))
    	   )
    	   (setq textsize (getvar "TEXTSIZE"))
    	 )
    	 (setq textsize
    		(cadr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE")))
    		)
    	 )
          )
          (foreach n strList
    	(progn
    	  (setq	TEXT (list (cons 0 "TEXT")
    			   (cons 7 (getvar "TEXTSTYLE"))
    			   (cons 8 (getvar "CLAYER"))
    			   (cons 10 TextPlacement)
    			   (cons 11 TextPlacement)
    			   (cons 40 textsize)
    			   (cons 72 0)
    			   (cons 1 N)
    			   (cons 50 0.0)
    			   (cons 51 0.0)
    		     )
    	  )
    	  (entmake TEXT)
    	  (setq	TextPlacement
    		 (polar	TextPlacement
    			4.71239
    			(* 0.3428571428571425 (/ textsize 0.20))
    		 )
    	  )
    	)
          )
        )
      )
    )
    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

  5. #5
    Member
    Join Date
    2007-08
    Posts
    3
    Login to Give a bone
    0

    Wink Re: Northing & Easting Miss Surveying Lisp routine

    YAAAAAAAAAAAAAAAAAAAY!!!!!!!!!

    OPIE IS MY HERO!

    thank you, you've helped me tremendously. This has entitled you to one "Get-down-with-your-bad-self" dance.

  6. #6
    Woo! Hoo! my 1st post
    Join Date
    2008-04
    Posts
    1
    Login to Give a bone
    0

    Default Re: Northing & Easting Miss Surveying Lisp routine

    Hi, you have posted a routine to amazingb2003 on 31-08-2007 for the northing and easting which i have copied below.
    This routine calculates the difference and lists the difference.
    however, i need to to modify this routine so that it displays the northing and easting values for the actual point ie i want the routine to add the (difference between calculated& actual) to
    the calculated point and give the value.

    for example : calculated values are 488.059E, 838.641N ,
    and the actual values are 491.674E, 838.264N
    and the difference is 376.4 S, 3614.8 E.
    when i click 2 points, the difference values are shown. but i want the actual values shown when i click the second point.can you help?

    Code:
    (defun c:NE-CLC (/ ACTUALPOINT CALCPOINT
    DIFFERENCEEASTING DIFFERENCENORTHING
    STREASTING STRLIST STRNORTHING
    TEXT TEXTPLACEMENT TEXTSIZE
    )
    (setq CalcPoint (getpoint "\nSpecify Calculated Point: ")
    ActualPoint (getpoint "\nSpecify Actual Point: ")
    )
    (setq DifferenceEasting (- (car CalcPoint) (car ActualPoint))
    DifferenceNorthing (- (cadr CalcPoint) (cadr ActualPoint))
    )
    (list DifferenceNorthing DifferenceEasting)
    (if (minusp DifferenceNorthing)
    (setq strNorthing "'N")
    (setq strNorthing "'S")
    )
    (if (minusp DifferenceEasting)
    (setq strEasting "'E")
    (setq strEasting "'W")
    )
    (setq strNorthing (strcat
    (rtos (abs DifferenceNorthing) 2 (getvar "luprec"))
    strNorthing
    )
    strEasting (strcat (rtos (abs DifferenceEasting) 2 (getvar "luprec"))
    strEasting
    )
    )
    (setq strList (list strNorthing strEasting))
    (setq TextPlacement
    (getpoint
    "\nSpecify text insertion or <Enter> to exit: "
    )
    )
    (if (= (type TextPlacement) 'LIST)
    (progn
    (if
    (or (null textsize)
    (= (cadr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE"))))
    0.0
    )
    )
    (if (= (getvar "TEXTSIZE") 0.0)
    (while
    (null (setq textsize (getreal "\nSpecify Text Height: ")))
    )
    (setq textsize (getvar "TEXTSIZE"))
    )
    (setq textsize
    (cadr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE")))
    )
    )
    )
    (foreach n strList
    (progn
    (setq TEXT (list (cons 0 "TEXT")
    (cons 7 (getvar "TEXTSTYLE"))
    (cons 8 (getvar "CLAYER"))
    (cons 10 TextPlacement)
    (cons 11 TextPlacement)
    (cons 40 textsize)
    (cons 72 0)
    (cons 1 N)
    (cons 50 0.0)
    (cons 51 0.0)
    )
    )
    (entmake TEXT)
    (setq TextPlacement
    (polar TextPlacement
    4.71239
    (* 0.3428571428571425 (/ textsize 0.20))
    )
    )
    )
    )
    )
    )
    )
    Last edited by Opie; 2008-04-23 at 06:41 PM. Reason: [code] tags added

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

    Default Re: Northing & Easting Miss Surveying Lisp routine

    Quote Originally Posted by mohibm2007 View Post
    Hi, you have posted a routine to amazingb2003 on 31-08-2007 for the northing and easting which i have copied below.
    This routine calculates the difference and lists the difference.
    however, i need to to modify this routine so that it displays the northing and easting values for the actual point ie i want the routine to add the (difference between calculated& actual) to
    the calculated point and give the value.

    for example : calculated values are 488.059E, 838.641N ,
    and the actual values are 491.674E, 838.264N
    and the difference is 376.4 S, 3614.8 E.
    when i click 2 points, the difference values are shown. but i want the actual values shown when i click the second point.can you help?
    Are you just wanting a label shown where you select the actual point? Can you provide an example and workflow of what you are trying to achieve?
    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

Similar Threads

  1. Surveying Bearing/Distance LISP Routine
    By BoarsNest01 in forum AutoLISP
    Replies: 59
    Last Post: 2017-03-02, 10:19 PM
  2. ID Northing/Easting In C3D
    By jimmyhill in forum AutoCAD Civil 3D - General
    Replies: 13
    Last Post: 2016-01-26, 11:00 PM
  3. 2013: LISP Routine for adding Coords / Leader / Northing + Easting to Drawing
    By Wayne.Tappe in forum AutoCAD General
    Replies: 1
    Last Post: 2013-12-11, 02:10 PM
  4. Northing & Easting
    By gmarshall.222707 in forum Dynamic Blocks - Sharing
    Replies: 0
    Last Post: 2009-08-11, 10:02 PM
  5. Lisp routine for Labeling Northing and Easting
    By mserapiglia in forum AutoLISP
    Replies: 1
    Last Post: 2008-05-21, 10:01 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
  •