sachindkini Posted July 21, 2010 Posted July 21, 2010 Dear All Pline area into table Select pline (various layer for example area-1, area-2, area-e etc. ) Add area center of pline (area in sq.mt. & sq.ft.) And total in table (various layer for example area-1, area-2, area-e etc. ) i'm all ready post here http://www.cadtutor.net/forum/showthread.php?50515-Drawing-a-PLINE-and-getting-it-s-area-LISP PROPIEDADES_ENTIDAD.lsp Quote
sachindkini Posted July 22, 2010 Author Posted July 22, 2010 Yes, and what is your question? dear sir sorry for my bad english my question is 1) after selete pline create autocad table and area of pline put in table & center of pline. see my jpg file 2) area in tbale by layer vise (area-1, area-2 etc...) see example of pline to excle file (defun c:pline-area ( / *error* data-lst sorted-lst str-lst top-str polys data cnt obj file-nm tmp item tmp-str fl) (defun *error* (msg) (if(= msg "quit / exit abort") (princ "\nNo output file was selected") (princ msg) ) ) (setq top-str "" file-nm (getfiled "Output File" "" "csv" 1) ) (if(null file-nm)(exit)) (if(setq polys(ssget '((0 . "*POLYLINE")))) (repeat(setq cnt(sslength polys)) (setq obj (vlax-ename->vla-object (ssname polys (setq cnt(1- cnt)) ) ) data-lst (cons (list(vlax-get obj 'Layer) (vlax-get obj 'Area) ) data-lst ) ) ) ) (while data-lst (setq data (car data-lst) data-lst (cdr data-lst) tmp (list data) ) (foreach item data-lst (if(=(car item)(car data)) (setq tmp (cons item tmp) data-lst (vl-remove item data-lst) ) ) ) (setq sorted-lst(cons tmp sorted-lst)) ) (setq sorted-lst (vl-sort sorted-lst '(lambda(a b)( ) (foreach item (reverse sorted-lst) (setq top-str (strcat(caar item)"," top-str) ) ) (setq str-lst (cons top-str str-lst) cnt 0 ) (repeat(apply 'max(mapcar 'length sorted-lst)) (setq tmp-str "") (foreach item (reverse sorted-lst) (setq tmp-str (if(setq tmp(nth cnt item)) (strcat(rtos(cadr tmp)) "," tmp-str) (strcat "," tmp-str) ) ) ) (setq cnt (1+ cnt) str-lst (cons tmp-str str-lst) ) ) (if(setq fl(open file-nm "w")) (progn (foreach str (reverse str-lst) (write-line str fl) ) (close fl) (alert(strcat file-nm " was created")) ) (alert "Unable to create file") ) (princ) ) Quote
sachindkini Posted July 22, 2010 Author Posted July 22, 2010 Yes, and what is your question? dear sir just like u r Line Length Calculator add opation selction Quote
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.