Solid Edge FrameworkSupport Type Library
SetConnectElementEx Method
Object as Input
Input IsKeyPoint as Boolean
Specify X coordinate as double
Specify Y coordinate as double
Specify Z coordinate as double
Description
Sets connect element data. Object must be 2d geometry, reference, or edge or vertex (for PMI).
Syntax
Visual Basic
Public Sub SetConnectElementEx( _
   ByVal Object As Object, _
   ByVal IsKeyPoint As Boolean, _
   ByVal x As Double, _
   ByVal y As Double, _
   ByVal z As Double _
) 
Parameters
Object
Object as Input
IsKeyPoint
Input IsKeyPoint as Boolean
x
Specify X coordinate as double
y
Specify Y coordinate as double
z
Specify Z coordinate as double
Example
Imports System.Runtime.InteropServices
Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objApp As SolidEdgeFramework.Application
        Dim objDoc As SolidEdgePart.PartDocument
        Dim objLeaders As SolidEdgeFrameworkSupport.Leaders
        Dim objLeader As SolidEdgeFrameworkSupport.Leader
        Dim objPMI As SolidEdgeFrameworkSupport.PMI
        Dim objEdges As SolidEdgeGeometry.Edges
        Dim objEdge1 As SolidEdgeGeometry.Edge
        Dim objEdge2 As SolidEdgeGeometry.Edge
        Dim objAnnotPlane As SolidEdgePart.RefPlane
        Dim objAnnotInitData As SolidEdgeFrameworkSupport.AnnotInitData
        Dim dblStartPoint1() As Double
        Dim dblEndPoint1() As Double
        Dim dblStartPoint2() As Double
        Dim dblEndPoint2() As Double
        Dim objBaseProfile As SolidEdgePart.Profile
        Dim objBaseProfileArray(0 To 2) As SolidEdgePart.Profile
        Dim objBaseModel As SolidEdgePart.Model

        Try
            'Get Application object
            objApp = Marshal.GetActiveObject("SolidEdge.Application")
            'Add Part document 
            objDoc = objApp.Documents.Add("SolidEdge.PartDocument")

            ' *** Creating the base feature
            ' Creating the profile for the base feature and validating it
            objBaseProfile = objDoc.ProfileSets.Add.Profiles.Add(pRefPlaneDisp:=objDoc.RefPlanes(1))
            Call objBaseProfile.Circles2d.AddByCenterRadius(x:=0, y:=0, Radius:=0.025)
            objBaseProfile.Visible = False
            ' Creating the base extruded protrusion and validating it
            objBaseProfileArray(0) = objBaseProfile
            objBaseModel = objDoc.Models.AddFiniteExtrudedProtrusion(NumberOfProfiles:=1, _
                                                                         ProfileArray:=objBaseProfileArray, ProfilePlaneSide:=SolidEdgePart.FeaturePropertyConstants.igSymmetric, ExtrusionDistance:=0.1)

            objPMI = Nothing
            objDoc.PMI_ByModelState(objPMI)
            If Err().Number() > 0 Or objPMI Is Nothing Then
                Exit Sub
            End If

            'Get the Leader collection from the PMI object
            objLeaders = objPMI.Leaders

            objEdges = objDoc.Models.Item(1).ExtrudedProtrusions.Item(1).Edges(SolidEdgeConstants.FeatureTopologyQueryTypeConstants.igQueryAll)
            objEdge1 = objEdges.Item(2)
            objEdge2 = objEdges.Item(1)

            objAnnotPlane = objDoc.RefPlanes.Item(3)

            objAnnotInitData = objLeaders.AnnotInitData

            dblStartPoint1 = {0.0}
            dblEndPoint1 = {0.0}
            objEdge1.GetEndPoints(StartPoint:=dblStartPoint1, EndPoint:=dblEndPoint1)

            dblStartPoint2 = {0.0}
            dblEndPoint2 = {0.0}
            objEdge2.GetEndPoints(StartPoint:=dblStartPoint2, EndPoint:=dblEndPoint2)

            'create Leader with terminator and connect element.
            Call objAnnotInitData.ClearTerminatorElement()
            Call objAnnotInitData.SetPlane(objAnnotPlane)
            Call objAnnotInitData.SetTerminatorElementEx(objEdge1, False, dblStartPoint1(0), dblStartPoint1(1), dblStartPoint1(2))
            Call objAnnotInitData.SetConnectElementEx(objEdge2, True, dblStartPoint2(0), dblStartPoint2(1), dblStartPoint2(2))

            objLeader = objLeaders.AddLeader(AnnotInitData:=objAnnotInitData, x:=0.24, y:=0.05, z:=0.05)


        Catch ex As Exception
            Console.WriteLine(ex.ToString)
        End Try

    End Sub

End Class
See Also

AnnotInitData Object  | AnnotInitData Members