Hello all!
How to add a new band data to existing profile with API? I have an array of points on alignment, and want to see them in a profile.
In this sample of Partha Sarkar a new data is added to band as an existing data. I need a new one.
Database db = AcadApp.DocumentManager.MdiActiveDocument.Database;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
CivilDocument civilDoc = CivilApplication.ActiveDocument;
//open the profile view
ProfileView pv = trans.GetObject(pvId, OpenMode.ForWrite) asProfileView;
//get the style of the first Bottom Bands
ObjectId bandStyleId = pv.Bands.GetBottomBandItems()[0].BandStyleId;
//now access the collection of top band
ProfileViewBandItemCollection topBandItems = pv.Bands.GetTopBandItems(); //add a new one (using the above style)
topBandItems.Add(bandStyleId);
//now Set the Top Bands
pv.Bands.SetTopBandItems(topBandItems);
trans.Commit();
}
Thank you in advance
I'm not sure if COGO Points can be added to a profile view band. Adding a band to a profile view is the code you provided.
If you want to draw AutoCAD objects at the point location, you'd find the Station/Offset in plan view and then convert that to XY on the profile view using FindXYAtStationAndElevation:
Can't find what you're looking for? Ask the community or share your knowledge.