Remove spaces in bearing-distance LISP output

Remove spaces in bearing-distance LISP output

EBDBC3D
Advocate Advocate
1,024 Views
3 Replies
Message 1 of 4

Remove spaces in bearing-distance LISP output

EBDBC3D
Advocate
Advocate

How can I remove spaces at the "N" and "E" in the output of this LISP routine? For example, to go from N 89°30’30” E   100.00' to N89°30’30”E   100.00'. Thanks!

0 Likes
Accepted solutions (1)
1,025 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

Replace this line:

 

(setq brng (angtos ang 4 4))

 

with this, to strip the spaces out of it [nested, because (vl-string-subst) substitutes only the first instance]:

 

(setq brng (vl-string-subst "" " " (vl-string-subst "" " " (angtos ang 4 4))))

 

[That's specific to this case, assuming the string returned by (angtos) for Surveyor's Units (the first 4), which will have 2 and only 2 spaces in it.  If you want to strip spaces out of something that might have any number  of spaces, a (while) loop approach would be needed.]

Kent Cooper, AIA
0 Likes
Message 3 of 4

EBDBC3D
Advocate
Advocate

That worked - thanks!

0 Likes
Message 4 of 4

john.uhden
Mentor
Mentor

Checkout the UNITMODE system variable.

John F. Uhden