See the top rated post in this thread. Click here

# Thread: Northing & Easting Miss Surveying Lisp routine

1. Login to Give a bone

## 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. Login to Give a bone

## 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))
)
(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.

3. Login to Give a bone

## 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. Login to Give a bone

## Re: Northing & Easting Miss Surveying Lisp routine

Originally Posted by amazingb2003
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))
)
(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))
)
)
)
)
)
)
)```

5. Login to Give a bone

## 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. Login to Give a bone

## 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))
)
(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))
)
)
)
)
)
)
)```

7. Login to Give a bone

## Re: Northing & Easting Miss Surveying Lisp routine

Originally Posted by mohibm2007
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?

#### Posting Permissions

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