Detect when Vault project is out of sync

Detect when Vault project is out of sync

louwill
Enthusiast Enthusiast
569 Views
2 Replies
Message 1 of 3

Detect when Vault project is out of sync

louwill
Enthusiast
Enthusiast

Hello,

 

We're using Vault 2016 + Plant 3D 2016 with a MSSQL backend for Plant projects.  I'm trying to programmatically determine within a Plant addin when the Plant project currently open is out of sync (i.e. files have been changed in the vault).  I'm writing some code that requires the project to be in sync and therefore need a way to check this prior to executing the code.  The actual synchronization can be performed via the 'PLANTREFRESHFROMVAULT' command--what's the most reliable way to check in code if my local project is out of sync with Vault?

 

Thanks in advance,

Will

0 Likes
Accepted solutions (1)
570 Views
2 Replies
Replies (2)
Message 2 of 3

sajith_subramanian
Autodesk Support
Autodesk Support
Accepted solution

Hi @louwill,

 

I checked with our Plant 3D team. Please find their response below:

 

>>>>>

 

We don’t provide any APIs to check whether current project is out of sync in 2016 SDK. But In 2018 SDK, we do provide such APIs in PnPProjectManagerMgd.dll like below,

        bool IsOutOfSync()

        {

            if (PlantApplication.CurrentProject == null || PlantApplication.CurrentProject.DocumentService == null)

            {

                return false;

            }

 

            // checks metadata

            //

            if (!PlantApplication.CurrentProject.DocumentService.IsLocalProjectTheSame(PlantApplication.CurrentProject))

            {

                return true;

            }

 

            // checks project parts

            //

            return PlantApplication.CurrentProject.DocumentService.IsLocalPlantProjectOutOfSync(PlantApplication.CurrentProject);

        }

 

<<<<<

Hope this helps.

 

Regards,

Sajith

 


Sajith Subramanian
Autodesk Developer Network
0 Likes
Message 3 of 3

louwill
Enthusiast
Enthusiast

Sajith,

 

Thank you for following up with the Plant team.  I'll put this feature on hold until we upgrade to 2018.

 

Thanks,

Will

0 Likes