Solid Edge FrameworkSupport Type Library
Layer Property
Description
Sets and returns the named layer on which the referenced object resides.
Property type
Read-write property
Syntax
Visual Basic
Public Property Layer As String
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFrameWork.Application
    Dim objDoc As SolidEdgeDraft.DraftDocument
    Dim objSheet As SolidEdgeDraft.Sheet
    Dim objEllipses As SolidEdgeFrameworkSupport.Ellipses2d
    Dim objEllipse1 As SolidEdgeFrameworkSupport.Ellipse2d
    Dim strDfltlayer As String
    ' Report errors
    Const PI = 3.14159265358979
    ' Create/get the application with specific settings
    On Error Resume Next
    Set objApp = GetObject(, "SolidEdge.Application")
    If Err Then
        Err.Clear
        Set objApp = CreateObject("SolidEdge.Application")
        Set objDoc = objApp.Documents.Add("SolidEdge.DraftDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    'getting the Active Sheet object
    Set objSheet = objDoc.ActiveSheet
    'Get the Ellipses2d object
    Set objEllipses = objSheet.Ellipses2d
    'Create an ellipse2d object
    Set objEllipse1 = objEllipses.AddByCenter(xCenter:=0.3, yCenter:=0.25, _
                                              xMajor:=0.1, yMajor:=0, Ratio:=0.5, Orientation:=igGeom2dOrientClockwise)
    'Get the Layer Property
    strDfltlayer = objEllipse1.Layer
    Call objSheet.Layers.Add("Testing")
    'Set the Ellipse to new Layer
    objEllipse1.Layer = "Testing"
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objSheet = Nothing
    Set objEllipses = Nothing
    Set objEllipse1 = Nothing
End Sub
See Also

Ellipse2d Object  | Ellipse2d Members