<xml> </xml>

SOLIDWORKS PDM Professional API Help | Send Feedback
AllocSerNoValue Method (IEdmSerNoGen7)
See Also Example

Collapse All Expand All Language Filter: All Language Filter: Multiple Language Filter: Visual Basic Language Filter: C# Language Filter: C++/CLI

EPDM.Interop.epdm Namespace > IEdmSerNoGen7 Interface : AllocSerNoValue Method (IEdmSerNoGen7)

Visual Basic
C#
C++/CLI

bsSerNoName
  Name of the serial number generator to use to generate a new serial number (see Remarks)

lParentWnd
  Parent window handle; passed to a serial number add-in, if it exists

bsFilePath
  Path to the file for which to generate a serial number

lFolderID
  ID of the file's parent folder

lFileID
  ID of the file for which to generate a serial number

lCardID
  ID of the data card for which to generate a serial number

lCardControlID
  ID of the control for which to generate a serial number

Generates a new serial number for the specified file, data card, or card control using the specified serial number generator.

# Syntax

Visual Basic |
--- | ---

    Function AllocSerNoValue( _
       ByVal bsSerNoName As System.String, _
       Optional ByVal lParentWnd As System.Integer, _
       Optional ByVal bsFilePath As System.String, _
       Optional ByVal lFolderID As System.Integer, _
       Optional ByVal lFileID As System.Integer, _
       Optional ByVal lCardID As System.Integer, _
       Optional ByVal lCardControlID As System.Integer _
    ) As IEdmSerNoValue

C# |
--- | ---

    IEdmSerNoValue AllocSerNoValue(
       System.string bsSerNoName,
       System.int lParentWnd,
       System.string bsFilePath,
       System.int lFolderID,
       System.int lFileID,
       System.int lCardID,
       System.int lCardControlID
    )

C++/CLI |
--- | ---

    IEdmSerNoValue^ AllocSerNoValue(
    &   System.String^ bsSerNoName,
    &   System.int lParentWnd,
    &   System.String^ bsFilePath,
    &   System.int lFolderID,
    &   System.int lFileID,
    &   System.int lCardID,
    &   System.int lCardControlID
    )

#### Parameters

bsSerNoName
  Name of the serial number generator to use to generate a new serial number (see Remarks)
lParentWnd
  Parent window handle; passed to a serial number add-in, if it exists
bsFilePath
  Path to the file for which to generate a serial number
lFolderID
  ID of the file's parent folder
lFileID
  ID of the file for which to generate a serial number
lCardID
  ID of the data card for which to generate a serial number
lCardControlID
  ID of the control for which to generate a serial number

#### Return Value

IEdmSerNoValue

# Example

Set Part Number Using Default Serial Numbers (C#)
Set Part Number Using Default Serial Numbers (VB.NET)

# Remarks

The difference between this method and the now obsolete IEdmSerNoGen6::GenerateSerNo method is that this method returns an IEdmSerNoValue interface instead of a string. IEdmSerNoValue::Rollback allows you to return generated numbers that you can not use. This helps to avoid gaps between serial numbers.

bsSerNoName is the name you specify in the SOLIDWORKS PDM Professional Administration tool when you create a serial number generator.

Return codes:

- S_OK: The method successfully executed.
- E_EDM_INVALID_SERIAL_NUMBER_NAME: The bsSerNoName argument is invalid.

# See Also

####

IEdmSerNoGen7 Interface
IEdmSerNoGen7 Members

# Availability

SOLIDWORKS PDM Professional Version 6.4