← Inbox

C3D-0453 · Draw building outline (closed) 260904 done

Draw the 8-corner PORCH COR building outline as a closed polyline on new layer V-BLDG (angular order 145-144-143-127-128-129-130-131).

Script file
C3D-0453.cs
Target
260904 - 920 W Sandtown Rd SW.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload


var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForWrite);
if(!lt.Has("V-BLDG")){ var nlr=new LayerTableRecord{Name="V-BLDG",Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,5)}; lt.Add(nlr); Tx.AddNewlyCreatedDBObject(nlr,true);}
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForWrite);
var pl=new Polyline();
var vs=new System.Collections.Generic.List<Point2d>();
vs.Add(new Point2d(2152705.528000,1430371.911000));
vs.Add(new Point2d(2152708.352000,1430354.692000));
vs.Add(new Point2d(2152718.584000,1430354.237000));
vs.Add(new Point2d(2152764.393000,1430374.679000));
vs.Add(new Point2d(2152762.821000,1430384.968000));
vs.Add(new Point2d(2152761.053000,1430384.894000));
vs.Add(new Point2d(2152758.033000,1430403.870000));
vs.Add(new Point2d(2152739.416000,1430400.467000));
for(int i=0;i<vs.Count;i++) pl.AddVertexAt(i,vs[i],0,0,0);
pl.Closed=true; pl.Layer="V-BLDG";
ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl,true);
Log("BLDG closed poly verts="+pl.NumberOfVertices+" area="+pl.Area.ToString("F0")+" handle="+pl.Handle);
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260904 - 920 W Sandtown Rd SW, Marietta, GA 30064, USA\260904 - 920 W Sandtown Rd SW.dwg
Message
Executed C3D-0453 (0 entities touched).
Entities
Duration
803 ms
Civil 3D
25.0.0.0

Log

BLDG closed poly verts=8 area=1695 handle=2106A

Notes

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

No notes yet.