Square
Create a solid or curve square in 2D.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"Square");
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>,"Square") to create a square. The following properties are available:
corner | center
Positions the object either centered about pos or with the lower left 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
solid | curve
on | off
all | obj | dom | bnd | pnt | off
Show selections, if selresult is on, in physics, materials, and so on; in part instances; or in 3D from a plane geometry. obj is not available in a component’s geometry. dom, bnd, and edg are not available in all features.
For information about the selresult and contributeto properties, see Selections of Geometric Entities.
Additional properties are available with the Design Module, see Square.
Compatibility
model.component(<ctag>).geom(<tag>).create(<ftag>,"square2") creates a solid square.
model.component(<ctag>).geom(<tag>).create(<ftag>,"square1") creates a curve square.
The following properties are also available:
x, y
The property const is no longer available.
Example
The sequence below creates a unit solid square:
Code for Use with Java
Model model = ModelUtil.create("Model1");
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1",2);
g.create("sq1","Square");
g.run();
Code for Use with MATLAB
model = ModelUtil.create('Model1');
model.component.create('comp1');
g = model.component('comp1').geom.create('geom',2);
g.create('sq1','Square');
g.run;
See Also
Rectangle