AnsweredAssumed Answered

Solidworks PDM get selected files variable

Question asked by Prabaharan Pichaiyan on Dec 3, 2018

I need to get selected files card variables in msgbox.

is it possible ?

 

my codes :

 

Imports EdmLib


Public Class VbAddin


    Implements IEdmAddIn5






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


        poInfo.mbsAddInName = "Minimal VB.Net Addi-in"
        poInfo.mbsCompany = "AEM"
        poInfo.mbsDescription = "Testing Only"
        poInfo.mlAddInVersion = 1
        poInfo.mlRequiredVersionMajor = 6
        poInfo.mlRequiredVersionMinor = 4


        If poVault.IsLoggedIn Then
            MsgBox("We are logged in to the  " + poVault.Name + " vault")
        Else
            MsgBox("We are not logged in to a vault")
        End If


        poCmdMgr.AddCmd(1, "Minimal VB.Net Add-in menu item")
        poCmdMgr.AddHook(EdmCmdType.EdmCmd_PreLock)


    End Sub


    Public Sub OnCmd(ByRef poCmd As EdmCmd, ByRef ppoData As Array) Implements IEdmAddIn5.OnCmd
        
        Dim AffectedFile As EdmCmdData
        Dim AffectedFileNames As String = vbCrLf + vbCrLf


        Select Case poCmd.meCmdType


            Case EdmCmdType.EdmCmd_PreLock


                For Each AffectedFile In ppoData
                    AffectedFileNames += AffectedFile.mbsStrData1 + vbCrLf
                Next AffectedFile
                AffectedFileNames += vbCrLf
                Dim MsgBoxResult As MsgBoxResult


                MsgBoxResult = MsgBox("The Files Below are about to be checked out" + AffectedFileNames + "Seleted.")


            Case Else
                poCmd.mpoVault.msgbox(poCmd.mlParentWnd, "An Unknown Command type was issued.")
        End Select


    End Sub
End Class

 

 

Thanks

Outcomes