Alcapone001 Posted January 19, 2017 Share Posted January 19, 2017 Hello everyone. I need a lisp to generate x y z values for contours from civil 3d to excel, into separate columns. Any ideas Thank you. Quote Link to comment Share on other sites More sharing options...
gS7 Posted January 19, 2017 Share Posted January 19, 2017 did you tried import/export tool in c3d Sent from my SM-E700H using Tapatalk Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 20, 2017 Share Posted January 20, 2017 You can convert CIV3D contours to plines and then could export out all the co-ordinates, the output file could be horrendous. You could export out at a spacing interval. I think you need to explain more why do you need the contour co-ords ? Quote Link to comment Share on other sites More sharing options...
Alcapone001 Posted January 20, 2017 Author Share Posted January 20, 2017 I am analysing a pipe network using some other software, which currently has no way of importing the contours in their current form. Hence the reason i need the contour x y z coordinates as text, preferably in excel Quote Link to comment Share on other sites More sharing options...
Alcapone001 Posted January 20, 2017 Author Share Posted January 20, 2017 Yes I have. No option for exporting contour values to text Quote Link to comment Share on other sites More sharing options...
gS7 Posted January 20, 2017 Share Posted January 20, 2017 (edited) May be this one helps you (only work for 3DPOLYLINES) (defun c:3dexport (/ *error* file sset pnt ssnm i vn omit ) (defun *error* (msg) (if file (close file)) (cond ((not msg)) ((member msg '("Function cancelled" "quit / exit abort"))) ((princ (strcat "\nError:" msg))) ) (princ) ) (if (setq sset (ssget "_:L" '((0 . "POLYLINE")))) (progn (if (setq file (open [color="red"](getfiled "File to Save" "C:\\" "csv" 1)[/color] "w")) (progn (write-line (strcat "Point No." "," "X" "," "Y" "," "Z") File) (setq pnt 1) (_Layer "Point_Text" 2) (repeat (setq i(sslength sset )) (setq ssnm(ssname sset (setq i(1- i)))) (setq vn (entnext ssnm)) (while (/= "SEQEND" (cdr (assoc 0 (entget vn)))) (setq pts(cdr (assoc 10 (entget vn)))) (_MakeText pts (rtos pnt 2 0) (getvar 'DIMSCALE) (Getvar 'TEXTSTYLE) "Point_Text") (setq omit (strcat (rtos pnt 2 0) ","(rtos (car pts) 2 4) "," (rtos (cadr pts) 2 4) "," (rtos (caddr pts) 2 4))) (write-line omit file) (setq vn(entnext vn)) (setq pnt(1+ pnt)) ) ) (close file) ) ) ) (*error* "Nothing Seleted:") ) (*error* nil) (princ) ) (defun _MakeTExt(point name ht style layer) (entmake (list (cons 0 "TEXT") (cons 10 Point) (cons 1 name) (cons 40 ht) (cons 7 style) (cons 8 layer) ) ) ) (defun _layer(name col) (if (not (Tblsearch "LAYER" name)) (command "_LAYER" "n" name "c" col name "") (command "_LAYER" "t" name "ON" name "c" col name "") ) ) Edited January 20, 2017 by gS7 Quote Link to comment Share on other sites More sharing options...
Alcapone001 Posted January 20, 2017 Author Share Posted January 20, 2017 My contours are all 3d polylines. when i use the lisp it shows 372 objects found. but nothing happens next Quote Link to comment Share on other sites More sharing options...
gS7 Posted January 20, 2017 Share Posted January 20, 2017 (open (strcat "D:\\Contour_Points" ".csv") "w")) Please Type Drive to save file Quote Link to comment Share on other sites More sharing options...
Alcapone001 Posted January 20, 2017 Author Share Posted January 20, 2017 How do i set it up to save to the desktop Quote Link to comment Share on other sites More sharing options...
gS7 Posted January 20, 2017 Share Posted January 20, 2017 Code updated in # 6 Now you sav save file anywhere Quote Link to comment Share on other sites More sharing options...
gS7 Posted January 20, 2017 Share Posted January 20, 2017 Did that worked for you ? Quote Link to comment Share on other sites More sharing options...
Alcapone001 Posted January 21, 2017 Author Share Posted January 21, 2017 Thanks man Quote Link to comment Share on other sites More sharing options...
Alcapone001 Posted January 21, 2017 Author Share Posted January 21, 2017 Though it is not picking all the 3d contour polylines, i dont know why.. Quote Link to comment Share on other sites More sharing options...
gS7 Posted January 21, 2017 Share Posted January 21, 2017 Please attach sample Drawing file which is not selecting contours lines Quote Link to comment Share on other sites More sharing options...
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.