Get Band Name from a Profile View Bandset

Hi, I’m new to the Civil3D API and to this forum and I’ve recently explored the Civil3D API library.

I want to get the band style names included in my bandset so I’m trying to extract the bandstyleid from the bandsetitem. How can I get a bandstyleid from a profile view bandset style? I keep trying to get the bandstyleid of the band item directly from the enumerated bandsetitem but it doesn’t seem to work.

Here’s the code for my python node in dynamo:

import sys
import clr


from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *

from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
from Autodesk.Civil.DatabaseServices.Styles import *

dataEnteringNode = IN

adoc = Application.DocumentManager.MdiActiveDocument
editor = adoc.Editor

with adoc.LockDocument():
    with adoc.Database as db:

        with db.TransactionManager.StartTransaction() as t:
            # Place your code below
            objBandSet=t.GetObject(idBandSet, OpenMode.ForRead)
            for i in bandlist:
            # Commit before end transaction

OUT = outlist

Might be my lack of Civil 3D expertise showing, but I feel like attaching a DWG with the profile view bandset in it would help for testing. If you can’t attach here then you can use another file hosting service, such as box, dropbox, onedrive, google drive, etc… It’d take me a few hours at least to figure out how to build the base data set, and a lot of other Dynamo experts are in a similar boat.

Get Bandset Names.dyn (11.1 KB)

I’m currently training myself hands-on in Python to access Civil3D APIs so I’ve attached my Dynamo script here.

I’m just using civil3d blank standard template files for testing this. Currently the string name to be tested is in the dynamo script. I’m using the AMR_CivilDynNodes package to access the civil bandset object to be inserted in my node.

My expected outcome as of the moment should be a list of band style IDs but I can’t seem to make line 47 in the python node work.


only set

Thanks for the insight but is there a way to get the band style id or band style name from the profile view band set?