Message 1 of 3
Create Alignment Label for High and Low Point using c#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Good day.
I'm trying to create a tool that will make High and Low Point labels in the selected alignment if detected using single profile.
I was able to create this manually using the Alignment Label.
Below the sample code attempting to create it automatically.
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = doc.Database;
var civdoc = CivilApplication.ActiveDocument;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
string mLabelStyleName = "High Point v1";
LabelStyle mLabelStyle = null;
foreach (var vf in civdoc.Styles.LabelStyles.AlignmentLabelStyles.VerticalGeometryPointLabelStyles)
{
var mStyle = tr.GetObject(vf, OpenMode.ForRead);
if(mStyle is LabelStyle)
{
mLabelStyle = (LabelStyle)mStyle;
if (mLabelStyle.Name == mLabelStyleName)
{
break;
}
else mLabelStyle = null;
}
}
acc3db.Alignment align = (acc3db.Alignment)tr.GetObject(civdoc.GetAlignmentIds()[0], OpenMode.ForRead);
var lblsetId = civdoc.Styles.LabelStyles.AlignmentLabelStyles.VerticalGeometryPointLabelStyles[mLabelStyleName];
// I stuck in this area and try to find it the internet but no samples provided. Autodesk.Civil.DatabaseServices.AlignmentVerticalGeometryPointLabelGroup.Create(mLabelStyle.ObjectId, align.ObjectId, )