Issue
When calling Open-Document with -Application 'DWG TrueView' in VsCode or another PowerShell IDE it fails with the following errors.
ERROR powerJobs.Application.TrueView.Application - DWG TrueView: Failed to initialize application!
System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at NativeMethods.SetupHostApplication()
at powerJobs.Application.TrueView.Application.Start()
ERROR powerJobs.Cmdlets.CmdLets.CadCmdletBase - OpenDocumentContext failed with exception: Unable to load DLL 'DwgLibrary.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
System.DllNotFoundException: Unable to load DLL 'DwgLibrary.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at powerJobs.Application.TrueView.UnsafeNativeMethods.☺(String ☻, Int32 ♥, Int32& ♦)
at ♣.♣.☺(String ☻, Int32 ♥, Int32& ♦)
at powerJobs.Application.TrueView.Document..ctor(IApplication application, OpenDocumentSettings openSettings)
at powerJobs.Application.TrueView.Application.OpenDocument_Internal(OpenDocumentSettings openSettings)
at powerJobs.Common.Applications.ApplicationBase.Open(OpenDocumentSettings openSettings)
at powerJobs.Cmdlets.CmdLets.OpenDocumentContext.Execute()
solution 1
This issue was fixed in powerJobs Processor v26.0.3. Install this version or a newer version of powerJobs Processor.
Solution 2
If an update is not possible you can get around this by manually loading the missing "acdbmgd.dll" and add the DWG TrueView directory to the windows path variable. Depending on your versions you'll have to update the paths
For TrueView 2024
[System.Reflection.Assembly]::LoadFrom('C:\Program Files\Autodesk\AutoCAD 2024\acdbmgd.dll')
$env:Path += ';C:\Program Files\Autodesk\DWG TrueView 2024 - English'