javent Posted June 9, 2010 Posted June 9, 2010 I am trying to export the offset/elevation data from my cross sections to a text file or excel file so i can paste the info into another program. so far i've been labeling the offset/elevation info on the section and typing it into excel by hand. Any suggestions? Quote
BIGAL Posted June 10, 2010 Posted June 10, 2010 I previously wrote a routine that exported out a line of text as a file you could then import it into excel. There should be here if you search for a way of writing selected multiple text straight to excel the only trick is to get it in the corect order I used a sort routine based on the x,y position of the text (when selecting objects they are returned in database order not whats seen on the screen) Otherwise how are you making the cross sections ? Our other civil softwrae can export the vaules to a text file can you maybe do this. Quote
javent Posted June 10, 2010 Author Posted June 10, 2010 I've searched in Civil3D for way to export the data, but so far I've come up empty. Quote
BIGAL Posted June 11, 2010 Posted June 11, 2010 here is a copy of the code to write a column (or row) of text you just need sort on X value for cross section Do twice or 3 times design existing offset etc [font=Courier New]; converts column of text to comma seprated file with text value and y value[/font] [font=Courier New]; put in excell and sort by y value[/font] [font=Courier New]; by Alan H Nov 2004[/font] [font=Courier New](setq x 1)[/font] [font=Courier New](while (/= x 4)[/font] [font=Courier New] (setq howmany (rtos x 2 0))[/font] [font=Courier New] (setq fileto (strcat "c:/temp/setout" howmany))[/font] [font=Courier New] (princ fileto)[/font] [font=Courier New] (setq fout (open fileto "w"))[/font] [font=Courier New] (while (not (setq ss (ssget )))) [/font] [font=Courier New](princ "wow")[/font] [font=Courier New] (while (setq en (ssname ss 0))[/font] [font=Courier New] ; Entity type[/font] [font=Courier New] (setq entyp (cdr (assoc 0 (entget en)))) [/font] [font=Courier New](princ "wow")[/font] [font=Courier New] (if (= entyp "TEXT")[/font] [font=Courier New] (progn[/font] [font=Courier New] (setq xyz (cdr (assoc 10 (entget en))))[/font] [font=Courier New] (setq txtht (cdr (assoc 1 (entget en))))[/font] [font=Courier New] ;write file out here[/font] [font=Courier New] (setq textout (strcat txtht "," (rtos (cadr xyz) 2 3)))[/font] [font=Courier New] ;write[/font] [font=Courier New] (write-line textout fout) [/font] [font=Courier New] (princ textout)[/font] [font=Courier New] ) [/font] [font=Courier New] ) [/font] [font=Courier New] ; Delete each measured entity from set[/font] [font=Courier New] (ssdel en ss)[/font] [font=Courier New] ;end while[/font] [font=Courier New] )[/font] [font=Courier New] (close fout)[/font] [font=Courier New] (setq x (+ x 1))[/font] [font=Courier New]) ;end if loop 3 times[/font] [font=Courier New](princ)[/font] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.