Solid Edge Draft Type Library
ShowHideEdgeOverride Property
Specify the index of the object.
Description
Gets or sets a show/hide override on an edge or segment.
Property type
Read-write property
Syntax
Visual Basic
Public Property ShowHideEdgeOverride( _
   Optional ByVal segmentIndex As Variant _
) As DVShowHideEdgeOverrideType
Parameters
segmentIndex
Specify the index of the 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 objApplication As SolidEdgeFramework.Application = Nothing
        Dim objFolder As DirectoryInfo
        Dim objFileInfo As FileInfo
        Dim objDocuments As SolidEdgeFramework.Documents = Nothing
        Dim objDraftDoc As SolidEdgeDraft.DraftDocument
        Dim objSheet As SolidEdgeDraft.Sheet
        Dim dv As SolidEdgeDraft.DrawingView
        Dim dvSheet As SolidEdgeDraft.Sheet = Nothing
        Dim dvline As SolidEdgeDraft.DVLine2d

        Try
            ' Create/get the application with specific settings
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            If objApplication Is Nothing Then
                ' Start Solid Edge
                objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("SolidEdge.Application"))
                objApplication.Visible = True
            End If
            objFolder = GetTrainingFolder()
            objFileInfo = New FileInfo(Path.Combine(objFolder.FullName, "sbddaan.dft"))
            objDocuments = objApplication.Documents
            objDraftDoc = objDocuments.Open(objFileInfo.FullName)

            objDraftDoc = objApplication.ActiveDocument
            'getting the Active Sheet object
            objSheet = objDraftDoc.ActiveSheet
            dv = objSheet.DrawingViews.Item(1)
            dvSheet = dv.Sheet
            dvline = dv.DVLines2d.Item(1)

            If dvline.SegmentedStyleCount > 1 Then
                ' hide the second segment on a multisegment edge
                dvline.ShowHideEdgeOverride(2) = SolidEdgeDraft.DVShowHideEdgeOverrideType.DVShowHideEdgeOverrideHide
            Else
                ' hide the entire edge. If the segment index is not provided, the override will apply to the entire edge.
                dvline.ShowHideEdgeOverride = SolidEdgeDraft.DVShowHideEdgeOverrideType.DVShowHideEdgeOverrideHide
            End If

        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

DVLine2d Object  | DVLine2d Members