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

Extract Sampled Cross Sections into a text file

11 REPLIES 11
Reply
Message 1 of 12
Seyyed
4069 Views, 11 Replies

Extract Sampled Cross Sections into a text file

HI,

I want to extract sampled sections to a text file like "Station,Offset,Elevation" by C#.net

Something like tplate output in land companion,

 

wich functons should I have access to do above?

11 REPLIES 11
Message 2 of 12
Partha.Sarkar
in reply to: Seyyed

Hi Seyyed,

 

I don't see any public function available in Civil 3d .net Section object to extract these details at the moment.

FYI - Section object is not yet fully exposed in .NET API.

 

Did you check the following API (Civil 3D COM ) ?

 

IAeccSampleLineVertex:: Location Property -> Gets or sets the 3D point location for the sample line vertex.

IAeccSection:: ElevationAt Method -> Gets the cross section elevation at a specified offset.


IAeccSection:: Station Property -> Gets the cross section station distance.

 

I am not familiar with 'tplate output in land companion'; if this is sampling the surface along a line, then you could see the following blog post with code sample useful to you -

 

Using SampleElevations() in AutoCAD Civil 3D 2013 .NET API
http://adndevblog.typepad.com/infrastructure/2012/04/using-sampleelevations-in-autocad-civil-3d-2013... 


Want to use only StartPoint and EndPoint as input to .NET API SampleElevations()?
http://adndevblog.typepad.com/infrastructure/2012/04/want-to-use-only-startpoint-and-endpoint-as-inp... 

 

Does it help ?



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 3 of 12
Jeff_M
in reply to: Partha.Sarkar


@Anonymous wrote:

 

I don't see any public function available in Civil 3d .net Section object to extract these details at the moment.

 

I am not familiar with 'tplate output in land companion'; if this is sampling the surface along a line, then you could see the following blog post with code sample useful to you -

 


Partha, the template in LDT was essentailly the Assembly in C3D, so I think they want to get the design data.

 

Seyyed, I don't have time to test this, but it looks like you can use the .net API in 2012 & 2013 (maybe earlier versions as well, I haven't looked). You will need to get the sections via the Alignment, SampleLineGroup, SampleLine, Sections, Section, SectionPoints. The section points returns a collection Point3d object which you can then use the Alignment's StationOffset() method.

Jeff_M, also a frequent Swamper
EESignature
Message 4 of 12
Jeff_M
in reply to: Seyyed

Or maybe you just need to run the Corridor SectionPoints report and save it as an Excel file?

Jeff_M, also a frequent Swamper
EESignature
Message 5 of 12
Seyyed
in reply to: Seyyed

HI,

 

Thank you partha,Jeff_M

I'm starting C3D programing about two weeks.

 

I want ground point data, In LDT in cross section  menu we have a command that give us a file (attached.)

 

Because our company uses a Local software for analyzing Profiles sections and Volumes, we need to import ground sections to it.

 

So when we migrated to C3D I didnt have an option, then I used landXml and export the project to landxml and importing it to LDT for my purpose.

sorry for my poor english

 

<script id="__changoScript" type="text/javascript">// var __chd__ = {'aid':11079,'chaid':'www_objectify_ca'};(function() { var c = document.createElement('script'); c.type = 'text/javascript'; c.async = true;c.src=( 'https:' == document.location.protocol ? 'https://z': 'http://p') + '.chango.com/static/c.js'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(c, s);})(); // </script>
Message 6 of 12
peterfunkautodesk
in reply to: Seyyed

I would either use the Corridor "Section Points Report" and save the results as a text file, or look at the source code for the Corridor Section Points Report's source code that ships with Civil 3D to see how we extract the data from the corridor model. If you are also looking at existing ground points, there are a bunch of examples on how to extract ground points between two points.

 

Regards,

 

Peter Funk

Autodesk, Inc.



Peter Funk
Autodesk, Inc.

Message 7 of 12
kh_night
in reply to: Seyyed

Hi

I have reversed question. How can I create section with a Text-File which it contains {station,offset,elevation}??

Message 8 of 12

In the Points menu there is a command under "Create Points - Alignment" "Import from File" what will import points from a file with station, offset elevation format. After the points are imported, create a surface and then create sections from that surface. The alignment could be a straight line if you are only interested in the sections.

 

Regards,

 

Peter Funk

Autodesk, Inc.



Peter Funk
Autodesk, Inc.

Message 9 of 12


@peterfunkautodesk wrote:

In the Points menu there is a command under "Create Points - Alignment" "Import from File" what will import points from a file with station, offset elevation format. After the points are imported, create a surface and then create sections from that surface. The alignment could be a straight line if you are only interested in the sections.

 

Regards,

 

Peter Funk

Autodesk, Inc.


tnx peterfunkautodesk

Of course I want to use C#.net for my question and I think we have problem in creating surface from points, We must edit this surface!

Message 10 of 12

I missed that this was a API question....

 

1. You can't make a Civil 3D section object from just points. They are dyanmic objects that are made from surfaces or corridors.

2. There isn't an API call to import a file by station offset elevation, but all the tools are in the API to do this without much effort.

3. After the points are in the drawing, they could be added to a point group and then a surface made from that

4. After the surface is made, add sample lines to the alignment (at the stations from text file)

5. After the sample lines are made, create the section and section views.

 

Regards,

 

Peter Funk

Autodesk, Inc.



Peter Funk
Autodesk, Inc.

Message 11 of 12
kh_night
in reply to: Partha.Sarkar

Hi
I produce a DLL which it can import sections from a text file and export section view to a text file.
 After Loading this file (section.dll) with NETLOAD command in Civil3D, you can export your section view with "Exportsec2xyzoffsta" command. This command generate a text file with PXYZ and Station format from your section view.
Another command is "CreateSectionFromFile". After running this comand, A dialog box will open and you must open your text file and select alignment and other...
Your text file format for importing sectiong must be like this:
//------------------------------
chainage83.695
-50.4085         14.0000  
-38.5566         12.0000  
-27.5584         25.0000  
-11.5134         30.0000  
0.0000         22.0831  
8.8465         16.0000  
22.8670         15.0000  
40.2376         20.0000  
48.6722         10.0000
//-------------------------------
"chainage"+Station and offset and elevation for below column.

 

Message 12 of 12
waov72
in reply to: Seyyed

Podés colocar un ejemplo?

no entiendo.

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

Post to forums  

Rail Community


Autodesk Design & Make Report