Jump to content

export cross section data?


javent

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...