Hide Table of Contents

Get B-Spline Surface Parameterization Data Example (VB.NET)

This example shows how to get B-spline parameterization data for a selected face or surface.

' Preconditions:
' 1.  Open public_documents\samples\tutorial\molds\telephone.sldprt.
' 2.  Select a face.
' 3.  Open the Immediate Window.
' Postconditions: Examine the Immediate window.
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System
Imports System.Diagnostics

Partial Class SolidWorksMacro

Sub main()

Dim swModel As ModelDoc2
Dim swSelMgr As SelectionMgr
Dim swFace As Face2
Dim swSurf As Surface
Dim swSurfParam As SurfaceParameterizationData
Dim swBSurfParam As BSurfParamData
Dim sense As Boolean
        Dim UKnots As Object
        Dim VKnots As Object
        Dim vCtrlPts As Object
        Dim i As Integer

        swModel = swApp.ActiveDoc
        swSelMgr = swModel.SelectionManager
        swFace = swSelMgr.GetSelectedObject5(1)
        swSurf = swFace.GetSurface
        swSurfParam = swSurf.Parameterization2
"File = " & swModel.GetPathName)
"  Surface:")
" U minimum is: " & swSurfParam.UMin)
" U minimum bound type is: " & swSurfParam.UMinBoundType)
" U maximum is: " & swSurfParam.UMax)
" U maximum bound type is: " & swSurfParam.UMaxBoundType)
" U property count is: " & swSurfParam.UPropertyNumber)
Dim varUProperties As Object
        varUProperties = swSurfParam.UProperties
" U properties: ")
For i = 0 To UBound(varUProperties)
"    " & varUProperties(i))
Next i

" V minimum is: " & swSurfParam.VMin)
" V minimum bound type is: " & swSurfParam.VMinBoundType)
" V maximum is: " & swSurfParam.VMax)
" V maximum bound type is: " & swSurfParam.VMaxBoundType)
" V property count is: " & swSurfParam.VPropertyNumber)
Dim varVProperties As Object
        varVProperties = swSurfParam.VProperties
" V properties: ")
For i = 0 To UBound(varVProperties)
"    " & varVProperties(i))
Next i

        swBSurfParam = swSurf.GetBSurfParams3(
False, False, swSurfParam, 0.01, sense)

"U order is: " & swBSurfParam.UOrder)
"V order is: " & swBSurfParam.VOrder)
" Control point column count is: " & swBSurfParam.ControlPointColumnCount)
" Control point row count is: " & swBSurfParam.ControlPointRowCount)
" Control point dimension is: " & swBSurfParam.ControlPointDimension)
" U periodicity is: " & swBSurfParam.UPeriodicity)
" V periodicity is: " & swBSurfParam.VPeriodicity)

        UKnots = swBSurfParam.UKnots
"Knot vector in the U direction: ")
For i = 0 To UBound(UKnots)
Next i
        VKnots = swBSurfParam.VKnots
"Knot vector in the V direction: ")
For i = 0 To UBound(VKnots)
Next i

' Get control points in row = 2, column = 3 of the control point matrix
        vCtrlPts = swBSurfParam.GetControlPoints(2, 3)
"Control point at row=2 and column=3: ")
For i = 0 To UBound(vCtrlPts)
Next i
End Sub

    Public swApp As SldWorks

End Class

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   Get B-Spline Surface Parameterization Data Example (VB.NET)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2018 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.