← Inbox

C3D-0224 · 260714 Huckaby: does any hatch pattern evaluate here done

Tries SOLID, ANSI31 and AR-CONC against 20CC8 with HatchLoopTypes.Default, erasing each test hatch after. Determines whether EvaluateHatch fails for every pattern (call context) or only AR-CONC.

Script file
C3D-0224.cs
Target
260714 - 285 Huckaby Rd.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// Does ANY pattern evaluate in this script context? The drawing already contains working
// SOLID and ANSI31 hatches, so if those fail too the problem is the call context, not AR-CONC.
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForWrite);
ObjectId bid;
Db.TryGetObjectId(new Handle(Convert.ToInt64("20CC8", 16)), out bid);

string[] pats = { "SOLID", "ANSI31", "AR-CONC" };
foreach (var pat in pats) {
    var h = new Hatch();
    h.Layer = "X-DRIV-CONC";
    ms.AppendEntity(h); Tx.AddNewlyCreatedDBObject(h, true);
    try {
        h.SetHatchPattern(HatchPatternType.PreDefined, pat);
        h.PatternScale = (pat == "ANSI31") ? 2.0 : 0.61;
        var ids = new ObjectIdCollection(); ids.Add(bid);
        h.AppendLoop(HatchLoopTypes.Default, ids);
        h.EvaluateHatch(true);
        Log(string.Format("{0}: OK  area {1:F0}  handle {2}", pat, h.Area, h.Handle));
        h.Erase();
        Log(string.Format("{0}: (test hatch erased)", pat));
    } catch (System.Exception e) {
        Log(string.Format("{0}: FAIL {1}", pat, e.Message));
        try { h.Erase(); } catch { }
    }
}
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd.dwg
Message
Executed C3D-0224 (0 entities touched).
Entities
Duration
481 ms
Civil 3D
25.0.0.0

Log

SOLID: FAIL eNotApplicable
ANSI31: FAIL eNotApplicable
AR-CONC: FAIL eNotApplicable

Notes

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

No notes yet.