## DuplicateMeshComponent

### Introduced

v1.5

### Description

Duplicates (aka: extrudes) a mesh component

### Scripting Syntax

    DuplicateMeshComponent( [ConnectionSet], [ImmediateMode], [Length], [NbSubdivs], [Merge], [Tx], [Ty], [Tz], [Rx], [Ry], [Rz], [Sx], [Sy], [Sz], [DuplicatePolygons] );

### Parameters

Parameter | Type | Description
--- | --- | ---
ConnectionSet | ConnectionSet | Specifies the components to duplicate (extrude). Default Value: Currently selected objects are used as the main group. Warning: An error occurs if the connection set is invalid. Please verify the connection set required for this operator to avoid breaking your scripts.
ImmediateMode | siOperationMode | Specifies whether or not the operator should be immediately frozen. Default Value: siPersistentOperation
Length | Double | Length of the extrusion Default Value: 0
NbSubdivs | Long | Number of subdivisions to use Default Value: 0
Merge | Boolean | Whether or not adjacent components should be handled as a whole or independently Default Value: 1
Tx | Double | Translation in X to apply to each subdivision Default Value: 0
Ty | Double | Translation in Y to apply to each subdivision Default Value: 0
Tz | Double | Translation in Z to apply to each subdivision Default Value: 0
Rx | Double | Euler Rotation in X to apply to each subdivision Default Value: 0
Ry | Double | Euler Rotation in Y to apply to each subdivision Default Value: 0
Rz | Double | Euler Rotation in Z to apply to each subdivision Default Value: 0
Sx | Double | Scaling in X to apply to each subdivision Default Value: 1
Sy | Double | Scaling in Y to apply to each subdivision Default Value: 1
Sz | Double | Scaling in Z to apply to each subdivision Default Value: 1
DuplicatePolygons | Boolean | Specifies if polygons should be duplicated (TRUE) or extruded (FALSE) Default Value: 0

### Examples

#### VBScript Example

    'This example will duplicate  an edge.

    newscene

    'Create 4 spheres and place them

    CreatePrim "Sphere", "MeshSurface", "Sphere1"

    CreatePrim "Sphere", "MeshSurface", "Sphere2"

    CreatePrim "Sphere", "MeshSurface", "Sphere3"

    CreatePrim "Sphere", "MeshSurface", "Sphere4"

    Translate "Sphere1", -8, 8,  0, siAbsolute, siParent, siObj, siXYZ

    Translate "Sphere2",  8, 8,  0, siAbsolute, siParent, siObj, siXYZ

    Translate "Sphere3", -8, -8, 0, siAbsolute, siParent, siObj, siXYZ

    Translate "Sphere4",  8, -8, 0, siAbsolute, siParent, siObj, siXYZ

    'Duplicate polygons (extrude) along common normal.

    'Duplicate is 10 SOFTIMAGE units long and has 10 subdivisions.

    'First case polygons are merged

    'Second case, they are not merged.  Note how they move along their local normal

    DuplicateMeshComponent "sphere1.poly[12,13,20,21]", siUnspecified, 10, 10, True

    DuplicateMeshComponent "sphere1.poly[10,18]", siUnspecified, 10, 10, False

    'Same basic duplication as previous but with translation in X of 1 unit at each step.

    'X translation is applied in the local reference frame of the selected polygons.

    DuplicateMeshComponent "sphere2.poly[12,13,20,21]", siUnspecified, 10, 10, True, 1,0,0

    DuplicateMeshComponent "sphere2.poly[10,18]", siUnspecified, 10, 10, False, 1,0,0

    'Same basic duplication as previous but with rotation around Y axis of 10 degrees (normal to the polygons).

    'Y axis rotation is applied in the local reference frame of the selected polygons.

    DuplicateMeshComponent "sphere3.poly[12,13,20,21]", siUnspecified, 10, 10, True, 1, 0, 0, 0, 10, 0

    DuplicateMeshComponent "sphere3.poly[10,18]", siUnspecified, 10, 10, False, 1, 0, 0, 0, 10, 0

    'Same basic duplication as previous but with scaling factor of 0.8 in X and Z of 0.8.

    'X and Z scaling is applied in the local reference frame of the selected polygons.

    DuplicateMeshComponent "sphere4.poly[12,13,20,21]", siUnspecified, 10, 10, True, 1, 0, 0, 0, 10, 0, 0.8, 1, 0.8

    DuplicateMeshComponent "sphere4.poly[10,18]", siUnspecified, 10, 10, False, 1, 0, 0, 0, 10, 0, 0.8, 1, 0.8

    'Duplicate also applies to other components: points and edges

    DuplicateMeshComponent "sphere1.pnt[100]", siUnspecified, 10, 10

    DuplicateMeshComponent "sphere2.edge[204]", siUnspecified, 10, 10

    'Duplicated objects can be mixed. Here we apply duplicate to points and edges.

    DuplicateMeshComponent "sphere3.pnt[100], sphere3.edge[204]", siUnspecified, 10, 10

### See Also

ApplyTopoOp