Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

inventor 2014 apprentice error : run-time error '91'

8 REPLIES 8
Reply
Message 1 of 9
nonno2
2288 Views, 8 Replies

inventor 2014 apprentice error : run-time error '91'

why?

hi
8 REPLIES 8
Message 2 of 9
nonno2
in reply to: nonno2

Answer please.

hi
Message 3 of 9
SeanFarr
in reply to: nonno2

Hey kbc

maybe a description of what your attempting to do will help, posting your files, or helpful screenshots..and systems specs will get you some replies...you are too vague..

Sean Farr
Product Designer at TESInc.ca

Inventor Professional 2014-Update 2 - AutoCAD Electrical 2014
Win7-x64 | ASUS P8Z77-V | i7 3770 -3.4 GHz | 32GB RAM |
240GB SSD | nVidia GTX 670 4GB - 320.49
Message 4 of 9
nonno2
in reply to: SeanFarr

My system specs
win7 -x64 Inventor Professional 2014
Intel(R) Core(TM) i7 CPU x980 @ 3.33GHz
RAM 24GB

Inventor Professional 2013 = no problem.

Only Not run apprentice.

hi
Message 5 of 9
nonno2
in reply to: SeanFarr

Error occurred Contents

hi
Message 6 of 9
johnsonshiue
in reply to: nonno2

Hi! Could you post the dataset or VB code here or send it to me directly (johnson.shiue@autodesk.com)? The information you provided so far is not enough for me to reproduce the problem.

Thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 7 of 9
samiharada
in reply to: nonno2

Hi,

I'm curious to know if

  • You are executing your code from Inventor
  • Your code used to work with Inventor 2013 64-bit version, and
  • The same code does not work with Inventor 2014 64-bit version

 

If this is the case, the error you are seeing is “as-expected.”

Here is why:

 

ApprenticeServerComponent is meant to be used from outside Inventor process.

(for example, it can be used from Excel VBA once “Autodesk Inventor Object Library” is referenced)

 

Inventor 2013 x64 (64-bit version) has 32-bit version of VBA 6.3  (there’s no 64-bit version of VBA 6)

Since 64-bit Inventor is calling 32-bit VBA, each is running in a different process.

As the result apprentice works even from inside Inventor.

 

Inventor 2014 x64 is now equipped with 64-bit version of VBA 7.1 (new in R2014), and

VBA code is executed in the same process as Inventor.

Apprentice call doesn’t work because of this change.

 

I believe you will see the same issue with Inventor 2013 x86 (32-bit version), where

both Inventor and VBA are 32-bit and VBA is executed within Inventor process.

 

I was wondering if you can use the current Inventor application object > document object

instead of ApprenticeServerDocument

For example:

 

<doesn’t work inside Inventor>

    Dim oApprentice As New ApprenticeServerComponent

    Dim oDoc As ApprenticeServerDocument

    Set oDoc = oApprentice.Open("C:\Test\Assembly\A1\A1.iam")

    If oDoc.AllReferencedDocuments.count > 0 then

    ..... 

 

<should work inside Inventor>

   Dim oDoc As Document

   Set oDoc = Inventor.ThisApplication.Documents.Open("C:\Test\Assembly\A1\A1.iam")

    If oDoc.AllReferencedDocuments.count > 0 then

    ....

 

Hope this helps,

-Sami

 

Message 8 of 9
nonno2
in reply to: nonno2

Thank you.
However, this is not the answer I want.

hi
Message 9 of 9
Mark_Wigan
in reply to: nonno2

nonno no body can help if you dont explain what you are actually doing and what the code is.

 

i am having an issue with approentice being used in my VBA now in inv 2014. you will see a response about vb7 now running inside inventor...

 

http://forums.autodesk.com/t5/Autodesk-Inventor/Please-help-me/m-p/3927602/thread-id/471062/highligh...

 

i am trying to find out some more about this. from what i can gather, we cannot use approentice inside inventor API for 2014 inventor onwards. we will likely have to use inventor instead of apprentice, at least in my case.

 

so if you can explain what you are doing, when you get the error, hit 'debug' and show us the code window and we can see the functions being called etc. i have some screenshots in this other post that you can see some of the code i was referring to. i would be interested to see if you have the same kind of "application or object defined error" in your variables as well.

best regards,
- Mark

(Kudo or Tag if helpful - in case it also helps others)

PDSU 2020 Windows 10, 64bit.

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

Post to forums  

Autodesk Design & Make Report