Share via


Page.DrawNURBS Method

Visio Automation Reference

Creates a new shape whose path consists of a single NURBS (nonuniform rational B-spline) segment.

Version Information
 Version Added:  Visio 2000

Syntax

expression.DrawNURBS(degree, Flags, xyArray(), knots(), weights)

expression   A variable that represents a Page object.

Parameters

Name Required/Optional Data Type Description
degree Required Integer The spline's degree; an integer between 1 and 25.
Flags Required Integer Flags that influence how the shape is drawn.
xyArray() Required Double An array of alternating x and y values that define the control points coordinates; use internal drawing units (inches).
knots() Required Double An array of knots.
weights Optional Variant An array of weights.

Return Value
Shape

Remarks

The DrawNURBS method creates a new shape whose path consists of a single NURBS segment as specified by the arguments.

The control points should be in internal drawing units (inches) with respect to the coordinate space of the page, master, or group in which the new shape is being created. The xyArray, knots, and weights arrays should be of type SAFEARRAY of 8-byte floating point values passed by reference (VT_R8|VT_ARRAY|VT_BYREF). This is how Microsoft Visual Basic passes arrays to Automation objects.

The knots argument is unit-less. The sequence of knots should be non-decreasing. In other words, knots(i + 1) < knots(i) is not acceptable. knots(i + 1) = knots(i) is permitted, and then the value is repeated, but the following restrictions apply:

  • The first knot may not be repeated more than degree + 1 times.
  • The last knot may not be repeated.
  • Any knot between the first and last may not be repeated more than degree times.
  • If the first knot is repeated less than degree + 1 times, the spline is periodic.
  • The list of weights is optional. Its absence signals that the spline is non-rational. Weights are unit-less.

The following rules apply to the sizes of the lists. For a spline with n control points:

  • If the spline is periodic, n > 2. Otherwise, n > degree.
  • The size of xyArray is 2n.
  • The size of the weights array is n (if present).
  • The size of the knots array is n + 1.

The conventional non-periodic spline requires n + degree + 1 knots, but the application implies the repeated knots at the end. For example, the degree 2 knot list (0,0,0,2,5,8) is interpreted in the application as the conventional knot sequence (0,0,0,2,5,8,8,8).

The Flags parameter is a bitmask that specifies options for drawing the new shape. Its value should be either zero (0) or visSpline1D (8). If Flags is visSpline1D and if the first and last points in xyArray don't coincide, the DrawNURBS method produces a shape with one-dimensional (1-D) behavior; otherwise, it produces a shape with two-dimensional (2-D) behavior.

If the first and last points in xyArray do coincide, the DrawNURBS method produces a filled shape.

See Also