Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How hard can it be survey file to polyline

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
richie_hodgson
537 Views, 10 Replies

How hard can it be survey file to polyline

Hi

 

I have been hunting arround to find a way to read a survey file as per attached and output a polyline. It contains the start coordinate in x,y format then a list of distances and bearings in 4<120d35'34' format. I thought it would be easy, I would write some code but am flat out. For us 0d is north.

Richie
10 REPLIES 10
Message 2 of 11
pbejse
in reply to: richie_hodgson


@richie_hodgson wrote:

Hi

 

I have been hunting arround to find a way to read a survey file as per attached and output a polyline. It contains the start coordinate in x,y format then a list of distances and bearings in 4<120d35'34' format. I thought it would be easy, I would write some code but am flat out. For us 0d is north.


 

It is easy. tell me, do you have any other info to add like layers?

Message 3 of 11
3wood
in reply to: richie_hodgson

Save the information as a .scr file.

Add "Pline" as the first line.

Add "@" in front of each line (you can use find and replace function in MS Word, replace ^pwith ^p@

Then use SCRIPT command to load and run above scr file.

Then you can rotate, mirror and do whatever to make 0d as north direction.

 

pline
25,25
@10<45d00'00"
@20<90d00'00"
@50<120d00'45"
 

Message 4 of 11
pbejse
in reply to: 3wood


@3wood wrote:

Save the information as a .scr file.

Add "Pline" as the first line.

Add "@" in front of each line (you can use find and replace function in MS Word, replace ^pwith ^p@

Then use SCRIPT command to load and run above scr file....

 


And then,  there's that approach Smiley Happy 

 

Good one 3wood 🙂

 

Message 5 of 11
richie_hodgson
in reply to: pbejse

Nope I can deal with layers later
__________________________________________________________________________________________

Caution: The content of this email is confidential and may be legally privileged. If it is not intended for you, please email the sender immediately and destroy the original message. You may not copy, disclose or use the contents in any way.

The sender's email address in this message may constitute a designation of an information system for the purposes of section 11(a) of the Electronic Transactions Act 2002 (New Zealand). You agree that, in sending an email message to that address, the time of receipt will be when the message actually comes to the attention of the addressee, not the time the message enters the designated information system. Thank You.
__________________________________________________________________________________________
Richie
Message 6 of 11
pbejse
in reply to: richie_hodgson


@richie_hodgson wrote:
Nope I can deal with layers later

I see, you can try 3woods suggestion for scripts.

 

Holler if you still need a lisp routine approach.

Message 7 of 11


@richie_hodgson wrote:

... I have been hunting arround to find a way to read a survey file as per attached and output a polyline. It contains the start coordinate in x,y format then a list of distances and bearings in 4<120d35'34' format. ...


Not very hard....  Here's a way to do it that doesn't require editing the text file, or making a different file type out of it, so you can use such files directly as received [minimally tested on only your sample file]:

 

(setq fil (open "C:/Your/File/Path/Survey File.txt" "r"))
(command "_.pline" (read-line fil)); first line = start point
(while (setq lin (read-line fil)) (command (strcat "@" lin))); subsequent bearings
(command ""); end Polyline
(close fil)

Kent Cooper, AIA
Message 8 of 11

Spoiler
One more quick question, I had a little play to do the same thing with a coordinates file as per attached, but it is currenlty not working and I cant seem to work out why, it's probably a easy fix Smiley Very Happy

 

Richie
Message 9 of 11

Hi Kent the previous post didn't apear to work, I have had a tinker to do the same thing with a coordinate file as per attached, it currently doesnt seem to work, its probably an easy fix, can you help.

Richie
Message 10 of 11


@richie_hodgson wrote:

... I have had a tinker to do the same thing with a coordinate file as per attached, it currently doesnt seem to work....


Try something like this [untested] -- simpler because the first line isn't a different kind of input from the remaining lines:

 

(setq fil (open "C:/Your/File/Path/Survey File.txt" "r"))
(command "_.pline"); start Polyline

(while (setq lin (read-line fil)) (command lin)); feed in coordinates
(command ""); end Polyline
(close fil)

Kent Cooper, AIA
Message 11 of 11

Awesome
Richie

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost