← Inbox

C3D-0507 · Find R/W line + road label near site 812 Christmas (read-only) [C3D-0508] done

Search for R/W / 100 / AVE text and polylines near the building to locate Christmas Ave R/W.

Script file
C3D-0507.cs
Target
812 Christmas Ave.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload


var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForRead);
// any text mentioning R/W or 100 near building (x 2434000-2434500)
foreach(ObjectId eid in ms){ var e=Tx.GetObject(eid,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; string s=null; Point3d pos=Point3d.Origin; if(e is DBText t){s=t.TextString;pos=t.Position;} else if(e is MText m){s=m.Contents;pos=m.Location;} if(s==null) continue; string u=s.ToUpper(); if((u.Contains("R/W")||u.Contains("100")||u.Contains("AVE")||u.Contains("ROAD")||u.Contains("CHRISTMAS"))){ Log(e.GetType().Name+" h="+e.Handle+" @ "+pos.X.ToString("F0")+","+pos.Y.ToString("F0")+" layer="+e.Layer+" '"+(s.Length>50?s.Substring(0,50):s)+"'"); } }
// boundary/RW polylines near the site
Log("=== polylines near site (x 2434000-2434600) ===");
foreach(ObjectId eid in ms){ var pl=Tx.GetObject(eid,OpenMode.ForRead) as Polyline; if(pl==null||pl.NumberOfVertices<2) continue; var p0=pl.GetPoint2dAt(0); if(p0.X>2433800&&p0.X<2434700&&p0.Y>1429000&&p0.Y<1429800){ var sb=new System.Text.StringBuilder(pl.Layer+" h="+pl.Handle+" v="+pl.NumberOfVertices+" | "); for(int i=0;i<System.Math.Min(pl.NumberOfVertices,6);i++){var p=pl.GetPoint2dAt(i); sb.Append(p.X.ToString("F1")+","+p.Y.ToString("F1")+" ");} Log(sb.ToString()); } }

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260903 - 812 Christmas Ave, Bethlehem, GA 30620, USA\812 Christmas Ave.dwg
Message
Executed C3D-0507 (0 entities touched).
Entities
—
Duration
649 ms
Civil 3D
25.0.0.0

Log

DBText h=22437 @ 2431863,1427683 layer=TEXT-MON 'IPS ON R/W'
DBText h=2243D @ 2431914,1428036 layer=TEXT-MON 'POB - IPF 1/2" REBAR241.64 ALONG R/W TO 40' R/W JO'
DBText h=22440 @ 2431909,1428069 layer=TEXT-MON '812 CHRISTMAS AVE - PB 59/147 - 2.452 AC - BEARING'
=== polylines near site (x 2434000-2434600) ===
BOUNDARY h=224D0 v=6 | 2433999.0,1429659.2 2434103.6,1429583.3 2434262.3,1429467.2 2434330.3,1429469.3 2434302.2,1429196.0 2433936.8,1429309.0 
SS-X-FENCE h=22670 v=12 | 2434272.1,1429210.5 2434158.9,1429240.0 2434081.2,1429262.5 2433993.8,1429287.3 2433972.1,1429293.4 2433978.7,1429320.2 
SS-V-ROAD-CURB h=227BD v=6 | 2433919.6,1429356.3 2433936.8,1429334.3 2433946.5,1429332.1 2433943.8,1429317.5 2433931.8,1429319.4 2433907.2,1429309.2 
V-BLDG h=22806 v=6 | 2434174.3,1429371.5 2434227.7,1429362.2 2434234.8,1429402.0 2434193.9,1429409.5 2434191.0,1429393.2 2434179.4,1429395.2 
SS-V-BLDG-OTLN h=22848 v=10 | 2434170.7,1429411.7 2434167.3,1429395.9 2434164.2,1429396.5 2434163.5,1429392.3 2434166.4,1429391.7 2434162.8,1429375.1 
SS-V-BLDG-OTLN h=22849 v=4 | 2434187.1,1429411.3 2434186.5,1429407.8 2434191.5,1429407.0 2434192.2,1429410.4 
SS-V-BLDG-OTLN h=2284A v=4 | 2434164.2,1429396.5 2434163.5,1429392.3 2434167.8,1429391.5 2434168.7,1429395.6 
SS-V-BLDG-OTLN h=2284B v=4 | 2434227.7,1429362.2 2434239.3,1429359.9 2434246.5,1429400.3 2434234.8,1429402.0 

Notes

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

No notes yet.