plecs Posted November 6, 2014 Posted November 6, 2014 can someone help me and me to change lisp routines below with something else to count same blocks and write text file on a line all the attributes of blocks thank you in advance (defun c:Test (/ f w ss i e en) ;;--- Tharwat 09. May. 2013 ---;; (if (and (setq ss (ssget "_X" '((0 . "INSERT") (66 . 1)))) (setq f (getfiled "Specify name of txt file :" "" "txt" 1)) (setq w (open f "w")) ) (progn (repeat (setq i (sslength ss)) (setq e (ssname ss (setq i (1- i)))) (while (/= (cdr (assoc 0 (setq en (entget (setq e (entnext e)))))) "SEQEND" ) (if (eq (cdr (assoc 0 en)) "ATTRIB") (write-line (cdr (assoc 1 en)) w) ) ) ) (close w) ) (cond ((not ss) (alert "Couldn't find any Attributed Block in the drawing <!>" ) ) ((not f) (princ "\n File failed to be created <!>")) (t (princ "\n Can not open the specified file <!>")) ) ) (princ "\n Written by Tharwat Al Shoufi") (princ) ) Quote
Tharwat Posted November 7, 2014 Posted November 7, 2014 Are you after giving the option to users to select the attributed blocks they want to export only ? if so , just remove "_X" from the routine . Otherwise more explanations is needed . Quote
plecs Posted November 8, 2014 Author Posted November 8, 2014 values that exports to txt file are vertical if the block has multiple attibute write them horizontally, and if the block were identical to remuve duplicates and have quantity 650 510 0 FUND_1 1 0 1 1 101PE Alb Perlat 18 744 510 0 LAT_1 1 0 0 0 101PE Alb Perlat 18 744 510 0 LAT_1 1 0 0 0 101PE Alb Perlat 18 614 100 0 TRAV_1 1 0 0 0 101PE Alb Perlat 18 614 100 0 TRAV_1 1 0 0 0 101PE Alb Perlat 18 645 757 0 SP_PFL_1 0 0 0 0 101PE Alb Perlat 3 I wish if I can help with lisp routine changed to export txt just like this 1 650 510 0 FUND_1 1 0 1 1 101PE Alb Perlat 18 2 744 510 0 LAT_1 1 0 0 0 101PE Alb Perlat 18 2 614 100 0 TRAV_1 1 0 0 0 101PE Alb Perlat 18 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.