Solid Edge Draft Type Library
AddConnectedAnnotationsToSelectSet Method
Description
Adds annotations to select set which are connected to drawing view.
Syntax
Visual Basic
Public Sub AddConnectedAnnotationsToSelectSet() 
Remarks
Function won’t clear the select set before adding the annotations to it.
Example
Imports System.Runtime.InteropServices

Public Class AddConnectedAnnotationstoSelectSet
    Private Sub btnAddConnectedAnnotationstoSS_Click(sender As System.Object, e As System.EventArgs) Handles btnAddConnectedAnnotationstoSS.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim ObjDraftDocument As SolidEdgeDraft.DraftDocument = Nothing
        Dim objSheet As SolidEdgeDraft.Sheet = Nothing
        Dim objDrawingViews As SolidEdgeDraft.DrawingViews = Nothing
        Dim objDrawingView As SolidEdgeDraft.DrawingView = Nothing
        Dim objType As Type = Nothing
        Dim selset As SolidEdgeFramework.SelectSet = Nothing
        Dim i As Integer

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

            If objApplication Is Nothing Then
                ' Get the type from the Solid Edge ProgID
                objType = Type.GetTypeFromProgID("SolidEdge.Application")
                ' Start Solid Edge
                objApplication = Activator.CreateInstance(objType)
                ' Make Solid Edge visible
                objApplication.Visible = True
            End If

            ObjDraftDocument = objApplication.ActiveDocument

            'getting the Active Sheet object
            objSheet = ObjDraftDocument.ActiveSheet
            objDrawingViews = objSheet.DrawingViews
            objDrawingView = objDrawingViews(0)

            'Add dimensions to select set which are connected to Drawing View.
            objDrawingView.AddConnectedAnnotationsToSelectSet()
            selset = ObjDraftDocument.SelectSet
            i = selset.Count
            MsgBox(i.ToString)

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class
See Also

DrawingView Object  | DrawingView Members