Inventor Pack And Go crashes AutoCAD

Inventor Pack And Go crashes AutoCAD

lharwoodWZKMU
Contributor Contributor
499 Views
0 Replies
Message 1 of 1

Inventor Pack And Go crashes AutoCAD

lharwoodWZKMU
Contributor
Contributor

So within a C# AutoCAD plugin I've added a reference to Autodesk.PackAndGo.Interop.dll and am running the following code in an AutoCAD command:

 

				var packAndGoComp = new PackAndGoLib.PackAndGoComponent();
				var packAndGo = packAndGoComp.CreatePackAndGo(@"C:\Users\lharwood\Downloads\shovel 9.8.21 (2)\Workspaces\Workspace\acad demo\shovel model\GBU promodel-for-autocad-2022-shovel-process-09.07.2021.iam", @"C:\Users\lharwood\Desktop\PackAndGoOutput - Copy");
				packAndGo.ProjectFile = @"C:\Users\lharwood\Downloads\shovel 9.8.21 (2)\GBU promodel-for-autocad-2022-shovel-process-09.07.2021.ipj";
				string[] refFiles = new string[] { };
				object refMissFiles = new object();
				// Set the options
				packAndGo.SkipLibraries = true;
				packAndGo.SkipStyles = true;
				packAndGo.SkipTemplates = true;
				packAndGo.CollectWorkgroups = false;
				packAndGo.KeepFolderHierarchy = true;
				packAndGo.IncludeLinkedFiles = true;

				// Get the referenced files
				packAndGo.SearchForReferencedFiles(out refFiles, out refMissFiles);

				// Add the referenced files for package
				packAndGo.AddFilesToPackage(refFiles);

				// Start the pack and go to create the package
				packAndGo.CreatePackage(true);

 It actually generates all the files as expected and returns out of my command method but then AutoCAD crashes and I get the following output:

 

Exception thrown: 'System.Runtime.InteropServices.SEHException' in ManagedMC3.dll
DAImpl.RegisterAddin throws External component has thrown an exception.'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\ProgramData\Autodesk\ApplicationPlugins\ProModel.AutoCAD.bundle\Contents\Autodesk.PackAndGo.Interop.dll'. Module was built without symbols.
The program '[15596] acad.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.

 

0 Likes
500 Views
0 Replies
Replies (0)