Navigation: Scripting Reference Manual > Functions & Subroutines > SetNURBSurfControlPt

 

SetNURBSurfControlPt

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine sets the x,y,z position coordinate and weight factor for a specific control point of a NURB surface.  Indexing into the control points list is given by a single value corresponding to the row of the control point as seen in the GUI.

 

Syntax

SetNURBSurfControlPt nurbNode, cpIndex, x, y, z, w

 

Parameters

nurbNode As Long

Node number of the NURB surface whose control point information is being modified.

 

cpIndex As Long

Index (0 based) into the control point list of a NURB surface for which the x,y,z position and weight values will be modified.  The index value corresponds to the single index as seen in the GUI (i.e. there are N control points, each indexed from 0 to N-1).

 

x As Double

This variable holds the value of the X position coordinate that will be applied to the requested control point.

 

y As Double

This variable holds the value of the Y position coordinate that will be applied to the requested control point.

 

z As Double

This variable holds the value of the Z position coordinate that will be applied to the requested control point.

 

w As Double

This variable holds the value of the control point weight that will be applied to the requested control point.

 

Examples

The example below retrieves the 3rd control point (index 2) from a NURB surface, modifies the weight, sets the modified values back to the NURB surface and then updates the model.

 

Sub Main

 

    Dim nurbNode As Long

    nurbNode = FindFullName( "Geometry.Elem 1.Surf 1" )

 

 

    Dim x As Double, y As Double, z As Double, w As Double

    GetNURBSurfControlPt( nurbNode, 2, x, y, z, w )

    w = w-0.1

    SetNURBSurfControlPt( nurbNode, 2, x, y, z, w )

    Update

 

End Sub

 

See Also

Surface Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC