← Inbox

C3D-0428 · V-WALL: 8 vetted straight polylines (rendered & checked before posting) [C3D-WALL3] done

Replaces the bad V-WALL chain with 8 separate STRAIGHT polylines - the wall-family points gap-split and self-crossing-resolved, verified in a rendered plot before posting (no arcs per user). The dense STEP blob 836-867 is dropped. Erases prior V-WALL polylines first, draws exact vetted vertices.

Script file
C3D-0428.cs
Target
281 MARANTHA 2607.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
150s

C# payload

// V-WALL redo from the vetted plot: 8 separate STRAIGHT polylines (no arcs), blob dropped,
// self-crossings resolved. Coordinates are the exact vertices I verified in the render.
const string LAYER="V-WALL"; const short COLOR=8;
Log("drawing: " + Db.Filename);
var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForWrite);
ObjectId layId; if(lt.Has(LAYER)) layId=lt[LAYER]; else { var l=new LayerTableRecord(); l.Name=LAYER; l.Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,COLOR); layId=lt.Add(l); Tx.AddNewlyCreatedDBObject(l,true); }
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForWrite);
// erase prior V-WALL polylines
var del=new List<ObjectId>();
foreach (ObjectId id in ms){ var e=Tx.GetObject(id,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; if(e is Polyline && e.Layer.Equals(LAYER,System.StringComparison.OrdinalIgnoreCase)) del.Add(id); }
foreach(var id in del) ((Autodesk.AutoCAD.DatabaseServices.Entity)Tx.GetObject(id,OpenMode.ForWrite)).Erase();
Log("removed " + del.Count + " prior V-WALL polylines");
var runs=new Point2d[][]{
  new Point2d[]{new Point2d(2359702.3700,1425604.3100),new Point2d(2359723.0500,1425609.6100),new Point2d(2359723.0800,1425609.6200)},
  new Point2d[]{new Point2d(2359725.5300,1425639.9300),new Point2d(2359725.4300,1425640.0500)},
  new Point2d[]{new Point2d(2359729.3100,1425687.4100),new Point2d(2359708.8600,1425686.1400),new Point2d(2359707.9800,1425704.1400),new Point2d(2359704.5300,1425723.5700),new Point2d(2359706.7800,1425723.9300),new Point2d(2359707.3300,1425724.1000),new Point2d(2359706.7600,1425726.6700),new Point2d(2359704.2600,1425726.3700)},
  new Point2d[]{new Point2d(2359709.2900,1425726.3000),new Point2d(2359706.4200,1425737.6100),new Point2d(2359702.5600,1425744.3700),new Point2d(2359702.0600,1425749.0000),new Point2d(2359702.0700,1425749.0100),new Point2d(2359697.3600,1425745.8900),new Point2d(2359691.9000,1425745.2400),new Point2d(2359686.5700,1425742.7600),new Point2d(2359683.6100,1425739.5100),new Point2d(2359679.4300,1425759.4700),new Point2d(2359682.9400,1425761.6300),new Point2d(2359688.9400,1425762.3900),new Point2d(2359693.2700,1425766.3300),new Point2d(2359695.6300,1425761.1100),new Point2d(2359698.1700,1425757.1700)},
  new Point2d[]{new Point2d(2359688.9600,1425773.4500),new Point2d(2359685.0200,1425775.6200),new Point2d(2359677.7900,1425775.6300),new Point2d(2359673.0600,1425771.9800),new Point2d(2359670.9900,1425766.3200)},
  new Point2d[]{new Point2d(2359727.0700,1425729.9400),new Point2d(2359729.8100,1425729.8800),new Point2d(2359730.0900,1425727.0300),new Point2d(2359727.0300,1425726.9100)},
  new Point2d[]{new Point2d(2359509.7500,1425570.8100),new Point2d(2359505.8100,1425559.8400),new Point2d(2359502.7500,1425554.7400),new Point2d(2359505.6100,1425550.1400),new Point2d(2359513.7200,1425537.0500)},
  new Point2d[]{new Point2d(2359478.1200,1425601.7300),new Point2d(2359465.2800,1425600.2600),new Point2d(2359456.1100,1425605.5900),new Point2d(2359445.7300,1425615.0700),new Point2d(2359451.8700,1425635.1700)}
};
int drawn=0;
foreach(var run in runs){ var pl=new Polyline(); for(int i=0;i<run.Length;i++) pl.AddVertexAt(i,run[i],0,0,0); pl.LayerId=layId; ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl,true); var back=(Polyline)Tx.GetObject(pl.ObjectId,OpenMode.ForRead); Log(string.Format("  poly [{0}] {1} verts len {2:F1}", back.Handle, back.NumberOfVertices, back.Length)); drawn++; }
Log("drew " + drawn + " straight wall polylines");
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260711 - 281 Maranatha Trail, Lawrenceville, GA 30045, USA\281 MARANTHA 2607.dwg
Message
Executed C3D-0428 (0 entities touched).
Entities
Duration
939 ms
Civil 3D
25.0.0.0

Log

drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260711 - 281 Maranatha Trail, Lawrenceville, GA 30045, USA\281 MARANTHA 2607.dwg
removed 9 prior V-WALL polylines
  poly [11B72] 3 verts len 21.4
  poly [11B73] 2 verts len 0.2
  poly [11B74] 8 verts len 66.2
  poly [11B75] 15 verts len 92.4
  poly [11B76] 5 verts len 23.7
  poly [11B77] 4 verts len 8.7
  poly [11B78] 5 verts len 38.4
  poly [11B79] 5 verts len 58.6
drew 8 straight wall polylines

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.