Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Good day.
I'm trying to find the list below but nowhere to be found. Can you point me to the right direction.
I used the code below to search the list of Profile Station and Elevation Label but failed.
// Get all the Profile View Styles
Autodesk.Civil.ApplicationServices.CivilDocument doc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument;
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
{
for (int i = 0; i < doc.Styles.ProfileViewStyles.Count; i++)
{
ObjectId oId = doc.Styles.ProfileViewStyles[i];
ProfileViewStyle mObjs = oId.GetObject(OpenMode.ForRead) as ProfileViewStyle;
System.Diagnostics.Debug.Print("\nProfile View Style Name: " + mObjs.Name + " - " + mObjs.ObjectId);
}
//for (int i = 0; i < doc.Styles.ProfileStyles.Count; i++)
//for (int i = 0; i < doc.Styles.ProjectionStyles.Count; i++)
//for (int i = 0; i < doc.Styles.LabelStyles.ProfileLabelStyles.MajorStationLabelStyles.Count; i++)
for (int i = 0; i < doc.Styles.PipeRuleSetStyles.Count; i++)
{
ObjectId PipeRuleSetStyleId = doc.Styles.PipeRuleSetStyles[i];
PipeRuleSetStyle mPipeRuleSetStyle = PipeRuleSetStyleId.GetObject(OpenMode.ForRead) as PipeRuleSetStyle;
ed.WriteMessage("\nPipe Rule Set Style Name: {0} - {1}", mPipeRuleSetStyle.Name, mPipeRuleSetStyle.ObjectId);
//ObjectId profileViewStyleId = doc.Styles.ProfileViewStyles[i];
//var o = profileViewStyleId.GetObject(OpenMode.ForRead);
//ProfileViewStyle oProfileViewStyle = ts.GetObject(profileViewStyleId, OpenMode.ForRead) as ProfileViewStyle;
//ed.WriteMessage("\nProfile View Style Name: {0} - {1}", oProfileViewStyle.Name, oProfileViewStyle.ObjectId);
//System.Diagnostics.Debug.Print("\nProfile View Style Name: " + oProfileViewStyle.Name + " - " + oProfileViewStyle.ObjectId);
//ed.WriteMessage("\nProfile View Style Name: {0} - {1}", oProfileViewStyle.Name, oProfileViewStyle.ObjectId);
}
ts.Commit();
}
Many Thanks in advance
Solved! Go to Solution.