Hi.
I would like remove(delete) all brealkine sets inluded in definition of surface.
try { Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; //lock the document using (DocumentLock docLock = doc.LockDocument()) { using (Transaction trans = db.TransactionManager.StartTransaction()) { Autodesk.Civil.DatabaseServices.Surface sup = trans.GetObject(Id, OpenMode.ForWrite) as Autodesk.Civil.DatabaseServices.Surface; //Operations in the SurfaceOperationCollection are in the order they are added to the Surface. SurfaceOperationCollection OperationColl = sup.Operations; for (int i = 0; i <= OperationColl.Count - 1; i++) { if (OperationColl[i].GetType().ToString() == "SurfaceOperationAddBreakline") { OperationColl.RemoveAt(i); i--; } } trans.Commit(); }//end using }//end lock } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); }
However, I don´t understand how I can get type of Surface Operation..
This code line doesn´t work.
if (OperationColl[i].GetType().ToString() == "SurfaceOperationAddBreakline")
Help please.
Thank you for advance.
Solved! Go to Solution.
Solved by Partha.Sarkar. Go to Solution.
Hi,
Try this -
// Get the TIN Surface
TinSurface tinSurface = surfaceId.GetObject(OpenMode.ForWrite) asTinSurface;
// Lets try to Remove Breakline using RemoveAt(int)
tinSurface.BreaklinesDefinition.RemoveAt(0);
Did you check this post -
Thanks,
Partha Sarkar
I use this:
Autodesk.Civil.DatabaseServices.TinSurface tinSurface = trans.GetObject(Id,OpenMode.ForWrite) as Autodesk.Civil.DatabaseServices.TinSurface;
It works.
Thank you for all.
I have another question:
Can I get ID or Name about Point Grups Definition? (tinSurface.PointGrupDefinition)