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.
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
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.