In AutoCAD Civil 3D Toolspace, under the 'Sample Line Groups' collection, for a particular Sample Line Group (SLG), you will see 'Section View Groups' collection.
Once you expand this collection, you will see 'Individual section views'. When we add a single Section View using SectionView.Create() API, it will be added to this collection. In Civil 3D .NET API, we can access this through the following API -
SampleLineGroup.IndividualSectionViewGroup Property // Gets the individual SectionViewGroup.
If you want to create multiple section views for a group of sample lines along an Alignment, in Civil UI tools we use 'CreateMultipleSectionView' as shown below -
If you want to programmatically create multiple section views, use SectionViewGroupCollection.Add() API. First to access the SectionViewGroup collection use the following Civil 3D .NET API -
SampleLineGroup.SectionViewGroups Property // Gets the collection of SectionViewGroup.
Here is a C# .NET code snippet using one of the overloaded versions of SectionViewGroupCollection.Add() API :
SampleLineGroup sampleLineGrp = SampleLineGrpId.GetObject(OpenMode.ForWrite) asSampleLineGroup;
//SampleLineGroup.SectionViewGroups Property
// Gets the collection of SectionViewGroup.
SectionViewGroupCollection sectionViewGrpColl = sampleLineGrp.SectionViewGroups;
// get the location to insert the Section views
Point3d insertPosition;
PromptPointResult ppr = ed.GetPoint("\nSelect a Location for the SectionViews:");
if (ppr.Status != PromptStatus.OK)
return;
insertPosition = ppr.Value;
// now call the Add()
// Add a SectionViewGroup which will create multiple SectionViews for each SampleLine in SampleLineGroup.
sectionViewGrpColl.Add(insertPosition);
And result in AutoCAD Civil 3D –