AutoCAD Civil 3D Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello Ppl,
I have this issue,
I want to export civil3D pipe, road, alignment as SDF file with additional properties.
currently civilSDF Export option only has limited options for exporting for civil 3D objects.
Basically I am developing an app It would export selected feature(eg: pipe) with all available properties such as material, radius, etc.
I tried an example online - which showed how to create SDF file and fetch data from layers. which is not usefull in my case.
I want to do exactly like the civilsdf export tool with additional properties can be selected.
if anyone help me with, how I can get geometry data of pipes or an exmple atleast that would be great.
Thanks guys.!
Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Civil BIM Consultant | Geo Spatial - IT Specialist
CSI Global pty Limited. - Singapore | Sydney
Web : www.csigs.com.au
www.civil3dforum.com | www.e4forums.com
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
have a look at the infrastructure dev blog here-
http://adndevblog.typepad.com/infrastructure/
There are a few examples of working with civil 3d objects.
Andrew Puller
Maitland, NSW, Australia
Windows 7 Enterprise 64bit
Intel core i7 2600 @ 3.40 GHz with 16GB Ram
Civil 3d 2013 64bit
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks for the reply. but I couldnt find anything relavent to pipes in there.
If there is any code snippet that would be great.
Cheers
Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Civil BIM Consultant | Geo Spatial - IT Specialist
CSI Global pty Limited. - Singapore | Sydney
Web : www.csigs.com.au
www.civil3dforum.com | www.e4forums.com
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Check out:
C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\Sample\Civil 3D API\DotNet\CSharp\PipeDataExcel\PipeDataExcel.cs
Christopher
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I cheked it but it doesnt give anywhere for getting geometry of the pipes.
Is there any example on how to get the geometry of the pipe or create gemetry data of pipes to be stored in an SDF file from the start and end point of the point.
Cheers
Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Civil BIM Consultant | Geo Spatial - IT Specialist
CSI Global pty Limited. - Singapore | Sydney
Web : www.csigs.com.au
www.civil3dforum.com | www.e4forums.com
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I don't see any API available to export Civil 3D objects other than using the ExportToSDF command (Export Civil Objects to SDF).
This UI command exports the Geometry and some other useful attributes like - InsideDia, OtsideDia, Length, slope etc.
Once the SDF is connected using FDO provider you can use the Expression builder and use the "Geometry" property to create a custom calculation.
Does it help ?
Partha Sarkar
Developer Technical Services
Autodesk Developer Network
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank Partha for the info.
Now I changed the course ...I am creating the SDF using the standard tool from C3D and then I wrote some code to create additional property defnitions under each featureclass..
then another code to insert/update value to the appropriate property defnition.
I am stuck at the point where my code to insert/ udpate doesnt seem to work.
Is there any example for code sinpet in C# to insert/ update value to the desiered coloumn and row in a feature class.
While inserting/ updating i want the code to choose the appropriate feature class (eg: pipe) and then column or property defnition (eg: lets say associated surface - custom added property - string data type) and check the pipe name (row) and add value.!!
please assist.
Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Civil BIM Consultant | Geo Spatial - IT Specialist
CSI Global pty Limited. - Singapore | Sydney
Web : www.csigs.com.au
www.civil3dforum.com | www.e4forums.com
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Is there any example for code sinpet in C# to insert/ update value to the desiered coloumn and row in a feature class.
>>> Did you check the following blog post ?
Does it help ?
Partha Sarkar
Developer Technical Services
Autodesk Developer Network
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Partha,
I checked that, my code is derived from that one and other the MAP3D developer Guide example and anothero one I found from OSGEO documentation.
But the problem is the code explains how to insert update data located in a layer.
in my case I have a SDF file and the SDF file I have feature classes (pipes, roads, alignments, etc) with that I have property defnitions (id, radious, starting point ,etc)
also there may be multiple pipes available (P1, P2, p3)
Now I want to go in to the desired feature class (eg: pipe)
then to the appropriate property defnition(eg: Associated surface - which already created in the schema)
and then I have go the row (pipe - p2) and update the value of the Associated surface for pipe p2 to the desiered value...
Any help would be appreciated. !!
Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Civil BIM Consultant | Geo Spatial - IT Specialist
CSI Global pty Limited. - Singapore | Sydney
Web : www.csigs.com.au
www.civil3dforum.com | www.e4forums.com
Re: Civil3D pipe Road Data to SDF (GIS) Export using .NET C#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
some more information
===================
My schema Structure (SDF File)
==================================================
Schema name: Civil_schema
Feature classes : Pipes, structure, point, ...
properties inside Pipes feature class : PipeRadius, PipeType,....
==================================================
Now that I have the schema, I have two pipe data inside (two rows - PipeName = p1 and p2)
I want to insert PipeType as Iron for R-1P1 and PVC for R-1P2
for some reason my insert and update command isnt working...
Code snippet
==================================================
//static sdf file
string sdffile = "c:\test.sdf";
//created a IConnection con (i have this in correct - just dont want to write all)
using(con)
{
using (osgeo_command.Feature.IUpdate update_data = con.CreateCommand(osgeo_command.CommandType.Comman
{
//set the target schema
update_data.SetFeatureClassName("Civil_schema: Pipes"); //schema name:clas name = this worked for reading
update_data.SetFilter("Name = R-1P1"); // this is to identify the row - i am not going to update this row
// property value collection
PropertyValueCollection pcoll = update_data.PropertyValues;
//creating a property value that needs to be added
PropertyValue propvalue = null;
propvalue = new PropertyValue();
ValueExpression expression = (ValueExpression)Expression.Parse("'Iron'"); //want to add iron as my pipe type
propvalue = new PropertyValue("Pipetype", expression);//here i am specifying the column name as Pipetype
pcoll.Add(propvalue);
if (1 != update_data.Execute())
{
ed.WriteMessage("\nUpdate failed");//this writes the message in autocad
}
}
}
==================================================
I dont know where i am going wrong...could you guys point me the correct direction please..
Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Civil BIM Consultant | Geo Spatial - IT Specialist
CSI Global pty Limited. - Singapore | Sydney
Web : www.csigs.com.au
www.civil3dforum.com | www.e4forums.com

