Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

error with ThisApplication.ApplicationAddIns.ItemById

1 REPLY 1
SOLVED
Reply
Message 1 of 2
sellis
1678 Views, 1 Reply

error with ThisApplication.ApplicationAddIns.ItemById

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

 

1 REPLY 1
Message 2 of 2
sellis
in reply to: sellis

Should also note that this works fine...

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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report