Author Topic: Export PipeStructureTable to Excel  (Read 5092 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Export PipeStructureTable to Excel
« on: May 19, 2015, 06:50:38 AM »
Hello!
I have created a tablestyle to PipeStructureTable which have
StructurName, X, Y, RIM-, SUMP-elevation
I want export table to Excel.

Or is there annother way to can export structureInformation to a file?

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: Export PipeStructureTable to Excel
« Reply #1 on: May 19, 2015, 07:02:20 AM »
It maybe interesting: I did it through CSV format - it is a plain text. Video of sample and code sources are here (first video only, second video is about export to MS Access).  Mouse double click opens necessary record of that file in the MS Excel and set this row as current. I exported information of block references, but the same principle as though I would use for tables: write to CSV.

P.S. the linked article has Russian text only,  :-( but C# code and videos are clear for understanding in my opinion.
« Last Edit: May 19, 2015, 07:14:24 AM by Andrey Bushman »

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: Export PipeStructureTable to Excel
« Reply #2 on: May 19, 2015, 08:50:58 AM »
P.S. the linked article has Russian text only,  :( but C# code and videos are clear for understanding in my opinion.


I reguarly visit your site Andrey as there is alot of good information there.  The Russian is not really a problem as Google Translate automatically translates it to English for me. 
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: Export PipeStructureTable to Excel
« Reply #3 on: May 19, 2015, 09:01:05 AM »
I reguarly visit your site Andrey as there is alot of good information there.  The Russian is not really a problem as Google Translate automatically translates it to English for me.
Thank you. Be careful, because it is old site. I wrote it when I was learning AutoCAD .NET API and C#, therefore often it has not optimal code. I write nothing there long ago. I am sure it has a lot of my errors. Today I would do a lot of things differently. My blog is newer than it.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Export PipeStructureTable to Excel
« Reply #4 on: May 19, 2015, 11:54:41 AM »
Not I was asking for, but looks also interesting. The problem I have is not solved in Civil3d to can export Pipenetdatas to Excelsheet. Only that way I can create PipeStructurTable, a type of Civil3d-object. My dotNet-expierence comes not so long to can easy do something... So my two questions are. How can I export Structure data(sump and rim-height) in a excel-table or how can I export a PipeStructureTable to Excel ?
_AeccAddNetworkStructTable creates this type of table in Civil3d. I can explode this table and get TEXT-entities which I can collect in a csv-file (checking here
« Last Edit: May 19, 2015, 12:01:10 PM by cadplayer »

kaefer

  • Guest
Re: Export PipeStructureTable to Excel
« Reply #5 on: May 20, 2015, 05:02:19 AM »
[...] how can I export a PipeStructureTable to Excel ?

Do the issues now lie on the Civil side or on the Excel side? If the latter, you might search this forum for excel late binding.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Export PipeStructureTable to Excel
« Reply #6 on: May 20, 2015, 05:40:27 AM »
Thank you.
First I have to think about how can I snap a ObjectName (RO) = "AeccDbPipeAndStructureTable" from Civil. I didnīt found it yet.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Export PipeStructureTable to Excel
« Reply #7 on: May 20, 2015, 08:51:10 AM »
The Civil3d table objects do not have any properties/methods to get the data in the table. The Structure and Pipe objects, however, are fully accessible so getting the date needed from them directly is certainly possible. There is sample code for the exchange with Excel in the C3D install folder.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Export PipeStructureTable to Excel
« Reply #8 on: May 20, 2015, 09:31:16 AM »
Yes I see, but I didnīt get run them. Something wrong with
Code: [Select]
Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported


Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Export PipeStructureTable to Excel
« Reply #9 on: May 20, 2015, 09:59:09 AM »
Which version of C3D? Which Sample are you trying? Which version of Visual Studio?

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Export PipeStructureTable to Excel
« Reply #10 on: May 20, 2015, 11:43:43 AM »
Hi Jeff!
I try it in Civil3d-2014 and VisualStudio2012.
I did not realy know if it have to do something with Excel.exe I have referenced in VS2012-projekt

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Export PipeStructureTable to Excel
« Reply #11 on: May 20, 2015, 12:23:05 PM »
Dirk, you need to add a reference for the .NET library Microsoft.CSharp and also for the COM Excel type library.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Export PipeStructureTable to Excel
« Reply #12 on: May 21, 2015, 01:23:56 AM »
Thanks for helping Jeff, I get it /D