fix: bind script PXP-OA planning to command document

This commit is contained in:
codex
2026-08-04 14:19:20 +03:00
parent 8a9f95a605
commit 3cecee4777
2 changed files with 6 additions and 1 deletions
@@ -73,7 +73,11 @@ public sealed class EntryPoint : IExtensionApplication
document = AcadApplication.DocumentManager.MdiActiveDocument;
var mode = ParseMode(RuntimeDiagnostics.RuntimeMode);
var context = new PlantRuntimeContextReader().ReadCurrentContext();
// Script-driven commands can run while Plant's implicit current
// document lags behind MDI activation. Bind the planner to the
// command document captured above, which is also the observer's
// fixture identity.
var context = new PlantRuntimeContextReader().ReadCurrentContext(document);
var details = new Dictionary<string, object?>
{
["ExecutionMode"] = mode.ToString(),