Lisp Batch process for turning frames on but does not print

Lisp Batch process for turning frames on but does not print

Anonymous
Not applicable
618 Views
3 Replies
Message 1 of 4

Lisp Batch process for turning frames on but does not print

Anonymous
Not applicable

Hi I am trying to create a lisp (but not working) to do a batch routine that will change all drawings pdf to on but does not plot.  Can anyone help?

 

Thanks!

0 Likes
619 Views
3 Replies
Replies (3)
Message 2 of 4

hmsilva
Mentor
Mentor

@Anonymous wrote:

Hi I am trying to create a lisp (but not working) to do a batch routine that will change all drawings pdf to on but does not plot.  Can anyone help?

 

Thanks!


Hello tbpbc and welcome to the Autodesk Community!

 

Additional explanations are required....

 

Are you trying to change PDFRAME?

Are you trying to change all PDF's references to a layer 'no plot'?

 

Henrique

 

EESignature

0 Likes
Message 3 of 4

Anonymous
Not applicable

I am trying to turn off a pfd frame.

0 Likes
Message 4 of 4

hmsilva
Mentor
Mentor

@Anonymous wrote:

I am trying to turn off a pfd frame.


Quick and dirty:

 

(defun c:demo (/ ALE_BrowseForFolder DocCol DwgList FName)
    ;; by Marc'Antonio Alessi
    ;; Example: (ALE_BrowseForFolder "Select drawings folder")
    ;; Original BrowseForFolder by Tony Tanzillo
    (defun ALE_BrowseForFolder (PrmStr / ShlObj Folder FldObj OutVal)
        (vl-load-com)
        (setq
            ShlObj (vla-getInterfaceObject
                       (vlax-get-acad-object)
                       "Shell.Application"
                   )
            Folder (vlax-invoke-method ShlObj 'BrowseForFolder 0 PrmStr 0)
        )
        (vlax-release-object ShlObj)
        (if Folder
            (progn
                (setq
                    FldObj (vlax-get-property Folder 'Self)
                    OutVal (vlax-get-property FldObj 'Path)
                )
                (vlax-release-object Folder)
                (vlax-release-object FldObj)
                OutVal
            )
        )
    )
    (if (and (setq FName (ALE_BrowseForFolder "Select folder to process: "))
             (setq DwgList (vl-directory-files FName "*.dwg"))
             (setq DocCol (vla-get-Documents (vlax-get-Acad-Object)))
        )
        (foreach Dwg DwgList
            (setq Dwg (vla-Open DocCol (strcat FName "\\" Dwg) :vlax-false))
            (if (/= (vlax-invoke Dwg 'getvariable "PDFFRAME") 2)
                (progn
                    (vlax-invoke Dwg 'setvariable "PDFfRAME" 2)
                    (vla-Close Dwg :vlax-true)
                )
                (vla-Close Dwg :vlax-false)
            )
        )
    )
    (princ)
)

 

Hope this helps,
Henrique

EESignature

0 Likes