Start addin on time

Start addin on time

Anonymous
Not applicable
444 Views
4 Replies
Message 1 of 5

Start addin on time

Anonymous
Not applicable

I would like to start an addin based on the time of day is this possible?

 

Malcolm

0 Likes
445 Views
4 Replies
Replies (4)
Message 2 of 5

Mike.Wohletz
Collaborator
Collaborator

Can you give a little more exlanation of what needs to start? is it the add in has something run or it will not work and will between some timeframe?

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

I need to copy some files at a specific time but only while Inventor is running so I need the addin to run when both those conditions are met but I don't want the addin to run in the backgroung all the time.

0 Likes
Message 4 of 5

Mike.Wohletz
Collaborator
Collaborator

I think that it should be very easy to do this if you use a COM application (exe) and run it from the windows Scheduled Tasks. With this you can set the time and it will not run unless inventor is running if done like my sample shown.

 

Imports Inventor

Module InventorRun
    Dim oApp As Application = Nothing
    Sub Main()
        Try
            oApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
            ' if we make it this far then we can say that Inventor is running
            'Call to copy the files
            CopyFiles()


        Catch ex As Exception

        End Try
        'clean up
        If Not oApp Is Nothing Then
            System.Runtime.InteropServices.Marshal.ReleaseComObject(oApp)
            oApp = Nothing
        End If
       

    End Sub

    Public Sub CopyFiles()
        'add your code to copy the files here..
        MsgBox("Copy Files")

    End Sub
End Module

 

 

0 Likes
Message 5 of 5

Anonymous
Not applicable

Thanks for the great idea, works fine.

 

Malcolm

0 Likes