Solid Edge Geometry Type Library
GetBSplineData Method
Specifies the total number of poles to be returned in the Poles argument.
Specifies the number of knot values to be returned in the Knots argument.
Specifies the number of weight values to be returned in the Weights argument. If the surface is nonrational, this value is 0. Otherwise, NumWeights is equal to the total number of poles (NumPoles).
Returns the poles that make up the curve.
Returns the knot values that make up the knot vector.
Returns the weights-per-pole when the curve is rational.
Description
Returns the poles, weights, and knots that fully define a non-uniform, rational B-Spline object.
Syntax
Visual Basic
Public Sub GetBSplineData( _
   ByVal NumPoles As Long, _
   ByVal NumKnots As Long, _
   ByVal NumWeights As Long, _
   ByRef Poles() As Double, _
   ByRef Knots() As Double, _
   ByRef Weights() As Double _
) 
Parameters
NumPoles
Specifies the total number of poles to be returned in the Poles argument.
NumKnots
Specifies the number of knot values to be returned in the Knots argument.
NumWeights
Specifies the number of weight values to be returned in the Weights argument. If the surface is nonrational, this value is 0. Otherwise, NumWeights is equal to the total number of poles (NumPoles).
Poles
Returns the poles that make up the curve.
Knots
Returns the knot values that make up the knot vector.
Weights
Returns the weights-per-pole when the curve is rational.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objBody As SolidEdgeGeometry.Body
    Dim objEdges As Object
    Dim objBSplnEdge As SolidEdgeGeometry.Edge
    Dim objBSpln As SolidEdgeGeometry.BSplineCurve
    Const TESTFILE = "T:\vbtests\testcases\Curve3d.par"
    Dim dblPoles() As Double, dblKnots() As Double, dblWts() 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
    ' Open the TestFile
    Set objDoc = objApp.Documents.Open(TESTFILE)
    ' Get the Model object
    Set objBody = objDoc.Models(1).Body
    ' Get Edges Collection object
    Set objEdges = objBody.Edges(EdgeType:=igQuerySpline)
    ' Get a Spline Edge
    Set objBSplnEdge = objEdges(1)
    ' Get the BSpline Curve
    Set objBSpln = objBSplnEdge.Geometry
    ' Get the BSplineCurve Data
    Call objBSpln.GetBSplineData(NumPoles:=16, NumKnots:=20, NumWeights:=0, _
                                 Poles:=dblPoles, Knots:=dblKnots, Weights:=dblWts)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objBody = Nothing
    Set objBSplnEdge = Nothing
    Set objEdges = Nothing
    Set objBSpln = Nothing
End Sub
See Also

BSplineCurve Object  | BSplineCurve Members

Send comments on this topic.