+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15
  1. #11
    Senior Member LibertyOne's Avatar
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    194

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by ben_vk View Post
    Hi Guys,

    We have been supplied over 150 dwg files and I have been assigned the task of exporting them all to PDF. Is there a batch processor that is capable of doing this task? I can see software that will cost $99 and hopefully be able to do it, but im hoping to learn how to do it some other way (if possible!)

    Has anyone been down this path before and been able to do it?

    Thanks
    Man, that type of job sucks -- soon as I get home I'll post some code that someone could possibly change to work with your situation...

  2. #12
    Senior Member LibertyOne's Avatar
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    194

    Default

    Oooooo....just looked into my code...and it's a bit complicated because the code was meant to place a plot stamp on a drawing in model space where the drawing border and title block were scaled up to a certain size to match the scale of the drawing in model space. None of the drawings were in paper space. Each drawing was read and it knew which sheet size (A4, A3. A2, A1, A0), where the border was positioned and what scale it had. It then entered the stamp and then plotted to pdf. We had about 450 drawings and divided them out between the three of us. While the other two guys were doing everything manually, I set out to write a program to do it automatically. I finished it in about a half hour and had my 150 drawings plotted in pdf about 20 minutes later. Of course I shared this with the other guys, and they had their drawings finished two hours ahead of what they would have done manually. So I post the code for you all to pick at:

    SCRIPT:
    Code:
    filedia 1
    -PLOT
    J
    Model
    DWG To PDF.pc3
    !md_blatt
    Millimeter
    Querformat
    Nein
    F
    !md_fen_ul
    !md_fen_or
    Anpassen
    Zentrum
    Ja
    Plot_SW_Fert03.ctb
    Ja
    W
    !md_file
    Nein
    Ja
    Ja
    LISP CODE: (I've changed some names around to keep identities secret)
    Code:
    ;;STAMP.LSP
    ;;Adds documentation stamp and stamp number to the drawing.
    
    (defun C:STAMP ( / )
    
    (setq md_filedia (getvar "filedia"))
    (setq md_attdia (getvar "attdia"))
    (setvar "filedia" 0)
    (setvar "attdia" 0)
    
    ;;-------------------------------
    ;;   add stamp
    ;;-------------------------------
    
    (setq en(car(entsel))) 
    (setq elist(entget en)) 
    (setq md_sf (cdr (assoc 41 elist)))
    
    (setq md_tb_ul (list -180.0 80.0 0.0))
    
    (setq md_ul_xyz (mapcar '(lambda (a) (* a md_sf)) md_tb_ul))
    
    (setq md_xyz (mapcar '+ md_ul_xyz (cdr (assoc 10 elist))))
    ;path of stamp
    (setq md_path "C:\\Dokumente und Einstellungen\\John.Doe\\Eigene Dateien\\Doku\\stamp.dwg")
    (setq stamp-nr (strcat (substr (getvar "dwgname") 1 12) "/" (substr (getvar "dwgname") 14 3)))
    (setq md_file (strcat (substr (getvar "dwgname") 1 23)))
    (command "_.-insert" md_path md_xyz md_sf "" "" stamp-nr "")
    (command "_regen")
    (command "_purge" "_a" "*" "_n") 
    (command "_purge" "_a" "*" "_n") 
    (command "_purge" "_a" "*" "_n") 
    (command _"zoom" "_e")
    
    (setvar "filedia" md_filedia)
    (setvar "attdia" md_attdia)
    
    ;;-------------------------------
    ;;   print
    ;;-------------------------------
    (setq en(car(entsel))) 
    (setq elist(entget en))
    (cond
        ( (= (cdr (assoc 2 elist)) "RAHMENA0_L4") (setq md_border_or '(2329.0 841.0 0.0)
                            md_blatt "ISO A0 (841.00 x 1189.00 mm)") )
        ( (= (cdr (assoc 2 elist)) "RAHMENA0_L3") (setq md_border_or '(1949.0 841.0 0.0)
                            md_blatt "ISO A0 (841.00 x 1189.00 mm)") )
        ( (= (cdr (assoc 2 elist)) "RAHMENA0_L2") (setq md_border_or '(1569.0 841.0 0.0)
                            md_blatt "ISO A0 (841.00 x 1189.00 mm)") )
        ( (= (cdr (assoc 2 elist)) "RAHMENA0_L1") (setq md_border_or '(1379.0 841.0 0.0)
                            md_blatt "ISO A0 (841.00 x 1189.00 mm)") )
        ( (= (cdr (assoc 2 elist)) "RAHMENA0") (setq md_border_or '(1189.0 841.0 0.0)
                            md_blatt "ISO A0 (841.00 x 1189.00 mm)") )
        ( (= (cdr (assoc 2 elist)) "RAHMENA1") (setq md_border_or '(841.0 594.0 0.0)
                            md_blatt "ISO A1 (594.00 x 841.00 mm)") )
        ( (= (cdr (assoc 2 elist)) "RAHMENA2") (setq md_border_or '(594.0 420.0 0.0)
                            md_blatt "ISO A2 (420.00 x 594.00 mm)") )
        ( (= (cdr (assoc 2 elist)) "RAHMENA3") (setq md_border_or '(420.0 297.0 0.0)
                            md_blatt "ISO A3 (297.00 x 420.00 mm)") )
        ( (= (cdr (assoc 2 elist)) "RAHMENA4") (setq md_border_or '(210.0 297.0 0.0)
                            md_blatt "ISO A4 (297.00 x 210.00 mm)") )
    ;    (= T (princ "Kein Rahmen"))
    )
    (setq md_border_sf (mapcar '(lambda (a) (* a md_sf)) md_border_or))
    (setq md_fen_ul (cdr (assoc 10 elist)))
    (setq md_fen_or (mapcar '+ md_border_sf (cdr (assoc 10 elist))))
    
    )
    For all this to work, I created three files.
    STAMP.DWG (which was inserted as a block into each drawing)
    STAMP.LSP (the lisp file listed above)
    STAMP.SCR (the script file listed above)
    The drawing borders and title blocks were company standard files and the plot PC3 plus the CTB used for plotting.

    Have fun picking at it...

  3. #13
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,723

    Default

    soon as I get home I'll post some code
    Liberty one did you look at my post and the link ?

    Ben_Vk its your turn now have we been helpfull before we all run away posting code as we are guessing what you want to do next.
    A man who never made mistakes never made anything

  4. #14
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,723
    A man who never made mistakes never made anything

  5. #15
    Super Moderator Tiger's Avatar
    Computer Details
    Tiger's Computer Details
    Operating System:
    Windows 7 Professional 64 bit
    Computer:
    HP EliteBook 8570w
    CPU:
    Intel Core i7-3720QM 2.60GHz
    RAM:
    16GB
    Graphics:
    NVIDIA Quadro K2000M
    Monitor:
    HP
    Discipline
    Civil
    Tiger's Discipline Details
    Occupation
    Education /support
    Discipline
    Civil
    Details
    Support/Education/Retail
    Using
    Civil 3D 2016
    Join Date
    Nov 2006
    Location
    FjÀrdhundra, Sweden
    Posts
    5,148

    Default

    Registered forum members do not see this ad.

    I have merged your two threads into one, please don't post the same question in multiple forums.
    MTJIGSTRING = BAZINGA

Similar Threads

  1. AutoCAD - Mass Convert DWG To DXF (Batch Convert DWG To DXF) (Mas DWG Convert)
    By kArThIcK hAcKeR in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 3
    Last Post: 13th Mar 2017, 12:31 pm
  2. How can I convert dxf to dwg in batch??
    By Han_BFY in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 7th Apr 2016, 03:48 am
  3. Batch convert dxf,dwg to pdf,jpg,bmp,gif...
    By anotherseason in forum Tutorials & Tips'n'Tricks
    Replies: 1
    Last Post: 21st Nov 2012, 06:12 pm
  4. Batch Convert DWG to RFA
    By Trevit in forum Revit General
    Replies: 4
    Last Post: 25th Jun 2012, 10:44 pm
  5. Batch convert DGN to DWG
    By sandiegophil in forum Civil 3D & LDD
    Replies: 5
    Last Post: 5th May 2011, 07:33 pm

Tags for this Thread

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