create_section_view_group

create_section_view_group is a skill for Claude Code, Codex from nezolder/civil3d-mcp-roslyn. It costs 41 tokens per session (4,375 once invoked), scanned A, original, MIT.

A tool for creating a native group of section views from a sample-line group, using a draft grid or a template and configured styles and data sources.

In plain words
What is it for?
Use it to create view groups, set their placement and naming, and attach band data sources.
Why use it?
It removes repetitive setup when turning sampled alignment data into placed cross-section views.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create view groups, set their placement and naming, and attach band data sources.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nezolder/civil3d-mcp-roslyn/create_section_view_group
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nezolder/civil3d-mcp-roslyn --skill create_section_view_group
Clone the repo
git clone --depth 1 https://github.com/nezolder/civil3d-mcp-roslyn

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for create_section_view_group

README.md
[![agentmods](https://agentmods.dev/badge/skills/nezolder/civil3d-mcp-roslyn/create_section_view_group/github.svg)](https://agentmods.dev/skills/nezolder/civil3d-mcp-roslyn/create_section_view_group)
Your own site
<a href="https://agentmods.dev/skills/nezolder/civil3d-mcp-roslyn/create_section_view_group"><img src="https://agentmods.dev/badge/skills/nezolder/civil3d-mcp-roslyn/create_section_view_group/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for create_section_view_group

Your own site · 80×15
<a href="https://agentmods.dev/skills/nezolder/civil3d-mcp-roslyn/create_section_view_group"><img src="https://agentmods.dev/badge/skills/nezolder/civil3d-mcp-roslyn/create_section_view_group.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,375 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.04375
Opus 5.5 $0.00016 $0.01750
Sonnet 5.5 $0.00008 $0.00875
Haiku 4.5 $0.00004 $0.00438

Measured 16d ago against content hash f6d7abdeb43b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

create_section_view_group scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sections/create_section_view_group.skill.md · 340 lines

How it starts

The opening of the file, as written. The whole thing — 340 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Template

var sampleLineGroupHandle = "SAMPLE_LINE_GROUP_HANDLE";
var insertionX = double.NaN;
var insertionY = double.NaN;
var startStation = double.NaN;
var endStation = double.NaN;
var leftWidth = double.NaN;
var rightWidth = double.NaN;
var sectionViewStyleName = "";
var bandSetStyleName = "";
var bandSources = new (int bandIndex, string section1SourceHandle, string section2SourceHandle, bool showLabels)[] { };
var templatePath = "";
var layoutName = "";
var groupPlotStyleName = "";
var viewNamePrefix = "";
var nameDecimals = 2;
var nameIntegerDigits = 3;

var isHandle = new Func<string, bool>(value =>
    !string.IsNullOrWhiteSpace(value)
    && System.Text.RegularExpressions.Regex.IsMatch(value, "^[0-9A-Fa-f]{1,16}$"));
var isOptionalName = new Func<string, bool>(value =>
    value != null && (value == "" || (value == value.Trim() && value.Length <= 255 && !value.Any(char.IsControl))));
if (!isHandle(sampleLineGroupHandle))
    return new { success = false, error = "sampleLineGroupHandle must be a hexadecimal handle." };
if (!double.IsFinite(insertionX) || !double.IsFinite(insertionY))
    return new { success = false, error = "insertionX and insertionY are required." };
if (double.IsInfinity(startStation) || double.IsInfinity(endStation))
    return new { success = false, error = "startStation and endStation must be finite or NaN." };
if (double.IsNaN(leftWidth) != double.IsNaN(rightWidth)
    || (!double.IsNaN(leftWidth) && (!double.IsFinite(leftWidth) || !double.IsFinite(rightWidth)
        || leftWidth <= 0 || rightWidth <= 0 || leftWidth > 1000 || rightWidth > 1000)))
    return new { success = false, error = "Give both leftWidth and rightWidth (greater than 0, at most 1000) or neither." };
if (!isOptionalName(sectionViewStyleName) || !isOptionalName(bandSetStyleName) || !isOptionalName(groupPlotStyleName)
    || !isOptionalName(layoutName) || templatePath == null || templatePath.Length > 1024 || templatePath.Any(char.IsControl))
    return new { success = false, error = "Style, layout and template names must be empty or trimmed names." };
if ((templatePath == "") != (layoutName == ""))
    return new { success = false, error = "Give templatePath and layoutName together for production placement, or neither for draft placement." };
if (viewNamePrefix == null || viewNamePrefix.Length > 100 || viewNamePrefix.Any(char.IsControl)
    || nameDecimals < 0 || nameDecimals > 4 || nameIntegerDigits < 0 || nameIntegerDigits > 6)
    return new { success = false, error = "viewNamePrefix must be at most 100 characters, nameDecimals 0..4 and nameIntegerDigits 0..6." };
if (bandSources == null || bandSources.Length > 20
    || bandSources.Any(b => b.bandIndex < 0 || b.bandIndex > 19
        || b.section1SourceHandle == null || b.section2SourceHandle == null
        || (b.section1SourceHandle != "" && !isHandle(b.section1SourceHandle))
        || (b.section2SourceHandle != "" && !isHandle(b.section2SourceHandle)))
    || bandSources.Select(b => b.bandIndex).Distinct().Count() != bandSources.Length)
    return new { success = false, error = "bandSources needs distinct band indexes 0..19 with empty or hexadecimal source handles." };

ObjectId? ResolveId(string handle)
{
    try { return Database.GetObjectId(false, new Handle(System.Convert.ToInt64(handle, 16)), 0); }
    catch { return null; }
}

var groupId = ResolveId(sampleLineGroupHandle);
var group = groupId.HasValue ? Transaction.GetObject(groupId.Value, OpenMode.ForRead) as SampleLineGroup : null;
if (group == null || group.IsErased || group.IsReferenceObject)
    return new { success = false, error = "sampleLineGroupHandle must identify an existing local sample line group." };

var lines = new List<SampleLine>();
foreach (ObjectId id in group.GetSampleLineIds())
    if (Transaction.GetObject(id, OpenMode.ForRead) is SampleLine line && !line.IsErased) lines.Add(line);
if (lines.Count == 0)
    return new { success = false, error = "The sample line group has no sample lines." };
var firstStation = double.IsNaN(startStation) ? lines.Min(l => l.Station) : startStation;
var lastStation = double.IsNaN(endStation) ? lines.Max(l => l.Station) : endStation;
var selected = lines.Where(l => l.Station >= firstStation - 1e-6 && l.Station <= lastStation + 1e-6)
    .OrderBy(l => l.Station).ToList();
if (lastStation < firstStation || selected.Count == 0 || selected.Count > 1000)
    return new { success = false, error = "The station range must select 1 to 1000 sample lines.", selected = selected.Count };

ObjectId LookupStyle(Func<ObjectId> lookup)
{
    try { return lookup(); }
    catch { return ObjectId.Null; }
}
var viewStyleId = sectionViewStyleName == "" ? ObjectId.Null : LookupStyle(() => CivilDoc.Styles.SectionViewStyles[sectionViewStyleName]);
var bandSetId = bandSetStyleName == "" ? ObjectId.Null : LookupStyle(() => CivilDoc.Styles.SectionViewBandSetStyles[bandSetStyleName]);
var plotStyleId = groupPlotStyleName == "" ? ObjectId.Null : LookupStyle(() => CivilDoc.Styles.GroupPlotStyles[groupPlotStyleName]);
if ((sectionViewStyleName != "" && viewStyleId.IsNull) || (bandSetStyleName != "" && bandSetId.IsNull)
    || (groupPlotStyleName != "" && plotStyleId.IsNull))
    return new { success = false, error = "A named section view, band set or group plot style does not exist.", sectionViewStyleName, bandSetStyleName, groupPlotStyleName };

// GetSectionSources needs the group open for write; on a read-open group
// Civil 3D 2025 ends with a fatal eNotOpenForWrite. Nothing is changed yet.
group.UpgradeOpen();
// Band sources must be sampled sources of this group.
var sampledSourceIds = new HashSet<ObjectId>();
foreach (SectionSource source in group.GetSectionSources())
    if (source.IsSampled) sampledSourceIds.Add(source.SourceId);
// Null means unchanged; an unknown or unsampled source is rejected.
(bool ok, ObjectId id) BandSource(string handle)
{
    if (handle == "") return (true, ObjectId.Null);
    var id = ResolveId(handle);
    return id.HasValue && sampledSourceIds.Contains(id.Value) ? (true, id.Value) : (false, ObjectId.Null);
}
var bandPlan = new List<(int bandIndex, ObjectId source1, ObjectId source2, bool showLabels)>();
foreach (var band in bandSources)
{
    var source1 = BandSource(band.section1SourceHandle);
    var source2 = BandSource(band.section2SourceHandle);
    if (!source1.ok || !source2.ok)
        return new { success = false, error = "Every band source handle must be a sampled section source of this sample line group.", band.bandIndex };
    bandPlan.Add((band.bandIndex, source1.id, source2.id, band.showLabels));
}

var placement = new SectionViewGroupCreationPlacementOptions();
if (templatePath != "")
{
    string[] layouts;
    try { layouts = placement.GetAvailableLayoutNames(templatePath); }
    catch (System.Exception ex) { return new { success = false, error = "The template could not be read.", templatePath, detail = ex.Message }; }
    if (layouts == null || !layouts.Contains(layoutName))
        return new { success = false, error = "The layout does not exist in the template.", layoutName, available = layouts };
    placement.UseProductionPlacement(templatePath, layoutName);
}
else
{
    placement.UseDraftPlacement();
}

string FormatStation(double station)
{
    var text = Math.Abs(station).ToString("F" + nameDecimals, System.Globalization.CultureInfo.InvariantCulture);
    var dot = text.IndexOf('.');
    var integerPart = dot < 0 ? text : text.Substring(0, dot);
    text = integerPart.PadLeft(nameIntegerDigits, '0') + (dot < 0 ? "" : text.Substring(dot));
    return (station < 0 ? "-" : "") + text;
}
var plannedNames = new Dictionary<ObjectId, string>();
if (viewNamePrefix != "")
{
    var otherNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
    foreach (var line in lines)
        foreach (ObjectId viewId in line.GetSectionViewIds())
            if (Transaction.GetObject(viewId, OpenMode.ForRead) is SectionView view) otherNames.Add(view.Name);
    foreach (var line in selected) plannedNames[line.ObjectId] = viewNamePrefix + FormatStation(line.Station);
    var clashes = plannedNames.Values.GroupBy(n => n, StringComparer.OrdinalIgnoreCase)
        .Where(g => g.Count() > 1 || otherNames.Contains(g.Key)).Select(g => g.Key).ToList();
    if (clashes.Count > 0)
        return new { success = false, error = "View names would collide; raise nameDecimals or change the prefix.", names = clashes };
}

// One native group: group-level editing and sheet placement need it.
// Any failure below throws, so nothing is kept.
SectionViewGroup viewGroup;
using (var range = new SectionViewGroupCreationRangeOptions(group.ObjectId))
{
    if (!double.IsNaN(leftWidth))
    {
        range.SetOffsetRange(-leftWidth, rightWidth);
        range.UseUserSpecifiedOffset = true;
    }
    viewGroup = group.SectionViewGroups.Add(new Point3d(insertionX, insertionY, 0), firstStation, lastStation, range, placement);
}
if (viewGroup == null || viewGroup.IsIndividual)
    throw new InvalidOperationException("Civil 3D did not create a native section view group.");
if (!plotStyleId.IsNull)
{
    viewGroup.PlotStyleId = plotStyleId;
    viewGroup.UpdateLayout();
}

var lineById = selected.ToDictionary(l => l.ObjectId);
var views = new List<(SectionView view, SampleLine line)>();
foreach (ObjectId viewId in viewGroup.GetSectionViewIds())
{
    var view = (SectionView)Transaction.GetObject(viewId, OpenMode.ForWrite);
    if (!lineById.TryGetValue(view.SampleLineId, out var line))
        throw new InvalidOperationException($"View '{view.Name}' belongs to a sample line outside the selected range.");
    views.Add((view, line));
}
if (views.Count != selected.Count || views.Select(v => v.line.ObjectId).Distinct().Count() != selected.Count)
    throw new InvalidOperationException($"Expected one view per selected sample line ({selected.Count}), got {views.Count}.");

foreach (var (view, line) in views)
{
    if (!viewStyleId.IsNull) view.StyleId = viewStyleId;
    if (!bandSetId.IsNull) view.Bands.ImportBandSetStyle(bandSetId);
    if (bandPlan.Count > 0)
    {
        var items = view.Bands.GetBottomBandItems();
        var itemList = items.Cast<SectionViewBandItem>().ToList();
        foreach (var band in bandPlan)
        {
            if (band.bandIndex >= itemList.Count)
                throw new InvalidOperationException($"View '{view.Name}' has {itemList.Count} bottom bands; band {band.bandIndex} does not exist.");
            var item = itemList[band.bandIndex];
            if (!band.source1.IsNull) item.Section1Id = line.GetSectionId(band.source1);
            if (!band.source2.IsNull) item.Section2Id = line.GetSectionId(band.source2);
            item.ShowLabels = band.showLabels;
        }
        view.Bands.SetBottomBandItems(items);
    }
}

// Rename through unique temporary names so swaps cannot collide.
if (plannedNames.Count > 0)
{
    foreach (var (view, line) in views) view.Name = "__tmp_" + view.Handle.ToString();
    foreach (var (view, line) in views) view.Name = plannedNames[line.ObjectId];
}

string SourceName(ObjectId sectionId) =>
    sectionId.IsNull ? null : (Transaction.GetObject(sectionId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Section)?.SourceName;
var ordered = views.OrderBy(v => v.line.Station).ToList();
var firstBands = new List<object>();
var bandIndex = 0;
foreach (SectionViewBandItem item in ordered[0].view.Bands.GetBottomBandItems())
{
    firstBands.Add(new {
        index = bandIndex++,
        type = item.BandType.ToString(),
        section1 = SourceName(item.Section1Id),
        section2 = SourceName(item.Section2Id),
        item.ShowLabels
    });
}
var steps = ordered.Zip(ordered.Skip(1), (a, b) => b.view.Location.X - a.view.Location.X).ToList();

return new {
    success = true,
    sampleLineGroup = new { name = group.Name, handle = group.Handle.ToString() },
    viewGroup = new {
        name = viewGroup.Name,
        isIndividual = viewGroup.IsIndividual,
        templatePath = viewGroup.TemplateFilePath,
        layoutName = viewGroup.LayoutName,
        viewCount = views.Count
    },
    stationRange = new { first = firstStation, last = lastStation },
    leftToRightByStation = steps.All(step => step > 0),
    views = ordered.Select(v => new {
        name = v.view.Name,
        handle = v.view.Handle.ToString(),
        sampleLine = v.line.Name,
        station = v.line.Station,
        x = v.view.Location.X,
        y = v.view.Location.Y,
        offsetLeft = v.view.OffsetLeft,
        offsetRight = v.view.OffsetRight,
        elevationMin = v.view.ElevationMin,
        elevationMax = v.view.ElevationMax,
        style = v.view.StyleName
    }).ToList(),
    firstViewBottomBands = firstBands
};

Read the full file on GitHub · 340 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago First seen · 340 lines · 41 tokens per session scan A f6d7abdeb43b

Subscribe to this mod's changes

create_section_view_group is a skill published in the GitHub repository nezolder/civil3d-mcp-roslyn (3 stars, last pushed 16d ago), licensed MIT. It adds 41 tokens to every session and 4,375 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-12.

Related

Other skills, from other repositories

shopify-theme-development

Build and customize Shopify themes using Liquid templating, JSON sections, dynamic blocks, and theme app extensions for added functionality.

finsilabs/awesome-ecommerce-skills · 28 tokens

web-section-splitter

Breaks a long-form article into web-optimized sections with subheadings, pull-quote suggestions, image placement markers, and reading-time estimates — ready for a web editor to drop into a CMS.

ur-grue/autopunk-media-skills · 47 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens