Jump to content

Plotting PDF Destination


Losinski

Recommended Posts

Hi all,

 

 

I have researched a fair bit and have found solutions to this issue, but I just can't seem to get it to work.

 

 

I'm writing a LISP that includes plotting a drawing to a PDF. The location of the plot will depend on the drawing and therefore will change each time the LISP is executed. I can't, however, figure out how to change the destination.

 

 

See below for what I was using to change the location of the plot:

 

 

___________________________________________

 

 

 

 

(defun c:test123 ()
(command "tilemode" "0")
(command "filedia" "0")
(setenv "PlotToFilePath" "C:\\Users\\slosinski\\Desktop")
(command "-PLOT" "Y" "LAYOUT" "ACADE - DWG TO PDF.PC3" "ISO FULL BLEED A1 (594.00 X 841.00 MM)" "M" "L" "N" "E" "1" "C" "Y" "" "Y" "N" "N" "N" "FILENAMETEST" "N" "Y")
(princ)
)
(princ)

___________________________________________

 

 

This should simply plot to whatever location I have specified, correct? After running the LISP, (getenv "PlotToFilePath") will return the correct path. I can change it manually in the settings- still doesn't work.

 

 

The PDF seems to plot to wherever it has last.

 

 

Any ideas?

 

 

Regards,

Losinski

 

 

P.S. I tried to wrap the code in code tags, but that isn't working for me either. But that's a separate issue...

Edited by SLW210
Added Code Tags
Link to comment
Share on other sites

Hi Losinski,

 

Nowhere in your code see you actually making the filename.

 

(setenv "PlotToFilePath" "C:\\Users\\slosinski\\Desktop")

->

 (setq PlotToFilePath "C:\\Users\\slosinski\\Desktop\\") 

 (setq PlotFilename (strcat PlotToFilePath "myfilename")) 

gr. Rlx

 

 

ps.

 

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-AutoLISP/files/GUID-0C2E8222-62A8-4529-8A8A-58AAB2A5F23B-htm.html

 

 

(setenv "MaxArray" "10000") "10000" Note that changes to settings might not take effect until the next time AutoCAD is started.

 

 

 

Edited by rlx
Link to comment
Share on other sites

Just type them in [NOPARSE]

CODE GOES HERE

[/NOPARSE] if the # isn't working, I fixed it for you.

Edited by SLW210
Link to comment
Share on other sites

Where I work we too plot to same folder as the dwg but that's not always possible depending on the status of the drawing , as built or checked out. So I made an app and placed it in the startup of acad.lsp and that by default uses the drawing folder , if not possible tries a user dependable document control folder or otherwise you can set your own folder , by default c:/temp. Usually works pretty well... so far anywayz...

 

 

gr.Rlx

RLFormat.jpg

Link to comment
Share on other sites

I have a lisp I created that may do what you want. It saves the PDF in the same folder the drawing is located

 

(defun PDF (/ fnm)

(if (setq fnm (getfiled "Specify Save Location" "" "pdf" 1))
(progn

(command "tilemode" "0")
(command "-plot" "y" "" "Dwg To PDF.pc3" "ANSI expand D (34.00 x 22.00 Inches)" "I" "L" "N" "E" "1:1" "C" "Y" "CMS_d_black.ctb" "Y" "N" "N" "N" fnm "N" "Y")
)
 )
 )

Link to comment
Share on other sites

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...