Inventor API (Apprentice) C# reference not working (MissingMethodException)

Inventor API (Apprentice) C# reference not working (MissingMethodException)

simon.durandWQBHQ
Explorer Explorer
1,970 Views
9 Replies
Message 1 of 10

Inventor API (Apprentice) C# reference not working (MissingMethodException)

simon.durandWQBHQ
Explorer
Explorer

Hi,

 

I want to build a small C# program to generate wireframe images of our parts (.ipt/.iam) using Apprentice in C#.

 

I followed the instructions on the Inventor help along with some tutorials from Mod the machine blog , but the issue I am having seems to be with the .Net Assembly reference to Inventor.

 

When I add the reference from the following folder : [INVENTOR 2021 INSTALL PATH]/Bin/Public Assemblies/Autodesk.Inventor.Interop.dll  my program compiles, but during runtime it seems most of the methods on objects are unavailable and I run into a "Catastrophic failure" error when trying to set the camera "SceneObject" (see attachments).

 

I have a feeling it might be linked to administrator rights (my company has pretty restrictive rights), but I tried running both Inventor & my IDE in Administrator mode and the issue is still there.

 

Please tell me if you need more details to assist me, your help would be very appreciated!

 

Simon

 

 

0 Likes
1,971 Views
9 Replies
Replies (9)
Message 2 of 10

nmunro
Collaborator
Collaborator

There is not a lot of help on this property but it is likely related to the "Scenes" available only in presentation documents. The part component definition that you are trying to assign to the camera.sceneobject property is not a viable object for this property. Sorry for the limited help.

        


https://c3mcad.com

Message 3 of 10

simon.durandWQBHQ
Explorer
Explorer

Thanks nmunro for your reply. The code I am trying to run was found on an Inventor API training lesson, so I would expect it to work, but you never know!

 

I attached a new screenshot that shows I am receiving the exact same error for a bunch of other fields I am trying to access that should work. The "apprentice" object seems to be correctly initialized, but I cannot access anything further than a few basic fields (like the installation path). It seems like the assembly is missing most of the functions that can normally be used in Apprentice.

 

Hope this can help to pinpoint the issue...

 

 

0 Likes
Message 4 of 10

nmunro
Collaborator
Collaborator

Sorry for the bad info then. In a quick test I'm seeing the same thing so perhaps it is something that has changed in apprentice since that article was written. Maybe someone from Autodesk might chime in with an answer.

        


https://c3mcad.com

Message 5 of 10

simon.durandWQBHQ
Explorer
Explorer

Thanks a lot nmunro for testing the issue, I am "glad" to see that you have the same problem on your side which means it is propably not linked to my company's restrictive administrator rights.

 

I could not find any changelog from Apprentice in Inventor 2021, but hopefully we can get some help from Autodesk directly (or link to more up-to-date documentation!).

0 Likes
Message 6 of 10

johnsonshiue
Community Manager
Community Manager

Hi Simon,

 

Apprentice is no longer part of Inventor Install as of Inventor 2021. You will need to install it separately. Please go to the following page to install it.

 

https://knowledge.autodesk.com/support/inventor/downloads/caas/downloads/content/inventor-apprentice...

 

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 7 of 10

simon.durandWQBHQ
Explorer
Explorer

Hi Johnson,

 

I just installed Inventor View 2021 following your link, but I did not find any dll that references to Apprentice nor Inventor Interop library for my C# project.

 

Can you point me to the location of the dll I should use or if there are any steps that need to be executed after installation?

 

The documentation for Apprentice seems to be very limited and could not find anything regarding this other than some posts about dropped 32bits support for Inventor 2019 (my program is running in 64bits).


Thanks a lot!

0 Likes
Message 8 of 10

simon.durandWQBHQ
Explorer
Explorer

Hi Johnson,

 

Since your solution proposal does not fix my problem, let me explain my requirements and maybe you can advise me on a alternative solution outside using Apprentice.

 

What we aim to achieve is the following:

 

  • Generate wireframe images of all the parts & assemblies that we have in our Autodesk Vault.
    • Automated process to keep images up-to-date without manual human intervention
    • Images would use the saved "Home" view from Inventor so that the camera angle of the image is right for all parts and can be corrected by a human if required.
    • File format TBD, should be irrelevant (png, bmp, jpg...)

The current idea was to create a program that would go through all of our Inventor files from the Vault and generate the images using Apprentice API (save image from camera of the document).

 

Since Apprentice does not seem to work anymore to do this, is there any other solution that could fit our requirements?

 

Thank you.

0 Likes
Message 9 of 10

Markus.Koechl
Autodesk
Autodesk

Hi Simon, my colleague Johnson asked me to chime in and propose a Vault based solution: Tasks like this are usually done by Vault Job Processor (available in Vault Workgroup or Vault Professional). The Vault SDK supports the creation of custom jobs and also allows to submit jobs not only based on lifecycle transitions but also on user selected files. To get started in custom job programming I can offer an AU class teaching on how to use the SDK template for a job. Vault jobs for Inventor files leverage an included InventorServer application that runs silently and faster than the full Inventor application (comparable to apprentice but more powerful). Once you succeeded with your first job, you could leverage other samples available doing a similar task like yours. If you get there join the Vault customization forum for further guidance. I hope this helps.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 10 of 10

simon.durandWQBHQ
Explorer
Explorer

Hi Markus, thank you so much for your answer. We have Vault Basic so we will need to upgrade to Professional (already planned). I will take your course and try it out once we have access to Vault Professionnal.

 

I will accept this answer once I had the chance to try this and confirm it fulfills our need.

0 Likes