Solid Edge Assembly Type Library
Add Method
Specifies the name of the part file that contains the structural frame.
Specifies the number of objects in the Path array.
Specifies the segments along which the structural frame is constructed.
Specifies a value (if applicable) for the global end condition.
Member of the StructuralFrameEndConditionConstants constant set that specifies the end condition for all of the segments in the structural frame.
Specifies whether the structural frame is automatically positioned.
Description
Adds an occurrence of the referenced object.
Syntax
Visual Basic
Public Function Add( _
   ByVal PartFileName As String, _
   ByVal NumPaths As Long, _
   ByRef Path() As Object, _
   Optional ByVal GlobalEndConditions As Variant, _
   Optional ByVal GlobalEndConditionValue As Variant, _
   Optional ByVal AutoPosition As Variant _
) As StructuralFrame
Parameters
PartFileName
Specifies the name of the part file that contains the structural frame.
NumPaths
Specifies the number of objects in the Path array.
Path
Specifies the segments along which the structural frame is constructed.
GlobalEndConditions
Specifies a value (if applicable) for the global end condition.
GlobalEndConditionValue
Member of the StructuralFrameEndConditionConstants constant set that specifies the end condition for all of the segments in the structural frame.
AutoPosition
Specifies whether the structural frame is automatically positioned.
Example
Imports System.Runtime.InteropServices

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objAsmDoc As SolidEdgeAssembly.AssemblyDocument = Nothing
        Dim objType As Type = Nothing
        Dim Occurrences As SolidEdgeAssembly.Occurrences
        Dim Occurrence As SolidEdgeAssembly.Occurrence
        Dim objDoc As SolidEdgePart.PartDocument
        Dim objEdges As SolidEdgeGeometry.Edges
        Dim pathSegarray(12)
        Dim objLineSegments As SolidEdgeAssembly.LineSegments = Nothing
        Dim objLineSegment As SolidEdgeAssembly.LineSegment = Nothing
        Dim objStructuralFrames As SolidEdgeAssembly.StructuralFrames = Nothing
        Dim objStructuralFrame As SolidEdgeAssembly.StructuralFrame = Nothing
        Dim PartFileName As String
        Dim NumPaths As Integer
        Dim objPath(0) As Object

        Dim StartPoint(0 To 2) As Double
        Dim EndPoint(0 To 2) As Double

        Try
            'Following example will create 2 Frames in an assembly
            'First frame will be using a single line and cross section
            'Second frame will be using a Body Edges and cross section
            'To create second frame you need an assembly file with a square block(part) in it.
            ' Create/get the application with specific settings
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")

            If objApplication Is Nothing Then
                ' Get the type from the Solid Edge ProgID
                objType = Type.GetTypeFromProgID("SolidEdge.Application")
                ' Start Solid Edge
                objApplication = Activator.CreateInstance(objType)
                ' Make Solid Edge visible
                objApplication.Visible = True
            End If
            'Get reference to active document
            objAsmDoc = objApplication.ActiveDocument()
            PartFileName = "C:\Program Files (x86)\Solid Edge ST6\Frames\DIN\I-Beam\I-Beam 80x46.par"

            StartPoint(0) = 0
            StartPoint(1) = 0
            StartPoint(2) = 0
            EndPoint(0) = 0
            EndPoint(1) = 0
            EndPoint(2) = 50
            objLineSegments = objAsmDoc.LineSegments

            objLineSegment = objLineSegments.Add(StartPoint, EndPoint)

            NumPaths = 1
            objPath(0) = objLineSegments.Item(1)
            'obtain frame collection  object
            objStructuralFrames = objAsmDoc.StructuralFrames
            objStructuralFrame = objStructuralFrames.Add(PartFileName, NumPaths, objPath)
            'Frame is made invisible to
            objStructuralFrame.Visible = False
            'getocurrence collection object
            Occurrences = objAsmDoc.Occurrences
            'get first occurence item
            Occurrence = Occurrences.Item(1)

            'create reference for edges
            objDoc = Occurrence.OccurrenceDocument
            objEdges = objDoc.Models.Item(1).ExtrudedProtrusions.Item(1).Edges(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryAll)

            'add refrence of edge to safearray to craete path
            For value As Integer = 0 To objEdges.Count()
                pathSegarray(value) = objAsmDoc.CreateReference(Occurrence, objEdges.Item(value))
            Next
            'obtain frame collection  object
            objStructuralFrames = objAsmDoc.StructuralFrames
            ' create frame
            objStructuralFrame = objStructuralFrames.Add(PartFileName, 12, pathSegarray)

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class
See Also

StructuralFrames Collection  | StructuralFrames Members