Skip to main content
Working with SHP files

SHP, Civil 3D, Shapefile, Import, Export

Alejandro Martinez / PVcase avatar
Written by Alejandro Martinez / PVcase
Updated over a week ago

Import SHP

This section explains how to prepare an existing Shapefile (.SHP) so that it can be used as terrain in PVcase GM. This cannot be done directly in AutoCAD, and requires the use of Civil 3D.

Note: 2D contours as polylines with 0 elevation and 3D contours as polylines with non-zero elevations. AutoCAD 3D polylines are not a valid terrain option for use in PVcase GM.

Importing the SHP file into Civil 3D

The first video shows the steps to be taken to import the SHP file into Civil 3D:

  1. Open Civil 3D and type the command MapImport.

  2. When prompted, select the file in SHP format to be imported and click OK.

  3. In the following window, select the Data column icon and in the new window select the Create object data option, click on Select Fields and make sure to select the attribute that includes the elevation of the contour lines (Contour attribute for the example in the video).

  4. Click OK (in all three windows) for the contour lines to be imported. If necessary, use Zoom Extents to show the imported contours.

  5. The contours will show with 0 elevation (2D) but with the elevation attribute (Contour for the example) showing in the Properties tab.

  6. Save the file as a 2D contour layout.

Creating the 3D contours in Civil 3D

The second video shows the steps to be taken in Civil 3D to create 3D contours from the previously generated 2D contours:

  1. Close the previously saved 2D contour file.

  2. Open a new file.

  3. Type MapWSpace to turn on the Map Explorer section in the Task Pane.

  4. Open the Windows file explorer and drag the previously generated 2D contour file into the Drawings section of the Map Explorer.

  5. Go to the Query Library in the Map Explorer and right-click on Current Query and select Define.

  6. In the Define Query of Attached Drawing(s) window, in the Query Type section, select Location as Boundary Type, confirm that All is selected in the Location Condition pop-up and click OK.

  7. In the Query Mode section, select Draw.

  8. In the Options section, check the box and click on Alter Properties to open.

  9. In the Set Property Alterations window, select Elevation as Property, then click on Expression and in the pop-up window select the adequate property from the Object Data list (Contour in the example) and click OK.

  10. Select Add to show the selected elevation property in the Current Property Alterations list and click OK.

  11. Back to the Define Query of Attached Drawing(s) window, select Execute Query (and use Zoom Extents if necessary) to show the contours in this new file. Now the contours will show the proper elevations.

  12. Save file in DWG format (now as 3D contours).

Using the 3D contours as terrain in AutoCAD

The third and last video shows the steps to be taken in AutoCAD to open the previously generated 3D contours and use them for Topographic Layout:

  1. Open AutoCAD, GM and previously generated DWG file (3D contours).

  2. Confirm the contour lines show as polylines with elevations.

  3. Open the Layout Generation Settings window, check the box and click Select terrain int the Topographic Layout section, and choose the layer of the contour lines to load them as terrain to be used in GM for frame placement.

Export SHP

This section explains how to prepare a DWG file (or some of the objects in it) for export as a Shapefile (.SHP) so that it can be used in other software that requires that format (e.g. ArcGIS). This cannot be done directly in AutoCAD, and requires the use of Civil 3D.

Generating the line objects to export

If the objects that need to be exported are the frames, the PVcase Frames would need to be converted from block objects to polylines. Another option is to use the command "PVcaseDrawFrameModules" to generate a 3D polyline for each module separately, as is shown here:

Generating the SHP file in Civil 3D

In order to export the line objects (in this case 3D polylines) follow these steps:

  1. Execute the Civil 3D command "MapExport".

  2. In the pop-up window, name the file and select the folder in which to save the generated SHP package.

  3. Select the object type (line in this case).

  4. Click on the "Select Manually" option and then on the icon right of it.

  5. Select all the line objects to be exported (in this case the individual PV modules).

  6. Click OK and Civil 3D will generate the files.

  7. Check the folder to make sure the required file package was generated.

Did this answer your question?