Getting a DWG file in and out of Visio has always been a problem.  The file needed to come in at the right scale so the Visio shapes would match the CAD shapes and then it needed to be exported with both CAD shapes and Visio shapes in right place at the right size and scale.  Unless some specific rules and procedures were followed, the full fidelity round trip would never happen.

Use case In my company’s case, most of the DWG conversions are centered around floor plans.  We needed to get the floor plans into a pre-existing Visio template, lay our Visio shapes on top of the CAD floor plan, and then export the entire floor plan to DWG for collaboration and printing.  This document covers preparing a CAD file for import into Visio for use with Visio shapes.  It also covers the export from Visio of a CAD file containing the Visio shapes for use as an External Reference (xref) with the original drawing.  For liability reasons, most architects will prefer to have just the xref files and not the entire drawing back.

Basic Facts about Visio and AutoCAD Before we jump into the process I should go over some CAD terms and how they relate to Visio.  The first thing we need to know about CAD is that there are two ways to view a drawing: Paper space and Model space.  Basically all drawing is done in Model space and all printing/plotting is done in Paper space.  Drawings done in Model space are created in the real world scale: 1: 1.  Drawings in Paper space are represented as a scaled version of model space so they can fit on paper, typically ¼” = 1’ for floor plans.

The important thing to remember about this is that Visio imports and exports CAD files in Model Space but uses Paper Space (scale) to work with shapes and objects.  Visio does not have a Model Space equivalent; everything is done in Paper Space as far as Visio is concerned.  When importing CAD files into Visio, it is important to always match the Visio page scale.  If the drawing is saved properly, it will export in Model Space at a 1:1 scale.

Another major difference between Visio and CAD is that the creator of the CAD file can place the 0,0,0 (zero point) reference anywhere in Model space.  This zero point is reference point of all the shapes and any external shapes are referenced to.  In Visio the zero point is always the lower left corner of the drawing page and as far as I know can not be changed.  This is the main reason Visio shapes never aligned themselves with the CAD drawings.

The Process This is a three step process.  The first step involves setting up the CAD file for import into Visio by making sure the file is as clean as possible, is in the correct format, and the reference point is set correctly.  The second step is setting Visio correctly so it can accept the CAD file at the right scale with a matching reference point and then saving the file in DWG format.  The third step involves inserting the Visio/CAD shapes back into the original CAD file as an xref or exporting both Visio shapes and CAD shapes as a single file

This process has not been thoroughly tested in the real world or with different version of AutoCAD other than 2006 and with files created in anything other than US units.  Since there are many ways of creating CAD files, this process may need to be refined as time goes on.
Section 1 – Prepare the file for insertion (requires AutoCAD) Some current version and basic knowledge of AutoCAD or AutoCAD Lt is needed for this part of the process.  If you don’t have AutoCAD, see if you can get the person who gave you the floor plan to follow these instructions.  This process assumes the user is working on an Architectural file.

Drawing units dialog box

  1. Open original file in AutoCAD in Model space.  The following commands will clean up the drawing and set the reference point.
  2. Run the Command: units
    Make sure the drawing is set to Type: Architectural and Insertion Scale:Unitless.
  3. Run the Command: zoom extents
    You should see the entire drawing.  Zoom extents will fill the page with the page  with the entire drawing.
  4. Run the Command: xref The Xref Manager dialog will open.  An xref is an external reference to other CAD files.  It is up to the Architect or the person putting together the file to determine which files are needed to be added or deleted from the drawing.
    1. If there are xrefs, select all files, click the [Bind] button.  The Bind Xrefs dialog will open.  Select the Insert option and then click [OK].  Click [OK] to close the Xref Manager.This will bind any externally referenced files to this file.

      Note: If the xref Status is “Not Found” or “Unloaded”, then select all files, click the [Detach] button and then click [OK].  If there are no xref’s then just click [OK].

Xref Manager dialog


  1. Run the Command: purge
    Purge removes unused entities that are not used in the drawings.  You may have to run this more than once.

    1. Check ‘Purge nested items’
    2. Uncheck ‘Confirm each item to be purged’
    3. Click [Purge All] until all items are purged, you may have to do this more than once.

