fixo Posted November 28, 2013 Share Posted November 28, 2013 I haven't have a time to rewrite this lisp to your needs, so sorry Quote Link to comment Share on other sites More sharing options...
minhphuong_humg Posted November 28, 2013 Share Posted November 28, 2013 I haven't have a time to rewrite this lisp to your needs,so sorry Please, fixo and members in forum help me. Quote Link to comment Share on other sites More sharing options...
minhphuong_humg Posted November 29, 2013 Share Posted November 29, 2013 Or do you want to do it with Lisp? PS This will not work in 2010 version ~'J'~ I'm using Autocad 2014 and MS Office 2010. I used VB in autocad appear error. Please, help me. Thank you very much. Quote Link to comment Share on other sites More sharing options...
ytong Posted December 19, 2013 Share Posted December 19, 2013 Thanks fixo! The lisp code works fine! You are such a great helper! here is complete code (defun C:dx (/ *error* abks aexc asht col data dim_data elist en i row row_data ss tmp xbks xcel xshs) (vl-load-com) (defun *error* (msg) (if (vl-position msg '("console break" "Function cancelled" "quit / exit abort" ) ) (princ "Error!") (princ msg) ) ) (if (setq ss (ssget (list (cons 0 "dimension")))) (progn (setq i -1) (repeat (sslength ss) (setq en (ssname ss (setq i (1+ i))) elist (entget en) tmp (cons (cdr (assoc 11 elist)) (cdr (assoc 42 elist))) data (cons tmp data)) ) (setq dim_data (vl-sort data (function (lambda (e1 e2) (< (caar e1) (caar e2)))))) (alert "Close Excel File Only") (setq aexc (vlax-get-or-create-object "Excel.Application") xbks (vlax-get-property aexc "Workbooks") abks (vlax-invoke-method xbks "Add") xshs (vlax-get-property abks "Sheets") asht (vlax-get-property xshs "Item" 1) xcel (vlax-get-property asht "Cells") ) (vla-put-visible aexc :vlax-true) (vlax-put-property aexc "UseSystemSeparators" :vlax-false) (vlax-put-property aexc "DecimalSeparator" (vlax-make-variant "." ) (setq row 0 col 1) ;;added: [color=red](vlax-put-property xcel "NumberFormat"[/color] [color=red] (vlax-make-variant "0.00" [/color] [color=red] )[/color] (repeat (length dim_data) (setq row_data (car dim_data)) (setq row (1+ row)) (vlax-put-property xcel "Item" row col (vl-princ-to-string (cdr row_data)) ) (setq dim_data (cdr dim_data)) ) (vlax-invoke-method abks 'SaveAs "C:\\ImportDims.xls" -4143 nil nil :vlax-false :vlax-false 1 2 ) (vlax-release-object xcel) (vlax-release-object asht) (vlax-release-object xshs) (vlax-release-object abks) (vlax-release-object xbks) (vlax-release-object aexc) (setq aexc nil) (gc) (gc) ) (*error* nil) ) (princ) ) (prompt "\n\t\t>>>\tType DX to execute\t<<<\n") (princ) about measuring of closed polyline areas this will not work there is need to write another routine Not clearly enough for me what do mean Start a new thread please and attach the sample drawing for testing ~'J'~ Quote Link to comment Share on other sites More sharing options...
ytong Posted December 19, 2013 Share Posted December 19, 2013 I'm using Autocad 2014 and MS Office 2010. I used VB in autocad appear error. Please, help me. Thank you very much. Hey, plz use the lisp code. I tried both. The VBA code gave the same error as yours, but the lisp code works fine! Quote Link to comment Share on other sites More sharing options...
minhphuong_humg Posted December 20, 2013 Share Posted December 20, 2013 Thanks fixo! The lisp code works fine! You are such a great helper! Thanks fixo! The lisp code works fine! You are such a great helper! Thanks Fixo! Thanks ytong! Thank you all for your interest! The lisp code your works fine with dimension is straigh. But, I tried lisp's ytong ( ;;added: (vlax-put-property xcel "NumberFormat" (vlax-make-variant "0.00" ) don't ouput result). File attached. However, your lisp only selection dimension but don't selected text or mtext. I have a drawing with groups (each group is 1 dimension, 2 text). I hope your lisp selected each object order select dimension, select text 1 on (numerator) , select text 2 bottom (denominator).....until end. Then, ouput to excel (2010) include 3 columns with order: Text 1, Dimension, Text 2 (ex: 31 54 H7.5). Although, your lisp work fine with dimension (straigh) don't branch. I select order each dimension but don't output result. Ah, Output result don't sort order select when result of your lisp order reserver. Select end ouput (in excel) before. Thanks all. Please, please help me. File attach: http://www.mediafire.com/download/masapimvvhfh9lv/File.dwg My final final (reference): http://www.mediafire.com/download/xxod08ltmzlocrm/LNam.dwg http://www.mediafire.com/view/6zp9ov84rf9o5ma/LNam.xls Quote Link to comment Share on other sites More sharing options...
BAPPA Posted February 11, 2019 Share Posted February 11, 2019 On 11/6/2009 at 3:45 AM, fixo said: Marek, This one works with fractions for me Let me know.. ~'J'~ DimsToXL_Frac.LSP how to use Quote Link to comment Share on other sites More sharing options...
adif Posted September 15, 2021 Share Posted September 15, 2021 On 11/6/2009 at 5:15 AM, fixo said: Marek, This one works with fractions for me Let me know.. ~'J'~ DimsToXL_Frac.LSP 2.08 kB · 200 downloads how to change architecture type to decimal type? 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.