C3DO-0858 · 261103: read the adjoiner side lines south of the subject (read-only) [C3D-SIDEREAD] done
Read-only: lines/polylines south of the subject (excluding point, road and fence layers).
C# payload
string F(double v)=>v.ToString("0.###");
ObjectId H(string h)=>Db.GetObjectId(false,new Handle(Convert.ToInt64(h,16)),0);
ObjectId Lyr(string name,short c){ var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForRead); if(lt.Has(name)) return lt[name]; lt.UpgradeOpen(); var r=new LayerTableRecord{Name=name,Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,c)}; var id=lt.Add(r); Tx.AddNewlyCreatedDBObject(r,true); Log("layer created "+name); return id; }
ObjectId Put(BlockTableRecord btr, Autodesk.AutoCAD.DatabaseServices.Entity e, string layer){ e.SetDatabaseDefaults(Db); e.Layer=layer; var id=btr.AppendEntity(e); Tx.AddNewlyCreatedDBObject(e,true); return id; }
var LM=LayoutManager.Current;
BlockTableRecord PS(string name){ var l=(Layout)Tx.GetObject(LM.GetLayoutId(name),OpenMode.ForRead); return (BlockTableRecord)Tx.GetObject(l.BlockTableRecordId,OpenMode.ForWrite); }
var BT=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
var MS=(BlockTableRecord)Tx.GetObject(BT[BlockTableRecord.ModelSpace],OpenMode.ForWrite);
bool HasText(BlockTableRecord btr,string contains){ foreach(ObjectId id in btr){ var o=Tx.GetObject(id,OpenMode.ForRead); if(o is MText m && m.Contents.Contains(contains)) return true; if(o is DBText t && t.TextString.Contains(contains)) return true; } return false; }
// read-only: every line / polyline south of the subject (the dashed adjoiner side lines)
foreach(ObjectId id in MS){ var e=Tx.GetObject(id,OpenMode.ForRead) as Curve; if(e==null) continue; Extents3d x; try{ x=e.GeometricExtents; }catch{ continue; }
if(x.MaxPoint.X<2271450||x.MinPoint.X>2272150||x.MaxPoint.Y<1283200||x.MinPoint.Y>1283500) continue;
if(e.Layer.StartsWith("0-")||e.Layer.StartsWith("SS-V-")||e.Layer=="SS-X-FENCE") continue;
string g=""; if(e is Line l) g=F(l.StartPoint.X)+","+F(l.StartPoint.Y)+" -> "+F(l.EndPoint.X)+","+F(l.EndPoint.Y); else if(e is Polyline p){ for(int i=0;i<p.NumberOfVertices;i++){ var q=p.GetPoint2dAt(i); g+=" "+F(q.X)+","+F(q.Y);} }
Log(e.GetType().Name+" "+e.Handle+" ["+e.Layer+"] lt "+e.Linetype+" "+g); }
Result
Log
Circle 1A9D7 [SS-FLOW WELL] lt ByLayer Polyline 22022 [SS-BOUNDARY] lt ByLayer 2271934.768,1283599.556 2271928.908,1283512.645 2271886.194,1283496.44 2271786.086,1283486.106 2271711.358,1283485.609 2271685.498,1283485.438 2271631.13,1283487.296 Line 2202B [SS-BOUNDARY MAG] lt ByLayer 2271566.7,1283491.038 -> 2271574.647,1283467.248 Site 22047 [SS-BOUNDARY MAG] lt ByLayer Line 22089 [V-PLAT-24-191-ARBORCOVE-U2] lt ByLayer 2271786.086,1283486.106 -> 2271886.194,1283496.44 Line 2208A [V-PLAT-24-191-ARBORCOVE-U2] lt ByLayer 2271711.358,1283485.609 -> 2271786.086,1283486.106 Line 2208B [V-PLAT-24-191-ARBORCOVE-U2] lt ByLayer 2271886.194,1283496.44 -> 2271928.821,1283512.635 Line 2208D [V-PLAT-24-191-ARBORCOVE-U2] lt ByLayer 2272041.487,1283353.074 -> 2272044.548,1283513.045 Polyline 220DA [SS-BOUNDARY MAG] lt ByLayer 2271389.427,1283414.591 2271463.346,1283437.097 2271466.517,1283437.889 2271576.003,1283469.367 2271642.355,1283488.988 2271734.46,1283517.29 2271943.925,1283577.843 Line 220F4 [V-PLAT-24-281-ARBORCOVE-U3] lt ByLayer 2271631.13,1283487.296 -> 2271685.498,1283485.438 Line 220F6 [V-PLAT-24-281-ARBORCOVE-U3] lt ByLayer 2271504.548,1283449.829 -> 2271631.13,1283487.296 Line 22101 [V-PLAT-24-281-ARBORCOVE-U3] lt ByLayer 2271685.498,1283485.438 -> 2271711.358,1283485.609 Line 22140 [SS-BOUNDARY MAG] lt ByLayer 2271961.587,1283336.874 -> 2271886.194,1283496.44 Line 22146 [SS-BOUNDARY MAG] lt ByLayer 2271701.065,1283267.072 -> 2271711.358,1283485.609 ParcelSegment 221EA [C-PROP-LINE] lt ByLayer Parcel 221EB [C-PROP] lt ByLayer ParcelSegmentLabel 221ED [C-PROP-LINE-TEXT] lt ByLayer ParcelSegmentLabel 221EE [C-PROP-LINE-TEXT] lt ByLayer ParcelSegmentLabel 221EF [C-PROP-LINE-TEXT] lt ByLayer ParcelSegmentLabel 221F0 [C-PROP-LINE-TEXT] lt ByLayer ParcelSegmentLabel 221F1 [C-PROP-LINE-TEXT] lt ByLayer
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.