Solid Edge Framework Type Library
GetLatestRevision Method
Solid Edge Framework Type Library > Application Object : GetLatestRevision Method
Path of file as string.
Scope where you would like to search.
Returns latest revision path as string.
Returns latest released revision path as string.
Description
Returns the latest revision far a given File.
Syntax
Visual Basic
Public Sub GetLatestRevision( _
   ByVal PathName As String, _
   ByRef psaScope() As Variant, _
   ByRef bLatestRevPath As String, _
   ByRef bLatestReleasedRevPath As String _
) 
Parameters
PathName
Path of file as string.
psaScope
Scope where you would like to search.
bLatestRevPath
Returns latest revision path as string.
bLatestReleasedRevPath
Returns latest released revision path as string.
Example
Imports System.Runtime.InteropServices
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim application As SolidEdgeFramework.Application = Nothing
        Dim strFilePath As String = "C:\SIEM00000008_A.asm"
        Dim strScopeList(0) As Object
        Dim strNewRev As String = ""
        Dim strNewReleasedRev As String = ""
        Dim objType As Type = Nothing
        Try

            ' Below code will test Solid Edge automation

            Try
                    application = Marshal.GetActiveObject("SolidEdge.Application")
                Catch ex As Exception
                    ' Get the type from the Solid Edge ProgID
                    objType = Type.GetTypeFromProgID("SolidEdge.Application")
                    ' Start Solid Edge
                    application = Activator.CreateInstance(objType)
                Finally
                ' Make Solid Edge visible
                application.Visible = True
            End Try
            strScopeList(0) = "C:\"
            application.GetLatestRevision(strFilePath, strScopeList, strNewRev, strNewReleasedRev)
          

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

    End Sub
End Class
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
public class Form1
{
    private void Button1_Click(object sender, EventArgs e)
    {
        SolidEdgeFramework.Application application = null;
        string strFilePath = "C:\\SIEM00000008_A.asm";
        object[] strScopeList = new object[1];
        string strNewRev = "";
        string strNewReleasedRev = "";
        Type objType = null;
        try
        {

            // Below code will test Solid Edge automation

            try
            {
                    application = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
                }
                catch (Exception ex)
                {
                    // Get the type from the Solid Edge ProgID
                    objType = Type.GetTypeFromProgID("SolidEdge.Application");
                    // Start Solid Edge
                    application = Activator.CreateInstance(objType);
                }
                finally
                {
                // Make Solid Edge visible
                application.Visible = true;
            }
            strScopeList[0] = "C:\\";
            application.GetLatestRevision(strFilePath, strScopeList, strNewRev, strNewReleasedRev);
            

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }

    }

    public Form1()
    {
        SubscribeToEvents();
    }

    private bool EventsSubscribed = false;
    private void SubscribeToEvents()
    {
        if (EventsSubscribed)
            return;
        else
            EventsSubscribed = true;

        Button1.Click += Button1_Click;
    }

}
See Also

Application Object  | Application Members