Solid Edge Part Type Library
AddLocalSimplifyEnclosure Method
Number of Inputs.
Array of bodies.
Reference plane as object.
Name of the body.
Description
Syntax
Visual Basic
Public Sub AddLocalSimplifyEnclosure( _
   ByVal numInputs As Long, _
   ByRef TopologyProxies() As Object, _
   ByVal RefPlane As Object, _
   ByVal EncloseType As EnclosureTypeConstant, _
   ByVal BodyName As String, _
   ByRef Enclosure As Object _
) 
Parameters
numInputs
Number of Inputs.
TopologyProxies
Array of bodies.
RefPlane
Reference plane as object.
EncloseType
ValueDescription
igEnclosureTypeBox
igEnclosureTypeInsideCylinder
igEnclosureTypeOutsideCylinder
BodyName
Name of the body.
Enclosure
Example
Imports System.Runtime.InteropServices
Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objAssy As SolidEdgeAssembly.AssemblyDocument = Nothing
        Dim objSimpAssys As SolidEdgeAssembly.SimplifiedAssemblies = Nothing
        Dim objSimpAssy As SolidEdgeAssembly.SimplifiedAssembly = Nothing
        Dim objSimpModel As SolidEdgePart.SimplifiedAssemblyModel = Nothing
        Dim objEnclosures As SolidEdgePart.Enclosures = Nothing
        Dim objOccs As SolidEdgeAssembly.Occurrences = Nothing
        Dim objOcc As SolidEdgeAssembly.Occurrence = Nothing
        Dim objRef As SolidEdgeFramework.Reference = Nothing
        Dim objEnc As SolidEdgePart.Enclosure = Nothing
        Dim objEnc2 As SolidEdgePart.Enclosure = Nothing
        Dim objSubOccs As SolidEdgeAssembly.SubOccurrences = Nothing
        Dim objSubOcc As SolidEdgeAssembly.SubOccurrence = Nothing
        Dim objModels As SolidEdgePart.Models = Nothing
        Dim objModel As SolidEdgePart.Model = Nothing
        Dim objConsts As SolidEdgePart.Constructions = Nothing
        Dim objIPCs As SolidEdgePart.InterpartConstructions = Nothing
        Dim objMRefPlanes As SolidEdgePart.RefPlanes = Nothing
        Dim objMRefPlane As SolidEdgePart.RefPlane = Nothing
        Dim objBody As SolidEdgeGeometry.Body = Nothing
        Dim bodyArray As System.Array = Array.CreateInstance(GetType(SolidEdgeGeometry.Body), 1)
        Dim occArray As System.Array = Array.CreateInstance(GetType(SolidEdgeFramework.Reference), 1)

        'The following sample code creates a local enclosure around the first body in the Simplified AssemblyModel. 

        Try
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")

            objAssy = objApplication.ActiveDocument
            objOccs = objAssy.Occurrences
            objOcc = objOccs.Item(1)
            objSubOccs = objOcc.SubOccurrences
            For Each subocc As SolidEdgeAssembly.SubOccurrence In objSubOccs
                If (subocc.ThisAsOccurrence.Subassembly = False) Then
                    objSubOcc = subocc
                End If
            Next
            objRef = objSubOcc.Reference
            objRef = objAssy.CreateReference(objOcc, objSubOcc.ThisAsOccurrence)
            occArray(0) = objRef
            objSimpAssys = objAssy.SimplifiedAssemblies
            objSimpAssy = objSimpAssys.Item(1)
            objSimpModel = objSimpAssy.SimplifiedModel
            objMRefPlanes = objSimpModel.RefPlanes
            objMRefPlane = objMRefPlanes(1)
            objModels = objSimpModel.Models
            objModel = objModels(0)
            objEnclosures = objModel.Enclosures
            objBody = objModel.Body
            bodyArray(0) = objBody
            objModels.AddLocalSimplifyEnclosure(1, bodyArray, objMRefPlane, SolidEdgePart.EnclosureTypeConstant.igEnclosureTypeOutsideCylinder, "newbody", objEnc2)
            'Following code will Edit Local Simplify Enclosure.
            objEnc2.EditLocalSimplifyEnclosure(1, bodyArray, objMRefPlane, SolidEdgePart.EnclosureTypeConstant.igEnclosureTypeBox)
            Console.WriteLine(objEnclosures.Count)
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try
    End Sub
End Class
See Also

Models Collection  | Models Members