Autocad to Photoshop with Layers

Introduction


Imagine the convenience of importing all your AutoCAD layers directly into Photoshop! This seamless integration allows you to maintain the structure and detail of your original drawings, making your workflow more efficient and preserving the integrity of your designs. It will be a game-changer for anyone looking to combine the precision of AutoCAD with the creative flexibility of Photoshop.

We’ve been searching the internet for a simple way to convert AutoCAD drawings into Photoshop files while preserving all layers. Converting AutoCAD drawings into Photoshop is not very complicated; a simple PDF export from AutoCAD is all it takes. However, by doing so, all layers from the original AutoCAD file will be merged into a single layer in Photoshop. After extensive searching, it became clear that there isn’t a simple, free, and ready-to-go solution for this.

Currently, the only way to preserve AutoCAD layers in Photoshop is to print or export each AutoCAD layer into a separate PDF file. Next, convert all these PDF files into Photoshop files and finally merge all Photoshop files together. Doing this manually requires a lot of effort, but with the two scripts we’ve created, it can all be done with a few mouse clicks.


figure 1: schematic view of the process

Converting your AutoCAD drawing into a Photoshop drawing while preserving all layers requires two scripts: a Visual LISP script for AutoCAD and a JavaScript for Photoshop. Both scripts can be downloaded here as a zip archive:

layers2PDF v2.16.lsp

Version: 2.16
License: Creative Commons – Attribution – Non Commercial – No Derivatives 4.0 International
Document format: AutoCAD visual lisp script
File size: 6.51 KB
Downloads: 4482
Platform: Windows
Rating:
Download: layers2PDF v2.16.lsp.zip

RasterizeVectorFiles v2.18.jsx

Version: 2.18
License: Creative Commons – Attribution – Non Commercial – No Derivatives 4.0 International
Document format: Adobe javascript
File size: 9.11 KB
Downloads: 4268
Platform: Windows and OS X
Rating:
Download: RasterizeVectorFiles v2.18.jsx.zip

Before you start


Our layers2PDF script still has some limitations, the most important are:

  • “layers2PDF.lsp” will only export from “Layout” (as designed);
  • “layers2PDF.lsp” skips empty layers (as designed);
  • “layers2PDF.lsp” skips off and frozen layers (as designed);
  • “layers2PDF.lsp” might change the layer status of your current drawing (on/off, freeze/unfreeze and current layer);
  • “layers2PDF.lsp” is written in Visual LISP and will not run on AutoCAD for Mac (as designed).

Getting started

  1. Open your drawing in AutoCAD.


    figure 2: example drawing opened in AutoCAD

     

  2. Click on one of the “Layout” tabs to start a new layout. In this example we name our new Layout “Arch B landscape” .


    figure 3: start a new layout from the Page Setup Manager

    Set paper size and other settings as you prefer.


    figure 4: make all the required page setup adjustments

    Our script has been tested with all AutoCAD printers: “AutoCAD PDF (High Quality Print).pc3”, “AutoCAD PDF (General Documentation).pc3”, “AutoCAD PDF (High Quality Print).pc3”, “AutoCAD PDF (Smallest File).pc3”, “AutoCAD PDF (Web and Mobile).pc3” and “DWG To PDF.pc3”. Support for third-party printers like Adobe PDF” and “Microsoft Print to PDF” is available, but due to third-party script limitations, a valid file name for each layer must be entered manually.

     

  3. Adjust the “viewport” size and “viewport” scale (scale list or zoom) as required.


    figure 5: example AutoCAD drawing in layout after adjusting paper size, viewport size and viewport scale

     

Preparation

Now you’re almost ready to use our script for the first time. As you might already know, AutoCAD will open a PDF file in the associated PDF reader as soon as it’s done printing. However, some PDF viewers can’t handle more than 20 PDF files at once. To avoid any issues, it’s 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, so this step only needs to be applied once.

  1. Open the “Page Setup Manager” dialog again (right mouse click on the “Layout” tab and choose “Page Setup Manager”).


    figure 6: Page Setup Manager

     
    Select “Arch B landscape” and click “Modify…” to open the “Page Setup” dialog again.


    figure 7: settings for current layout

     

  2. Next click “PDF Options” to open the “PDF Options” dialog. Uncheck the “Show results in viewer” option.


    figure 8: PDF options dialog

     

  3. Close the “PDF Options” dialog by clicking “OK” and click “OK” again to close the “Changes to a Printer Configuration File” dialog.


    figure 9: confirm to update the printer configuration file

     

  4. Click “OK” once more to close the “Page Setup” dialog. If AutoCAD shows the below dialog click “Yes” to close the dialog.


    figure 10: default warning dialog

     

  5. Finally close the “Page Setup Manager” dialog by clicking “Close”.


    figure 11: the visual result is still the same

     

Load the Script

