RS 5.12
The uploaded .zip file includes a Pack&Go station and a VB Add-in.
webwiz/40/WireTest4.zip
The API help for ‘Wire.GetLengthAtPoint’ states:
“Returns the curve length from the start point of the wire to the supplied point on the wire.”
This is my code:.
.
dblMyWireLen = bdyMyWire.Shells(0).Wires(0).Length 'get wire length
.
.
'Display data when selection changed
Public Sub SelectionChanged(ByVal sender As Object, ByVal e As GraphicPickEventArgs)
If e.PickedObject IsNot Nothing Then
Dim dblLengthAtPoint As Double 'distance along wire of selected point
dblLengthAtPoint = bdyMyWire.Shells.Item(0).Wires.Item(0).GetLengthAtPoint(e.PickedPosition)
Logger.AddMessage(New LogMessage("Selected object type = " & e.PickedObject.TypeDisplayName & _
"; dblLengthAtPoint = " & dblLengthAtPoint & "; Wire Length = " & dblMyWireLen))
End If
End Sub
When I click at different points on a wire ‘GetLengthAtPoint(e.PickedPosition)’ returns a constant value which is equal to the value returned by Wire.Length.
Is this a bug or have I made an error?
Thanks,
Kevin