+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 29
  1. #1
    Full Member
    Using
    AutoCAD 2015
    Join Date
    Sep 2016
    Posts
    99

    AutoCAD Title Block Update Automatically

    Registered forum members do not see this ad.

    Hi Everyone
    I Have a Bulk of DWG files which needs to fill up the Title Block, each drawing file having Multiple layouts, all the title Block need to fill same details, and i have a text file for that. I need to update the title block Automatically.
    When i run the Command it will automatically get the detail from that text file (without open the dialog box for user selection) and update the Title Block. Text file saved on Specific path.

    Anyone Have an Idea Please Help Me.

    Thanks in Advance.

  2. #2
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,013

  3. #3
    Full Member
    Using
    AutoCAD 2015
    Join Date
    Sep 2016
    Posts
    99

    Default

    Hi RLX
    I have already tried that lee-mac Lisp, when i run that lisp its opening the dialog box for select the csv file. and also it was working with CSV file, but i have a Text file only.

    Could you please help me, how to fill automatically using text file.

    Thanks

  4. #4
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,013

    Default

    Quote Originally Posted by gmmdinesh View Post
    Hi RLX
    I have already tried that lee-mac Lisp, when i run that lisp its opening the dialog box for select the csv file. and also it was working with CSV file, but i have a Text file only.

    Could you please help me, how to fill automatically using text file.

    Thanks

    don't have much time but post example dwg & txt and will try to have a look at it. Or maybe just convert your txt file to a csv file?

  5. #5
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,603

    Default

    some examples

    line1
    line2
    line3


    line1,line2,line3

    line1 line2 line3 = line1,line2,line3

    Did you look at sample.zip in "Lee-mac" use notepad or excel to open sample csv.
    A man who never made mistakes never made anything

  6. #6
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,013

    Default

    quick , dirty & barely tested (txt -> csv)
    Attached Files
    Last edited by rlx; 7th Jun 2018 at 11:33 am. Reason: fixed little reverse bug

  7. #7
    Full Member
    Using
    AutoCAD 2015
    Join Date
    Sep 2016
    Posts
    99

    Default

    Please look at the Sample files.

    Sample.dwg
    Att.txt

    Thanks

  8. #8
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,013

    Default

    converting txt file could be as simple as :


    Code:
    (defun c:t2 ( / fn-in fp-in fn-out fp-out inp)
      (defun _ct (s)
        (while (vl-string-position (ascii "\t") s)(setq s (vl-string-subst "," "\t" s))) s)
    
      (and (setq fn-in (getfiled "Filename to convert" "" "txt" 0))
           (setq fp-in (open fn-in "r"))       
           (setq fn-out (strcat (vl-filename-directory fn-in) "/"
                                (vl-filename-base fn-in) ".csv"))
           (setq fp-out (open fn-out "w"))
           (while (setq inp (read-line fp-in)) (write-line (_ct inp) fp-out)))
      (if fp-in (close fp-in))(if fp-out (close fp-out)) (gc)
      (princ)
    )

  9. #9
    Full Member
    Using
    AutoCAD 2015
    Join Date
    Sep 2016
    Posts
    99

    Default

    Hey Rlx,
    Thanks for your Code, But I dont want to convert the text file to CSV.
    If I have A CSV file, Can i Update my title Block without opening the Dialog Box?

    Thanks

  10. #10
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,013

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by gmmdinesh View Post
    Hey Rlx,
    Thanks for your Code, But I dont want to convert the text file to CSV.
    If I have A CSV file, Can i Update my title Block without opening the Dialog Box?

    Thanks

    You started your 1st mail by saying you have a text file on a specific location. But probably not a problem. Each drawing has it own txt / csv file or one big mother of all csv / txt files for multiple files (drawings) , so multiple lines? And if so , how is the structure of your drawing name or is it just 9574896 as in your example? If so , is each sheet on a separate (named?) layout?

Similar Threads

  1. Lee Mac's Update Title Block
    By Craisbeck in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 7th Mar 2013, 05:04 pm
  2. Trying to Automatically update/redefine block in Thousands of drawings
    By john_waggs in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 4
    Last Post: 13th Feb 2013, 02:19 pm
  3. Automatically Update Title block lisp HELP!
    By Millsy29 in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 15th Jul 2010, 05:29 pm
  4. Update the attribute title block
    By andy_gs in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 4th May 2010, 04:22 am
  5. Title Block Update
    By eddablin in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 18th Apr 2009, 01:35 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts