Ad

Friday, February 27, 2009

Convert Point Text File to SHP File

There is probably a better way to do this, but I wasn't able to find a better way.

  • Import the points into the drawing as Civil 3D Points.
  • Set the Point Style to have an AutoCAD point for the marker.
  • Explode the Civil 3D Points to be points.
  • Go to

image

  • Create a New Table with the fields you want to use with the correct format you want.

image

For my purposes I'm going to have PointNum as Integer, Desc As Character and Picture As Character.

  • Next attach Object Data to the points created.

image

Make sure that the Correct Table is selected (Easting and Northing are not used).

image

  • Now Export the points to a Shape file using the Map > Tools > Export from the menu, making sure to select the Object Data from the Data Tab.

image

  • If you are using Office 2003 you can use Excel and open the dbf file that accompanies the shape file and overwrite the data with the data from the text file and save the file as a dbf file. Excel 2007 doesn't let you do this so you will have to use Microsoft Access. To use Microsoft Access open the program and then import the DBF file.

image

Make sure you use the Link to data source to ensure any changes are saved to the dbf file.

  • Now delete all of the rows of records by selecting all of the rows and deleting them.
  • Next save the text file as an Excel file and put the same headings as the dbf file as the headings, deleting the X, Y values we don't need.

image

  • So now import the Excel data into the Table in Access.

image

image

Follow the prompts and make sure how the Excel file is being imported makes sense.

  • Now export the Table as a dBASE file to a location you can find.

image

  • Now delete the original .dbf exported and replace it with the Exported dbase file from above. Make sure the you change the name of the file to match the original one, including capitalization of the file name.
  • Now import the data to check the data, making sure to assign the Object Data (Map > Tools > Import).

image

  • So when you look in the Properties Palette you will see the imported information.

image

2 comments:

Brian Hailey said...

Chris,

I haven't tried it but, couldn't you simply export the Civil 3D drawing with the points in it to a .sdf file and then bulk copy that data into a .shp file?

Brian

Christopher Fugitt said...

I couldn't figure out how to include the Pictures column with the SDF export. When I tried it only included the PNEZD and not the additional custom column I needed.

LinkWithin

Blog Widget by LinkWithin

Ad