Now that all preparations are complete, it’s time to load the script and export each layer to a PDF file.

  1. Download the script “layers2PDF v2.16.lsp.zip” by using the download link on top of this page. Since the script is provided as a zip archive, you’ll need to unzip it before use. Once unzipped, look for a file named “layers2PDF v2.16.lsp”.

    To use the script, drag it into the AutoCAD Layout. When AutoCAD shows the security dialog as shown below, click “Load Once” or “Always Load”. If, for any reason, you do not trust the content of this script, choose “Do Not Load” to cancel loading.


    figure 12: the AutoCAD security dialog

     

Check the AutoCAD command line to make sure the script is correctly loaded.


figure 13: the AutoCAD command line afer loading the script

 

Export AutoCAD layers to PDF files

  1. Type the “layers2pdf” command on the command line. AutoCAD will execute the script and display the “Browse For Folder” dialog. Choose a folder location to save all PDF files. Click “Make New Folder” if you want to create a new folder. Click “OK” to start converting all layers to PDF files.


    figure 14: the Browse For Folder dialog

     

AutoCAD will now export each layer as a PDF file. This process might take some time, so please wait and avoid interrupting it. When the script is finished, it will display “Layers2PDF finished. Exported PDF files can be found in: …” on the command line.


figure 15: script finished message on the command line

 
Use the Windows Explorer and browse to the folder that contains the exported PDF files.


figure 16: all layers converted into pdf files

 

  1. When the script is finished you can close AutoCAD.

     

Rasterize PDF files into Photoshop PSD files

The next step is to rasterize all the vector PDF files into Photoshop PSD files. For automating this process, we will use our second script.

  1. Download the “RasterizeVectorFiles v2.18.jsx.zip” script and save it on your computers hard drive. Unzip the downloaded zip-archive.

  2. 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 extracted script “RasterizeVectorFiles v2.18.jsx” and drag the script into Photoshop. The script will execute as soon as you release your mouse button.


    figure 17: the RasterizeVectorFiles script opened in Photoshop

     

  3. Click the “Add..” button and browse to the folder where AutoCAD saved all the PDF files. Select all PDF files and click “OK”.


    figure 18: PDF files added to the script dialog

     

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


    figure 19: output folder set in the script dialog

     

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


    figure 20: the script is converting all PDF files into PSD files

     

  6. Use the Windows Explorer to check if the creation of the PSD files was successful.


    figure 21: 20 PDf files are now converted into 20 PSD files

     

Merging PSD files in Photoshop

The final step is to merge all PSD files together into one Photoshop document. For this task you will use the default Photoshop script “Load Files into Stack”.

  1. Close all files in Photoshop and choose for “File” » “Scripts” » “Load Files into Stack”. The “Load Layers” dialog will become visible.


    figure 22: 20 the “Load Files into Stack” shwos the “Load Layers”dialog

     

  2. Click the “Browse” button and select all Photoshop files created in the previous step. Next click “OK” and Photoshop will merge all selected files together.


    figure 23: all PSD files are added to the “Load Layers”dialog

     

  3. The final result in our example looks like:


    figure 24: all PSD files are merged into one document

     

  4. Take a look at the Photoshop “Layers” dialog. Notice that all AutoCAD layers are now available in Photoshop.


    figure 25: all AutoCAD layers are now preserved in Photoshop

     

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


    figure 26: the result with a white backgorund for better visibility

     

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


    figure 27: only one of the layers is shown

     

Finished result:

As all items are converted on separate layers it’s much easier now to colourise this drawing. In the example below we’ve been using water paint textures to finish this drawing.


figure 28: example of a possible finished product

 

Support Our Scripts!

If you love using our scripts, consider making a small donation to help us keep them running smoothly. Maintaining these scripts and covering server costs isn’t free, and your support makes a big difference. Every little bit helps us continue creating, updating, and improving these tools for everyone. Thank you for being part of our community!

 
If you wish to make a donation, simply click on the “Donate with PayPal” button. You don’t need to have a PayPal account, you can use any debit or credit card when you select debit or credit card as payment method.

 

Share Your Experience!

Have you used our scripts to export your AutoCAD drawing into Photoshop? We hope they made your work easier and more efficient! We’d love to hear your feedback. What did you enjoy and what can we improve? Your insights are invaluable to us. Please share your thoughts in the comments below!

10 thoughts on “AutoCAD to Photoshop with layers”

  1. amazing!! Layers2PDF is the kind of script i was searching for days and days!!!
    if someone goes to photoshop is a mast!! with this you have 100% control on your drawing
    fast selection (of all trees or all walls or what you want), you also have transparency control on each layer and most of all, some kind of line weight with strokes!
    thank you!!!

  2. The example is great.
    However, to maximize automation, you could write a single script for both using VBA. VBA is supported in both AutoCAD and Photoshop.

    1. You’re probably right. We have programming skills in many languages however VBA is not one of them.

  3. Its not working with imperial units (Feet/Inches) Kindly update this routine so that it work with Feet/Inches.

    1. Sorry for the late reply, can you provide us with a sample drawing so we can look into this? Thanks.

      Update: January 2020: an adjusted script version for working in inches has been released.

  4. well it says i can’t save the files in ph “the parameters for command Save are not currently valid” any help?

Leave a Reply

Your email address will not be published. Required fields are marked *