Mesh > Mesh Commands > Copy

Copy
Copy a mesh.
Syntax
model.mesh(<tag>).create(<ftag>,"Copy");
model.mesh(<tag>).feature(<ftag>).selection(property);
model.mesh(<tag>).feature(<ftag>).create(<ftag1>,maptype);
Description
Use model.mesh(<tag>).create(<ftag>,"Copy") to copy a mesh between mesh sequences. Any mesh sequence can be used as the source of the operation, whereas the destination sequence cannot contain an imported mesh. The dimension of the source sequence must be less than or equal to the dimension of the destination sequence.
The following properties are available:
auto | singlecopy | arraycopy
on | off
Use the properties source and destination to specify the geometric entities of the source and destination. The copymethod property determines if many-to-one or many-to-many copying is used.
Example
The following example shows how to use the Copy feature with a modified geometry from an imported mesh,
Code for use with Java
Model model = ModelUtil.create("Model");
model.modelNode().create("comp1");
GeomSequence geom1 = model.geom().create("geom1", 2);
geom1.create("c1", "Circle");
MeshSequence mesh1 = model.mesh().create("mesh1", "geom1");
mesh1.run();
 
model.modelNode().create("comp2");
GeomSequence geom2 = model.geom().create("geom2", 2);
GeomFeature imp1 = geom2.create("imp1", "Import");
imp1.set("type", "mesh");
imp1.set("mesh", "mesh1");
GeomFeature r1 = geom2.create("r1", "Rectangle");
r1.set("size", new String[]{"3", "3"});
r1.set("base", "center");
 
MeshSequence mesh2 = model.mesh().create("mesh2", "geom2");
MeshFeature copy1 = mesh2.create("copy1", "Copy");
copy1.set("mesh", "mesh1");
copy1.set("dimension", 2);
copy1.selection("source").set(1);
copy1.selection("destination").set(2);
mesh2.run();
Code for use with MATLAB
model = ModelUtil.create('Model');
model.modelNode.create('comp1');
geom1 = model.geom.create('geom1', 2);
geom1.create('c1', 'Circle');
mesh1 = model.mesh.create('mesh1', 'geom1');
mesh1.run;
 
model.modelNode.create('comp2');
geom2 = model.geom.create('geom2', 2);
imp1 = geom2.create('imp1', 'Import');
imp1.set('type', 'mesh');
imp1.set('mesh', 'mesh1');
r1 = geom2.create('r1', 'Rectangle');
r1.set('size', {'3', '3'});
r1.set('base', 'center');
 
mesh2 = model.mesh.create('mesh2', 'geom2');
copy1 = mesh2.create('copy1', 'Copy');
copy1.set('mesh', 'mesh1');
copy1.set('dimension', 2);
copy1.selection('source').set(1);
copy1.selection('destination').set(2);
mesh2.run;
See Also
CopyEdge, CopyFace, CopyDomain