attext lisp with block count

Discussion in 'AutoCAD' started by jhendershot, Jul 13, 2004.

  1. jhendershot

    jhendershot Guest

    been working on this with little to no luck. here is what i am trying to do:
    i have an equipment drawing with attributes related to each. right now i use the command attext and go through this way and then manually put into excel and edit out the duplicates of equipment. what i would like is a routine that does the extraction and counts the duplicate blocks. so what i get in the end result is a text file that has them counted already so when i open in excel it already has say, 3 EE-01 (eq. #) then the following attributed information.
    basically what iam looking to do is create an equipment schedule in excel right now i have it working very well with the attext command, but it just takes a bit and about a dozen commands later. iam just looking for a way to automate most of it.

    here are the steps that i follow now to get my result. anybody has any ideas on how to shorten and speed up the process i am all ears.

    1. attext - choose comma - pick template file - pick save location
    2. take text file and open with excel. - create column and put in quantity of duplicate blocks - delete duplicates
    3. once formatted to my specifications copy into pre-made equipment schedule (in excel)
    4. copy excel and paste into cad.


    *. i did find another topic on using a lisp routine to combine step 1 which i think is getting closer. lisp i am using below.

    (defun C:HEQ ( / ss)
    (if (setq ss (ssget '((0 . "INSERT")(66 . 1))))
    (command "attext" "C" ss "" "A" "F:/Hanger Ortho/Drawings Standards/Block Library/Block

    Attribute Extraction Files/HANGER_EQUIPMENT.TXT" (strcat "F:/Hanger Ortho/EQTEXT/" (getvar

    "dwgname")))
    )
    )
     
    jhendershot, Jul 13, 2004
    #1
  2. jhendershot

    ECCAD Guest

    If you .zip up a 'sample' .dwg and your Excel template, and E-Mail to:
    remove the nospam + .

    I will take a stab at it tomorrow. No charge.

    Bob Shaw
    www.bobscadshop.com
     
    ECCAD, Jul 13, 2004
    #2
  3. jhendershot

    jhendershot Guest

    appreciate it.
     
    jhendershot, Jul 13, 2004
    #3
  4. jhendershot

    jhendershot Guest

    email sent.

    thanks again.
     
    jhendershot, Jul 14, 2004
    #4
  5. jhendershot

    ECCAD Guest

    E-Mail returned with .lsp - tuned to your sample..
    Let me know if you like / don't like it.

    :) Cheers

    Bob
    www.bobscadshop.com
     
    ECCAD, Jul 14, 2004
    #5
  6. jhendershot

    jhendershot Guest

    all i can say Bob is wow.......

    this is great, works like a champ.

    i can't tell ya how much i appreciate it.

    thanks again.
     
    jhendershot, Jul 14, 2004
    #6
  7. jhendershot

    ECCAD Guest

    Glad to be of help.
    Keep in touch.
    You got my E-Mail.....

    :))

    Bob
     
    ECCAD, Jul 14, 2004
    #7
  8. jhendershot

    molokaiboy Guest

    Bob also helped me with a very similar routine. Can you post the routine or email it to me so I can see what the differences are?

    TIA
    Collin
     
    molokaiboy, Jul 14, 2004
    #8
  9. jhendershot

    ECCAD Guest

    Collin,
    Coming at ya.
    Bob
     
    ECCAD, Jul 14, 2004
    #9
  10. jhendershot

    jhendershot Guest

    i do have one question. (well for now anyway :) )

    i was testing this out and it works great in my 'masterblocks' drawing. but if i open up a new or existing drawing and insert the block then the lsp won't creat the csv file. is there a way for this to read the attribues even inside a block?

    thanks again.
     
    jhendershot, Jul 14, 2004
    #10
  11. jhendershot

    ECCAD Guest

    If you insert your 'masterblocks' as a regular insert, you will need to explode (1) time. Or, you can insert with the "*" preceeding the blockname.

    Bob
     
    ECCAD, Jul 14, 2004
    #11
  12. jhendershot

    ECCAD Guest

    If you include the 'equipmenttags' block with attributes, (inside) the block insert, you could check for all blocks, and extract the data that way, using the same 'tag' names.

    Bob
     
    ECCAD, Jul 14, 2004
    #12
  13. jhendershot

    jhendershot Guest

    basically all those equipment drawings in the masterblock drawing i emailed you were wblocked out to individual files and then people insert them into thier drawing as needed. I wanted to keep them as blocks so its easier to move around and switch up the floor plan without having to worry about grabing each line. is the thing you suggested about checking all the blocks something easily done? or could you point me in the right direction. i have no problems looking things up and doing some trial and error myself as i wish to learn more about this.

    thanks again for all the Help..
     
    jhendershot, Jul 14, 2004
    #13
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.