As the story goes Dana was working on this weekends design project with pipe networks. So I am idly minding my own business when I get an IM asking if I have any clue why the import portion from the pipes import/export routine that someone down Manchester way posted wasn’t working, of course it was posted with no implied warranty. So I began digging around to see what I could find. The routine worked just fine on the Getting started guide pipes drawing. An IM later and I had Dana’s current dwg.
Now I could see the error. Certain pipes inverts were not being updated as expected. After some hunting I was able to track down the error. Autocad and thus Civil3D track items by something called the handle(A unique identifier made up of letters and numbers for each object). The problem in this case was some of the handles were numbers which include an E, such as 305E8. Now in most cases this wouldn’t be a problem, excel however being a spreadsheet application sees that number as 3.05E+10. When one went to import the adjustments made in the spreadsheet no object in the drawing had a handle 30500000000 which was causing pipes not to get their updates.
I simply added a line to the export routine which formats the first column in the workbook to be text and stops excel from converting any of the handle values which happen to contain an E into scientific notation. So here is a link to the updated code.