Jump to content

Extract the attributes, and written table (help)


andy_lee

Recommended Posts

Extract the attributes, and written table(or output excel), this is a BOM ?

sshot-5.png

 

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 by andy_lee
Link to comment
Share on other sites

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

  • andy_lee

    31

  • Tharwat

    22

  • hanhphuc

    7

  • hmsilva

    1

Top Posters In This Topic

Posted Images

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 .

Link to comment
Share on other sites

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

andy%20att.PNG

Link to comment
Share on other sites

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

andy%20att.PNG

 

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)
)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :thumbsup:

Link to comment
Share on other sites

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 :thumbsup:

 

Many thanks for help! han.:D

I post at #7 , that lisp can use ?

Link to comment
Share on other sites

Many thanks for help! han.:D

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

Link to comment
Share on other sites

you are welcome. i din't try it, but the code does export attribute to .txt

but not as user-friendly as ATTOUT

 

Hi han, I use ATTOUT only get a txt file ,Could not reach the requirements of me.

test.jpg

Need programming ??

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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. (不是我不想自己動手,而是確實不會.)

 

ww.jpg

Edited by andy_lee
Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

Hi Andy .

 

Can you explain in more details this part of your request ?

 

Hi Tharwat, I'm glad to meet you .:D

In a dwg file ,Usually have 200~500 drawings , Each drawing has different "PARTNAME" and different "DRAWING NO."

www.png

 

Because , This contents must be input to ERP system , Can not be repeated !

So , Check is the best .

Link to comment
Share on other sites

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 .

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...