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
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')
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
#
#
cBandSet=IN[0]
outlist=[]
idBandSet=cBandSet.InternalObjectId
objBandSet=t.GetObject(idBandSet, OpenMode.ForRead)
iBandItems=objBandSet.GetBottomBandSetItems()
bandlist=list(iBandItems.GetEnumerator())
for i in bandlist:
idBandStyle=i.BandStyleId
outlist.append(idBandStyle)
# Commit before end transaction
t.Commit()
#pass
OUT = outlist