How to run code throuh API before Vault Check-In?

How to run code throuh API before Vault Check-In?

Ezekiel12
Collaborator Collaborator
1,518 Views
11 Replies
Message 1 of 12

How to run code throuh API before Vault Check-In?

Ezekiel12
Collaborator
Collaborator

Hi,

how to run code through API when the User will click check-in to the Vault? 

 

User will click the Check-In button, I need to run some "control" code and after that send it to Vault. If the "control" code fails, I need to stop the Check-in process. (Because user will be notifies to fill in more info to model).

 

Any idea how to get to check-in through api? 

 

Thx,

Matt

0 Likes
1,519 Views
11 Replies
Replies (11)
Message 2 of 12

bradeneuropeArthur
Mentor
Mentor

you need to use the pre and post events of the EDM vault add in of inventor.

Read this in the meanwhile:

https://forums.autodesk.com/t5/inventor-customization/use-inventor-vault-add-in-through-inventor-api...

 

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
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 !

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 12

Ezekiel12
Collaborator
Collaborator

Hello,

thx for the info. It got us further but there is still problem with it. Can you please help?

 

We created PRE and POST events (CheckinFileEvents_Pre , CheckinFileEvents_Post) according the code.
The OnLoad function is supposed to register event handler, and it is called from Activate function of the add-in.
HOwever, when pushing Check-in button, no PRE or POST actions are performed.
When debugging, the following error message can be seen during registration of the event handler: "The runtime is unable to evaluate this expression", see the picture:

InventorCheckINAPIProblem.png

0 Likes
Message 4 of 12

bradeneuropeArthur
Mentor
Mentor

Hi,

 

I am developing in Vb.net an I use this:

AddHandler DocumentService.AddFileEvents.Pre, AddressOf AddFileCheckPre

Hope this will help you.

 

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
Message 5 of 12

Maxim-CADman77
Advisor
Advisor

If not secret what workflow you are expecting to achieve?

For example user tries to check in a huge assembly.... are you going to let him untill each and every component of the assembly passes your checks?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 6 of 12

Ezekiel12
Collaborator
Collaborator

Not secret at all. Trying to accomplish this (not sucesfull yet):

 

  • User clicks Check-In
  • The procedure will check several thing in assembly (iproperties by company standard etc...)
  • If correct, check-In will continue
  • If not correct, there will be message window with information what user needs to correct in assembly and the Check*in will abort

 

 

Message 7 of 12

Maxim-CADman77
Advisor
Advisor
You plan to check only IAMs?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 8 of 12

bradeneuropeArthur
Mentor
Mentor

@Ezekiel12 

 

Where can I help you further with?

I am using also a add in to do specific things on check in of before or after.

Please let me know what is going wrong exactly?

This should not be any issue...

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 9 of 12

Ezekiel12
Collaborator
Collaborator

@Maxim-CADman77 

Anything (ipts/iams/idw..) as standard check-in dialog.

 

@bradeneuropeArthur 

Well this is where we got stuck 😞 

---------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualBasic;
using System.Windows.Forms;
using Autodesk.Connectivity.Explorer.Extensibility;
using Autodesk.DataManagement.Addin.Vault;
using Autodesk.Connectivity.WebServices;
using Autodesk.Connectivity.WebServicesTools;
using VDF = Autodesk.DataManagement.Client.Framework.Vault;
using Connectivity.InventorAddin.EdmAddin;
namespace MyProject.Classes
{
    public class VaultEventHandler : Autodesk.Connectivity.WebServices.IWebServiceExtension
    {
        public void OnLoad()
        {
            //Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.Pre += new EventHandler<CheckinFileCommandEventArgs>(addfilerunlogic);
            Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.Pre += CheckinFileEvents_Pre;
            Autodesk.Connectivity.WebServices.DocumentService.CheckinFileEvents.Post += CheckinFileEvents_Post;
        }

        private void CheckinFileEvents_Pre(object sender, CheckinFileCommandEventArgs e)
        {
            MessageBox.Show("Pre - Check-in action");
        }

        public void CheckinFileEvents_Post(object sender, Autodesk.Connectivity.WebServices.CheckinFileCommandEventArgs e)
        {
            MessageBox.Show("Post - Check-in action");
        }
    }
}

0 Likes
Message 10 of 12

bradeneuropeArthur
Mentor
Mentor

are you happy with vb.net code too?

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 11 of 12

Ezekiel12
Collaborator
Collaborator

Hi @bradeneuropeArthur 

So its a bit frustrating but... 

We found out that Vault BASIC does not perform any Document.Service functions. We have tested the application using PROFESSIONAL version where it works well. There is no info about it in documentation.

 

I have no idea how it will perform on Workgroup... I hope same as Professional.

0 Likes
Message 12 of 12

AlexFielder
Advisor
Advisor

Workgroup has (mostly) the same API as Professional whereas Basic doesn't have any API functions AFAIK.

0 Likes