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.!
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.
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
Check out:
C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\Sample\Civil 3D API\DotNet\CSharp\PipeDataExcel\PipeDataExcel.cs
Christopher
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
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 ?
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.
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,
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. !!
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.CommandType_Update) as osgeo_command.Feature.IUpdate)
{
//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..
Guys
Were you able to get this code to work I have a similar situation here where I am trying to get an automated workflow up and running to supply shp data to the local council in their format.
Currently I have
1. Some code to update my design pipe network with updated as built survey data.
2. Then I am using the workflow described here to convert the Civil3d objects to a sdf file and then make shp files
http://www.augi.com/library/convert-civil-3d-data-to-shp-files
3. The problem after getting to this point is I have to add a number of addintional fields of data that do not come into the sdf file from the Civil3d model for example pipe material,manufacturer and other fields required to meet councils format such as pipe condition, install date, etc. I do not know how to do this by hand yet but would ultimately like to do it with code if possible.
As my problem sounds similar to yours I thought I would ask to see it you found a solution. Before I look at it indepth myself.
Can't find what you're looking for? Ask the community or share your knowledge.