Purge dialog box

    1. Click [Close] to exit the dialog


  1. Run the Command: audit
    1. Type y to fix any errors
  2. Run the Command: Base
    Base resets the 0,0,0 point

    1. Set point to 0,0,0
  3. Run the Command: line 0,0,0
    1. This will find the origin point of the CAD drawing.  The pivot point of the line is the ‘origin’ or ‘zero point’ of the drawing.  This is very important if you want the Visio shapes to match the floor plan on export.  Draw the line along the x axis to the right of the ‘zero point’ and then hit the Esc key.
    2. Run the Command: line 0,0,0
      Draw another line at the pivot point along the y-axis to form a 90 degree angle.  The two lines will form an “L”.  The corner of the angle is the zero point of the CAD drawing.  When done, hit the Esc key.
    3. Sometimes the base point will be set off the page if this happens go to the troubleshooting section below.
  4. Run the Command: zoom extents
  5. Do a FileàSave as… and save the drawing in AutoCAD 2000/LT2000 Drawing format.


At this stage the file is ready to be exported at its cleanest and most Visio compatible state.

The corner of the green angle is showing the 0,0,0 point on the CAD drawing (zoom helps here)

Section 2 – Set up Visio page to insert CAD file as a background

  1. Start with a pre existing template or new page
  2. Select File/New/Building Plan/Floor Plan (US Units)
    The file will open and there will be one page, Page-1.
    Note:
    this step assumes that you are using Visio 2003 Professional
  3. Select FileàPage Setup…

Page Setup dialog box

    1. Click the Page Properties tab and verify that Measurement Units is set to Inches, not Feet and Inches.  Click the Drawing Scale tab and verify that the Pre-defined scale: is set to Architectural ¼” = 1’0”.  This is a good scale to start with.  Click [OK].
  1. Right click on the Page-1 tab and select Insert Page…
    1. Select the Background radio button for the Type:.
    2. The Measurement Units should already be set to Inches but verify this as this is extremely important.  Click [OK].
    3. If you did not rename the page, a page named Background-1 was created.
  2. While on the Background-1 page , select InsertàCAD Drawing… ,browse to the file you just saved in the example above and click [Open].  The Insert AutoCAD Drawing dialog box will open.
  3. The Custom Scale: radio button is selected by default.  You must change this to Pre-defined scale: Page ScaleDO NOT change the value of the scale of the drawing with this dialog box.  Click [OK].
    1. If the CAD drawing is too large for the page size then start the insert over (step 3 in this section) but with a smaller scale from the File >> Page Setup >> Drawing Scale dialog

File >> Page Setup >> Drawing Scale dialog box – adjust scale here

    1. If the CAD drawing is too small for the page size then start over with a larger scale (step 3 in this section)
    2. Sometimes this file will still not be compatible with Visio and you will get an error message.  See the Troubleshooting section of this document for multiple ways to solve this issue.
  1. Test the scale by going to a door, most doors are standard sizes and are usually marked 2-4 or 2-6 to represent a 2’4” or 2’ 6” door.  If the scale is not perfect START OVER.
    Note: to remove the CAD drawing from the Visio page, double click the CAD drawing in Visio.  The CAD Drawing Properties dialog box will open.  Un-check the Lock against deletion box and then click [OK]. Hit the delete key on your keyboard to remove the CAD drawing from Visio.  Start over with step 3 in this section.

Proper setup dialog box for inserting CAD files.  Do not adjust drawing scale here, always use page setup

  1. Go to the main drawing page where you want to add Visio shapes, NOT the background page

Select File/Page Setup and then click the Page Properties tab.  Select Background-1 from the Background: dropdown menu.  You will now see the CAD drawing displayed on the Visio page.

Matching scale of dwg floor plan and Visio shapes

  1. Create a shape in Visio that will match the CAD zero point.  This will be used as a reference when bringing the file back to AutoCAD.  In this case I used a red reverse “L” shape and aligned the corner exactly with the CAD “L” shape.  This shape will be referred to as the Visio/CAD Reference henceforth.

    Where the red and green corners meet is the zero point in Visio and CAD.  The red reverse L is a Visio shape, the green L is from the CAD drawing.

  2. Layout Visio shapes as needed.  In this case I added some icons, a piano, a couch, and a table with dimensions in Bedroom #3
  3. Optional procedure: Once all the shapes are laid out you can highlight all the shapes and move them all to so the Visio/CAD Reference is at the lower right corner of the Visio drawing (you may want to temporarily Group all items selected so you don’t accidentally move just one).  This means that all the shapes will now be in the wrong areas on the Visio drawing.  This is done so you can automatically insert the Visio shapes on the CAD file at the zero point.  The reason for this is that Visio’s ‘zero point’ is always at the lower left corner of the page while the CAD ‘zero point’ is set by the user.  Once you complete step 13 in this section, you can then move the shapes back to the proper place in Visio.
  4. Save as a DWG by selecting FileàSave as… and selecting AutoCAD Drawing from the Save as type: dropdown.

