PartInstance
Create an instance of a geometry part.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"PartInstance");
model.component(<ctag>).geom(<tag>).feature(<ftag>).set(property,<value>);
model.component(<ctag>).geom(<tag>).feature(<ftag>).getType(property);
model.component(<ctag>).geom(<tag>).feature(<ftag>).geom().geomSequenceMethod;
Description
This feature creates an instance of a geometry part with new values of its input parameters. Use model.component(<ctag>).geom(<tag>).feature(<ftag>).geom() to access its local copy of the part.
The following properties are available:
Tag of part to call, or local to use a local part.
The default for part is the first part in model.geom(), or local if there is none.
In 3D, the following additional properties are available to control the positioning of the output objects:
x | y | z | Cartesian | spherical
In 2D, the following additional properties are available to control the positioning of the output objects:
For each geometric entity level (object, domain, boundary, edge, and point) that exists in the geometry, there is in addition the following properties related to the output selections for that level:
on | off
seltaglevel
selnamelevel
all none
selkeeplevel
all off
selshowlevel
where level is obj, dom, bnd, edg, or pnt for geometry objects, domains, boundaries, edges, and points, respectively.
Compatibility
In version 5.1, the following properties were deprecated and replaced:
Example
Create a geometry part that makes a torus of revolution angle a, where a is an argument (default value: 90 degrees). Then add work planes for the two planar face to make it easy to position the result:
Code for Use with Java
Model model = ModelUtil.create("Model1");
GeomSequence p = model.geom().create("part1", "Part", 3);
p.inputParam().set("a", 90);
p.create("tor1", "Torus");
p.feature("tor1").set("angle", "a");
p.run("tor1");
p.create("wp1", "WorkPlane");
p.feature("wp1").set("planetype", "faceparallel");
p.feature("wp1").selection("face").set("tor1", new int[]{1});
p.feature("wp1").set("reverse", "on");
p.create("wp2", "WorkPlane");
p.feature("wp2").set("planetype", "faceparallel");
p.feature("wp2").selection("face").set("tor1", new int[]{6});
Code for Use with MATLAB
model = ModelUtil.create('Model1');
p = model.geom.create('part1', 'Part', 3);
p.inputParam.set('a', 90);
p.create('tor1', 'Torus');
p.feature('tor1').set('angle', 'a');
p.run('tor1');
p.create('wp1', 'WorkPlane');
p.feature('wp1').set('planetype', 'faceparallel');
p.feature('wp1').selection('face').set('tor1', 1);
p.feature('wp1').set('reverse', 'on');
p.create('wp2', 'WorkPlane');
p.feature('wp2').set('planetype', 'faceparallel');
p.feature('wp2').selection('face').set('tor1', 6);
Create two part instances of this geometry part. The first has a = 90 (the default value), and the second has a = 120. The objects are positioned so that the two circular faces match, with a rotation angle of 50 degrees.
Code for Use with Java
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1", 3);
g.create("pi1", "PartInstance");
g.create("pi2", "PartInstance");
g.feature("pi2").setIndex("inputexpr", 120, 0);
g.feature("pi2").set("workplanepart", "wp1");
g.feature("pi2").set("workplanesrc", "pi1");
g.feature("pi2").set("workplane", "wp2");
g.feature("pi2").set("rot", 50);
g.run("pi2");
Code for Use with MATLAB
model.component.create('comp1');
g = model.component('comp1').geom.create('geom1', 3);
g.create('pi1', 'PartInstance');
g.create('pi2', 'PartInstance');
g.feature('pi2').setIndex('inputexpr', 120, 0);
g.feature('pi2').set('workplanepart', 'wp1');
g.feature('pi2').set('workplanesrc', 'pi1');
g.feature('pi2').set('workplane', 'wp2');
g.feature('pi2').set('rot', 50);
g.run('pi2');
See Also
If, ElseIf, Else, EndIf