Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Marshal.GetActiveObject fails with InventorServer Object. Help!

KKizildemir
Collaborator

Marshal.GetActiveObject fails with InventorServer Object. Help!

KKizildemir
Collaborator
Collaborator

Hi,

 

I'am trying to write some code on VS .NET Framework 4.6.1 and to generate a .dll file for my Inventor model that works on C360. So I can not use 'Inventor.Application' object. That's OK.

When I use 'Inventor.InventorServer' object, I can't set that object reference to the intance of my object. I think 'Marshal.GetActiveObject' does not work in this case. So what is the solution?

 

This is the error message: Object reference not set to an instance of an object.

 

This is related part of my code:

 

        Dim oThisServer As Inventor.InventorServer = Nothing
        Try
            oThisServer = Marshal.GetActiveObject("Inventor.InventorServer")
        Catch ex As Exception
            Exit Sub
        End Try

 

Thanks!

 

 

Signature

website
emailskypelinkedinyoutubeemail
0 Likes
Reply
605 Views
4 Replies
Replies (4)

bradeneuropeArthur
Mentor
Mentor
Is inventor server already running.
Otherwise use createobject.....

Regards,

Arthur Knoors

Autodesk Affiliations:

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: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 !

0 Likes

KKizildemir
Collaborator
Collaborator

Hi Arthur,

 

Sorry, I didn't get you. Maybe you would like to do your solution clearer.

 

Thanks anyway.

 

Signature

website
emailskypelinkedinyoutubeemail
0 Likes

FRFR1426
Collaborator
Collaborator

I think that Inventor Server can only be used in the context of a job. 

 

GetActiveObject() can not get an instance, it will always returns null.

 

Inventor Server is started from C:\Program Files\Autodesk\Vault Client 20xx\Explorer\Inventor Server\Bin\VaultInventorServer.exe and then there is a specific process to connect to the running instance which can not be used by an external developer (only Autodesk can use this).

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

bradeneuropeArthur
Mentor
Mentor

That is correct.

You can only use it with a Vault JobProcessor Job!

Regards,

Arthur Knoors

Autodesk Affiliations:

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: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 !

0 Likes