← Inbox

C3D-0230 · 260612 Springdale: Civil 3D objects/styles for a profile view (retry) error

READ-ONLY. Retry with ProfileViewStyle/ProfileStyle fully qualified to Autodesk.Civil.DatabaseServices.Styles.

Script file
C3D-0230.cs
Target
260612-Springdale Sanitary Sewer Extension As-Built 60.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// READ-ONLY: what Civil 3D infrastructure exists for a real ProfileView?
var cdoc = CivilApplication.ActiveDocument;
Log("alignments: " + cdoc.GetAlignmentIds().Count);
foreach (ObjectId id in cdoc.GetAlignmentIds()) {
    var a = (Alignment)Tx.GetObject(id, OpenMode.ForRead);
    Log(string.Format("  ALIGN {0} len={1:F2} sta {2:F2}-{3:F2}", a.Name, a.Length, a.StartingStation, a.EndingStation));
}
Log("surfaces: " + cdoc.GetSurfaceIds().Count);
foreach (ObjectId id in cdoc.GetSurfaceIds()) {
    var s = (Autodesk.Civil.DatabaseServices.Surface)Tx.GetObject(id, OpenMode.ForRead);
    Log("  SURFACE " + s.Name);
}
var ss = cdoc.Styles;
Log("ProfileViewStyles: " + ss.ProfileViewStyles.Count);
foreach (ObjectId id in ss.ProfileViewStyles) {
    var st = (Autodesk.Civil.DatabaseServices.Styles.ProfileViewStyle)Tx.GetObject(id, OpenMode.ForRead);
    Log("  PVSTYLE " + st.Name);
}
Log("ProfileStyles: " + ss.ProfileStyles.Count);
foreach (ObjectId id in ss.ProfileStyles) {
    var st = (Autodesk.Civil.DatabaseServices.Styles.ProfileStyle)Tx.GetObject(id, OpenMode.ForRead);
    Log("  PSTYLE " + st.Name);
}
Log("AlignmentStyles: " + ss.AlignmentStyles.Count);
try { Log("pipe networks: " + cdoc.GetPipeNetworkIds().Count); }
catch (System.Exception e) { Log("pipe networks: " + e.Message); }
try {
  var bands = ss.ProfileViewBandStyles;
  Log("band style groups present: " + (bands != null));
} catch (System.Exception e) { Log("bands: " + e.Message); }

Result

Status
error
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\260612-Springdale Sanitary Sewer Extension As-Built 60.dwg
Message
Compile error: (28,18): error CS1061: 'StylesRoot' does not contain a definition for 'ProfileViewBandStyles' and no accessible extension method 'ProfileViewBandStyles' accepting a first argument of type 'StylesRoot' could be found (are you missing a using directive or an assembly reference?)
Entities
Duration
300 ms
Civil 3D
25.0.0.0

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.