+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Dwg to pdf

  1. #1
    Forum Newbie
    Discipline
    P&ID
    Using
    AutoCAD 2014
    Join Date
    Jan 2017
    Posts
    8

    Unhappy Dwg to pdf

    Registered forum members do not see this ad.

    hi guys,

    I have found a desired lisp routine to convert DWG TO PDF after long googling and made little changes to suit my requirement. Here problem is this routine converts each DWG at a time but I have to convert around 100 dwgs to pdf. somebody can help me to convert this routine to proceed as batch converter.

  2. #2
    Forum Newbie
    Discipline
    P&ID
    Using
    AutoCAD 2014
    Join Date
    Jan 2017
    Posts
    8

    Default

    sorry forgot routine

    (defun c:A3_BIGENCOLOUR_PDF (/)
    (setvar "cmdecho" 0)

    (setq cur_plottransparencyoverride (getvar "PLOTTRANSPARENCYOVERRIDE"))
    (setvar "PLOTTRANSPARENCYOVERRIDE" 2)


    (setq cur_space (getvar "ctab"))

    (
    (command "zoom" "Extents")
    (setq filename (getfiled "Enter PDF file name" "" "pdf" 1)) ;;;https://forums.autodesk.com/t5/visua...p/td-p/3060536
    (command "-plot" ; Start plot command
    "yes" ; Detailed plot configuration?
    (getvar "ctab") ; Get a layout name
    "DWG To PDF.pc3" ; Enter an output device name GEBRUIK DUBBEL \\ VIR UNC PARTHS
    "ISO full bleed A3 (420.00 x 297.00 MM)" ; Enter paper size
    "Millimeters" ; Enter paper units
    "Landscape" ; Enter drawing orientation
    "No" ; Plot upside down?
    "window" ; Enter plot area
    "1:1" ; Enter plot scale
    "Center" ; Enter plot offset (x,y)
    "Yes" ; Plot with plot styles?
    "prop.ctb" ; Enter plot style table name or
    "No" ; Plot with lineweights?
    "No" ; Scale lineweights with plot scale?
    "No" ; Plot paper space first?
    "No" ; Hide paperspace objects?
    filename
    ;;; "No" ; Write the plot to a file
    "Yes" ; Save changes to page setup
    "Yes" ; Proceed with plot
    ))

    (setvar "cmdecho" 1)
    (setvar "PLOTTRANSPARENCYOVERRIDE" cur_plottransparencyoverride)
    (princ)

    (princ)
    )

  3. #3
    Senior Member SunnyTurtle's Avatar
    Computer Details
    SunnyTurtle's Computer Details
    Operating System:
    Win 7 64 bit
    Discipline
    Civil
    SunnyTurtle's Discipline Details
    Occupation
    Drafter CAD
    Discipline
    Civil
    Details
    Rail, Roads, Civil
    Using
    AutoCAD 2016
    Join Date
    Apr 2011
    Location
    Sydney Australia
    Posts
    158

    Default

    I know this is not exactly what you are looking for but have you looked into PUBLISH
    https://knowledge.autodesk.com/suppo...n-AutoCAD.html

  4. #4
    Forum Newbie
    Discipline
    P&ID
    Using
    AutoCAD 2014
    Join Date
    Jan 2017
    Posts
    8

    Default

    sunny,
    I know publishing but instead of publish I want to use routine.

  5. #5
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,797

    Default

    Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[CODE]Your Code Here[/CODE] =
    Code:
    Your Code Here
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  6. #6
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    729

    Default

    I have Page Setups for both PDF or Plotter in every Layout for all my Templates. When needed I'll toggle Page Setups for all layouts at between PDF and Plotter with a lisp routine.
    To plot a single layout I have a macro in my Ribbon
    Code:
    ^C^C-Plot;No;;;;No;No;Yes
    that sends it to the plotter with one click.

    With a structured approach AutoCAD is easy. Are you seriously still picking window corners every time you plot?

  7. #7
    Senior Member
    Computer Details
    OMEGA-ThundeR's Computer Details
    Operating System:
    Windows 10
    Computer:
    HP Z440
    Discipline
    Civil
    OMEGA-ThundeR's Discipline Details
    Occupation
    Civil Engineer (CAD Design)
    Discipline
    Civil
    Using
    AutoCAD 2017
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    301

    Default

    Quote Originally Posted by naren View Post
    sunny,
    I know publishing but instead of publish I want to use routine.
    I don't see any better way then using PUBLISH for this. Since you want the drawings to plot to PDF. PUBLISH is perfect for that (has an checkbox to override the plotter set in the layout)

  8. #8
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    608

    Default

    Hi i use this lisp

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;                                                               ;
    ;                          Layouts To PDF                      ;
    ;                                                               ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    (defun C:laytopdf ( / cmd )
      (setq cmd (getvar 'cmdecho)) (setvar 'cmdecho 0)
      (foreach Layout (layoutlist)
    
        (command "_.-PLOT" 
          "No"                                        ; Detailed plot configuration? [Yes/No] <No>: No
          Layout                                      ; Enter a layout name or [?] <Layout1>:
          ""                                          ; Enter a page setup name
          "DWG To PDF.pc3"                            ; Enter an output device name or [?] <DWG To PDF.pc3>:
          (strcat (getvar "DWGPREFIX") Layout ".pdf") ; Directory to save
          "No"                                        ; save changes to page setup?
          "YES"                                       ; proceed with plot?
        ); command
      ); foreach
      (vla-put-StyleSheet(vla-get-ActiveLayout (vla-get-ActiveDocument (vlax-get-acad-object))) "monochrome.stb" )
      (setvar 'cmdecho cmd)
      (princ)
    ); defun C:test

  9. #9
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    729

    Default

    Quote Originally Posted by prodromosm View Post
    Hi i use this lisp → Layouts To PDF
    I like that, it's simple!

  10. #10
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,124

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by prodromosm View Post
    Hi i use this lisp
    The formatting looked familiar

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