Regarding System.Runtime.Interopservices.COMException

Regarding System.Runtime.Interopservices.COMException

Anonymous
Not applicable
700 Views
5 Replies
Message 1 of 6

Regarding System.Runtime.Interopservices.COMException

Anonymous
Not applicable
public void PackAndGoSample()
        {
            PackAndGoComponent packAndGoComp = new PackAndGoComponent();
            PackAndGo packAndGo = packAndGoComp.CreatePackAndGo("C:\\Temp\\Source\\Assembly1.iam", "C:\\Temp\\Destination");

            // Set the design project. This defaults to the current active project.
            packAndGo.ProjectFile = "C:\\Temp\\Source\\Test.ipj";

            string[] refFiles = new string[] { };
            object refMissFiles = new object();

            // Set the options
            packAndGo.IsSkippingLibraries = true;
            packAndGo.IsSkippingStyles = true;
            packAndGo.IsSkippingTemplates = true;
            packAndGo.IsCollectingWorkgroups = false;
            packAndGo.IsKeepingFolderHierarchy = 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();
        }


Above is the code which I am using and for the line
PackAndGoComponent packAndGoComp = new PackAndGoComponent(); I am getting an System.Runtime.Interoservices.COMException error
Please help me in resolving this issue.
Thank you.
0 Likes
701 Views
5 Replies
Replies (5)
Message 2 of 6

bradeneuropeArthur
Mentor
Mentor

Hi,

 

What version of inventor are you using?

 

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 6

Anonymous
Not applicable

Hello Sir,

 

I am using Inventor version 2015 and visual studio 2015

 

 

Thank you.

0 Likes
Message 4 of 6

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Are you familiar with Vb.net too?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 6

Anonymous
Not applicable

Hello sir,

 

Ya I am familiar with vb.net but I not getting a solution to resolve System.Runtime.Interop.COMException  please help.

 

Thank you.

 

Regards,

Amruta

0 Likes
Message 6 of 6

bradeneuropeArthur
Mentor
Mentor

you need something like this added:

 

oPacknGo.SearchForReferencingFiles(sRefFiles, sRefcingFiles, False, dirio.Parent.FullName & "\_Dwg")


        Dim xa = New String(sRefFiles.Length + sRefcingFiles.Length - 1) {}
        sRefFiles.CopyTo(xa, 0)
        sRefcingFiles.CopyTo(xa, sRefFiles.Length)

        'oPacknGo.AddFilesToPackage(sMissFiles)
        ' Start the pack and go to create the 
        oPacknGo.AddFilesToPackage(xa)
        'MsgBox(xa.Length)
        
        oPacknGo.CreatePackage(True)

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes