Solid Edge Geometry Type Library
GetLengthAtParam Method
Specifies the parameter from which the length is to be measured.
Specifies the parameter to which the length is to be measured.
Returns the length between the specified parameters.
Description
Returns the length, measured along the curve, from one given parameter to another.
Syntax
Visual Basic
Public Sub GetLengthAtParam( _
   ByVal FromParam As Double, _
   ByVal ToParam As Double, _
   ByRef Length As Double _
) 
Parameters
FromParam
Specifies the parameter from which the length is to be measured.
ToParam
Specifies the parameter to which the length is to be measured.
Length
Returns the length between the specified parameters.
Remarks
If either of the input parameters is out of the bounds of the curve's parametric range, GetLengthAtParam snaps the value to the closest endpoint before computing the Length.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objBody As SolidEdgeGeometry.Body
    Dim objEdge As SolidEdgeGeometry.Edge
    Dim dblFromParam As Double
    Dim dblToParam As Double
    Dim dblLength 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
    ' creating the base feature
    If CreateModel(objDoc) <> "" Then
        MsgBox "Error creating the model"
        Exit Sub
    End If
    ' getting the body object of the model
    Set objBody = objDoc.Models(1).Body
    'getting an edge from the collection of edges of the body
    Set objEdge = objBody.Edges(EdgeType:=igQueryAll).Item(2)
    ' getting the length between two given points on an edge
    dblFromParam = 0
    dblToParam = PI / 2
    Call objEdge.GetLengthAtParam(FromParam:=dblFromParam, ToParam:=dblToParam, Length:=dblLength)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objBody = Nothing
    Set objEdge = Nothing
End Sub
See Also

Edge Object  | Edge Members

Send comments on this topic.