How to add a source (surface) of cross section to section views

I’m trying to create flow where when we select a polyline and surface, a cross section is brought up.

When I run the process, the cross section does not appear because there are no sources in the cross section.

I would like to know if there is a process or Node for adding a source to the cross section.

operating is Civil3D 2023

:Civil3D Toolkit 1.1.32
:Camber 4.1.4
:Clockwork for Dynamo 2.x 2.4.0

Thank you for your attention.

Create CrossSection from a Polyline.dyn (100.3 KB)

I’m not sure if there is a node for that, but you can add sources using python.

1 Like

Thank you!
I’ve run the API for several times, but error occurs.
Actually I’ve almost never used API, so I can’t understand what error means.
Is it the case that error occurs if Dynamo version is different?

Sorry to ask here but can you explain how can I use this? I’m trying to add sources to a sample line group and cán’t get that code to work in mi graph. Thanks.

Please be more specific. What type of sources would you like to add, what error do you get etc.

This is the iportant part:
Here you can change the type to be added or add items by name etc.:

for source in slgs:
					st = source.SourceType
					if str(st) == "TinSurface":
						source.IsSampled = True

What I try to do is to add sources (surfaces and corridors) to a sample line group, as you have done in this thread.

When I try to use the graph I get this message:

I understand that it has somethin to do with the indentation. But I haven’t change anything in the Python code as you can see:

I would also like to know how to sample the corridors. Thank you so much for your response. I haven’t been able to get information on this, apart from that thread. Thanks.

Oh okay I see. Sorry I am on phone on the weekend so I cannot take a look at it. Try to switch the script to ironpython 2.7 as it is less sensitive with tabs and spaces. Or enable the display of spaces in the options to see what causes this and change every indentation to space or tab. To add corridors change the TinSurface part to Corridor. But note that it vill add all available Corridors

@yoshida this isn’t totally related, but might be of interest to you.


You’re right. I’ve managed to add TIN Surfaces correcting the indentation. That Python script should recognize also corridor surfaces? Cause it doesn’t add them.
As for corridors, there shouldn’t be a problema if it adds all the corridors cause I only have one this time. But is there a way to just add specific corridors?
Thank you so much for your responses.

Theoretically all types listed here should work. Change “TinSurface” to the desired Member Name
You can add Corridor by name with source.SourceName property, but you should change the code so it filters out corridors first, then finds the one with the selected name.

Sorry for the late reply.
I was studying to find out API.

I want to add Surface to 18 Samplelines.
※“SampleLineGroup.SampleLines” is List

Watching the chat, I’ve changed “・・・・” to “>>”

I have no idea what the error means. and how to solve

Thank you!!
It was very interesting and I would like to use it.

The script in current form requires 1 sample line as input and it gets the group from there.
You put a list in, not a sample line.

Thank you very much !!
The problem has been successfully solved.

1 Like