From 9a7a6cd6784bd821f684765fa0b31db484a801da Mon Sep 17 00:00:00 2001 From: codex Date: Fri, 31 Jul 2026 11:36:46 +0300 Subject: [PATCH] fix: bind P_Rec_Annot to Plant 3D 2026 assemblies --- Plant3D2026/P_Rec_Annot/.gitignore | 2 ++ Plant3D2026/P_Rec_Annot/Directory.Build.props | 4 +++- .../PRecAnnot.Plant3D2026/EntryPointLifecycle.cs | 15 --------------- .../PRecAnnot.Plant3D2026.csproj | 16 +++++++++------- .../Plant3D2026Availability.cs | 2 +- 5 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/EntryPointLifecycle.cs diff --git a/Plant3D2026/P_Rec_Annot/.gitignore b/Plant3D2026/P_Rec_Annot/.gitignore index 42fcf36..9ce3bf6 100644 --- a/Plant3D2026/P_Rec_Annot/.gitignore +++ b/Plant3D2026/P_Rec_Annot/.gitignore @@ -1,4 +1,6 @@ artifacts/ +.local-dotnet-sdk/ +.local-tools/ bin/ obj/ .vs/ diff --git a/Plant3D2026/P_Rec_Annot/Directory.Build.props b/Plant3D2026/P_Rec_Annot/Directory.Build.props index fa78c7b..6ffcf3b 100644 --- a/Plant3D2026/P_Rec_Annot/Directory.Build.props +++ b/Plant3D2026/P_Rec_Annot/Directory.Build.props @@ -6,6 +6,8 @@ true true portable - $(ProgramFiles)\Autodesk\AutoCAD 2026 + $(Plant3D2026InstallDir) + $(Plant3D2026InstallDir)\PLNT3D + $(AutoCAD2026ManagedDir) diff --git a/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/EntryPointLifecycle.cs b/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/EntryPointLifecycle.cs deleted file mode 100644 index 3f3b2ca..0000000 --- a/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/EntryPointLifecycle.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace PRecAnnot.Plant3D2026; - -/// -/// Autodesk-facing composition-root lifecycle. The concrete IExtensionApplication -/// implementation is enabled only after the Plant 3D 2026 SDK reference contract -/// is verified on the target installation. -/// -public sealed class EntryPointLifecycle : IDisposable -{ - private int _initialized; - public bool IsInitialized => Volatile.Read(ref _initialized) == 1; - public bool Initialize() => Interlocked.Exchange(ref _initialized, 1) == 0; - public void Terminate() => Interlocked.Exchange(ref _initialized, 0); - public void Dispose() => Terminate(); -} diff --git a/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/PRecAnnot.Plant3D2026.csproj b/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/PRecAnnot.Plant3D2026.csproj index c5d408b..b978064 100644 --- a/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/PRecAnnot.Plant3D2026.csproj +++ b/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/PRecAnnot.Plant3D2026.csproj @@ -1,15 +1,17 @@ - net8.0-windowsx64true + net8.0-windowsx64truefalse - - $(Plant3D2026InstallDir)\AcMgd.dllfalse - $(Plant3D2026InstallDir)\AcDbMgd.dllfalse - $(Plant3D2026InstallDir)\AcCoreMgd.dllfalse - $(Plant3D2026InstallDir)\PLNT3D\PnPProjectManagerMgd.dllfalse - $(Plant3D2026InstallDir)\PLNT3D\PnPDataLinks.dllfalse + + $(AutoCAD2026ManagedDir)\AcMgd.dllfalsefalse + $(AutoCAD2026ManagedDir)\AcDbMgd.dllfalsefalse + $(AutoCAD2026ManagedDir)\AcCoreMgd.dllfalsefalse + $(AutoCAD2026ManagedDir)\AdWindows.dllfalsefalse + $(AutoCAD2026ManagedDir)\PnPDataLinks.dllfalsefalse + $(Plant3D2026ManagedDir)\PnPProjectManagerMgd.dllfalsefalse + $(Plant3D2026ManagedDir)\PnP3dObjectsMgd.dllfalsefalse diff --git a/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/Plant3D2026Availability.cs b/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/Plant3D2026Availability.cs index 541907c..9dfda67 100644 --- a/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/Plant3D2026Availability.cs +++ b/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/Plant3D2026Availability.cs @@ -4,7 +4,7 @@ public sealed record Plant3D2026Availability(bool IsAvailable, string InstallDir { public static Plant3D2026Availability Detect(string installDirectory) { - var expected = new[] { "AcMgd.dll", "AcDbMgd.dll", "AcCoreMgd.dll", Path.Combine("PLNT3D", "PnPProjectManagerMgd.dll"), Path.Combine("PLNT3D", "PnPDataLinks.dll") }; + var expected = new[] { "AcMgd.dll", "AcDbMgd.dll", "AcCoreMgd.dll", "PnPDataLinks.dll", Path.Combine("PLNT3D", "PnPProjectManagerMgd.dll"), Path.Combine("PLNT3D", "PnP3dObjectsMgd.dll") }; var missing = expected.Where(x => !File.Exists(Path.Combine(installDirectory, x))).ToArray(); return new(missing.Length == 0, installDirectory, missing); }