+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 22
  1. #11
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,727

    Default

    Registered forum members do not see this ad.

    Thanks Roy_043 hopefully it works

    Back to Greenla if post above does not work you need to go to Mcolor and seek help. http://www.m-color.com/ I take it that you purchased it.
    A man who never made mistakes never made anything

  2. #12
    Full Member
    Using
    AutoCAD 2017
    Join Date
    Dec 2015
    Location
    Aus
    Posts
    87

    Default

    sorry to veer a little from the discussion, but i'm still searching for a way to set the default save location for published pdfs to be same location as the dwg.
    needing to locate this folder every single time is such a waste of time...
    if anyone can advise how this can be done it would be much appreciated

  3. #13
    Super Member halam's Avatar
    Using
    AutoCAD 2017
    Join Date
    Jul 2015
    Posts
    618

    Default

    Once I thought this is a registry entry that needs to follo dwgprefix. But I didn't manage to get it to work.also looking for a solid solution..
    Modelling is done with two hands, 2d & 3d. Let it work together..
    https://twitter.com/halammerts

  4. #14
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,727

    Default

    If you ignore "Publish" and go back to a lisp you can achieve same.

    Here is an example
    Attached Files
    A man who never made mistakes never made anything

  5. #15
    Full Member
    Using
    AutoCAD 2017
    Join Date
    Dec 2015
    Location
    Aus
    Posts
    87

    Default

    i think i'm heading in right direction. but,
    when i load it it asks me for start and end tab numbers.
    after specifying that, it doesn't seem to function properly..
    what am i doing wrong?

    plotA3Pdfrange.lsp successfully loaded.
    nil
    Command: Regenerating model.
    Regenerating layout.
    Regenerating model.
    Yes or No, please.
    Function cancelledWrite the plot to a file [Yes/No] <N>:

  6. #16
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,727

    Default

    If you look carefully at the plotpdfrange it is hardcoded to put the pdfs' into a directory called pdf that exists below the dwg directory "design" this was a request from my co-workers. Its probably working but can not find this directory. The original verison put it in same location. Version 2 of this uses Ghost script and joins the created pdf's into one. Post if you want it.

    \projects\1234\design\pdf

    Code:
    (setq pdfname (strcat (getvar "dwgprefix") "pdf\\" dwgname "-" (getvar "ctab"))) ; sub directory pdf
    
    (setq pdfname (strcat (getvar "dwgprefix")  dwgname "-" (getvar "ctab"))) ; no pdf directory saved same as dwg
    Last edited by BIGAL; 29th Sep 2016 at 03:56 am.
    A man who never made mistakes never made anything

  7. #17
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,727

    Default

    Back to you Greenla any progress ?
    A man who never made mistakes never made anything

  8. #18
    Full Member
    Using
    AutoCAD 2017
    Join Date
    Dec 2015
    Location
    Aus
    Posts
    87

    Default

    ok, so after a bit of testing i could not get the plotpdfrange lsp file to run properly.. i did manage to find an alternative that seems to work. It saves all the pdfs to the same location as dwg, but as individual sheets
    BIGAL you mentioned theres a way to get these combined also?

    Code:
    ;; Prints All Layout Tabs and names the new PDFs with the name of the
    ;; drawing followed by the layout tab name.
    ;;
    ;; Adjust the paper size and .ctb file as needed.
    ;;
    ;; The PDFs will be placed in the folder where the drawing resides
    ;;
    (defun c:PA ()
    (foreach lay (layoutlist)
      (setvar 'CTab lay)
      (COMMAND 	"-PLOT"
    		"Y"
    		""
    		"DWG To PDF.pc3"
    		"ANSI full bleed A (8.50 x 11.00 Inches)"
    		"Inches"
    		"PORTRAIT"
    		"N"
    		"E"
    		"f"
    		"C"
    		"Y"
    		"monochrome.ctb"
    		"Y"
    		"N"
    		"N"
    		"N"
    		""; Name of file
    		"N"
    		"y"      )
        )
    )

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

    Default

    The only thing that should stop plotpdfrange from working is the pdf directory below the drawing location, change the code using the 2nd line in my previous post. And you will need the correct parameters size sheet etc. Like the code masterfal you posted there is lots of examples with very slight tweaks.

    This is a merge pdf's lisp that uses ghostscript you need to down load seperately.

    The version of plotpdf's does individuals and a single merged in one step.

    Post edited above.

    Code:
    ;MergePdfs
    ;Merges multiple pdf (or eps) files into one
    ;
    
    ; make a batch file ?
    ;gs -sDEVICE=pdfwrite \
    ;    -dNOPAUSE -dBATCH -dSAFER \
    ;    -sOutputFile=combined.pdf \
    ;    first.pdf \
    ;    second.pdf \
    ;    third.pdf [...]
    
    ;Ghostscript (http://www.ghostscript.com/) can be used to combine PDFs.
    
    ; Something like this should work: by Roy_043
    
    (defun KGA_String_Join (strLst delim)
    (if strLst
    (apply
    'strcat
    (cons
    (car strLst)
    (mapcar '(lambda (a) (strcat delim a)) (cdr strLst))
    )
    )
    ""
    )
    )
    
    ; (CombinePdf 
      (setq gsexe "C:\\Program Files\\gs\\gs9.19\\bin\\gswin64c.exe")
    ; (setq srcFilelst  '("D:\\Tmp\\A.pdf" "D:\\Tmp\\B.pdf"))
    ; (setq trgfile "C:\\Acadtemp\\Total.pdf")
    ; )
    ; Note: Existing trgFile will be overwritten.
    (defun CombinePdf (gsExe srcFileLst trgFile)
    (startapp 
    (strcat
    gsExe " "
    "-sDEVICE=pdfwrite -dBATCH -dNOPAUSE -dQUIET  "
    "-sOutputFile=\"" trgFile "\" "
    "\"" (KGA_String_Join srcFileLst "\" \"") "\""
    )
    )
    )
    plotA3Pdfrange2.lsp
    A man who never made mistakes never made anything

  10. #20
    Full Member
    Using
    AutoCAD 2017
    Join Date
    Dec 2015
    Location
    Aus
    Posts
    87

    Default

    Registered forum members do not see this ad.

    yeh thats pretty much what i've done but still doesn't run properly.. i've amended so uses my plotter name/style. not sure what else i'm doing wrong?

    Code:
    ;Plots layouts by range
    ; By Alan H Feb 2014
    (defun AH:pltlays ( / lay numlay numend)
    (SETVAR "PDMODE" 0)
    
    (setvar "fillmode" 1)
    (setvar "textfill" 1)
    
    (if (not AH:getval2) (load "getvals"))
    (ah:getval2 "Enter start tab number" 6 4 "Enter end tab number" 6 4)
    (setq numlay (ATOI val1))
    (setq numend (ATOI val2))
    
    (setq len (+ (- numend numlay) 1))
    
    (setq dwgname (GETVAR "dwgname"))
    (setq lendwg (strlen dwgname))
    (setq dwgname (substr dwgname 1 (- lendwg 4)))
    
    (repeat len
    (vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))
    (if (= numlay (vla-get-taborder lay))
      (setvar "ctab" (vla-get-name lay))
    ) ; if
    (setq pdfname (strcat (getvar "dwgprefix")  dwgname "-" (getvar "ctab"))) ; no pdf directory saved same as dwg
    
    ) ; for
    (setq lay nil)
    (setvar "textfill" 1)
    (setvar "fillmode" 1)
        (COMMAND "-PLOT"  "Y"  "" "adobe pdf"
    	       "A3" "m" "LANDSCAPE"  "N"   "W"  "-6,-6" "807,560" "1=2"  "C"
    	       "y" "EP Full Mono - NEW.ctb" "Y"	"n" "n" "n" pdfName "N" "y"
        )
        
    (setq numlay (+ numlay 1))
    ) ; end repeat
    ) ; defun
    
    (AH:pltlays)

Similar Threads

  1. Save a dwg in a subfolder with the same name as the file, using lisp code
    By ankoron in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 10th Sep 2016, 11:40 am
  2. Replies: 17
    Last Post: 15th Nov 2015, 12:07 pm
  3. Lisp Command For Setting The Auto File Save Location
    By ReinierMeyer in forum AutoLISP, Visual LISP & DCL
    Replies: 17
    Last Post: 9th Jan 2014, 05:49 pm
  4. calling commands from loaded arx file using lisp function (command)
    By LibertyOne in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 3rd May 2011, 01:43 pm
  5. Where to save a Lisp file?
    By amounjid in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 7
    Last Post: 23rd Sep 2008, 09:27 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