## NurbsSurfaceMesh.AddSurfaceWithTrim

### Description

Adds a trimmed surface to the mesh.

### C# Syntax

    NurbsSurface NurbsSurfaceMesh.AddSurfaceWithTrim( Object in_vsaControlPoints, Object in_vsadUKnots, Object in_vsadVKnots, Boolean in_bUClosed, Boolean in_bVClosed, Int32 in_lUDegree, Int32 in_lVDegree, siKnotParameterization in_eUParam, siKnotParameterization in_eVParam, siNurbsFormat in_eNurbsFormat, Int32 in_lNbTrim, Object in_vsabIsBoundary, Object in_vsalProjectionType, Object in_vsalNbCurve, Object in_vsaCurveControlPoints, Object in_vsaCurveNbControlPoints, Object in_vsaCurveParam, Object in_vsaCurveKnots, Object in_vsaCurveNbKnots, Object in_vsaCurveDegree, Object in_vsaCurveClosed );

### Scripting Syntax

    oReturn = NurbsSurfaceMesh.AddSurfaceWithTrim( [ControlPoints], [UKnots], [VKnots], [UClosed], [VClosed], [UDegree], [VDegree], [UParam], [VParam], [NurbsFormat], [NbTrim], [IsBoundary], [ProjectionType], [NbCurve], [CurveControlPoints], [CurveNbControlPoints], [CurveParam], [CurveKnots], [CurveNbKnots], [CurveDegree], [CurveClosed] );

### Return Value

NurbsSurface

### Parameters

Parameter | Type | Description
--- | --- | ---
ControlPoints | 1D or 3D Array | The control points used for creating the nurbs surface. The control points can be stored in a 1-dimensional array or in a 3-dimensional matrix (UxVx4) of x,y,z,w values. The 1 dimensional array should contain the number of points in U and V at the beginning followed by a sequence of x,y,z,w values e.g. {U,V,Xo,Yo,Zo,...X(uv-1),Y(uv-1),Z(uv-1),W(uv-1)}.
UKnots | Array of Doubles | A vector of knot values in the U direction.
VKnots | Array of Doubles | An array of knot values in the V direction.
UClosed | Boolean | Specifies whether the nurbs surface is closed or not in U direction. Default Value: false
VClosed | Boolean | Specifies whether the nurbs surface is closed or not in V direction. Default Value: false
UDegree | Long | Degree of the nurbs surface in U direction. Default Value: 3
VDegree | Long | Degree of the nurbs surface in V direction. Default Value: 3
UParam | siKnotParameterization | The parameterization factor of the nurbs surface in U direction. Default Value: siNonUniformParameterization
VParam | siKnotParameterization | The parameterization factor of the nurbs surface in V direction. Default Value: siNonUniformParameterization
NurbsFormat | siNurbsFormat | Specifies how the data is formatted. Default Value: siSINurbs
NbTrim | Long | Specifies how many trims this surface contains. Default Value: 0
IsBoundary | Array of Booleans | Specifies whether each trim is a boundary.
ProjectionType | Array of Longs | Specifies the projection type of each trim. Each member of the array maps to a single trim, so the array is actually a combination of the possible values (0 and 1).
Possible Values: | Description:
0 | UV space
1 | World space
NbCurve | Array of Longs | Number of nurbs curves in each trim
CurveControlPoints | 2D Array of 2D Array | Array where each set of control points is stored in a 2-dimensional array. The array is 4 x Number of ControlPoints.
CurveNbControlPoints | Array of Array of Longs | Specifies the number of ControlPoints per NurbsCurve per trim.
CurveParam | Array of Array of siKnotParameterization values | The parameterization factor of the nurbs curve for each trim.
CurveKnots | Array of Array of Doubles | An array of knot values for each trim.
CurveNbKnots | Array of Array of Longs | Specifies the number of Knots per nurbs curve per trim.
CurveDegree | Array of Array of Longs | Degree of the nurbs curves for each trim. Default Value: 3
CurveClosed | Array of Array of Booleans | Specifies whether the nurbs curve is closed for each trim. Default Value: False

### Examples

#### VBScript Example

    ' This example creates a sphere with a circular trim
    Dim lDegree(2), bClosed(2), eParameterization(2), aControlPoints, aKnots(2)
    ' Extract data from a sphere nurbs surface
    set oRoot = Application.activeproject.activescene.root
    set oSphere = oRoot.AddGeometry( "Sphere", "NurbsSurface" )
    oSphere.ActivePrimitive.Geometry.Surfaces(0).Get _
            siSINurbs, _
            aControlPoints, _
            aKnots(siUDirection),aKnots(siVDirection) , _
            bClosed(siUDirection),bClosed(siVDirection), _
            lDegree(siUDirection),lDegree(siVDirection), _
            eParameterization(siUDirection),eParameterization(siVDirection)
    ' Extract data from a cricular curve for the trim
    set oCurve = CreatePrim("Circle", "NurbsCurve")
    Dim lCDegree, bCClosed, eCParameterization, aCControlVertex, aCKnots, lCCount, aCNbControlVertex
    oCurve.ActivePrimitive.geometry.get _
            siSINurbs, _
            lCCount, _
            aCControlVertex, _
            aCNbControlVertex, _
            aCKnots , _
            aCNbKnots, _
            bCClosed, _
            lCDegree, _
            eCParameterization
    ' Create the trimmed surface
    set oNew = oRoot.AddNurbsSurfaceMesh
    oNew.ActivePrimitive.Geometry.AddSurfaceWithTrim _
            aControlPoints, _
            aKnots(siUDirection),aKnots(siVDirection) , _
            bClosed(siUDirection),bClosed(siVDirection), _
            lDegree(siUDirection),lDegree(siVDirection), _
            eParameterization(siUDirection),eParameterization(siVDirection), _
            siSINurbs, _
            1, _
            array(True), _
            array(0), _
            array(lCCount), _
            array(aCControlVertex), _
            array(aCNbControlVertex), _
            array(eCParameterization), _
            array(aCKnots) , _
            array(aCNbKnots), _
            array(lCDegree), _
            array(bCClosed)