Solid Edge FrameworkSupport Type Library
AddByStartEndEllipse Method
Specifies in radians the angle along the EllipticalArc that defines the start point of the arc.
Specifies in radians the angle along the EllipticalArc that defines the end point of the arc.
Specifies the Ellipse2d object used to generate the EllipticalArc2d object.
Description
Creates an EllipticalArc2d object based on an existing Ellipse object and bounded by a start angle and end angle.
Syntax
Visual Basic
Public Function AddByStartEndEllipse( _
   ByVal StartAngle As Double, _
   ByVal EndAngle As Double, _
   ByVal Ellipse As Ellipse2d _
) As EllipticalArc2d
Parameters
StartAngle
Specifies in radians the angle along the EllipticalArc that defines the start point of the arc.
EndAngle
Specifies in radians the angle along the EllipticalArc that defines the end point of the arc.
Ellipse
Specifies the Ellipse2d object used to generate the EllipticalArc2d object.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objEllipses As SolidEdgeFrameworkSupport.Ellipses2d
    Dim objEllipse As SolidEdgeFrameworkSupport.Ellipse2d
    Dim objEllpArcs As SolidEdgeFrameworkSupport.EllipticalArcs2d
    Dim objEllpArc As SolidEdgeFrameworkSupport.EllipticalArc2d
    Dim dblStart As Double, dblEnd As Double
    ' 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.PartDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    'Create an Ellipses collection object
    Set objEllipses = objDoc.ProfileSets.Add.Profiles.Add(pRefPlaneDisp:= _
                                                          objDoc.RefPlanes(1)).Ellipses2d
    'Create an Ellipse object
    Set objEllipse = objEllipses.AddByCenter(xCenter:=0.04, yCenter:=0.03, _
                                             xMajor:=0.01, yMajor:=0.01, _
                                             Ratio:=0.5, Orientation:=igGeom2dOrientClockwise)
    If objEllipses.Count <> 1 Then
        MsgBox (" Error in the Ellipses2d Property of the Profile object")
    End If
    ' Create an EllipticalArcs2d Collection object
    Set objEllpArcs = objDoc.ProfileSets.Add.Profiles.Add(pRefPlaneDisp:= _
                                                          objDoc.RefPlanes(1)).EllipticalArcs2d
    dblStart = 45 * PI / 180
    dblEnd = 235 * PI / 180
    ' Create an EllipticalArc2d object
    Set objEllpArc = objEllpArcs.AddByStartEndEllipse(StartAngle:=dblStart, EndAngle:=dblEnd, _
                                                      Ellipse:=objEllipse)
    ' Call objEllipse.Delete
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objEllipses = Nothing
    Set objEllipse = Nothing
    Set objEllpArcs = Nothing
    Set objEllpArc = Nothing
End Sub
See Also

EllipticalArcs2d Collection  | EllipticalArcs2d Members

Send comments on this topic.