Jump to content

Recommended Posts

Posted

I am trying to write an AutoLISP routine that exports a pdf from an open CAD file. It is stuck at the end and i can't get it to take "" (enter) which should trigger the export button in the dialog box to finish it out. Here is what I have:

 

(defun c:expdf ()

(setq dwgName (getvar "DWGNAME"))
(setq dwgNameNoExt (vl-filename-base dwgName))
(setq prefix (getvar "DWGPREFIX"))
(setq outputPath (strcat prefix "Design\\Work Prints\\" dwgNameNoExt ".pdf"))
(command "_EXPORTPDF" outputPath "")

)

Posted

maybe try -EXPORTPDF (- instead of _)

Posted
Quote

maybe try -EXPORTPDF (- instead of _)

 

I'm afraid that does not help with my issue, but thanks for the try!

Posted

try :

....

(setvar 'filedia 0)

(command "-EXPORTPDF" outputPath "")

Posted

ah , you're right, not working (didn't do any testing) , try it now

 

 

 

(defun c:expdf ( / dwgName dwgNameNoExt prefix outputPath)
  (setq dwgName (getvar "DWGNAME"))
  (setq dwgNameNoExt (vl-filename-base dwgName))
  (setq prefix (getvar "DWGPREFIX"))
  (setq outputPath (strcat prefix "Design\\Work Prints\\" dwgNameNoExt ".pdf"))
  (setvar 'filedia 0)
  (command "_.-export" "Pdf" "_E" "_NO" outputPath)
  (while (> (getvar 'cmdactive) 0) (command ""))
  (princ)
)

 

you can also try plot command in combination with DwgToPdf , should be plenty routines around

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/export-to-pdf-lisp-routine/td-p/5704455

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...