Message 1 of 5
create inventor object in VB6

Not applicable
04-10-2006
12:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to use VB6 to create an invisible Inventor object with a preloaded assembly. I have a macro that runs over a webpage and having the assembly as well as inventor invisible and preloaded makes a huge speed difference. To do this, I wanted to create the inventor application object in VB6 and load the file like so:
-------------
On Error Resume Next
Set oInvApp = CreateObject("Inventor.Application")
If Err.Number <> 0 Then Exit Sub
Dim ThisDoc As Inventor.Document
oInvApp.Documents.Open "C:\test.iam", True
'Just a test to make sure it opened the documents
MsgBox oInvApp.Documents.Count
Set ThisDoc = Nothing
Set oInvApp = Nothing
-------------
This works great, but as soon as the file loads and the program exits, Inventor dissapears out of the task manager. I was under the impression that the application had started and should have stayed open until someone exited it.
Does anyone know how to keep it open? This would be a huge help to me. Note that I've also tried not setting the objects to nothing afterwords.
-------------
On Error Resume Next
Set oInvApp = CreateObject("Inventor.Application")
If Err.Number <> 0 Then Exit Sub
Dim ThisDoc As Inventor.Document
oInvApp.Documents.Open "C:\test.iam", True
'Just a test to make sure it opened the documents
MsgBox oInvApp.Documents.Count
Set ThisDoc = Nothing
Set oInvApp = Nothing
-------------
This works great, but as soon as the file loads and the program exits, Inventor dissapears out of the task manager. I was under the impression that the application had started and should have stayed open until someone exited it.
Does anyone know how to keep it open? This would be a huge help to me. Note that I've also tried not setting the objects to nothing afterwords.