Solid Edge FrameworkSupport Type Library
BringToFront Method
Description
Changes the display order of the referenced object by moving it in front of all other overlapping objects.
Syntax
Visual Basic
Public Sub BringToFront() 
Remarks
This command is useful when objects are hidden by other objects that are filled and have a higher priority display. The BringForward method can also be used.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFrameWork.Application
    Dim objDoc As SolidEdgeDraft.DraftDocument
    Dim objSheet As SolidEdgeDraft.Sheet
    Dim objDatumTargets As SolidEdgeFrameworkSupport.DatumTargets
    Dim objDatumTarget As SolidEdgeFrameworkSupport.DatumTarget
    Dim objDatumTarget1 As SolidEdgeFrameworkSupport.DatumTarget
    Dim objLine As SolidEdgeFrameworkSupport.Line2d
    Dim lngZorderbfr As Long
    ' 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
    'Getting the DatumTargets object
    Set objDatumTargets = objSheet.DatumTargets
    'Create a Datum target in the active sheet
    Set objDatumTarget = objDatumTargets.Add(x1:=0.3, y1:=0.25, z1:=0.25)
    'Add a Text to the Datum Target
    objDatumTarget.DatumReference = "A"
    'Get the ZOrder of the DatumTarget befor drawing the other elements
    lngZorderbfr = objDatumTarget.ZOrder
    'Add a vertex at the end
    Call objDatumTarget.AddVertex(x:=0.35, y:=0.3, z:=0)
    'Draw a Line in the active sheeet
    Set objLine = objSheet.Lines2d.AddBy2Points(x1:=0.6, y1:=0.15, _
                                                x2:=0.1, y2:=0.4)
    'Create another Datum target in the active sheet
    Set objDatumTarget1 = objDatumTargets.Add(x1:=0.25, y1:=0.35, z1:=0)
    'Add a Text to the DatumTarget1
    objDatumTarget1.DatumReference = "B"
    'Add a vertex at the end to the DatumTarget1
    Call objDatumTarget1.AddVertex(x:=0.35, y:=0.15, z:=0)
    'Bring forward first Datum Target
    objDatumTarget.BringToFront
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objSheet = Nothing
    Set objDatumTargets = Nothing
    Set objDatumTarget = Nothing
    Set objDatumTarget1 = Nothing
    Set objLine = Nothing
End Sub
See Also

DatumTarget Object  | DatumTarget Members

Send comments on this topic.