C3D-0454 · Draw driveway edges (centerline+offset) 260904 done
Draw two driveway edge polylines (12 ft wide, centerline-offset method) on new layer V-DWY.
C# payload
var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForWrite);
if(!lt.Has("V-DWY")){ var nlr=new LayerTableRecord{Name="V-DWY",Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,4)}; lt.Add(nlr); Tx.AddNewlyCreatedDBObject(nlr,true);}
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForWrite);
System.Action<System.Collections.Generic.List<Point2d>> draw = (vs)=>{
var pl=new Polyline(); for(int i=0;i<vs.Count;i++) pl.AddVertexAt(i,vs[i],0,0,0); pl.Layer="V-DWY";
ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl,true);
Log("DWY edge verts="+pl.NumberOfVertices+" len="+pl.Length.ToString("F1")+" handle="+pl.Handle);
};
var L=new System.Collections.Generic.List<Point2d>(); L.Add(new Point2d(2152678.287500,1430428.912600));
L.Add(new Point2d(2152696.154400,1430421.101800));
L.Add(new Point2d(2152733.803000,1430436.719500));
L.Add(new Point2d(2152736.642000,1430434.863100));
L.Add(new Point2d(2152759.397000,1430437.942100));
L.Add(new Point2d(2152766.629500,1430445.203600));
L.Add(new Point2d(2152801.844000,1430450.099100));
L.Add(new Point2d(2152813.129800,1430449.116800)); draw(L);
var R=new System.Collections.Generic.List<Point2d>(); R.Add(new Point2d(2152680.589500,1430417.078400));
R.Add(new Point2d(2152698.456300,1430409.267500));
R.Add(new Point2d(2152736.105000,1430424.885200));
R.Add(new Point2d(2152738.944000,1430423.028900));
R.Add(new Point2d(2152761.699000,1430426.107900));
R.Add(new Point2d(2152768.931500,1430433.369400));
R.Add(new Point2d(2152804.146000,1430438.264900));
R.Add(new Point2d(2152815.431700,1430437.282500)); draw(R);
Ed.Regen();
Result
Log
DWY edge verts=8 len=143.7 handle=2106C DWY edge verts=8 len=143.7 handle=2106D
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.