+ Reply to Thread
Page 4 of 4 FirstFirst ... 2 3 4
Results 31 to 40 of 40
  1. #31
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,456

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by rlx View Post
    I know of the scripting possibilities that most windows applications have and I remember I used someting to plot or insert / attach all pdf's from a multipage pdf some time ago
    Would be interesting what other application offers this functionality (to be honest, I'm fairly new to the scripting objects).


    Quote Originally Posted by rlx View Post
    attach all pdf's from a multipage pdf some time ago but never considered the option installing acrobat and use it to merge my pdf's
    I initally thought to use Photoshop for the pdf merging task, but I'm glad I avoided it - since when accessing its application object, the code actually runs the program itself.


    Quote Originally Posted by rlx View Post
    Also went to Sofia and Instanbull by bus. Since then me and the misses decided on future vacations not to make so many day trips any more haha.
    Ah, so you are familiar with our trippy, bumpy balkan roads - we just want autobahn like yours!



    BTW the MergePDFs shouldn't cause any problems if Acrobat is not installed, so it should only prompt:
    Unable to interfere with Acrobat object.

    So don't worry if its used in the main code.



    Quote Originally Posted by BrianTFC View Post
    rlx,

    Thanks for putting it all together if the company I worked for would put Acrobat on our PC's it would be nice to try it out but we use PDF Complete for all of our PDF needs. It would cost to much to upgrade the computers that would find this beneficial. We will just have to keep doing it the old way.

    Thanks,
    Brian
    It looks like no one ever has been satisfied in this forum, despite the posted codes that save a ton of time..
    "Thanks for <fill in> but <fill in>"

    Why do you need to upgrade all the computers, when just one is enough for the printing job?
    I think that if only one worker that uses this code would save the time and effort for the rest co-workers, and even he won't spend his energy by just doing this!

  2. #32
    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,006

    Default

    took some digging but pdfcomplete seems to have command line options :

    http://www.informatik.com/manuals/He...ommandline.pdf

    gr.Rlx

  3. #33
    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,006

    Default

    Ah, so you are familiar with our trippy, bumpy balkan roads - we just want autobahn like yours!
    yip , but if I want bumpy roads just going to Belgium is far enough haha. Also nice in Belgium are the locations of some of the road signs : In Holland they are placed befóre the exit , not after. That can lead to something like 'you have just passed (missed) exit number ...

    back to my music listening (smetana - die moldau , nice!) conducted by Karajan (who else)

    gr. Rlx

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

    Default

    Have a look at these combines pdfs. You need a copy of ghostscript the GSexe. The combine is the mergepdfs.
    Attached Files
    A man who never made mistakes never made anything

  5. #35
    Senior Member
    Discipline
    Manufacture
    BrianTFC's Discipline Details
    Occupation
    Structral Detailer
    Discipline
    Manufacture
    Using
    AutoCAD 2017
    Join Date
    Jan 2012
    Location
    Indiana
    Posts
    188

    Default

    Grrr,

    I've always appreciated all of the work done by everyone on this forum to make lives easier at the work place. The problem at my company is all of our computers are identical and if one person gets a new program then everyone gets a new program and they are stingy with the how much they spend to up grade, even trying to get GhostScript on our computer is impossible and its freeware.

    Thanks,
    Brian

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

    Default

    Its called the desk shuffle and the hidden usb. We had a total meltdown around 1000 pc's turn them all off NOW!!!! So even the hidden usb is a bit of a problem but I have a good relationship with our IT about installing new software and we have a work around arrangement.

    Maybe you just have to put together a case why you would like to use some FREE software. Ghostscript has been around a long time.
    It takes like 2 minutes to install. Happy to provide details about how we use it and the time savings to a private email. Yes I had to do 8 machines.
    A man who never made mistakes never made anything

  7. #37
    Senior Member
    Discipline
    Manufacture
    BrianTFC's Discipline Details
    Occupation
    Structral Detailer
    Discipline
    Manufacture
    Using
    AutoCAD 2017
    Join Date
    Jan 2012
    Location
    Indiana
    Posts
    188

    Default

    All,

    With the help of other lisp routines We have come up with a way to use Publish to make a multi page PDF without using a 3rd party program. Here it is for everyone to look at and use. It works and does what we want it to do but we haven't figured out how to delete the DWG files when it's done Publishing, so if some one could figure that out that would be great.

    Code:
    (defun c:pdfpub (/ ob ss bn mn mx)
    ;; This was created by combining a multitude of different lisp routines by Lee Mac, RLX, Lee Ambrosius, Stephan BMR and howiez69
          (vl-load-com) 
     
      (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
        ;; Get the PlotConfigurations collection
        (setq plotCfgs (vla-get-PlotConfigurations doc))
     
        ;; Check to see if the pagesetup already exists
        (setq plotCfg (vl-catch-all-apply 'vla-Item (list plotCfgs "PDFSetup")))
     
        ;; If the page setup exists, the variable will be of type VLA-OBJECT
        (if (/= (type plotCfg) 'VLA-OBJECT)
     
            ;; Create a page setup for model or paper space accordingly
            (if (= (getvar "TILEMODE") 0)  
                (setq plotCfg (vla-Add plotCfgs "PDFSetup" :vlax-false))
                (setq plotCfg (vla-Add plotCfgs "PDFSetup" :vlax-true))
            )
        )
        ;;(vla-put-Name plotCfg "PDFSetup")
        (vla-RefreshPlotDeviceInfo plotCfg)
     
        ;; Set the plot device
        (vla-put-ConfigName plotCfg "DWG To PDF.pc3")
     
        ;; Set the paper size
        (vla-put-CanonicalMediaName plotCfg "ARCH_full_bleed_C_(24.00_x_18.00_Inches)")
     
        ;; Set the plot units (inches, millimeters, pixels)
        (vla-put-PaperUnits plotCfg acInches)
     
        ;; Set what to plot
        ;; - If using acView, set the ViewToPlot property
        ;; - If using acWindow, call GetWindowToPlot
        (if (= (getvar "TILEMODE") 0)
            (progn
                (vla-put-PlotType plotCfg acLayout)
                ;; Set scale
                (vla-put-UseStandardScale plotCfg :vlax-true)
                (vla-put-StandardScale plotCfg ac1_1)          
            )
            (progn
                (vla-put-PlotType plotCfg acExtents)
     
                ;; Set scale
                (vla-put-UseStandardScale plotCfg :vlax-true)
                (vla-put-StandardScale plotCfg acScaleToFit)
     
                )
        )
        ;; Hide paperspace objects
        (vla-put-PlotHidden plotCfg :vlax-false)
     
        ;; Set the plot origin
        (setq origin (vlax-make-safearray vlax-vbDouble '(0 . 1)))
        (vlax-safearray-fill origin (list 0.5 0.5))
        (vla-put-PlotOrigin plotCfg origin)
     
        ;; Set the plot rotation
        (vla-put-PlotRotation plotCfg ac0degrees)
     
        ;; Set viewport plot behavior
        (vla-put-PlotViewportBorders plotCfg :vlax-false)
        (vla-put-PlotViewportsFirst plotCfg :vlax-true)
     
        ;; Set lineweight behavior
        (vla-put-PlotWithLineweights plotCfg :vlax-true)
        (vla-put-ScaleLineweights plotCfg :vlax-true)
     
        ;; Set plot styles behavior
        (vla-put-PlotWithPlotStyles plotCfg :vlax-true)
        (vla-put-ShowPlotStyles plotCfg :vlax-true)
     
        ;; Center the plot on the page
        (if
        (= :vlax-false (vla-get-CenterPlot plotCfg))
        (vla-put-CenterPlot plotCfg :vlax-true)
        )
        (if (= (getvar "PSTYLEMODE") 0)
            (vla-put-StyleSheet plotCfg "acad.stb")
            (vla-put-StyleSheet plotCfg "TFC.ctb")
        )
     
        ;; Assign the page setup to the current layout
        (vla-CopyFrom (vla-get-ActiveLayout doc) plotCfg)
     
        (vl-cmdf "UCS" "")
     
        (setq cnt 0)
        (if (not (setq folder (getfolder "Select folder to save views")))
        (setq folder (getvar 'dwgprefix))(setq folder (strcat folder "\\")))
                 (if (and (progn
                     (initget "B")
               (setq ob (entsel "\nSelect Block/B for blockname: "))
                    (cond 
                    ((eq ob "B")
                        (setq bn (getstring "\nEtner Block Name: "))
                        )
                    ((and (eq (type ob) 'LIST)
                   (vlax-method-applicable-p (vlax-ename->vla-object (car ob)) 'getboundingbox))
                          (setq bn (cdr (assoc 2 (entget (car ob))))))))
      (tblsearch "BLOCK" bn)
                    bn     
                    (setq ss  (ssget "_X" (list '(0 . "INSERT")'(410 . "Model")(cons 2 bn))))
                          )
     
     (progn 
              (vla-zoomextents (vlax-get-acad-object))
            (repeat (setq i (sslength ss))
      (setq cnt (1+ cnt))
      (vla-getboundingbox (vlax-ename->vla-object (ssname ss (setq i (1- i)))) 'mn'mx)
                          (setq tmp (ssget "_C" (trans (vlax-safearray->list mx) 0 1) (trans (vlax-safearray->list mn) 0 1)))
       (vl-cmdf "_.-wblock" (strcat folder (itoa cnt) "-" (vl-filename-base (getvar 'dwgname)) ".dwg") "" "0,0"  
                tmp "")
                              (command "oops")
        )
        )          
                   (princ "\nNo Blocks Selected: ")
              )(princ)
         (defun *error* ( msg )
        (setvar "FILEDIA" OldFda) ;sets system variable FILEDIA back to original value
        (setvar "EXPERT" Save_Expert) ;sets system variable EXPERT back to original value
            (princ "error: ")
            (princ msg)
            (princ)
        )
     
    (setq OldFda (getvar "FILEDIA")) ;reads current system variable FILEDIA value
    (setvar "FILEDIA" 0) ;sets FILEDIA to 0 so no dialog boxes popup
    (setq Save_Expert (getvar "EXPERT")) ;reads current system variable EXPERT value
    (setvar "EXPERT" 2) ;sets EXPERT to 2 so no dialog boxes popup
    (setvar "EXPERT" Save_Expert) ;sets system variable EXPERT back to original value
    (setq pathtxt (strcat folder "TEMP.DSD")) ;sets path for DSD file from current drawing saved location
    (setq file (open (strcat folder "TEMP.DSD") "w")) ;opens DSD file for writing
     
    ;**********START OF DSD FILE**********
     
    ;**********START HEADER**********
    (write-line "[DWF6Version]" file)
    (write-line "Ver=1" file)
    (write-line "[DWF6MinorVersion]" file)
    (write-line "MinorVer=1" file)
    ;**********END OF HEADER**********
     
    ;**********START OF LAYOUTS/DWG TO PLOT********** !!!repeat this section for each of your layouts or dwgs to plot
    (setq cnt2 0)
            (repeat (setq i2 (sslength ss))
      (setq cnt2 (1+ cnt2))
    (setq dname (strcat "[DWF6Sheet:PDF Sheet " (itoa cnt2) "]"))
    (write-line dname file)
    (write-line (strcat "DWG=" folder (itoa cnt2) "-" (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4)) ".dwg")file)
    (write-line "Layout=Model" file) ;layout to plot
    (write-line (strcat "OriginalSheetPath=" (strcat folder (itoa cnt2) "-" (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4))".dwg") )file)
    (write-line "Has Plot Port=0" file)
    (write-line "Has3DDWF=0" file)
    (setq i2 (1- i2))
    )
     
    ;**********END OF 'ONE' LAYOUT TO PLOT********** !!!repeat previous section for each of your layouts or dwgs to plot
     
    ;**********START OF DSD FOOTER**********
    (write-line "[Target]" file)
    (write-line "Type=6" file) ;change to "TYPE=6" for multiple output files, "TYPE=5" for single output file
    (write-line (strcat "DWF=" (strcat folder(substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4))".pdf") )file)
    (write-line (strcat "OUT="(strcat folder)) file)
    (write-line "PWD=" file)
    ;**********END OF DSD FOOTER**********
     
    ;**********END OF DSD FILE**********
    (close file) ;closes DSD file
    (command "_.delay" 2000) ;system delay before starting publish command so DSD file closes
    (command "-Publish" pathtxt ) ;start publish command with TEMP.DSD file just created
    (setvar "FILEDIA" OldFda) ;sets system variable FILEDIA back to original value
    (command "_.delay" 2000) ;system delay before deleting TEMP.DSD so publish routine has time to release it
    (vl-file-delete pathtxt) ;deletes TEMP.DSD file
    (princ)
    )
       (defun getfolder  (msg / fl sh)
        (if (and (setq sh (vlax-create-object "Shell.Application"))(setq fl (vlax-invoke sh 'browseforfolder 0 msg 0 "")))
        (setq fl (vlax-get-property (vlax-get-property fl 'self) 'path))(setq fl nil))(release_me (list sh)) fl)
    (defun release_me  (lst)
      (mapcar '(lambda (x)(if (and (= 'vla-object (type x))(not (vlax-object-released-p x)))(vlax-release-object x))(set (quote x) nil)) lst))
      (princ)
    Thanks,
    Brian

  8. #38
    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,006

    Default

    Quote Originally Posted by BrianTFC View Post
    All,

    With the help of other lisp routines We have come up with a way to use Publish to make a multi page PDF without using a 3rd party program. Here it is for everyone to look at and use. It works and does what we want it to do but we haven't figured out how to delete the DWG files when it's done Publishing, so if some one could figure that out that would be great.

    Thanks,
    Brian
    you could try the following , but you must set the delay long enough for the publish command to finish (i think). Last lines of your code could look something like this :

    Code:
      .
      .
      (vl-file-delete pathtxt);deletes TEMP.DSD file
      ; optional to wait until pub is finished
      (princ "\nPress any key to delete drawings")(grread)
      (mapcar '(lambda (x) (vl-file-delete (strcat folder x))) (vl-directory-files folder "*.dwg"))
      (princ)
    )
    variable 'folder' was set previously when you used getfolder to select the output folder so you can recycle it.

    gr. Rlx
    Last edited by rlx; 14th Mar 2018 at 08:05 am.

  9. #39
    Senior Member
    Discipline
    Manufacture
    BrianTFC's Discipline Details
    Occupation
    Structral Detailer
    Discipline
    Manufacture
    Using
    AutoCAD 2017
    Join Date
    Jan 2012
    Location
    Indiana
    Posts
    188

    Default

    Rlx,

    Thanks for your help on this, instead of setting a delay is it possible to find the PDF it creates in the same folder and then delete the dwg's in the folder?

    Thanks,
    Brian

  10. #40
    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,006

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by BrianTFC View Post
    Rlx,

    Thanks for your help on this, instead of setting a delay is it possible to find the PDF it creates in the same folder and then delete the dwg's in the folder?

    Thanks,
    Brian

    Hi Brian,


    When publish creates the pfd it probably starts with and empty file , adding to it as it goes. So you would need a signal (reactor?) telling it has finished. There is a reactor in autocad that can tell a command has ended (:vlr-commandended) but I'm not sure this will work on publish.


    I did find this : https://forums.autodesk.com/t5/visua...h/td-p/2978030


    haven't checked it out yet


    gr .Rlx

Similar Threads

  1. No objects visible in model space/3d views
    By PACKRAT69 in forum AutoCAD 3D Modelling & Rendering
    Replies: 3
    Last Post: 6th Mar 2016, 01:28 pm
  2. Plot Views, sheets at the same Model Space.
    By CafeJr in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 19th Oct 2015, 12:41 pm
  3. I have 2 views showing in model space...
    By kippax in forum AutoCAD Beginners' Area
    Replies: 4
    Last Post: 3rd Sep 2015, 04:02 pm
  4. No objects in Model space, But View ports has dwg views
    By RRS1987 in forum AutoCAD Drawing Management & Output
    Replies: 5
    Last Post: 4th Aug 2015, 01:48 pm
  5. Model Space Views ??
    By 4:3 in wide in forum AutoCAD General
    Replies: 4
    Last Post: 26th Aug 2009, 07:39 am

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