Get Region Name of FeatureLine

Hi Geert,
ok i have just tried the code you have provide with traceback. I agree nice add in. Thank You

it reported back Attribute Error - ‘CorridorFeatureLine’ object has no attribute ‘InternalObjectId’

I tried with multiple and single, same error.

No idea what I am doing wrong now…By all account that code you provided should work.

Hi, the reason be that you are trying to use Civil3D API code on a Dynamo object. So the CorridorFeatureLine is a Dynamo class (Civil3D.Geometry.CorridorFeatureLine), where the AutoCoridorFeatureLine is a Civil3d class (Autodesk.Civil.DatabaseServices.AutoCorridorFeatureLine).

If you want to use the Civil API you need to either construct the Civil class of make sure the object in the class exists in your drawing. As far as I know the first is not exposed in the API.

Hi @aa047,

There are a few different concepts at play here that I’ll try to explain.

A CorridorFeatureLine is what is formed by connecting together points in a corridor that share the same point code. A technicality here is that they don’t actually “exist” in the drawing - they are simply a visual feature of the corridor itself. That’s why you can’t select them and delete, copy, move, etc. like you can with other objects. The corridor is the actual object, and the feature lines are what help comprise the corridor and produce something visual for display. This is what you are getting with the CorridorFeatureLine nodes in Dynamo. You can get some basic information about them, and you can get some Dynamo geometry representations like points, polycurve, coordinate system at a station, etc.

An AutoCorridorFeatureLine is what you get when you create/extract a CorridorFeatureLine into the drawing. The end result of the extraction is a “real” object that exists in the model (often referred to as a “database-resident” object) that shares a lot of the same characteristics as a regular feature line (i.e., a grading feature line). You can select it, delete it, change the style, etc.

This is why InternalObjectId is not available as a property of a CorridorFeatureLine, because an object ID is something that gets assigned to database-resident objects.

I know this all sounds pretty granular, but once you start to get beneath the surface of Civil 3D, there are many more nuances to navigate :slight_smile:

Back to your original problem…maybe you can share what your end goal is for the overall workflow? Perhaps there is another way we can get there.