Autocad to Photoshop with Layers
We’ve been searching for a while for a simple way to convert AutoCAD drawings into Photoshop files preserving all layers. Converting AutoCAD files into Photoshop files is not very complicated, a simple PDF export from AutoCAD is all that it takes. However, by doing so all layers from the original AutoCAD file will be merged together into a single layer in Photoshop. After a lot of internet searching it was clear to us that there isn’t a simple, ready to go, solution for this.
To only way to preserve AutoCAD layers in Photoshop is to print or export each AutoCAD layer into a separate PDF file. Next, rasterize all PDF files into Photoshop files and finally merge all Photoshop files together. Doing so manually requires a lot of effort but by using two scripts we’ve created it all can be done with a few mouse clicks.
|Document format:||AutoCAD visual lisp script|
|File size:||14 KB|
|License:||Free / GNU General Public License|
|File size:||29 KB|
|Platform:||Windows and OS X|
Before you start
Our layers2PDF script still has some limitations, the most important are:
- layers2PDF.lsp will only export from “Layout”.
- layers2PDF.lsp will only export if your assigned printer/plotter is “AutoCAD PDF (High Quality Print).pc3”.
- layers2PDF.lsp is only tested with decimal units, please let us know if you run into issues when using feed/inches.
- layers2PDF.lsp skips empty layers (as designed).
- layers2PDF.lsp might change the layer status of your current drawing.
- layers2PDF.lsp is written in visual lisp and will not run on AutoCAD for Mac.
Open your drawing in AutoCAD.
Click on one of the “Layout” tabs to start a new layout. In this example we name our new Layout “Arch B landscape” .
Choose paper size and other settings as you prefer.
Our script only works with the “AutoCAD PDF (High Quality Print).pc3” printer/plotter selected. Make sure you choose the “AutoCAD PDF (High Quality Print).pc3” printer/plotter in your page setup.
Adjust the scale of the current page “viewport”
Now your almost ready to use our script for the first time. As you might know already, AutoCAD will open a PDF file in the associated PDF reader as soon as it’s done printing. Some PDF viewers can’t handle more than 20 PDF files at once. To avoid problems its good practice to disable the option to open printed PDF files by default.
AutoCAD will remember this setting the next time you use our script again so this step needs to be applied only once.
Open the “Page Setup Manager” dialog again (right mouse click on the “Layout” tab and choose “Page Setup Manager”).
Select “Arch B landscape” and click “Modify…” to open the “Page Setup” dialog again.
Next click “PDF Options” to open the “PDF Options” dialog. Uncheck the “Show results in viewer” option.
Close the “PDF Options” dialog by clicking “OK” and click “OK” again to close the “Changes to a Printer Configuration File” dialog.
Click “OK” once more to close the “Page Setup” dialog. If AutoCAD shows the below dialog click “Yes” to close the dialog.
Finally close the “Page Setup Manager” dialog by clicking “Close”.
Load the Script
Now all preparations are done it’s time to load the script and export each layer to an PDF file.
Download the “layers2pdf.lsp” script (see on top of this page) and save this script on your hard drive. Use the Windows Explorer to browse the
downloaded script and drag the script into the AutoCAD Layout. Click “Load Once” of “Always Load” if AutoCAD shows the below security dialog.
Check the AutoCAD command line to make sure the script is loaded.
Export AutoCAD layers to PDF files
Type the “layers2pdf” command on the command line. AutoCAD executes the script and shows the “Browse For Folder” dialog. Choose a folder location to save all PDF files. Click “Make New Folder” if you like to create a new folder. Click “OK” to start converting all layers to PDF files.
AutoCAD will now export each layer as a PDF file. This might take a few seconds, just wait and make sure not to interrupt the export process. When the script is finished it shows “Layers2PDF finished. Exported PDF files can be found in: ……” on the command line.
Use the Windows Explorer and browse to the folder that contains the exported PDF files.
- Now you can close AutoCAD.
Rasterize PDF files into Photoshop PSD files
The next step is to rasterize vector PDF files into Photoshop PSD files. For this step we will use our second script.
- Download the “rasterizePDFfiles_v1.06.jsx” script and save it on your computers hard drive
Open Photoshop but do not open any files. If Photoshop is already open make sure all files are closed. Use the Windows Explorer to locate the downloaded script and drag the script into Photoshop. The script executes as soon as you release your mouse button.
Click the “Add..” button and browse to the folder where AutoCAD saved all the PDF files. Select all PDF files and click “OK”.
Click the “Choose…” button and select a folder to save all rasterized PSD files. Again, use the “Make New Folder button if you like to create a new folder.
Finally click “Convert” to start the conversion of the selected PDF files into PSD files. Click “Close” when the conversion is finished to close
the script dialog.
Use the Windows Explorer to check if the creation of the PSD files was successful.
Merging PSD files in Photoshop
The final step is to merge all PSD files together into one file. For this task you will use the default Photoshop script “Load Files into Stack”.
Close all files in Photoshop and choose for “File” » “Scripts” » “Load Files into Stack”. The “Load Layers” dialog will become visible.
Click the “Browse” and select all Photoshop files created in the previous step. Next click “OK” and Photoshop will merge all selected files together.
The final result in our example looks like:
Take a look at the Photoshop “Layers” dialog. Notice that all AutoCAD layers are now available in Photoshop.
You might want to add a new layer on the bottom of your layers and fill this layer with a “White” fill colour. This will increase the visibility of your drawing.
Hold down the “Alt” and click one of the Photoshop layers in the “Layers” dialog. All layers except the one you’ve clicked on will be turned off. Turn the “White” layer on again. In our example it now shows only the crowns of the trees. This is how you can colour your layers one by one.
As all items are now on separate layers it’s much easier now to colourise this drawing. In the example below we’ve been using water paint textures to complete this drawing.