I’m seeking assistance in Civil 3D and was wondering if there’s a specific node or Python code that can be used to efficiently import label sets for multiple profiles into existing profile views.
a similar node for alignments coming from Camber, but we haven’t come across a similar solution for profiles yet.
Or is it possible to change in the following code to only change import label sets?
result = []
# Get the active document in the AutoCAD session:
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
# get alignment
alignId = align.InternalObjectId
# set layer same as alignment
layerId = alignId.LayerId
# set profile style
styleId = civdoc.Styles.ProfileStyles[style]
# set label set
labelSetId = civdoc.Styles.LabelSetStyles.ProfileLabelSetStyles[label]
for n in name:
try:
# Creates a new profile
profId = Profile.CreateFromSurface(n, alignId, layerId, styleId, labelSetId)
except Exception() as ex:
MessageBox.Show(ex.message)
t.Commit()
for n in name:
result.append(align.ProfileByName(n))
return result
alignment = IN[0]
names = IN[1]
surface = IN[2]
StyleName = IN[3]
LabelSetName = IN[4]
if not isinstance(names, list):
names = [names]
OUT = create_profiles(alignment, names, StyleName, LabelSetName)
Your insights and guidance on this matter would be greatly appreciated. Thank you in advance for your assistance.