也许更好的描述:
我必须删除Surface中的边界,而不是重新创建它们并设置与以前相同的名称。重新创建的边界的位置在SurfacoperationCollection的末尾。但它必须位于位置2(例如)
- public static SurfaceOperationCollection ReadSurfaceOperations(TinSurface tinsurf)
- {
- Document acadDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
- using (Transaction tr = acadDoc.TransactionManager.StartTransaction())
- {
- SurfaceOperationCollection SuOpColl = tinsurf.Operations;
- tr.Commit();
- return SuOpColl;
- }
- }
- public static void SortSurfaceOperations(SurfaceOperationCollection before, SurfaceOperationCollection after)
- {
- Document acadDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
- using (Transaction tr = acadDoc.TransactionManager.StartTransaction())
- {
- var m_Bef = from x in before.GetType().FullName
- //where x.GetType().FullName == "Autodesk.Civil.DatabaseServices.SurfaceOperationAddBoundary"
- select x;
- var m_Aft = from x in before.GetType().FullName
- //where x.GetType().FullName == "Autodesk.Civil.DatabaseServices.SurfaceOperationAddBoundary"
- select x;
- foreach(SurfaceOperation x in m_Bef)
- {
- foreach(SurfaceOperation y in m_Aft)
- {
- if(x != y)
- {
- y.MoveUp();
- }
- }
- }
- tr.Commit();
- }
- }
|