Section 2a – Set up Visio for a full export of CAD drawing and Visio files

  1. Follow steps 1-3 from above to insert a file.
  2. Skip step 4.
  3. Follow steps 5-11, substituting your page name wherever you see “Background-1
  4. The CAD and Visio shapes are exported in one file, eliminating the need for Section 3 below.

External (xref) dialog box

Section 3 – Externally Reference (Xref) the Visio created DWG to the original DWG

  1. Open the original CAD file created in Section 1 in AutoCAD
  2. Select InsertàExternal Reference…and Browse to the file you just saved from Visio.  Click [Open].  The
  3. If you changed the reference point in the Visio file (step 11 from Section 2) then make sure the Insertion Point: Specify On-screen option is unchecked and the reference is 0,0,0.  Click [OK].
  4. If using the matching Visio and CAD reference shape then check the Specify On-screen dialog then click [OK].  You will need to  point the cursor to the matching CAD reference point.  The corners should match perfectly.
  5. Verify that the reference points line up.
  6. All the Visio shapes are now part of a single xref in the original CAD drawing.

Visio shapes on top of a CAD floor plan

Optional – Name and lock the Visio layers on the CAD drawing

  1. Run Command line: -layer
    1. N for New.
    2. Name the layer as XREF-AV.
    3. Type in LO, then XREF-AV to lock the new layer.
  2. Select the Visio xref to highlight the layer.
  3. On the layer manager pull down menu bar, select the layer name XREF-AV.
  4. Click anywhere in the model space and the command should be done.


Troubleshooting:

Multiple views of a floor plan in model space.

Wblock dialog box

  1. Multiple views in the same model space – Sometime you will get a file with multiple views of the project in a single Model space.  This is not technically correct but it happens frequently.  Ways to solve:
    1. The best way is to get the architect to change the drawing so that each file only has the proper view.  What needs to be done is the drawing has to be broken down into separate views.  Follow these instructions:
    2. Command: zoom extents (ze)
    3. Command: wblock to separate a specific part of a drawing to a separate file.  The Write Block dialog will open.
    4. Click the [Select Objects] button in the Write Block dialog.  Highlight the area that you want to save
    5. Hit enter, the Write Block dialog will show again.
    6. Enter a file name and path in the Destination section of the dialog box.
    7. Click [OK].
    8. Open new file
    9. Command: ucs
    10. n for new
    11. Pick an arbitrary point somewhere in the lower right beyond the boundary of the drawing for the new zero point
    12. Command: base
    13. 0,0,0
    14. Run the file through the clean up commands outlined in Section 1 of this document.

Visio CAD error dialog box

  1. Visio import error – If you  saved as an AutoCAD 2000 file but you still get this dialog box, this usually means that the CAD file is still not compatible with Visio.  Some things to try:
    1. Save the file as AutoCAD R12/LT2 DXF (*.dxf) file.
    2. Save as R10 DWG  Use Amethyst CADwizz Max if your version of AutoCAD will not support R10
    3. Save the file as a WMF by highlighting the entire file and using the AutoCAD export command and choosing WMF.  You can use CADWizz Max or AutoCAD to save/export as WMF.  Import WMF file in Visio by using the InsertàPicture command.  This process will always work but the file is not really scaled anymore.  You can stretch it until it matches the Visio scale but you will not be able to xref back and get a perfect match, although it will be close.
  2. The line 0,0,0 point is off the main drawing – This is usually an architect’s mistake or the drawing was based off of a civil drawing.  To set a new arbitrary point to use as a reference follow these commands
    1. Command: ucs
    2. n for new
    3. Pick the arbitrary point somewhere in the lower right beyond the boundary of the drawing
    4. Command: base
    5. 0,0,0
  3. Proxy Object error – Visit site below for a complete explination of what a proxy object is http://www.archidigm.com/lounge/autocad%20tips/proxy_objects.ht
  4. All I have is the paper version of the drawings
    1. Get them scanned and converted to dwg.  There are hundreds of companies that can accomplish this for you.  Google raster to vector conversion service to start

You can download a pdf of this whitepaper at the D-Tools User Forum here.