Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PipeDataExcel.cs

7 REPLIES 7
Reply
Message 1 of 8
RCBmstg007
1033 Views, 7 Replies

PipeDataExcel.cs

I have been reading alittle up on this Civil 3D API, but I know nothing really about it.

C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\Sample\Civil 3D API\DotNet\CSharp\PipeDataExcel

PipeDataExcel.cs
PipeDataExport.csproj
AssemblyInfo.cs

//
// (C) Copyright 2010 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
///////////////////////////////////////////////////////////////////////////////

This samples illustrates how to work with pipe networks and move data to and
from MS Excel using COM interop.

It defines two commands:
ExportToExcel - exports pipe data to excel
ImportFromExcel - imports the same pipe data from excel, updating the pipe network

Building the sample: This project requires two Microsoft Office interop
libraries (Microsoft Office 12.0 Object Library, and Excel 12.0 Object Library)
installed with Excel, as well as AecBaseMgd, AecDBMgd, AcMgd, and AeccDbMgd.

Using the sample: Open a drawing with at least one pipe network and run the ExportToExcel command. 
This exports information about the pipe network pipes and structures to an Excel document. 
Change values as required in the spreadsheet, then run the ImportFromExcel command to apply the
changed values to the open document.







Does anyone have an idea how to use this? I am want to use civil 3d export pipes to excel, then update the network from the excel changes.

Thanks for your thoughts!

7 REPLIES 7
Message 2 of 8
MikeEvansUK
in reply to: RCBmstg007

You really need to download Visual Studio Express for visual basic .net then open the compiled project in that.

 

I have used this code extract to add functionality to the import / export so that you can swap sizes, parts levels and edit optional data tags in one hit after editing it in excel.

 

Obviously you have no experience with .net or programing but don't let that put you off. There are many good tutorials and learning docs about that will help you out.

 

I sudgest you look at the following.

Tutorials in the autodesk docs, developer information.

Civil3d Reminders blog, Infrastructure Modelling blog & between the lines and many other blogs such as kean's.

AutoDesk University.

 

Once you have a basic understanding play about to figure out what you can and can't do. Refer to customisation forum.

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

Message 3 of 8

I want to do this also.  I searched and found the locations of the files on my C:drive.  I tried typing in ExporttoExcel on the command line but it does not come up and is a unknown command.  How do I load this routine into AutoCad so I can use this command?  Not sure I understood what you were talking about with Visual Basic?

Kindest Regards
Michael,
Civil Design Technologist (Exploration Technologist)
Civil 3D 2013
Windows 8
Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
32. GB
64-bit Oepration System, x64-based processor
No Pen or Touch Input
Message 4 of 8

The code for the sample listed by the OP is actually written in c# but you can just as easily do it in VB.

 

You can find information to get you started at the Autodesk Developer Network (http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=8007696) and you can download Microsoft's latest free version of Visual Studio at https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx.

 

The API for Civil 3D is documented at http://docs.autodesk.com/CIV3D/2016/ENU/API_Reference_Guide/

 

I'm not sure the sample files for the PipeDataExcel tool are still published.

 

Gil

Message 5 of 8

Thx.  I downloaded Visual Studio last night and watched the Autodesk University video on .NET programming.  Josh states in the video he downloaded the templates.  I downloaded the ObjectARX SDK files to my computer but don't know how to load them into Visual Studio.

 

Does anyone know how to do this?

Kindest Regards
Michael,
Civil Design Technologist (Exploration Technologist)
Civil 3D 2013
Windows 8
Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
32. GB
64-bit Oepration System, x64-based processor
No Pen or Touch Input
Message 6 of 8

You can download the AutoCAD .NET Wizards from the ADN homepage, the links installers are at the very bottom of the page.

 

Once installed you should be able to see AutoCAD plug in as a new project type.

 

Capture.PNG

Message 7 of 8

I don't think you actually need the Arx files. I use .net and have not used them. I recently found that Arx is already included in .net. I think there is little difference between .net and c++ apart from formatting.

 

I quite often translate c++ to .net.

 

Once you open the file you need to add the links to the application folder so that the correct imported assemblies can be found these will be displayed in the imports dialogue under project settings. The path is usually just the same as the Acad.exe file location dependant on version.

 

Next look at errors, these will hint at problems with missing references or different target file versions.

Also ensure if .com (not .net managed .com) is being used that the Acad version is correct, it is version specific.

 

For more assistance go to the customisation forum. Before that search the internet AutodeskUniversity has some great tutorials on .net API which will get you started with the basics. Also Civil3d reminders has great code examples.

 

Good luck.

 

M

 

Edit: BTW there are many examples of the API in the sample folder (but I guess this is where you found the pipetoexcel file).

 

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

Message 8 of 8
gil.dalton
in reply to: MikeEvansUK

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report