Solid Edge Part Type Library
Add Method
Specifies the number of tools to be used as input for the trim operation.
Specifies the Edge object(s) at which the trim will take place.
Specifies the side of the input curve(s) on which the trim will take place. Valid values are members of the TrimSurfaceAreaSideConstants constant set.
Description
Trim a surface using object.
Syntax
Visual Basic
Public Function Add( _
   ByVal NumberOfTools As Long, _
   ByRef ToolsArray() As Object, _
   ByVal AreaSide As TrimSurfaceAreaSideConstants _
) As TrimSurface
Parameters
NumberOfTools
Specifies the number of tools to be used as input for the trim operation.
ToolsArray
Specifies the Edge object(s) at which the trim will take place.
AreaSide
ValueDescription
igTSLeftSpecifies that the trim will occur on the left side of the input curve.
igTSRightSpecifies that the trim will occur on the right side of the input curve.
Specifies the side of the input curve(s) on which the trim will take place. Valid values are members of the TrimSurfaceAreaSideConstants constant set.
Example
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 objPartDoc As SolidEdgePart.PartDocument = Nothing
        Dim objConstructions As SolidEdgePart.Constructions = Nothing
        Dim objBdrySurfaces As SolidEdgePart.SurfaceByBoundaries = Nothing
        Dim objBdrySurface As SolidEdgePart.SurfaceByBoundary = Nothing
        Dim objProfileSet As SolidEdgePart.ProfileSet = Nothing
        Dim objProfile As SolidEdgePart.Profile = Nothing
        Dim sketch As SolidEdgePart.Sketch = Nothing
        Dim arrInEdges(4) As Object
        Dim arrEdge(0) As Object
        Dim objConsModel As SolidEdgePart.ConstructionModel = Nothing
        Dim objTrimSurfaces As SolidEdgePart.TrimSurfaces = Nothing
        Dim objTrimSurface As SolidEdgePart.TrimSurface = Nothing

        Try
            ' Create/get the application with specific settings
            objApp = Marshal.GetActiveObject("SolidEdge.Application")
            If objApp Is Nothing Then
                MessageBox.Show("Could not get application.")
            End If

            ' Get the active document which contains 2 sketechs. One with rectangle and other with circle in the middle of rectangle
            objPartDoc = objApp.ActiveDocument
            If objPartDoc Is Nothing Then
                MessageBox.Show("Could not open document ")
            End If

            ' Get the constructions collection
            objConstructions = objPartDoc.Constructions
            objBdrySurfaces = objConstructions.SurfaceByBoundaries

            If objBdrySurfaces Is Nothing Then
                MessageBox.Show("Could not get SurfaceByBoundary collection.")
            End If

            ' Input edges
            sketch = objPartDoc.Sketches.Item(1)
            objProfile = sketch.Profile

            ' Get input edges to create bounded surface
            arrInEdges(0) = objProfile.CurveBody.Curves.Item(1)
            arrInEdges(1) = objProfile.CurveBody.Curves.Item(2)
            arrInEdges(2) = objProfile.CurveBody.Curves.Item(3)
            arrInEdges(3) = objProfile.CurveBody.Curves.Item(4)

            ' Input edges
            sketch = objPartDoc.Sketches.Item(2)
            objProfile = sketch.Profile
            arrEdge(0) = objProfile.CurveBody.Curves.Item(1)

            objBdrySurface = objBdrySurfaces.Add(4, arrInEdges)
            Dim objProjCurve As SolidEdgePart.ProjectCurve = Nothing

            objConsModel = objConstructions.Item(1)
            objTrimSurfaces = objConsModel.TrimSurfaces
            objTrimSurface = objTrimSurfaces.Add(1, arrEdge, SolidEdgePart.TrimSurfaceAreaSideConstants.igTSLeft)

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

TrimSurfaces Collection  | TrimSurfaces Members