In Civil 3D
UI, if we expand the styles collection of a Civil 3D object, you will notice
the yellow triangle next to it which indicates this style is 'in-use', e.g. in
the screenshot we see the style collection of Surface styles which are in use –
In Civil 3D
2014 .NET API, we have a very useful API StyleBase.IsUsed which will tell us if
a particular style is in-use. Here is a
relevant C# code snippet :
foreach (ObjectId surfaceStyleId in civilDoc.Styles.SurfaceStyles)
{
// Open each style object to check if it is "in-use"
SurfaceStyle csStyle = surfaceStyleId.GetObject(OpenMode.ForRead) as SurfaceStyle;
if (csStyle.IsUsed)
surfaceStyleNameColl = surfaceStyleNameColl + "n " + csStyle.Name.ToString();
}


Leave a Reply