C3DO-0785 · 261101 ALTA redline: read sheet notes, labels, boundary, monuments (read-only) [C3D-ALTAREAD] error
Read-only: full text + positions of every note on 11X17, title block attributes, model labels/dims/boundary polylines, monument and line-feature points - to plan the ALTA redline orders.
C# payload
string F(double v)=>v.ToString("0.###");
var ld=(DBDictionary)Tx.GetObject(Db.LayoutDictionaryId,OpenMode.ForRead);
foreach(DBDictionaryEntry de in ld){ var lay=(Layout)Tx.GetObject(de.Value,OpenMode.ForRead); if(lay.ModelType) continue;
var ps=(BlockTableRecord)Tx.GetObject(lay.BlockTableRecordId,OpenMode.ForRead);
foreach(ObjectId id in ps){ var o=Tx.GetObject(id,OpenMode.ForRead) as Entity; if(o==null) continue;
if(o is MText m){ Log("MT "+id.Handle+" L="+m.Layer+" at "+F(m.Location.X)+","+F(m.Location.Y)+" h "+F(m.TextHeight)+" w "+F(m.Width)+" att "+m.Attachment+" style "+((TextStyleTableRecord)Tx.GetObject(m.TextStyleId,OpenMode.ForRead)).Name+" ext "+F(m.ActualWidth)+"x"+F(m.ActualHeight)+" rot "+F(m.Rotation)); Log(" RAW "+m.Contents.Replace("\n","\n")); }
else if(o is DBText t){ if(t.TextString.Length<=3 && t.Layer!="C-ANNO") continue; Log("T "+id.Handle+" L="+t.Layer+" at "+F(t.Position.X)+","+F(t.Position.Y)+" h "+F(t.Height)+" style "+((TextStyleTableRecord)Tx.GetObject(t.TextStyleId,OpenMode.ForRead)).Name+" | "+t.TextString); }
else if(o is BlockReference br){ Log("B "+id.Handle+" "+br.Name+" L="+br.Layer+" at "+F(br.Position.X)+","+F(br.Position.Y)+" sc "+F(br.ScaleFactors.X));
foreach(ObjectId aid in br.AttributeCollection){ var ar=(AttributeReference)Tx.GetObject(aid,OpenMode.ForRead); Log(" A "+ar.Tag+" at "+F(ar.Position.X)+","+F(ar.Position.Y)+" h "+F(ar.Height)+" inv "+ar.Invisible+" = "+ar.TextString); } }
else if(o is Viewport vp){ Log("VP "+id.Handle+" c "+F(vp.CenterPoint.X)+","+F(vp.CenterPoint.Y)+" "+F(vp.Width)+"x"+F(vp.Height)+" view "+F(vp.ViewCenter.X)+","+F(vp.ViewCenter.Y)+" tgt "+F(vp.ViewTarget.X)+","+F(vp.ViewTarget.Y)+" sc "+F(vp.CustomScale)); }
else { var e=o.GeometricExtents; Log("E "+o.GetType().Name+" "+id.Handle+" L="+o.Layer+" "+F(e.MinPoint.X)+","+F(e.MinPoint.Y)+" - "+F(e.MaxPoint.X)+","+F(e.MaxPoint.Y)); } }
Log("LAYOUT "+lay.LayoutName+" limits "+F(lay.Limits.MinPoint.X)+","+F(lay.Limits.MinPoint.Y)+" - "+F(lay.Limits.MaxPoint.X)+","+F(lay.Limits.MaxPoint.Y)); }
// model: text/mtext/labels near boundary on C-ANNO / C-PROP-LINE-TEXT etc
var bt=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
var msr=(BlockTableRecord)Tx.GetObject(bt[BlockTableRecord.ModelSpace],OpenMode.ForRead);
foreach(ObjectId id in msr){ var o=Tx.GetObject(id,OpenMode.ForRead) as Entity; if(o==null) continue;
var lr=(LayerTableRecord)Tx.GetObject(o.LayerId,OpenMode.ForRead); if(lr.IsFrozen) continue;
if(o is MText m) Log("MMT "+id.Handle+" L="+m.Layer+" at "+F(m.Location.X)+","+F(m.Location.Y)+" h "+F(m.TextHeight)+" rot "+F(m.Rotation*180/Math.PI)+" | "+m.Contents.Replace("\n","\n"));
else if(o is DBText t) Log("MT "+id.Handle+" L="+t.Layer+" at "+F(t.Position.X)+","+F(t.Position.Y)+" h "+F(t.Height)+" rot "+F(t.Rotation*180/Math.PI)+" | "+t.TextString);
else if(o.GetType().Name=="NoteLabel"||o.GetType().Name=="GeneralSegmentLabel"||o.GetType().Name=="ParcelSegmentLabel"){ var e=o.GeometricExtents; Log("LBL "+o.GetType().Name+" "+id.Handle+" L="+o.Layer+" "+F(e.MinPoint.X)+","+F(e.MinPoint.Y)+" - "+F(e.MaxPoint.X)+","+F(e.MaxPoint.Y));
try{ var lb=(Autodesk.Civil.DatabaseServices.Label)o; var st=(Autodesk.Civil.DatabaseServices.Styles.LabelStyle)Tx.GetObject(lb.StyleId,OpenMode.ForRead); foreach(ObjectId cid in st.GetComponents(Autodesk.Civil.DatabaseServices.Styles.LabelStyleComponentType.Text)){ var c=(Autodesk.Civil.DatabaseServices.Styles.LabelStyleTextComponent)Tx.GetObject(cid,OpenMode.ForRead); string ov=""; try{ov=lb.GetTextComponentOverride(cid);}catch{} Log(" "+c.Name+" = "+c.Text.Contents.Value+(ov!=""?" OVR "+ov:"")); } }catch(System.Exception ex){ Log(" lbl ERR "+ex.Message); } }
else if(o is Polyline pl && (o.Layer.StartsWith("SS-BOUNDARY")||o.Layer=="C-PROP-LINE"||o.Layer=="SS-OUTSITEPROP"||o.Layer=="SS-BUFFER SETBACK"||o.Layer=="X-ESMT-STRM")){ var s=""; for(int i=0;i<pl.NumberOfVertices;i++){ var p=pl.GetPoint2dAt(i); s+=" "+F(p.X)+","+F(p.Y);} Log("PL "+id.Handle+" L="+o.Layer+" closed "+pl.Closed+" |"+s); }
else if(o is BlockReference br2){ Log("MB "+id.Handle+" "+br2.Name+" L="+br2.Layer+" at "+F(br2.Position.X)+","+F(br2.Position.Y)); }
else if(o is AlignedDimension ad){ Log("DIM "+id.Handle+" L="+ad.Layer+" "+F(ad.XLine1Point.X)+","+F(ad.XLine1Point.Y)+" -> "+F(ad.XLine2Point.X)+","+F(ad.XLine2Point.Y)+" meas "+F(ad.Measurement)+" txt '"+ad.DimensionText+"'"); }
}
foreach(ObjectId pid in CivilDoc.CogoPoints){ var cp=(Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(pid,OpenMode.ForRead); string d=(cp.RawDescription??"").ToUpper(); if(cp.PointNumber>=400||d.Contains("IP")||d.Contains("CTP")||d.Contains("OTP")||d.Contains("SIGN")||d.Contains("SBUC")||d.Contains("FENCE")||d.Contains("WALL")||d.Contains("POB")||d.Contains("RB")||d.Contains("STEP")||d.Contains("FC")) Log("P "+cp.PointNumber+" "+F(cp.Easting)+","+F(cp.Northing)+" z "+F(cp.Elevation)+" "+cp.RawDescription); }
Result
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.