Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
HideoYamada
in reply to: Cadkunde.nl

Hi,

 


@Cadkunde.nl wrote:

My program is run within Inventor as an Addin. AFAIK that is all single threaded so the process waits till Inventor is started. Though I'm not sure I can already start another Inventor Application in another thread, or how to program that is then picked up in the main thread. If that would be possible, that would be awesome


Run the Inventor in another thread. If you are using .net language (e.g. VB.net), it is easy.

 

To do this with VBA, some technique are required.

1) Master process uses VB script to run the Inventor in another thread and start the macro which saves dwg files.

' VB script sample
Dim oInvApp Set oInvApp = CreateObject("Inventor.Application") oInvApp.Visible = True oInvApp.VBAProjects(1).InventorVBAComponents("Module1").InventorVBAMembers("YourMacroName").Execute

2) Communication between the master(host) and slave(remote) is done via file.

Master writes list of idws to one text file, and create the lock file.

Slave(VBA macro which executed by VB script) waits creation of lock file, and then reads list file, delete lock file, save dwg files in the list, finally terminate Inventor.

3) If master needs to know that slave is alive or not,  slave can tell it by another lock file which is created when the macro starts and deleted before ThisApplication.Quit().

 

=====

Freeradical

 Hideo Yamada

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp