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.
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
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.