Solid Edge Framework Type Library
DownloadDocumentsFromServerWithOptionsUsingKeyProperties Method
It is a two-dimensional array which will take Key Properties and their values as input.
Specify the item-rev of the item.
Specify the dataset name of the file.
Specify the Revision Rule.
Specify the item-type of the item.
This flag has following possible values:
o TRUE – In case where it is required to only download the given item from the Teamcenter database but don’t want to check it out.
o FALSE – In case where it is required to both download as well as checkout.
This flag will decide the download level of the file.
o TRUE - This is going to download the files for one level.
o FALSE- Going to download the files for ALL levels

User can assign one of below values.
o (COImplicit) 
SolidEdge.Constant.Interop.TCDownloadOptions. COImplicit
Check out file implicitly.
o (DoNotShowUnableToExportDlg)  SolidEdge.Constant.Interop.TCDownloadOptions.DoNotShowUnableToExportDlg
Do not show error message if check out fails.
o (DoNotContinue)  SolidEdge.Constant.Interop.TCDownloadOptions.DoNotContinue
Do not continue current operation on failure.
o (DoNotExpandAllGRMs) SolidEdge.Constant.Interop.TCDownloadOptions.DoNotExpandAllGRMs
Do not expand GRMs. e.g. Asm A1.asm has part P1.par. P1.par has link to another Part P2.par. When this option is set, P2.par is not downloaded.
o (DownloadOnlyNon3dlinks)  SolidEdge.Constant.Interop.TCDownloadOptions.DownloadOnlyNon3dlinks
Download only non- 3D links for selected draft only. This option is used when user selects "Inactivate Drawing views for review”

A two dimensional array or list of files. 0th (first dimension) element is name of the file and 1st (second dimension) element is the operation to be done.
The operation can be
a. Download and Checkout
b. Download
c. Neither.
This is similar to the operations that users can specify on BOM dialog
Description
Checkout document from the server with options given by the user and also using Key Properties provided by user.
Syntax
Visual Basic
Public Sub DownloadDocumentsFromServerWithOptionsUsingKeyProperties( _
   ByRef pvarMFKAttrInfo As Variant, _
   ByVal bstrItemRev As String, _
   ByVal bstrDataSetFileName As String, _
   ByVal bstrRevisionRule As String, _
   ByVal bstrItemType As String, _
   ByVal vbReadOnly As Boolean, _
   ByVal vbAllLevel As Boolean, _
   ByVal dwDownloadOption As ULong, _
   Optional ByRef pvarListOfFiles() As Variant _
) 
Parameters
pvarMFKAttrInfo
It is a two-dimensional array which will take Key Properties and their values as input.
bstrItemRev
Specify the item-rev of the item.
bstrDataSetFileName
Specify the dataset name of the file.
bstrRevisionRule
Specify the Revision Rule.
bstrItemType
Specify the item-type of the item.
vbReadOnly
This flag has following possible values:
o TRUE – In case where it is required to only download the given item from the Teamcenter database but don’t want to check it out.
o FALSE – In case where it is required to both download as well as checkout.
vbAllLevel
This flag will decide the download level of the file.
o TRUE - This is going to download the files for one level.
o FALSE- Going to download the files for ALL levels
dwDownloadOption

User can assign one of below values.
o (COImplicit) 
SolidEdge.Constant.Interop.TCDownloadOptions. COImplicit
Check out file implicitly.
o (DoNotShowUnableToExportDlg)  SolidEdge.Constant.Interop.TCDownloadOptions.DoNotShowUnableToExportDlg
Do not show error message if check out fails.
o (DoNotContinue)  SolidEdge.Constant.Interop.TCDownloadOptions.DoNotContinue
Do not continue current operation on failure.
o (DoNotExpandAllGRMs) SolidEdge.Constant.Interop.TCDownloadOptions.DoNotExpandAllGRMs
Do not expand GRMs. e.g. Asm A1.asm has part P1.par. P1.par has link to another Part P2.par. When this option is set, P2.par is not downloaded.
o (DownloadOnlyNon3dlinks)  SolidEdge.Constant.Interop.TCDownloadOptions.DownloadOnlyNon3dlinks
Download only non- 3D links for selected draft only. This option is used when user selects "Inactivate Drawing views for review”

pvarListOfFiles
A two dimensional array or list of files. 0th (first dimension) element is name of the file and 1st (second dimension) element is the operation to be done.
The operation can be
a. Download and Checkout
b. Download
c. Neither.
This is similar to the operations that users can specify on BOM dialog
Remarks
Though the last argument is optional, .net requires this argument to be specified when calling this API. The API does not work and throws exception if this argument is not specified. Hence if not required then a temporary argument must be passed as shown in sample code.
Example
Imports System.Runtime.InteropServices

Public Class Form1 

    Private Sub DownloadDocumentsFromServerWithOptionsUsingKeyProperties_Click(sender As Object, e As EventArgs) Handles DownloadDocumentsFromServerWithOptionsUsingKeyProperties.Click
        Dim objSEApplication As SolidEdgeFramework.Application = Nothing
        Dim objTCE As SolidEdgeFramework.SolidEdgeTCE = Nothing
        Dim majorVersion As Object = Nothing
        Dim completeVersion As Object = Nothing
        Dim UserName As String
        Dim Password As String
        Dim Group As String
        Dim Role As String
        Dim URL As String
        Dim bTeamCenterMode As Boolean

        Dim MFKAttributes(2, 1) As Object
        MFKAttributes(0, 0) = "item_id"
        MFKAttributes(0, 1) = "001410"
        MFKAttributes(1, 0) = "object_type"
        MFKAttributes(1, 1) = "MFK9Item12"
        MFKAttributes(2, 0) = "mfk9attribute1"
        MFKAttributes(2, 1) = "hhhh"

        Dim FileItemRevID As String = "B"
        Dim ItemTypeMFK As Object
        ItemTypeMFK = "MFK9Item12"
        Dim FileDataSetName As String = "001410-BE144.asm"
        Dim revRule As String = "Latest Working"

        Dim bReadOnly As Boolean = False / True
        Dim bAllLevel As Boolean = False / True
        Dim ListOfFiles(0, 0) As Object


        Try
            objSEApplication = Marshal.GetActiveObject("SolidEdge.Application")
            objSEApplication.DisplayAlerts = False

            objTCE = objSEApplication.SolidEdgeTCE
            Call objTCE.GetTeamCenterMode(bTeamCenterMode)
            If bTeamCenterMode = False Then
                objTCE.SetTeamCenterMode(True)
            End If

            'Specify Server Credentials
            UserName = "abc"
            Password = "abc"
            Group = ""
            Role = ""
            URL = "http://Servername:8085/tc"

            Call objTCE.ValidateLogin(UserName, Password, Group, Role, URL)
            objTCE.DownloadDocumentsFromServerWithOptionsUsingKeyProperties(MFKAttributes, FileItemRevID, FileDataSetName, revRule, ItemTypeMFK, bReadOnly, bAllLevel, 0, Listoffiles)
            MsgBox("Done")
        Catch ex As Exception
            MsgBox(ex.ToString)
            Clipboard.SetText(ex.ToString)
        End Try
    End Sub
End Class
See Also

SolidEdgeTCE Object  | SolidEdgeTCE Members