By default, AutoCAD plots, prints or publishes PDFs to the current folder. However, it is often needed to place the output PDF file directly next to the drawing, i.e. into the same folder as the currently processed DWG file.
The undocumented variable PlotToFilePath is used for this setting. It is available since version 2019. Note that in AutoCAD 2024, you must first install the 2024.1.2 (or higher) update. In AutoCAD LT (2024+), it is only accessible via the LISP functions (getvar) and (setvar).
This variable is then used by our LISP application, reactor AutoPathPDF, available on the Download page. It automatically directs PDF output to the current DWG drawing folder. Simply download the application from Download and load it into your AutoCAD or AutoCAD LT (2024+) using APPLOAD. Drag it to the briefcase icon in this command to load it automatically in each AutoCAD session. Before each PLOT, PUBLISH, EXPORTPDF, or AUTOPUBLISH command, the output folder is automatically switched according to the DWG drawing. You can turn the function off or on by typing the AUTOPATHPDF command.
Another option is using the function of automatic publishing of PDFs - on any DWG save, or DWG close , or with a prompt at each of these actions. The resulting PDF can be stored into the DWG folder, or to the "PDF" subfolder under the drawing folder. You can find this setting in the dialog of the OPTIONS command, under the tab "Plot & Publish".
You can also use the freeware application AutoPDF to automatically publish a PDF to the drawing folder each time you save your DWG - see Tip 6515, this will simplify the publishing process even further.