C3D-IMPORT · Import 358 HOUSE.txt points (100-175) done
Create 76 COGO points from the PNEZD file with original numbers + descriptions; apply desc keys.
C# payload
// Import 358 HOUSE.txt (PNEZD) as COGO points with original numbers 100-175 + descriptions.
var cd = CivilDoc; var cps = cd.CogoPoints;
string dir = System.IO.Path.GetDirectoryName(Doc.Name);
string f = System.IO.Path.Combine(dir, "358 HOUSE.txt");
int made = 0, fail = 0;
foreach (var line in System.IO.File.ReadAllLines(f)) {
var p = line.Split(',');
if (p.Length < 5) continue;
if (!uint.TryParse(p[0].Trim(), out uint num)) continue; // skips base station
if (!double.TryParse(p[1], out double N) || !double.TryParse(p[2], out double E)) continue;
double.TryParse(p[3], out double Z);
string desc = p[4].Trim();
try {
var id = cps.Add(new Point3d(E, N, Z), desc, true);
var cp = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForWrite);
try { cp.PointNumber = num; } catch { }
cp.RawDescription = desc;
try { cp.ApplyDescriptionKeys(); } catch { }
made++;
} catch (System.Exception ex) { fail++; Log($" pt {num}: {ex.Message}"); }
}
Log($"imported {made} cogo points ({fail} failed) from 358 HOUSE.txt");
Result
Log
imported 76 cogo points (0 failed) from 358 HOUSE.txt
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.