How to create a COM object for the Task-Scheduler!

How to create a COM object for the Task-Scheduler!

bradeneuropeArthur
Mentor Mentor
599 Views
3 Replies
Message 1 of 4

How to create a COM object for the Task-Scheduler!

bradeneuropeArthur
Mentor
Mentor

Hi,

 

How to create a COM object for the Task-Scheduler using ServiceModuleInterfaceDef.tlb?

Are there any examples available?

 

Found this in the Help but I need some more support on this:

"Definine COM interface

If you want to use the custom task functionality with COM, first create a COM component which is derived from IServiceModules. The file ServiceModuleInterfaceDef.tlb, which defines the COM interface -- IServiceModules, is installed at Program Files 

 

 Autodesk 

 

 Inventor [version] 

 

 

 Bin. There are five methods defined in the interface:

  • HRESULT StartTask() -- Must be implemented to start the actual custom work at a scheduled time.
  • HRESULT KillTask(void) -- Reserved.
  • HRESULT SetOptions ([in] VARIANT varOptions) -- Passes in the options specified on the UI.
  • HRESULT GetInventorProcessID([in, out] SAFEARRAY(long)* ppsaInventorProcIDs) -- Retrieves Inventor process IDs for monitor usage.
  • HRESULT SetCommand)(*[in} enumTaskCmd enumTaskCmd) -- Sets the commands for pause, stop, and resume task.
Note: Reference the file ServiceModuleInterfaceDef.tlb within your project for access to the COM interface."

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
600 Views
3 Replies
Replies (3)
Message 2 of 4

bradeneuropeArthur
Mentor
Mentor

@johnsonshiue 

Do you know what is needed here?

If I reference the files I get an error that the reference cannot be made.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 4

bradeneuropeArthur
Mentor
Mentor
Any help would be needed with this.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 4 of 4

FRFR1426
Collaborator
Collaborator

You need to create an interop dll. Open the developer command prompt then type theses commands:

cd "C:\Program Files\Autodesk\Inventor 2025\Bin\"
tlbimp /machine:X64 ServiceModuleInterfaceDef.tlb /out:ServiceModuleInterfaceDef.dll

 Then reference the dll in your .NET project.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes