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: 

Please help me.

6 REPLIES 6
Reply
Message 1 of 7
nonno2
944 Views, 6 Replies

Please help me.

 

on the inventor 2013 64bit(vba6) ,  there was no problem.

But on the inventor 2014 64bit(vba7) , there is a problem.

 

An error occurs.

 

private sub xx()

    Dim oApprentice As New ApprenticeServerComponent

    Dim oDoc As ApprenticeServerDocument

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

    debug.print oDoc.AllReferencedDocuments.count

end sub

hi
6 REPLIES 6
Message 2 of 7
Mark_Wigan
in reply to: nonno2

i am seeing a brand new error in 2014 as well, that has been fine before now.

 

it has been seen to happen on a line like i see in yours as well:  Set oDoc = oApprentice....

 

the error info i see is:

runtime error 445

object doesn't support this action

 

i will be looking further into it tonight and let you know what happens.

best regards,
- Mark

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

PDSU 2020 Windows 10, 64bit.

Message 3 of 7
Mark_Wigan
in reply to: Mark_Wigan

looking in the API window in debug mode, i set a break point before the error arises.

 

now, looking within the object variable i can see some issues now that i have not encountered before now. see snapshot showing values of the returned properties...

 

so, it makes sense that we would then get an error when running our macro since there is already an issue in the information that it will need to assign to the variable we are using!

 

i don't know why this is happening now. i did a google search on this and didn't find anyone talking about it but i did see a note on mod the machine that they are now saying to NOT USE APPRENTICE in API  WITH A RUNNING INSTANCE OF INVENTOR PROCESS (or words to that effect).

 

i was not aware of this before. i don't know if it has aything to do with what we are now seeing.

 

best regards,
- Mark

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

PDSU 2020 Windows 10, 64bit.

Message 4 of 7
JarFu
in reply to: nonno2

This because after VBA7 is integrated, the VBA editor is in the same process with Inventor. Most of the functions of Apprentice are not worked when it’s in the same process of Inventor.

 

You can use the VBA7 of Excel (Tools> Reference> add Autodesk Inventor Object Library) to run below VBA code.

 



Jar Fu
SW Engineer
Inventor QA
Autodesk, Inc.
Message 5 of 7
Mark_Wigan
in reply to: nonno2

Not sure about excel, do u mean we need to call excel for the OP instead of apprentice to run a specific task needing excel tools?

i think We ran apprentice to reduce load on inventor and cpu.

Are we now having to change the code and leave apprentice for plug ins and never run inventor at the same time or just make sure we load a new process if we wish to use apprentice?
best regards,
- Mark

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

PDSU 2020 Windows 10, 64bit.

Message 6 of 7
JarFu
in reply to: Mark_Wigan

Sorry, Microsoft Excel is just a tool example which uses VBA out-process of Inventor. You can use any other tools which can run VBA. Or use VB directly.

 

Yes, we don't need change code, just make sure use Apprentice with the out-process tools (as Inventor32bitHost.exe for VBA of Inevntor 2013 on 64bit).



Jar Fu
SW Engineer
Inventor QA
Autodesk, Inc.
Message 7 of 7
Mark_Wigan
in reply to: JarFu

thanks Jar Fu,

 

i think maybe i will try to use the inventor intstead of calling apprentice. especially now that it is integrate. generally speaking i now find that most of the macros seem to work much better now than in 2013 & previous.

 

thanks.

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