AnsweredAssumed Answered

Copy variable when check out files - PDM API

Question asked by Pichaiyan Prabaharan on Dec 19, 2018
Latest reply on Dec 27, 2018 by Pichaiyan Prabaharan

Hi,

I'm creating an Add-in to copy variable when check out files. I don't know where I'm Doing mistake. Its getting an error.

Could you please check and let me know what is the issue?

 

Imports EdmLib


Public Class Class1


    Implements IEdmAddIn5


    Public Sub GetAddInInfo(ByRef poInfo As EdmAddInInfo, poVault As IEdmVault5, poCmdMgr As IEdmCmdMgr5) Implements IEdmAddIn5.GetAddInInfo


        poInfo.mbsAddInName = "Update old Revision"
        poInfo.mbsCompany = "test"
        poInfo.mbsDescription = "Update old Revision"


        poInfo.mlAddInVersion = 1
        poInfo.mlRequiredVersionMajor = 10
        poInfo.mlRequiredVersionMinor = 0


        poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostLock)




    End Sub


    Public Sub OnCmd(ByRef poCmd As EdmCmd, ByRef ppoData As Array) Implements IEdmAddIn5.OnCmd


        Dim AffectedFile As EdmCmdData


        Select Case poCmd.meCmdType


            Case EdmCmdType.EdmCmd_PostLock


                Dim myVault As IEdmVault12 = CType(poCmd.mpoVault, IEdmVault12)
                Dim Inc_RevA As Integer
                Dim Cur_RevA As Integer


                For Each AffectedFile In ppoData


                    Dim myfile As IEdmFile5 = myVault.GetFileFromPath(AffectedFile.mbsStrData1)
                    Dim myvars As IEdmEnumeratorVariable10 = Nothing
                    myvars = CType(myfile.GetEnumeratorVariable(), IEdmEnumeratorVariable10)
                    myvars.GetVar("A", "@", Cur_RevA)
                    MsgBox(Cur_RevA)
                    myvars.SetVar("B", "@", Inc_RevA)
                    myvars.CloseFile(True)


                Next


        End Select


    End Sub
End Class

 

 

Thanks

Outcomes