Alignment sheet Profile Data to excel

Alignment sheet Profile Data to excel

bit_Cad2018
Advocate Advocate
5,650 Views
38 Replies
Message 1 of 39

Alignment sheet Profile Data to excel

bit_Cad2018
Advocate
Advocate

Dear User, 

                 I have 254 Alignment sheet file, i want to make List from Alignment sheet data 

as following

 

1) Chainage with Ground Level & Some Points Crossing or TP 

 

Please see Attachment

0 Likes
Accepted solutions (4)
5,651 Views
38 Replies
Replies (38)
Message 21 of 39

pbejse
Mentor
Mentor

@bit_Cad2018 wrote:

@pbejse  Thanks you for Help, This Program Extremely Good.

 


 

Good to know you finally able to make it work on your PC. Remember what i said about layers, it will make yur life easir.

And you are welcome 🙂

 

 

Message 22 of 39

hak_vz
Advisor
Advisor
Accepted solution

@bit_Cad2018  As I promised, here is my final solution.

After window selection it asks user to select name of output csv file and it opens it in Excel.

There record can be checked and finaly saved to desired file format and with final name.

For multiple sheets you can always overwrite single csv file, or keep them if your like. 

 

 

(defun c:sef nil (sef))

(defun sef ( / data data1 data2 data3  p1 p2 ss i n ent dist cont e xcords a b c str f file1 path)

(setq p1 (getpoint "\nSelect first window point (down left) >"))
(setq p2 (getcorner p1 "\nSelect second window point (up right) >"))
(setq f  (getfiled "Output csv:" (getvar "dwgprefix") "csv" 3))
(setq path f)
(setq file1 (open f "w"))
(setq ss (ssget "_W" p1 p2 '((0 . "TEXT"))))
(setq i -1 n (sslength ss))
(while (< (setq i (+ i 1)) n)
	(setq ent (entget (ssname ss i)))
	(setq dist (cadr (assoc 11 ent)))
	(setq cont (cdr (assoc 1 ent)))
	(setq data (cons (cons dist cont) data))
)
(setq i -1 )
(while (< (setq i (+ i 1)) n)
	(setq e (nth i data))
	(cond 
		((and (vl-string-position (ascii "+") (cdr e)) (vl-string-position (ascii ".") (cdr e))(< (strlen (cdr e)) 12 )) (setq data1 (cons e data1)))
		((and (not(vl-string-position (ascii "+") (cdr e)))  (< (strlen (cdr e)) 12 )) (setq data2 (cons e data2)))
		((> (strlen (cdr e)) 12 ) (setq data3 (cons e data3)))
	)
)
(setq data1 (vl-sort data1 '(lambda (a b) (< (car a)(car b)))))
(setq data2 (vl-sort data2 '(lambda (a b) (< (car a)(car b)))))
(setq data3 (vl-sort data3 '(lambda (a b) (< (car a)(car b)))))
(setq xcords (mapcar 'car data1))

(write-line "REQUIRED LIST;" file1)
(write-line (strcat "GROUND LEVELS(IN METRES)" ";" "CUMULATIVE CHAINAGE (KM     METRES)(000   +   000)" ";"	"CROSSING" ";"	"TP" ";") file1)

(foreach x xcords
    (setq del1 (- x 6) del2 (+ x 6) a nil b nil c nil)
	(foreach entry data1 (if (and(> (car entry) del1)(< (car entry) del2)) (setq a entry)))
	(foreach entry data2 (if (and(> (car entry) del1)(< (car entry) del2)) (setq b entry)))
	(foreach entry data3 (if (and(> (car entry) del1)(< (car entry) del2)) (setq c entry)))
	(if a (setq a (cdr a)))
	(if b (setq b (cdr b)))
	(if c (setq c (cdr c)))
	(setq str "")
	(if a (setq str (strcat str a ";")))
	(if b (setq str (strcat str b ";")))
	(if c (setq str (strcat str c ";")))
	(write-line str file1)
)
(close file1)
(startapp "explorer" path)
(princ)
)

 

 

Now you have solution by @pbejse  and my own sou you can use which better suites you.

If you need som changes now, just reply to this post.

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 23 of 39

bit_Cad2018
Advocate
Advocate

@hak_vz  you are a true gentleman, Your solution also very useful.

 

no changes require in this code..  🙏

 

 

0 Likes
Message 24 of 39

hak_vz
Advisor
Advisor
Accepted solution

It seams to me there is an error in your .xslt template file.

You should change order of header columns:

Change

GROUND LEVELS, CUMULATIVE CHAINAGE,CROSSING,TP

to

CUMULATIVE CHAINAGE,GROUND LEVELS,CROSSING,TP

 

Or @pbejse  and I have to change our scripts.

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 25 of 39

bit_Cad2018
Advocate
Advocate

Okay @hak_vz . 

 

after this changes accurate result gives us.

 

Thank you for your efforts. 🙏

0 Likes
Message 26 of 39

HR2323
Advocate
Advocate

@hak_vz ,

I was also looking for one such Lisp, I need some more data export TP number and angle which has shown the top in the drawing.

0 Likes
Message 27 of 39

hak_vz
Advisor
Advisor

@HR2323  I will look what I can do.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 28 of 39

HR2323
Advocate
Advocate

@pbejse , @hak_vz ,

Any update?

0 Likes
Message 29 of 39

hak_vz
Advisor
Advisor

@HR2323 

 

Provide sampled drawing that has in it all your required data. I'll check it through the weekend.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 30 of 39

HR2323
Advocate
Advocate

@hak_vz 

Please see the attached file

0 Likes
Message 31 of 39

hak_vz
Advisor
Advisor

@HR2323   TP is collected in current code. To calculate angle ? try to use Excel. It would make task a bit complicated, and that is relative easy to do in Excel.

 

If that is not what you request, then add som more detail.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 32 of 39

HR2323
Advocate
Advocate

@hak_vz ,

There is no need to calculate an angle, just like we have to find the crossing in front of the chainage, in the same way that the Tp number and angle is to be exported in front of the chainage which is already present in the drawing at top side.

Please look a closely

 

0 Likes
Message 33 of 39

hak_vz
Advisor
Advisor

@HR2323  I finally  get it.  You have this data at the top of the table. Will look to do it over the weekend. Maybe @pbejse  will have time to tackle this task and update his code.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 34 of 39

pbejse
Mentor
Mentor

@hak_vz wrote:

Maybe @pbejse  will have time to tackle this task and update his code.


 

🤔

No thanks ,I think I'll pass😊 Not interesting enough

 

 

Message 35 of 39

HR2323
Advocate
Advocate

@hak_vz,

Have you improved your code?

0 Likes
Message 36 of 39

hak_vz
Advisor
Advisor

@HR2323I'll work on it through the weekend. Didn't have time. I'll have to rewrite the code so it can accept as many rows from the table and not to rely on string filtering. 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 37 of 39

HR2323
Advocate
Advocate

Forgive me for the disturbance, but I wanted to know if you found a solution?

0 Likes
Message 38 of 39

hak_vz
Advisor
Advisor

I'm working on it, but don't promise anything.I had been busy over the weekend and didn't had a time to work on it as I have planed. It is not simple to collect all the data since there are inter rows categories (angles ....).  and they don't follow distribution in CSV.

 

What I don't like is to work on solution that solve only individual problem.  I would rather create solution to read as

many rows of data you like (universal solution) where you can later add what is missing.

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 39 of 39

paul.reichert
Contributor
Contributor

Route Mapper Ai can automate infrastructure centerline construction alignment sheets with heartbeat centerlines and reroutes!  Need slope station?  Route Mapper AI works with 2D and 3D polylines.  Efficiency smart AI technology.

0 Likes