Quit

Quit

Anonymous
Not applicable
381 Views
8 Replies
Message 1 of 9

Quit

Anonymous
Not applicable
What am I missing. Shouldn't Quit do more than make Inventor Invisible? Or
is this not the right way to shut down Inventor from a standalone exe?

It is being one of those kind of days.


--
___________________
Kent Keller
www.kwikmcad.com
0 Likes
382 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Hey Kent,

You probably still have a live variable that holds a reference to some IV
object (may not be the IV application object). Have your closed all IV docs,
etc.

Neil

"Kent Keller" wrote in message
news:5519780@discussion.autodesk.com...
What am I missing. Shouldn't Quit do more than make Inventor Invisible? Or
is this not the right way to shut down Inventor from a standalone exe?

It is being one of those kind of days.


--
___________________
Kent Keller
www.kwikmcad.com
0 Likes
Message 3 of 9

Anonymous
Not applicable
I would think if Inventor is hung, you will need to kill the
process using windows api instead of inventor.quit. Just like
you can't use the File->Exit menu to quit if it's hung, it just
won't respond to it.

Kent Keller wrote:
> What am I missing. Shouldn't Quit do more than make Inventor Invisible? Or
> is this not the right way to shut down Inventor from a standalone exe?
>
> It is being one of those kind of days.
>
>
0 Likes
Message 4 of 9

Anonymous
Not applicable
Neil's right about the reference issue. Inventor follows COM rules in that
it doesn't shut down if there are still any remaining references. The
problem with this is when everybody else isn't correctly handling their COM
references. Occasionally there will be an Add-In that will end up keeping
Inventor alive.
--
Brian Ekins
Autodesk Inventor API
0 Likes
Message 5 of 9

Anonymous
Not applicable
Thanks all for the quick answers. I just went searching and found that I
had asked a very similar question in the past. (hate this old age lack of
memory)
In that case I had to add a delay, but in this case I can sit there for a
long time and it keeps running.

At that point I have opened one assembly file, and then gathered some info
from it and closed it. Since I am having trouble with the program hanging
in the middle of processing 1000 +files I figured I would try closing
inventor after each one. All that is doing for me is leaving me with as
many Inventor.exe's running in task manager as files I have opened.

So is the answer to set oInventorApp = Nothing after the Quit and then start
from scratch with a new Set oInventorApp =
CreateObject("Inventor.Application")? Or how do I go about determining who
is causing it to stay open?

--
___________________
Kent Keller
www.kwikmcad.com


"Brian Ekins (Autodesk)" wrote in message
news:5519851@discussion.autodesk.com...
Neil's right about the reference issue. Inventor follows COM rules in that
it doesn't shut down if there are still any remaining references. The
problem with this is when everybody else isn't correctly handling their COM
references. Occasionally there will be an Add-In that will end up keeping
Inventor alive.
--
Brian Ekins
Autodesk Inventor API
0 Likes
Message 6 of 9

Anonymous
Not applicable
Setting it to Nothing seems to clear it from task manager. Is that
normally required after Quit, and before creating a new instance of it? If
not, then I would still like to try to figure out what is keeping it open.

I have found that on another computer it isn't leaving a Inventor.exe
running, so it is likely a Addin... and if that is the case it is Likely one
of mine.

Is the easiest way to determine which one might be causing it to unload the
suspect addins and run the program?

--
___________________
Kent Keller
www.kwikmcad.com
0 Likes
Message 7 of 9

Anonymous
Not applicable
Setting it to nothing may or may not be required, depending on the scope of
the variable. If you have declared the IV application object in the
subroutine, it will go out of scope and become nothing when the sub ends. If
you have declared it at the form, class, or module level, it will remain as
long as that "container" is alive.

So, if setting it to Nothing works, ... it works.

Neil

"Kent Keller" wrote in message
news:5519844@discussion.autodesk.com...
Setting it to Nothing seems to clear it from task manager. Is that
normally required after Quit, and before creating a new instance of it? If
not, then I would still like to try to figure out what is keeping it open.

I have found that on another computer it isn't leaving a Inventor.exe
running, so it is likely a Addin... and if that is the case it is Likely one
of mine.

Is the easiest way to determine which one might be causing it to unload the
suspect addins and run the program?

--
___________________
Kent Keller
www.kwikmcad.com
0 Likes
Message 8 of 9

Anonymous
Not applicable
;~) I like that answer.

It is a global variable, so it makes sense. I just thought that "Quit"
should
close it and clear it.

Now how do I set up a timeout when opening inventor or loading a file in
Inventor hangs :~)

___________________
Kent Keller


----- Original Message -----
From: "Neil Munro"
Newsgroups: autodesk.inventor.customization
Sent: Thursday, March 15, 2007 11:41 AM


So, if setting it to Nothing works, ... it works.

Neil
0 Likes
Message 9 of 9

Anonymous
Not applicable
Are you calling DoEvents after the line that opens the file? That is oftern
required.

Is there a reason that the file is not opening (out of date, unresolved
links, etc)?

If that doesn't help, you could declare a form level timer, start it just
before opening the document, and stop it once the file is opened. Set the
timer value to X seconds and in the event handler for the timer event, clean
up the file opening and move on. This may require a more structured approach
where you open the file and then respond to the
ApplicationEvents_OnOpenDocument event to catch when the file is actually
opened (or not). You'll have to do some thinking on this to get it straight
if this ends up being the approach required.

Neil

"Kent Keller" wrote in message
news:5520006@discussion.autodesk.com...
;~) I like that answer.

It is a global variable, so it makes sense. I just thought that "Quit"
should
close it and clear it.

Now how do I set up a timeout when opening inventor or loading a file in
Inventor hangs :~)

___________________
Kent Keller


----- Original Message -----
From: "Neil Munro"
Newsgroups: autodesk.inventor.customization
Sent: Thursday, March 15, 2007 11:41 AM


So, if setting it to Nothing works, ... it works.

Neil
0 Likes