Evaluates the edge for the specified U parameter.
.NET Syntax
Visual Basic (Declaration) | |
---|
Function Evaluate2( _
ByVal Parameter As System.Double, _
ByVal NumberOfDerivatives As System.Integer _
) As System.Object |
Visual Basic (Usage) | |
---|
Dim instance As IEdge
Dim Parameter As System.Double
Dim NumberOfDerivatives As System.Integer
Dim value As System.Object
value = instance.Evaluate2(Parameter, NumberOfDerivatives) |
Parameters
- Parameter
- Curve parameter U value (see Remarks)
- NumberOfDerivatives
- Number of derivatives (see Remarks)
Return Value
Array of doubles (see
Remarks)
Example
- Open a part in SOLIDWORKS.
- Open an Immediate window.
- Select an edge.
- Run this VBA macro:
=========================================================
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As BooleanDim longstatus As Long, longwarnings As Long
Type DoubleRec
dValue As Double '64 bits, 8 bytes
End Type
Type Int2Rec
iLower As Long '4 bytes
iUpper As Long '4 bytes
End Type
' Unpack the status double
Function DoubleToLong(ByVal dVal As Double) As Long
Dim dr As DoubleRec
Dim i2r As Int2Rec
' Set the double value
dr.dValue = dVal
' Copy the values
LSet i2r = dr
' Extract the status value
DoubleToLong = i2r.iLower
End Function
Sub main()
Dim status As Long
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myModelView As SldWorks.ModelView
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
Dim swSelectMgr As SldWorks.SelectionMgr
Set swSelectMgr = Part.SelectionManager
Dim swEdge As SldWorks.Edge
Set swEdge = swSelectMgr.GetSelectedObject6(1, -1)
Dim swCurve As SldWorks.Curve
Dim swCurveParamData As SldWorks.CurveParamData
Set swCurve = swEdge.GetCurve
Set swCurveParamData = swEdge.GetCurveParams3
Debug.Print "The maximum U parameter value is: " & swCurveParaData.UMaxValue
Debug.Print "The minimum U parameter value is: " & swCurveParaData.UMinValue
Dim pt As Variant
pt = swEdge.Evaluate2(swCurveParaData.UMaxValue, 0)
status = DoubleToLong(pt(UBound(pt)))
If status Then
Debug.Print " The evaluated point at UMax is: = " & pt(0) & ", " & pt(1) & ", " & pt(2)
Else
Debug.Print "***** Error!"
End If
End Sub
====================================================================
Remarks
See Also