error with ThisApplication.ApplicationAddIns.ItemById

error with ThisApplication.ApplicationAddIns.ItemById

sellis
Advocate Advocate
1,919 Views
1 Reply
Message 1 of 2

error with ThisApplication.ApplicationAddIns.ItemById

sellis
Advocate
Advocate

Trying to export a PDF with PDF translator. Using sample "Save as PDF Translator Sample API Sample" from programers help, I created an addin but... 

Getting error "Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))" on "ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")".  

 

I created an addin starting with

 

Imports Inventor
Imports System.Runtime.InteropServices

Namespace IvPublish
    <ProgIdAttribute("IvPublish.StandardAddInServer"), _
    GuidAttribute("5404f6be-46bb-4bf2-b1b4-7a5e70b69e8f")> _
    Public Class StandardAddInServer
        Implements Inventor.ApplicationAddInServer

        ' Inventor application object.
        Public Property ThisApplication As Inventor.Application

 and activate starts with

 

        Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate

            ' Initialize AddIn members.
            ThisApplication = addInSiteObject.Application

 and command triggered with a button starts with

 

        Private Sub _ExportPdfAllButton_OnExecute(Context As NameValueMap) Handles _ExportPdfAllButton.OnExecute

            Dim PDFAddIn As TranslatorAddIn
            PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")

 And that is where it fails... getting PDFAddin. Tried on two systems with same result...

 

Inventor 2014, Visual Studios 2012

 

Thanks

Stan

 

0 Likes
Accepted solutions (1)
1,920 Views
1 Reply
Reply (1)
Message 2 of 2

sellis
Advocate
Advocate
Accepted solution

Should also note that this works fine...

            Dim oSTEPTranslator As TranslatorAddIn
oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")

 

0 Likes