Solid Edge Draft Type Library
AddEx Method
Object of drawing view to define the model to be used.

If this parameter is set to "True" then it will match with the settings of existing active parts list.

An integer 0 should be equivalent of FALSE, all other values will be TRUE.

Name of saved settings to define the properties of the new parts list.

The saved settings file is in <install dir>/Template/Reports/DraftList.txt

Balloons will be placed if this parameter is set to True.
Parts list will be created if this parameter is set to True.
Description
Adds PartsList in the document and match it with the settings of existing active parts list.
Syntax
Visual Basic
Public Function AddEx( _
   ByVal DrawingView As DrawingView, _
   ByVal LinkToActive As Long, _
   ByVal SavedSettings As String, _
   ByVal AutoBalloon As Long, _
   ByVal CreatePartsList As Long _
) As PartsList
Parameters
DrawingView
Object of drawing view to define the model to be used.
LinkToActive

If this parameter is set to "True" then it will match with the settings of existing active parts list.

An integer 0 should be equivalent of FALSE, all other values will be TRUE.

SavedSettings

Name of saved settings to define the properties of the new parts list.

The saved settings file is in <install dir>/Template/Reports/DraftList.txt

AutoBalloon
Balloons will be placed if this parameter is set to True.
CreatePartsList
Parts list will be created if this parameter is set to True.
Example
Imports System.IO
Imports System.Runtime.InteropServices

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objApp As SolidEdgeFramework.Application = Nothing
        Dim objDoc As SolidEdgeDraft.DraftDocument = Nothing
        Dim objSheets As SolidEdgeDraft.Sheets = Nothing
        Dim objSheet As SolidEdgeDraft.Sheet = Nothing
        Dim objDrawingViews As SolidEdgeDraft.DrawingViews = Nothing
        Dim objDrawingView As SolidEdgeDraft.DrawingView = Nothing
        Dim objPartsLists As SolidEdgeDraft.PartsLists = Nothing
        Dim objPartsList As SolidEdgeDraft.PartsList = Nothing
        Dim objModelLinks As SolidEdgeDraft.ModelLinks = Nothing
        Dim objModelLink As SolidEdgeDraft.ModelLink = Nothing
        Dim objFolder As DirectoryInfo
        Dim objFileInfo As FileInfo

        Try
            objApp = Marshal.GetActiveObject("SolidEdge.Application")
    
            objDoc = objApp.Documents.Add("SolidEdge.DraftDocument")
            objFolder = GetTrainingFolder()
            objFileInfo = New FileInfo(Path.Combine(objFolder.FullName, "carrier.asm"))

            objModelLinks = objDoc.ModelLinks
            objModelLink = objModelLinks.Add(objFileInfo.FullName)
            objSheets = objDoc.Sheets
            objSheet = objDoc.Sheets.Item(1)
            objDrawingViews = objSheet.DrawingViews
            objDrawingView = objDrawingViews.AddAssemblyView(objModelLink, SolidEdgeDraft.ViewOrientationConstants.igBackView, 1.0, 0.25, 0.25, SolidEdgeDraft.AssemblyDrawingViewTypeConstants.seAssemblySimplifiedView)
            objPartsLists = objDoc.PartsLists
            objPartsList = objPartsLists.AddEx(objDrawingView, 0, "ANSI", 1, 1)
            objSheet.Activate()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

    End Sub
    Function GetTrainingFolder() As DirectoryInfo
        Dim objInstallData As SEInstallDataLib.SEInstallData = Nothing
        Dim objInstallFolder As DirectoryInfo = Nothing
        Dim objTrainingFolder As DirectoryInfo = Nothing

        Try
            objInstallData = New SEInstallDataLib.SEInstallData
            objInstallFolder = New DirectoryInfo(objInstallData.GetInstalledPath())
            objTrainingFolder = New DirectoryInfo(Path.Combine(objInstallFolder.Parent.FullName, "Training"))
        Catch
        Finally
            If Not (objInstallData Is Nothing) Then
                Marshal.FinalReleaseComObject(objInstallData)
                objInstallData = Nothing
            End If
        End Try

        Return objTrainingFolder
    End Function
End Class


See Also

PartsLists Collection  | PartsLists Members  | Solid Edge ST5 - What's New