Message 1 of 21
Create Labels for Crossing Pipes in Profile View using C#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to create a tool to generate crossing pipe labels for the profile view. But I didn't know if there's a possibility to identify the crossing pipe in the profile view.
void CreateProfileViewLabel(Transaction tr, ObjectId profViewId, ObjectId PartId)
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = doc.Database;
var civdoc = CivilApplication.ActiveDocument;
acc3db.ProfileView pview = (acc3db.ProfileView)tr.GetObject(profViewId, OpenMode.ForRead);
var labelStyleID = civdoc.Styles.LabelSetStyles.ProfileLabelSetStyles["Standard"];
var PipeStyleID = civdoc.Styles.PipeStyles["Crossing"];
//acc3db.PipeProfileLabel.Create(PartId, profViewId, .5, labelStyleID);
var o = tr.GetObject(PartId, OpenMode.ForWrite);
var pv = tr.GetObject(profViewId, OpenMode.ForWrite);
if (o is acc3db.ProfileViewPart && pv is acc3db.ProfileView)
{
acc3db.ProfileViewPart mPart = o as acc3db.ProfileViewPart;
acc3db.ProfileView mPV = pv as acc3db.ProfileView;
foreach (var mPipe in mPV.PipeOverrides)
{
mPipe.OverrideStyleId = PipeStyleID;
System.Diagnostics.Debug.Print("Draw: " + mPipe.Draw.ToString());
}
acc3db.StructureProfileLabel.Create(profViewId, PartId);
}
}
Is it possible to identify the Crossing Pipes in the PipeOverrides from ProfileView?
Then once it is detected, it will create label with the Pipe Diameter.
Thank you in advance.