Solid Edge Assembly Type Library
Add Method
X - coordinate of the point defining the lower position of zone.
Y - coordinate of the point defining the lower position of zone.
Z - coordinate of the point defining the lower position of zone.
X - coordinate of the point defining the upper position of zone.
Y - coordinate of the point defining the upper position of zone.
Z - coordinate of the point defining the upper position of zone.
Description
Adds a zone in an assembly file.
Syntax
Visual Basic
Public Function Add( _
   ByVal Point1x As Double, _
   ByVal Point1y As Double, _
   ByVal Point1z As Double, _
   ByVal Point2x As Double, _
   ByVal Point2y As Double, _
   ByVal Point2z As Double _
) As Zone
Parameters
Point1x
X - coordinate of the point defining the lower position of zone.
Point1y
Y - coordinate of the point defining the lower position of zone.
Point1z
Z - coordinate of the point defining the lower position of zone.
Point2x
X - coordinate of the point defining the upper position of zone.
Point2y
Y - coordinate of the point defining the upper position of zone.
Point2z
Z - coordinate of the point defining the upper position of zone.
Remarks
This method has as input 6 doubles which represent a low and high xyz position will return a zone object
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 objSEApplication As SolidEdgeFramework.Application
        Dim objDoc As SolidEdgeAssembly.AssemblyDocument
        Dim P1X, P1Y, P1Z, P2X, P2Y, P2Z As Double
        Dim SEInstallDir As DirectoryInfo
        Dim objZones As SolidEdgeAssembly.Zones = Nothing
        Dim objZone As SolidEdgeAssembly.Zone = Nothing

        Try
            ' Get the application
            objSEApplication = Marshal.GetActiveObject("SolidEdge.Application")
            SEInstallDir = GetTrainingFolder()
            objDoc = objSEApplication.Documents.Open(SEInstallDir.FullName + "\carrier.asm")
            objZones = objDoc.Zones
            objZone = objZones.Add(0.05, 0.05, 0.05, 0.2, 0.2, 0.2)
            objZone.Name = "ZoneName"
            objZone.Overlap = True
            'Show Parts
            objZone.ShowOnlyParts()
            'Hide Parts
            'objZone.HideParts()
            
        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

Zones Collection  | Zones Members  | Solid Edge V20 - What's New