sanju2323 Posted January 10, 2015 Share Posted January 10, 2015 i need lisp The text along polyline to make coordinate & text Code Extract to CSV Sample.dwg Required.csv Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 11, 2015 Share Posted January 11, 2015 Your dwg in no way reflects how you got those elevations. Is it some form of set out routine did you have some other vertical curve info ? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 11, 2015 Share Posted January 11, 2015 Here is my approach . (defun c:Test (/ sel f o l) ;; Tharwat 11.01.2014 ;; (princ "\n Select Single texts :") (if (and (setq sel (ssget '((0 . "TEXT")))) (setq f (getfiled "Save as to csv format " (getvar 'DWGPREFIX) "CSV" 1)) (setq o (open f "w")) ) (progn ((lambda (x / sn e) (while (setq sn (ssname sel (setq x (1+ x)))) (setq l (cons (list (cdr (assoc 10 (setq e (entget sn)))) (cdr (assoc 1 e))) l)) ) ) -1) (setq l (vl-sort l '(lambda (q p) (< (cadr (car q)) (cadr (car p)))))) (write-line "Code,EASTING,NORTHING,ELEVATION" o) (mapcar '(lambda (v) (write-line (strcat (cadr v) "," (rtos (caar v) 2) "," (rtos (cadar v) 2) "," (rtos (caddar v) 2)) o)) l) (close o) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted January 11, 2015 Author Share Posted January 11, 2015 Thank you sir, Made a very good job lisp code Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted January 11, 2015 Author Share Posted January 11, 2015 The text appears to be vertical, The text appears to be vertical, the Polyline along text find out the text should accordingly. Sample2.dwg Required.csv Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 11, 2015 Share Posted January 11, 2015 My program is to work on the first drawing that you have attached in the first post . So to make the program works on cases like that , I think the program should consider the way that the polyline goes along and sort the texts accordingly . Quote Link to comment Share on other sites More sharing options...
pBe Posted January 12, 2015 Share Posted January 12, 2015 I knew i'd seen and replied to this request on another forum. The code i posted there should work on "sample2.dwg" and any other polyline configuration., only thing is, i opted to use the "TEXT" value instead of the Z coordinates for numerical text, as you already know, 1.292 will be listed as "0.0" elevation on the CSV file if Z coordinate supersedes the numeric value. So again, if the TEXT value is 1.292 and the Z coordinate is 0.0, what value should appear on the CSV list? 0.0 for me does not makes sense, unless your telling me 1.292 is the Base Elevation. Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted January 12, 2015 Author Share Posted January 12, 2015 sir, need right changes 1.292 text z (Elevation) value is 0.00 "p2csv.lsp" Quote Link to comment Share on other sites More sharing options...
pBe Posted January 12, 2015 Share Posted January 12, 2015 And change the TEXT string value that is "1.292" to "0.0" on the drawing? or will remain the same? or are you saying 0.00 at csv should read as 1.292 at the elevation column? Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted January 12, 2015 Author Share Posted January 12, 2015 (edited) text value as it is, in code column. but keep change elevation value actual height. ex 1.292 to 0.000 actual Elevation. Edited January 12, 2015 by sanju2323 Quote Link to comment Share on other sites More sharing options...
pBe Posted January 12, 2015 Share Posted January 12, 2015 Yes sir, the actual value of the Elevation of the column I'm sorry, its still not clear. Elevation "1.292" on the drawing would appear as 0.00 at the elevation column, using Z elevation coordinate of the TEXT entity as basis for the value? if that's the case, the text string value on the drawing will remain as "1.292" but listed as 0.00 on the CSV file? is that because 1.292 is the base elevation? and the rest should read as "+0.421" and/or "-0.203"? its odd because "TP00" is at 0.95 elevation? Or you are wanting 1.292 as Elevation value on the csv file and not 0.00? I just want to clear this up, in the long run, the user might inadvertently put the wrong "numerical string" value on the rest of the TEXT entity and end up with a mismatch on the CSV file. Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted January 12, 2015 Author Share Posted January 12, 2015 Please See Screen Shot Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 12, 2015 Share Posted January 12, 2015 I knew i'd seen and replied to this request on another forum. I would not have written any code about this thread if I saw your reply to the same thread in Autodesk forum . Quote Link to comment Share on other sites More sharing options...
pBe Posted January 12, 2015 Share Posted January 12, 2015 text value as it is, in code column.but keep change elevation value actual height. ex 1.292 to 0.000 actual Elevation. I understand about the "ELEVATION" column as 0.00on the CSV file But change the string value to "0.00" on the drawing or "keep" it as it is as "1.292"? it's the only thing that is not clear to me. I'm guessing change means chainage, that is where the disconnect is. "keep" / "change" Quote Link to comment Share on other sites More sharing options...
pBe Posted January 12, 2015 Share Posted January 12, 2015 I would not have written any code about this thread if I saw your reply to the same thread in Autodesk forum . No worries Tharwat, the more the better for the OP You have been very helpful to a lot of requests for custom routines, keep it up buddy. Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted January 12, 2015 Author Share Posted January 12, 2015 Code value is ok nothing problem Quote Link to comment Share on other sites More sharing options...
pBe Posted January 12, 2015 Share Posted January 12, 2015 Alrighty then. I change the code a bit to prompt for a filename , [similar to tharwats] there are times the user forgets to close the excel csv file and that will cause another set of problems. TEXT value will remain as it is on the drawing p2csv2.LSP Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted January 12, 2015 Author Share Posted January 12, 2015 sorry, Forgive me for understanding Thanks for Suggestion and replay Quote Link to comment Share on other sites More sharing options...
pBe Posted January 12, 2015 Share Posted January 12, 2015 sorry, Forgive me for understandingThanks for Suggestion and replay no problem dude, try the code on the previous post and tell me how it goes, Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted January 12, 2015 Author Share Posted January 12, 2015 It works, Thank You 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.