Lee Mac Posted September 23, 2009 Share Posted September 23, 2009 Hey dude, Give this a shot: (defun c:pExt (/ *error* acc doc spc ent tmp file pt) (vl-load-com) (setq acc 2) ;; Accuracy (defun *error* (msg) (if doc (vla-EndUndoMark doc)) (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)) spc (if (zerop (vla-get-activespace doc)) (if (= (vla-get-mspace doc) :vlax-true) (vla-get-modelspace doc) (vla-get-paperspace doc)) (vla-get-modelspace doc))) (while (progn (setq ent (car (entsel "\nSelect Polyline: "))) (cond ( (eq 'ENAME (type ent)) (if (not (wcmatch (strcase (cdr (assoc 0 (entget ent)))) "*POLYLINE")) (princ "\n** Invalid Object Selected **"))) (t (princ "\n** Nothing Selected **"))))) (or *def* (setq *def* 2.0)) (initget 6) (and (setq tmp (getdist (strcat "\nSpecify Interval for Measurement <" (vl-princ-to-string *def*) "> : "))) (setq *def* tmp)) (if (setq file (getfiled "Select Output File" (cond (*out) ("")) "txt;csv" 9)) (progn (vla-StartUndoMark doc) (setq *out file file (open file "a") i -1) (write-line (delim '("X" "Y" "Z") 9) file) (while (setq pt (vlax-curve-getPointatDist ent (* (setq i (1+ i)) *def*))) (vla-AddPoint spc (vlax-3D-point pt)) (write-line (delim (mapcar (function (lambda (x) (rtos x 2 acc))) pt) 9) file)) (close file) (vla-EndUndoMark doc)) (princ "\n*Cancel*")) (princ)) (defun delim (lst chc / x y) (setq x (car lst)) (foreach y (cdr lst) (setq x (strcat x (chr chc) y))) x) Quote Link to comment Share on other sites More sharing options...
daffet Posted September 23, 2009 Share Posted September 23, 2009 Perfect Thank you very much. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 23, 2009 Share Posted September 23, 2009 Not a problem, I had fun Quote Link to comment Share on other sites More sharing options...
aryanarch Posted December 8, 2009 Share Posted December 8, 2009 hi i have many blocks in autocad file, i want to import xyz of any block to an Excel file. i dont know to use CoorN som one tell me step by step please Quote Link to comment Share on other sites More sharing options...
bbb120 Posted December 19, 2009 Share Posted December 19, 2009 stevesfr you use what version MS OFFICE? (I did not test with Office 2007) In any case I have a little changed programs. Now it is possible to keep in a text file csv or txt a format. If option Excell does not work, try option Text file (csv a format) and to answer "YES" inquiry "Open text file? [Yes/No] :" Commands: COOR - export of coordinates COORN-export of coordinates with numbering. Numbers of points are drawn by the text on the current layer, the current style, current height (TEXTSIZE) COORT-export of coordinates with numbering where number considers the text nearest to a point CoorNP-Coordinates + Numbers + Points. Draw points with current value of PDMODE and PDSIZE **ADD 2009-12-16 ** EcoorE.lsp - lisp file without russian text PS especially it was not tested, mistakes are possible PPS and one was found EcoorE.lsp works perfect on my machine ,it is really a good LISP file. Quote Link to comment Share on other sites More sharing options...
aryanarch Posted December 19, 2009 Share Posted December 19, 2009 thank u bbb120 it is working Quote Link to comment Share on other sites More sharing options...
ihsan179 Posted December 20, 2009 Share Posted December 20, 2009 thanks ----------------------------------- Quote Link to comment Share on other sites More sharing options...
rob_acor Posted June 10, 2010 Share Posted June 10, 2010 stevesfr you use what version MS OFFICE? (I did not test with Office 2007) In any case I have a little changed programs. Now it is possible to keep in a text file csv or txt a format. If option Excell does not work, try option Text file (csv a format) and to answer "YES" inquiry "Open text file? [Yes/No] :" Commands: COOR - export of coordinates COORN-export of coordinates with numbering. Numbers of points are drawn by the text on the current layer, the current style, current height (TEXTSIZE) COORT-export of coordinates with numbering where number considers the text nearest to a point CoorNP-Coordinates + Numbers + Points. Draw points with current value of PDMODE and PDSIZE **ADD 2009-12-16 ** EcoorE.lsp - lisp file without russian text PS especially it was not tested, mistakes are possible PPS and one was found Vva this is great, but could you amend this as to put a leader to the point and then the number and if possible the number with S in front of it eg S1, S2 etc Many thanks Rob Using Autocad 2010 Quote Link to comment Share on other sites More sharing options...
rob_acor Posted June 10, 2010 Share Posted June 10, 2010 Lee Mac this is great, but could you amend this as to put a leader to the point and then the number and if possible the number with S in front of it eg S1, S2 etc Many thanks Rob Using Autocad 2010 Quote Link to comment Share on other sites More sharing options...
ravi12 Posted June 11, 2010 Share Posted June 11, 2010 Dear VVa want one help from you want extract xyz and rotation angel of blocks on polyline is their any lisp? and one more thing i tried with coorn in that i can extract xyz but cant extract rotation angel plz help me Quote Link to comment Share on other sites More sharing options...
irawanaja Posted January 1, 2011 Share Posted January 1, 2011 stevesfr you use what version MS OFFICE? (I did not test with Office 2007) In any case I have a little changed programs. Now it is possible to keep in a text file csv or txt a format. If option Excell does not work, try option Text file (csv a format) and to answer "YES" inquiry "Open text file? [Yes/No] :" Commands: COOR - export of coordinates COORN-export of coordinates with numbering. Numbers of points are drawn by the text on the current layer, the current style, current height (TEXTSIZE) COORT-export of coordinates with numbering where number considers the text nearest to a point CoorNP-Coordinates + Numbers + Points. Draw points with current value of PDMODE and PDSIZE **ADD 2009-12-16 ** EcoorE.lsp - lisp file without russian text PS especially it was not tested, mistakes are possible PPS and one was found How If I want to Extport Dimension of an autocad object to excels? (sorry, my english not good).... Thanks Quote Link to comment Share on other sites More sharing options...
BearDyugin Posted January 1, 2011 Share Posted January 1, 2011 Irawanaja, my English is not good too. And accordingly I did not understand. What do you mean when you say Dimension? AutoCAD Dimension object or a length of object, such as line, or polyline? Quote Link to comment Share on other sites More sharing options...
irawanaja Posted January 2, 2011 Share Posted January 2, 2011 Tanks to your time Geobuilder, i mean length of object and the text of the object and i want to sort all to excels, like this image Quote Link to comment Share on other sites More sharing options...
VVA Posted January 2, 2011 Share Posted January 2, 2011 (edited) 1. The figure shows a polyline or lines ? 2. Marked text will always be in the middle of segment? Edited June 6, 2015 by VVA Quote Link to comment Share on other sites More sharing options...
kcrawford Posted May 18, 2011 Share Posted May 18, 2011 (edited) Can ECoorE.lsp be made to do Midpoints as well as Endpoints??? And also to include Z co-ordinates along with the XY co-ords??? Edited May 18, 2011 by kcrawford Quote Link to comment Share on other sites More sharing options...
woodman78 Posted May 18, 2011 Share Posted May 18, 2011 Where are the Coor, CoorN and CoorNP commands? Quote Link to comment Share on other sites More sharing options...
irawanaja Posted May 18, 2011 Share Posted May 18, 2011 the figure shows as polylines and / or lines (both) and the marker texts does not always in the middle of segment, i want to use the marker texts as sign where the lines / p. line if the dimension exsported to ms excels. tks Quote Link to comment Share on other sites More sharing options...
AvisRara Posted August 31, 2011 Share Posted August 31, 2011 Thank you for the lisps - I work in Acad 2000 and they did the job. Great! Quote Link to comment Share on other sites More sharing options...
VVA Posted September 1, 2011 Share Posted September 1, 2011 Thanks AvisRara Where are the Coor, CoorN and CoorNP commands? post #12 Quote Link to comment Share on other sites More sharing options...
dong95 Posted September 16, 2011 Share Posted September 16, 2011 Thank you for Lisp. 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.