← Inbox

C3DO-0740 · 261101: Turn 2 - boundary 43" about 243 [C3D-TURN2] done

Rotate the new boundary (parcel segment 214DE / parcel 2184B) clockwise about point 243 so the south line reads the deed bearing S83°22'17"W (about 43"). Angle is taken from the drawing.

Script file
C3DO-0740.cs
Target
261101 - 5491 Roswell Rd NE R2.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

Func<string,ObjectId> oid=hs=>{ ObjectId id; Db.TryGetObjectId(new Handle(Convert.ToInt64(hs,16)),out id); return id; };
Point3d? p243=null; foreach(ObjectId id in CivilDoc.CogoPoints){ var cp=(Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id,OpenMode.ForRead); if(cp.PointNumber==243) p243=new Point3d(cp.Easting,cp.Northing,0); }
if(p243==null){ Log("STOP - point 243 not found"); return; }
var par=Tx.GetObject(oid("2184B"),OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Parcel;
var seg=Tx.GetObject(oid("214DE"),OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if(par==null||seg==null){ Log("STOP - parcel 2184B / segment 214DE not found"); return; }
var bc=par.BaseCurve as Polyline; if(bc==null){ Log("STOP - parcel base curve is not a polyline"); return; }
int n=bc.NumberOfVertices, sw=-1; for(int i=0;i<n;i++) if(bc.GetPoint2dAt(i).GetDistanceTo(new Point2d(p243.Value.X,p243.Value.Y))<0.005) sw=i;
if(sw<0){ Log("STOP - no boundary corner on point 243"); return; }
var a=bc.GetPoint2dAt(sw); var se=bc.GetPoint2dAt((sw-1+n)%n);
double az=Math.Atan2(a.X-se.X,a.Y-se.Y)*180/Math.PI; if(az<0) az+=360;
double deed=180+83+22.0/60+17.0/3600; double dsec=(deed-az)*3600;
Log("south line SE "+se.X.ToString("F4")+","+se.Y.ToString("F4")+" -> 243 az "+az.ToString("F6")+" deed "+deed.ToString("F6")+" diff "+dsec.ToString("F2")+" sec");
if(Math.Abs(dsec)<0.5){ Log("already on the deed bearing - nothing to do"); return; }
for(int i=0;i<n;i++) Log("  before v"+i+" "+bc.GetPoint2dAt(i).X.ToString("F4")+","+bc.GetPoint2dAt(i).Y.ToString("F4"));
double th=-dsec/3600*Math.PI/180;
seg.UpgradeOpen(); seg.TransformBy(Matrix3d.Rotation(th,Vector3d.ZAxis,p243.Value));
Log("rotated segment 214DE "+(dsec).ToString("F2")+" sec clockwise about 243");
var cv=seg as Curve;
if(cv!=null){ for(int i=0;i<=(int)cv.EndParam;i++){ var q=cv.GetPointAtParameter(i); Log("  after seg param "+i+" "+q.X.ToString("F4")+","+q.Y.ToString("F4")); } }
else { var ex=seg.GeometricExtents; Log("  after extents "+ex.MinPoint+" "+ex.MaxPoint); }
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\261101 - Project\261101 - 5491 Roswell Rd NE R2.dwg
Message
Executed C3DO-0740 (0 entities touched).
Entities
—
Duration
481 ms
Civil 3D
25.0.0.0

Log

south line SE 2232597.3316,1420481.8158 -> 243 az 263.359474 deed 263.371389 diff 42.90 sec
  before v0 2232597.3316,1420481.8158
  before v1 2232335.8260,1420451.3711
  before v2 2232330.1031,1420625.3470
  before v3 2232597.3574,1420645.8558
rotated segment 214DE 42.90 sec clockwise about 243
  after seg param 0 2232335.8260,1420451.3711
  after seg param 1 2232330.1393,1420625.3482
  after seg param 2 2232597.3978,1420645.8014
  after seg param 3 2232597.3379,1420481.7614
  after seg param 4 2232335.8260,1420451.3711

Notes

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

No notes yet.