andy_lee Posted November 14, 2014 Share Posted November 14, 2014 (edited) Extract the attributes, and written table(or output excel), this is a BOM ? Maybe one dwg have 300~500 drawings........ I think like this : 1step. run command 2step. choose all drawing in mode space. (crossing ) 3step. Enter the text height (Text style is SIMPLEX, is style ,not font ) 4step. Select (a) pick a baskpoint insert table (b)or output excel Essential 1.Use Drawing number from top to bottom order arrange Sort by the last three digits of drawing No. eg. 1-SS706A-001 3-SS706A-002 2-SS706A-003 1-SS706A-004 1-SS706A-005 2.Check the PARTNAME , if have Duplicate PARTNAME ,SO Pop-up tips. 3.Check the DRAWING NO , if have Duplicate DRAWING NO ,SO Pop-up tips. 4.If insert table, Must: Layer is DIM , Text style is SIMPLEX, (is style ,not font ) DIM layer and SIMPLEX style is exist. But I can't try it by myself. I 'm sorry! I don't understand write lisp .lisp is so magical, when I have time, I will learn. Now I need help. Many thanks for help me! See Attachments. for test. TEST1.dwg Edited November 14, 2014 by andy_lee Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 14, 2014 Author Share Posted November 14, 2014 (edited) I think I find a way , USE "ATTEXT" AND "EATTEXT " AND "ATTOUT " See post #6 and #7 Edited November 14, 2014 by andy_lee Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 14, 2014 Author Share Posted November 14, 2014 May something like this ,http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extract-attributes-from-a-specific-block-and-write-to-table/td-p/5399759 I 'm sorry! I don't understand write lisp , someone can help? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted November 14, 2014 Share Posted November 14, 2014 hi Andy, please understand all members are volunteers , i think there're similar thread can be found here or other forum. 1.did you try? blockcounter? 2.Tips: to modify multiple (if you have express tool installed) command: ATTOUT after modify in excel command: ATTIN Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 14, 2014 Author Share Posted November 14, 2014 hi Andy,please understand all members are volunteers , i think there're similar thread can be found here or other forum. 1.did you try? blockcounter? 2.Tips: to modify multiple (if you have express tool installed) command: ATTOUT after modify in excel command: ATTIN Thanks han. I know all members are volunteers . Very wonderful forum and members ! There're similar thread not suitable for me . need modify ! Maybe one dwg have 300~500 drawing ... if manual statistics , It's a very difficult task . Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted November 14, 2014 Share Posted November 14, 2014 creating table from excel is not problem if your are using higher version of acad. also many blocks / attribute collection function around. my method is almost same, but not all can suit every need. as start point you should try how to manually manipulate data? try command: ATTOUT , edit in excel is better way. you can rearrange the column ,sorting, filter ,list table etc.. example has almost data in your post#1 Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 14, 2014 Author Share Posted November 14, 2014 creating table from excel is not problem if your are using higher version of acad.also many blocks / attribute collection function around. my method is almost same, but not all can suit every need. as start point you should try how to manually manipulate data? try command: ATTOUT , edit in excel is better way. you can rearrange the column ,sorting, filter ,list table etc.. example has almost data in your post#1 Thank you so much! han . Use " ATTOUT" can output all attribute in a txt file ......, need to manually organize. And I find another way , use command EATTEXT And I find a lisp , Can use ? I don't understand. ;;http://bbs.mjtd.com/thread-84241-3-1.html (defun c:tt(/ qxpath qxname files data ff ) (setq ff (open "c:\\tempfiles\\bom.txt" "w")) (princ "" ff) (close ff) (setvar "filedia" 0) (setvar "sdi" 1) (setvar "lispinit" 0) (setq qxpath "C:\\tempfiles\\") (setq qxname "*.dwg") (setq files (vl-directory-files qxpath qxname 1)) ;(setq files (FileNameSort files)) (setq data (car files)) (while data (command "open" ) (command (strcat "c:\\tempfiles\\" data)) (getatti) (command "qsave") (setq files (cdr files)) (setq data (car files)) ) (setvar "sdi" 0) (setvar "lispinit" 1) (command "close") ) (defun getatti(/ ss i ent elist tymc tydh js loop ename ff) (setq ss (ssget "all" (list '(0 . "INSERT") (cons 2 "A4,A4横,A3,A2,A1,A0")))) (if ss (progn (setq i (sslength ss)) (setq ent (ssname ss (setq i (1- i))) ename (entnext ent) loop t ) (while (and ename loop) (setq elist (entget ename)) (if (= (cdr (assoc 0 elist)) "ATTRIB") (progn (if (= (cdr (assoc 2 elist)) "图样名称") (progn (setq tymc (cdr (assoc 1 elist))) ) ) (if (= (cdr (assoc 2 elist)) "图样代号") (progn (setq tydh (cdr (assoc 1 elist))) ) ) (if (= (cdr (assoc 2 elist)) "件数") (progn (setq js (cdr (assoc 1 elist))) ) ) ) (setq loop nil) ) (setq ename (entnext ename)) ) ) ) (setq ff (open "c:\\tempfiles\\bom.txt" "a")) (princ (strcat tymc "\t\t" tydh "\t" js "\n") ff) (close ff) (princ) ) Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted November 14, 2014 Share Posted November 14, 2014 with ATTOUT you are close to the result because very easy manipulate in excel. i'm not sure Drawing Number to be renumbered (override)? Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 14, 2014 Author Share Posted November 14, 2014 with ATTOUT you are close to the result because very easy manipulate in excel.i'm not sure Drawing Number to be renumbered (override)? let us see your manually organized result in excel (screen shot) I think " EATTEXT " is best ! you can try it ! can choose attribute, can output *.xls ,can insert table. and no need ET tools Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted November 14, 2014 Share Posted November 14, 2014 I think " EATTEXT " is best ! you can try it ! can choose attribute, can output *.xls ,can insert table.and no need ET tools by EATTEXT , that's mean you are not going to reorganize column, edit or renumber attributes? however, i'm happy if it solved your issue if you want to edit multiple renumber or modify attribute: ATTOUT Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 14, 2014 Author Share Posted November 14, 2014 by EATTEXT , that's mean you are not going to reorganize column, edit or renumber attributes? however, i'm happy if it solved your issue if you want to edit multiple renumber or modify attribute: ATTOUT Many thanks for help! han. I post at #7 , that lisp can use ? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted November 14, 2014 Share Posted November 14, 2014 Many thanks for help! han.I post at #7 , that lisp can use ? you are welcome. i din't try it, but the code does export attribute to .txt but not as user-friendly as ATTOUT Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 14, 2014 Author Share Posted November 14, 2014 you are welcome. i din't try it, but the code does export attribute to .txtbut not as user-friendly as ATTOUT Hi han, I use ATTOUT only get a txt file ,Could not reach the requirements of me. Need programming ?? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted November 14, 2014 Share Posted November 14, 2014 why open with notepad?? open with EXCEL, check the tab delimited dialog. you can multiple select/move/add/delete the entire column/row etc.. filter/sort ascending/decending very easy to manipulate. (It's difficult to edit in acad table if you have many items to sort / renumber etc..) command: TABLE , then maybe has datalink etc.. (sorry im using v2007 i don't have this feature, so you try explore yourself) Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 14, 2014 Share Posted November 14, 2014 Hi andy lee, Was my 'Demo' suitable? Henrique Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 15, 2014 Author Share Posted November 15, 2014 (edited) Hi andy lee, Was my 'Demo' suitable? Henrique Hi henrique ,Many thanks! Thank you for your efforts! http://forums.autodesk.com Always display is not normal, Constantly refresh,is the same. Can you give me a full version ? Not I don't want to do it myself, I really can't do it. (不是我不想自己動手,而是確實不會.) Edited November 15, 2014 by andy_lee Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 15, 2014 Share Posted November 15, 2014 2.Check the PARTNAME , if have Duplicate PARTNAME ,SO Pop-up tips. 3.Check the DRAWING NO , if have Duplicate DRAWING NO ,SO Pop-up tips. Hi Andy . Can you explain in more details this part of your request ? Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 15, 2014 Author Share Posted November 15, 2014 Hi Andy . Can you explain in more details this part of your request ? Hi Tharwat, I'm glad to meet you . In a dwg file ,Usually have 200~500 drawings , Each drawing has different "PARTNAME" and different "DRAWING NO." Because , This contents must be input to ERP system , Can not be repeated ! So , Check is the best . Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 15, 2014 Share Posted November 15, 2014 Because , This contents must be input to ERP system , Can not be repeated ! So if both ( Part Name ) and ( Drawing No ) is the same , just ignore it and keep only one ? Quote Link to comment Share on other sites More sharing options...
andy_lee Posted November 15, 2014 Author Share Posted November 15, 2014 So if both ( Part Name ) and ( Drawing No ) is the same , just ignore it and keep only one ? Something is better than nothing , just ignore it and keep only one , ok . 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.