From 6f3237141807c7cac4a0eb5955400461d62d52e4 Mon Sep 17 00:00:00 2001 From: codex Date: Mon, 3 Aug 2026 09:08:47 +0300 Subject: [PATCH] docs: record source-model DataLinks runtime evidence --- Plant3D2026/P_Rec_Annot/AGENTS.md | 10 ++ .../docs/evidence/ortho-runtime-summary.json | 27 +++-- .../P_Rec_Annot/docs/ortho-runtime-results.md | 22 ++-- .../P_Rec_Annot/docs/ortho-source-mapping.md | 39 +++++++ .../docs/research/dwgquery-model-files-api.md | 101 ++++++++++++++++++ 5 files changed, 181 insertions(+), 18 deletions(-) create mode 100644 Plant3D2026/P_Rec_Annot/docs/ortho-source-mapping.md create mode 100644 Plant3D2026/P_Rec_Annot/docs/research/dwgquery-model-files-api.md diff --git a/Plant3D2026/P_Rec_Annot/AGENTS.md b/Plant3D2026/P_Rec_Annot/AGENTS.md index 2e67c51..216cc3f 100644 --- a/Plant3D2026/P_Rec_Annot/AGENTS.md +++ b/Plant3D2026/P_Rec_Annot/AGENTS.md @@ -63,6 +63,16 @@ DataLinks активного Ortho drawing не являются источни rows читаются из source model drawing и Piping project part, разрешённых через Ortho sheet/view definitions. +Перед предположениями об Autodesk runtime API необходимо исследовать текущий +код, доступный legacy usage, assembly metadata и реальные runtime types. +Reflection/runtime inspection применяется только для подтверждения данных, +которых нельзя установить статически. Production resolver не угадывает +Autodesk properties по строковым именам. + +Подтверждённый контракт Plant 3D 2026: `IDwgViewDef.DwgQuery` → +`IDwgQuery.ModelFiles` → `ModelFile[].ModelFileName`. При несовпадении типа +возвращать `ORTHO_MODEL_FILES_API_UNSUPPORTED`, без fallback-эвристики. + Проверка DCF выполняется на парных `control` и `DryRun` fixtures, созданных из одного закрытого состояния проекта. Сравнивать нужно `control delta` с `DryRun delta`: одинаковые изменения классифицируются как baseline behavior diff --git a/Plant3D2026/P_Rec_Annot/docs/evidence/ortho-runtime-summary.json b/Plant3D2026/P_Rec_Annot/docs/evidence/ortho-runtime-summary.json index be943f2..5676f56 100644 --- a/Plant3D2026/P_Rec_Annot/docs/evidence/ortho-runtime-summary.json +++ b/Plant3D2026/P_Rec_Annot/docs/evidence/ortho-runtime-summary.json @@ -6,16 +6,23 @@ "orthoDetection": "Confirmed", "viewportCount": 1, "dataLinksAvailable": true, - "dataLinksSheetToSourceMapping": "blocked", - "objectsRead": 0, - "phpRecAnnotRuns": 2, - "pxpAavRuns": 2, - "pxpOaRuns": 1, - "dbmodBefore": 0, - "dbmodAfter": 0, + "dataLinksSheetToSourceMapping": "resolved-through-piping-project-drawing-id", + "sourceDrawingsResolved": 1, + "sourceDataLinksAvailable": true, + "objectsRead": 7, + "pipeObjectsRead": 7, + "phpRecAnnotRuns": 1, + "pxpAavRuns": null, + "pxpOaRuns": null, + "planId": null, + "repeatedPlanIdEqual": null, + "dbmodBefore": null, + "dbmodAfter": null, "dwgModified": null, - "dcfModified": true, - "changedProjectFiles": ["Piping.dcf"], + "dcfModified": null, + "changedProjectFiles": null, "unhandledExceptions": 0, - "applyModeUsed": false + "applyModeUsed": false, + "launcherRollback": "RolledBack", + "exactViewportMembership": "not-verified" } diff --git a/Plant3D2026/P_Rec_Annot/docs/ortho-runtime-results.md b/Plant3D2026/P_Rec_Annot/docs/ortho-runtime-results.md index 9f41adf..c592631 100644 --- a/Plant3D2026/P_Rec_Annot/docs/ortho-runtime-results.md +++ b/Plant3D2026/P_Rec_Annot/docs/ortho-runtime-results.md @@ -10,13 +10,19 @@ viewport. In `DryRun`, `PHP_REC_ANNOT` ran twice, `PXP-AAV` ran twice, and `PlantProject.Name` was available for this fixture and rendered as `PRecAnnotTestProject`. -The Ortho sheet did not expose direct Piping rows through -`DataLinksManager.SelectAcPpRowIds`; that API threw `DLException: NotFound`. -The adapter now converts this to an empty read-only result. Consequently the -run read zero source Plant objects and produced an empty plan. Mapping the -Ortho sheet to source-model objects remains the blocker for non-empty -AnnotationPlan validation. +The active Ortho sheet does not expose direct Piping rows and must not be used +as a DataLinks source. Metadata inspection and a sanitized runtime probe +confirmed `IDwgViewDef.DwgQuery.ModelFiles[].ModelFileName` as the source-model +reference. The adapter resolves that reference through +`PipingProject.GetPnPDrawingFiles()` and reads +`DataLinksManager.SelectAcPpRowIds(PnPProjectDrawing.Id)`. + +On the latest real DryRun, one source drawing was resolved and seven source +Plant objects were read. `PHP_REC_ANNOT` reported seven skipped operations, +zero writes, zero conflicts, and zero errors. This verifies source-model +DataLinks access; it does not yet verify exact source-object-to-viewport +membership or repeated-plan determinism. The test fixture SHA baseline changed for `Piping.dcf` before the first DryRun -command. This run therefore does not prove DCF invariance, although no plugin -write operation was performed and DBMOD remained unchanged. +command. This run therefore does not prove DCF invariance. A paired control +fixture versus DryRun fixture comparison remains required. diff --git a/Plant3D2026/P_Rec_Annot/docs/ortho-source-mapping.md b/Plant3D2026/P_Rec_Annot/docs/ortho-source-mapping.md new file mode 100644 index 0000000..76f862e --- /dev/null +++ b/Plant3D2026/P_Rec_Annot/docs/ortho-source-mapping.md @@ -0,0 +1,39 @@ +# Ortho source-model mapping + +## Confirmed Plant 3D 2026 read path + +```text +Active Ortho document +→ OrthoProject.DwgSheetDefinitions +→ IDwgSheetDef.DwgViewDefs +→ IDwgViewDef.DwgQuery.ModelFiles[].ModelFileName +→ PipingProject.GetPnPDrawingFiles() +→ exact normalized-path match to PnPProjectDrawing +→ PnPProjectDrawing.Id +→ DataLinksManager.SelectAcPpRowIds(int dwgid) +→ GetObjectClassname / GetAllProperties +→ independent PlantObjectSnapshot +→ AnnotationPlanBuilder +``` + +`PlantOrthoViewportReader.ReadViewports` reads the typed DwgQuery contract and +creates an Ortho viewport snapshot. `PlantObjectReader.ReadObjects` resolves +the resulting model-file reference through the Piping project drawing list and +reads DataLinks by project drawing ID. The active Ortho database is not a +Piping-row source. + +All calls are read-only. The adapter opens no write transaction and does not +save a drawing, DCF, or project metadata. + +## Diagnostics + +The source reader returns stable telemetry diagnostics rather than suppressing +the result of a failed query: `ORTHO_SOURCE_DRAWING_NOT_RESOLVED`, +`ORTHO_SOURCE_DRAWING_NOT_IN_PROJECT`, `ORTHO_SOURCE_DRAWING_AMBIGUOUS`, +`PIPING_PROJECT_PART_NOT_FOUND`, `SOURCE_DATALINKS_UNAVAILABLE`, +`SOURCE_DATALINKS_NO_ROWS`, `SOURCE_DATABASE_READ_FAILED`, +`SOURCE_PIPE_ROWS_NOT_FOUND`, or `SOURCE_DATALINKS_READ`. + +Exact membership of a source object in a particular Ortho viewport is not yet +implemented. A source-level DryRun plan must not be presented as proof of +viewport membership. diff --git a/Plant3D2026/P_Rec_Annot/docs/research/dwgquery-model-files-api.md b/Plant3D2026/P_Rec_Annot/docs/research/dwgquery-model-files-api.md new file mode 100644 index 0000000..05efe01 --- /dev/null +++ b/Plant3D2026/P_Rec_Annot/docs/research/dwgquery-model-files-api.md @@ -0,0 +1,101 @@ +# Plant 3D 2026 DwgQuery / ModelFiles API contract + +## Scope and method + +This report is based on metadata-only inspection of the installed Plant 3D 2026 +assemblies. The assemblies were read from `` and were not +copied into the repository. Metadata-only inspection was necessary because the +normal PowerShell host cannot load the product's .NET 8 dependencies safely. + +Legacy source at the documented local path was not present on this machine, so +there is no legacy API claim in this report. + +## Confirmed assemblies + +| Assembly | Version | Relevant type | +| --- | --- | --- | +| `PnPDwg2dDef` | `0.0.0.0` | `Autodesk.ProcessPower.Drawings2d.DwgQuery`, `IDwgQuery`, `DwgViewDef`, `IDwgViewDef`, `DwgSheetDef`, `IDwgSheetDef` | +| `PnPDwg2dUtil` | `0.0.0.0` | `Autodesk.ProcessPower.Drawings2d.ModelFile` | +| `PnP3dOrthoProjectPart` | `17.0.60.1` | Ortho project-part integration assembly; the metadata scan found no public DwgQuery declaration there | + +`PnPDwg2dDef` and `PnPDwg2dUtil` use `0.0.0.0` assembly versions in the +installed metadata. The supported runtime contract is therefore identified by +the exact public type names below, not by an invented product-version number. + +## Confirmed contract + +```text +Autodesk.ProcessPower.Drawings2d.IDwgViewDef.DwgQuery + : Autodesk.ProcessPower.Drawings2d.IDwgQuery + +Autodesk.ProcessPower.Drawings2d.IDwgQuery.ModelFiles + : Autodesk.ProcessPower.Drawings2d.ModelFile[] + +Autodesk.ProcessPower.Drawings2d.ModelFile.ModelFileName + : System.String + +Autodesk.ProcessPower.Drawings2d.ModelFile.ModelFileGuid + : System.String +``` + +`DwgViewDef` implements `IDwgViewDef`; `DwgQuery` implements `IDwgQuery` and +`IDisposable`; `ModelFile` implements `IComparable`. + +`ModelFiles` is an array, not an untyped enumerable. `ModelFileName` is the +only confirmed string field representing the model-file reference. `ModelFileGuid` +is a separate identity field. `IsReferencedDwg` and `Xform` describe reference +state and transform, not a substitute path. + +## Public members relevant to source resolution + +`IDwgViewDef` exposes `DwgQuery`, `ViewName`, layout/orientation properties, +and `SetClippingPlanes`, `SetLayout`, `SetOrientation`, `Erase`, and `New`. + +`IDwgQuery` exposes `ModelFiles`, `Execute`, and `Erase`. + +`ModelFile` exposes `ModelFileName`, `ModelFileGuid`, `IsReferencedDwg`, and +`Xform`; its constructors accept a file-name string and optional transform, +reference flag, and GUID. + +`IDwgSheetDef.DwgViewDefs` exposes the view-definition collection. Sheet +`DwgName`/`DwgPath` identify the Ortho sheet and must not be used as the source +of Piping DataLinks. + +## Current and legacy usage + +The original adapter used reflection and tried several possible names +(`ModelFileName`, `Value`, and arbitrary string values). That was not a valid +Plant 3D 2026 contract. + +The production read path now uses the confirmed typed chain only: + +```text +IDwgViewDef.DwgQuery.ModelFiles[].ModelFileName +``` + +The legacy source path was unavailable locally, so no legacy source-model or +DataLinks workaround has been imported. + +## Runtime evidence + +Static metadata cannot prove whether `ModelFileName` is project-relative or +absolute in a concrete Ortho fixture, or whether a particular view has zero, +one, or multiple model files. In DryRun only, setting +`P_REC_ANNOT_DIAGNOSTICS=OrthoStructure` enables a sanitized structure probe. +It records type names, collection counts, null state, string length, and a +one-way value hash; it does not emit paths or engineering data. + +On the local DryRun fixture, the runtime probe recorded one view with one +`ModelFile`. The concrete types were `DwgViewDef`, `DwgQueryByBox`, and +`ModelFile[]`; `ModelFileName` was non-null and an absolute fixture-model +reference. The path itself was not retained in repository evidence. + +The resolver resolves that reference to exactly one +`PipingProject.GetPnPDrawingFiles()` entry by normalized full-path equality, +then uses the confirmed `DataLinksManager.SelectAcPpRowIds(int dwgid)` overload +with the resolved `PnPProjectDrawing.Id`. It does not open or query the active +Ortho database for Piping rows. + +The production resolver has no fallback property-name search. If the exact +contract is unavailable at runtime it reports +`ORTHO_MODEL_FILES_API_UNSUPPORTED` rather than guessing.