Block
Create a right-angled solid or surface block in 3D.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"Block");
model.component(<ctag>).geom(<tag>).feature(<ftag>).set(property,<value>);
model.component(<ctag>).geom(<tag>).feature(<ftag>).getType(property);
Description
Use model.component(<ctag>).geom(<tag>).create(<ftag>,"Block") to create a block. The following properties are available:
Direction of the edge on the local z-axis. Vector has length 3 if axistype is cartesian, and length 2 if axistype is spherical.
x | y | z | cartesian | spherical
corner | center
Positions the object either centered about pos or with one corner in pos.
none | custom | integer between 1 and the number of colors in the current theme
The color to use. Active when color is set to custom.
on | off
on | off
on | off
on | off
on | off
on | off
solid | surface
on | off
all | obj | dom | bnd | edg | pnt | off
Show selections, if selresult is on, of resulting objects in physics, materials, and so on, or in part instances. obj is not available in a component’s geometry. dom, bnd, and edg are not available in all features.
this | Part Instance feature
xyplane | Work plane feature
Work Plane feature that defines the coordinate system. The default, xyplane, is the global Cartesian coordinate system.
For information about the selresult and contributeto properties, see Selections of Geometric Entities.
Compatibility
model.component(<ctag>).geom(<tag>).create(<ftag>,"block2") constructs a solid block.
model.component(<ctag>).geom(<tag>).create(<ftag>,"block3") constructs a surface block.
The following properties are also available:
Alias for axis when axistype is spherical.
Alias for axis when axistype is cartesian.
lx, ly, lz
x, y, z
The property const is no longer available.
Example
The following commands create a solid and surface block, where the position is defined in the two alternative ways.
Code for Use with Java
Model model = ModelUtil.create("Model1");
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1",3);
g.create("b1","Block");
g.feature("b1").set("size","1 2.1 0.5");
g.feature("b1").set("base","center");
g.feature("b1").set("pos","1 0 1");
g.feature("b1").set("axis","1 0 0");
g.feature("b1").set("rot",30);
double[] a = g.feature("b1").getDoubleArray("pos");
g.create("b2","Block");
g.feature("b2").set("type","surface");
g.feature("b2").set("size","1 2.1 0.5");
g.feature("b2").set("pos",a);
String b = g.feature("b2").getString("pos");
Code for Use with MATLAB
model = ModelUtil.create('Model1');
model.component.create('comp1');
g = model.component('comp1').geom.create('geom1',3);
g.create('b1','Block');
g.feature('b1').set('size','1 2.1 0.5');
g.feature('b1').set('base','center');
g.feature('b1').set('pos','1 0 1');
g.feature('b1').set('axis','1 0 0');
g.feature('b1').set('rot',30);
a = g.feature('b1').getDoubleArray('pos');
g.create('b2','Block');
g.feature('b2').set('type','surface');
g.feature('b2').set('size','1 2.1 0.5');
g.feature('b2').set('pos',a);
b = g.feature('b2').getString('pos');
See Also
Hexahedron