← Inbox

C3D-0229 · 260612 Springdale: what Civil 3D objects/styles exist for a profile view error

READ-ONLY. Enumerates alignments, surfaces, ProfileView/Profile styles and pipe networks to decide whether a real Civil 3D ProfileView is possible or whether the profile must be drafted from geometry.

Script file
C3D-0229.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);
}
// styles available for a profile view
var ss = cdoc.Styles;
Log("ProfileViewStyles: " + ss.ProfileViewStyles.Count);
foreach (ObjectId id in ss.ProfileViewStyles) {
    var st = (ProfileViewStyle)Tx.GetObject(id, OpenMode.ForRead);
    Log("  PVSTYLE " + st.Name);
}
Log("ProfileStyles: " + ss.ProfileStyles.Count);
foreach (ObjectId id in ss.ProfileStyles) {
    var st = (ProfileStyle)Tx.GetObject(id, OpenMode.ForRead);
    Log("  PSTYLE " + st.Name);
}
Log("AlignmentStyles: " + ss.AlignmentStyles.Count);
Log("labelset ProfileView: " + ss.LabelSetStyles.ProfileViewLabelSetStyles.Count);
// pipe networks?
try { Log("pipe networks: " + cdoc.GetPipeNetworkIds().Count); }
catch (System.Exception e) { Log("pipe networks: " + 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: (17,15): error CS0246: The type or namespace name 'ProfileViewStyle' could not be found (are you missing a using directive or an assembly reference?); (22,15): error CS0246: The type or namespace name 'ProfileStyle' could not be found (are you missing a using directive or an assembly reference?); (26,50): error CS1061: 'LabelSetStylesRoot' does not contain a definition for 'ProfileViewLabelSetStyles' and no accessible extension method 'ProfileViewLabelSetStyles' accepting a first argument of type 'LabelSetStylesRoot' could be found (are you missing a using directive or an assembly reference?)
Entities
Duration
514 ms
Civil 3D
25.0.0.0

Notes

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

No notes yet.