Solid Edge FrameworkSupport Type Library
AddBy2Points Method
The x coordinate of the start point of the line.
The y coordinate of the start point of the line.
The x coordinate of the end point of the line.
The y coordinate of the end point of the line.
Description
Creates a text box by specifying the diagonal points of the text box.
Syntax
Visual Basic
Public Function AddBy2Points( _
   ByVal x1 As Double, _
   ByVal y1 As Double, _
   ByVal x2 As Double, _
   ByVal y2 As Double _
) As Line2d
Parameters
x1
The x coordinate of the start point of the line.
y1
The y coordinate of the start point of the line.
x2
The x coordinate of the end point of the line.
y2
The y coordinate of the end point of the line.
Remarks
This method can also be used to create a SmartFrame2d object by specifying the upper left and lower right corners of the frame.
Example
Imports System.IO
Imports System.Runtime.InteropServices

Module Example
    <STAThread()> _
    Sub Main()

        Dim objApplication As SolidEdgeFramework.Application
        Dim objDraftDocument As SolidEdgeDraft.DraftDocument
        Dim objSheet As SolidEdgeDraft.Sheet
        Dim objLines2d As SolidEdgeFrameworkSupport.Lines2d
        Dim objHzLine2d As SolidEdgeFrameworkSupport.Line2d
        Dim objVtLine2d As SolidEdgeFrameworkSupport.Line2d

        Try
            OleMessageFilter.Register()

            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            objDraftDocument = objApplication.Documents.Add("SolidEdge.DraftDocument")
            objSheet = objDraftDocument.ActiveSheet
            objLines2d = objSheet.Lines2d

            'Add a horizontal line and a vertical line
            objHzLine2d = objLines2d.AddBy2Points(x1:=0.2, y1:=0.2, x2:=0.3, y2:=0.2)
            objVtLine2d = objLines2d.AddBy2Points(x1:=0.35, y1:=0.35, x2:=0.35, y2:=0.25)

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        Finally
            OleMessageFilter.Revoke()
        End Try
    End Sub
End Module
See Also

Lines2d Collection  | Lines2d Members

Send comments on this topic.