C3D-0455 · Draw sidewalk + TBC 260904 done
Draw sidewalk (SW 114-126, open, by number) on V-WALK and top-of-curb (TBC 158-161, open) on V-TBC.
C# payload
var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForWrite);
System.Action<string,short> ensure=(nm,ci)=>{ if(!lt.Has(nm)){ var l=new LayerTableRecord{Name=nm,Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,ci)}; lt.Add(l); Tx.AddNewlyCreatedDBObject(l,true);} };
ensure("V-WALK",3); ensure("V-TBC",6);
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForWrite);
System.Action<System.Collections.Generic.List<Point2d>,string> draw=(vs,ly)=>{ var pl=new Polyline(); for(int i=0;i<vs.Count;i++) pl.AddVertexAt(i,vs[i],0,0,0); pl.Layer=ly; ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl,true); Log(ly+" verts="+pl.NumberOfVertices+" len="+pl.Length.ToString("F1")+" handle="+pl.Handle); };
var SW=new System.Collections.Generic.List<Point2d>(); SW.Add(new Point2d(2152767.638000,1430432.205000));
SW.Add(new Point2d(2152767.313000,1430430.624000));
SW.Add(new Point2d(2152761.833000,1430431.197000));
SW.Add(new Point2d(2152762.652000,1430429.633000));
SW.Add(new Point2d(2152768.886000,1430385.319000));
SW.Add(new Point2d(2152768.614000,1430383.895000));
SW.Add(new Point2d(2152767.905000,1430383.186000));
SW.Add(new Point2d(2152774.018000,1430384.485000));
SW.Add(new Point2d(2152774.399000,1430380.974000));
SW.Add(new Point2d(2152773.869000,1430379.486000));
SW.Add(new Point2d(2152771.601000,1430378.564000));
SW.Add(new Point2d(2152763.612000,1430382.313000));
SW.Add(new Point2d(2152764.352000,1430377.380000)); draw(SW,"V-WALK");
var TB=new System.Collections.Generic.List<Point2d>(); TB.Add(new Point2d(2152860.489000,1430339.114000));
TB.Add(new Point2d(2152843.004000,1430456.843000));
TB.Add(new Point2d(2152841.310000,1430470.174000));
TB.Add(new Point2d(2152846.343000,1430516.290000)); draw(TB,"V-TBC");
Ed.Regen();
Result
Log
V-WALK verts=13 len=83.7 handle=21070 V-TBC verts=4 len=178.8 handle=21071
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.