Solid Edge Framework Type Library
GetNextDocumentNumbers Method
Solid Edge Framework Type Library > Application Object : GetNextDocumentNumbers Method
Count of files for which document number is required. This is input argument as an Integer.
Prefix to be added before document number [This is mentioned in SEOptions]
This is a resultant array of document numbers, where its size is countOfFiles. This is output argument as an array.
Description
Returns the next Document Numbers generated from NumberGenerator.dat file.
Syntax
Visual Basic
Public Function GetNextDocumentNumbers( _
   ByVal countOfFiles As Integer, _
   ByRef pVarPrefix As Variant, _
   ByRef pVarDocNumbs As Variant _
) As Long
Parameters
countOfFiles
Count of files for which document number is required. This is input argument as an Integer.
pVarPrefix
Prefix to be added before document number [This is mentioned in SEOptions]
pVarDocNumbs
This is a resultant array of document numbers, where its size is countOfFiles. This is output argument as an array.
Example
Imports System.Runtime.InteropServices
Imports System.IO

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objApp As SolidEdgeFramework.Application = Nothing
        Dim iCountOfDocNum As Integer
        iCountOfDocNum = 5
        Dim objDocumentNumList() As Object
        Erase objDocumentNumList
        Dim strPrefix As Object
        strPrefix = ""
        Dim GetNextDocumentNumbersHR As Integer = 0
        Try
            'Get Solid Edge Object
            objApp = Marshal.GetActiveObject("SolidEdge.Application")
            If Not objApp Is Nothing Then
                GetNextDocumentNumbersHR = objApp.GetNextDocumentNumbers(iCountOfDocNum, strPrefix, objDocumentNumList)

                If GetNextDocumentNumbersHR <> 0 Then
                    'Fail
                Else
                    'Success
                End If
            End If
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;

public class Form1
{

    private void Button1_Click(object sender, EventArgs e)
    {
        SolidEdgeFramework.Application objApp = null;
        int iCountOfDocNum = 5;
        object[] objDocumentNumList = null;
        objDocumentNumList = null;
        object strPrefix = "";
        int GetNextDocumentNumbersHR = 0;
        try
        {
            //Get Solid Edge Object
            objApp = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
            if (objApp != null)
            {
                GetNextDocumentNumbersHR = objApp.GetNextDocumentNumbers(iCountOfDocNum, strPrefix, objDocumentNumList);

                if (GetNextDocumentNumbersHR != 0)
                {
                    //Fail
                }
                else
                {
                    //Success
                }
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }

    public Form1()
    {
        SubscribeToEvents();
    }

//Converted event handler wireups:
    private bool EventsSubscribed = false;
    private void SubscribeToEvents()
    {
        if (EventsSubscribed)
            return;
        else
            EventsSubscribed = true;

        Button1.Click += Button1_Click;
        Button1.Click += Button1_Click;
        Button1.Click += Button1_Click;
        Button1.Click += Button1_Click;
        Button1.Click += Button1_Click;
    }

}
See Also

Application Object  | Application Members