LineSegment
Create line segments in 2D and 3D.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"LineSegment");
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>).setAttribute(attribute,<value>);
model.component(<ctag>).geom(<tag>).feature(<ftag>).getAttribute(attribute);
Description
Use model.component(<ctag>).geom(<tag>).create(<ftag>,"LineSegment") to create a line segment. The following properties are available:
none | custom | integer between 1 and the number of colors in the current theme
Coordinates for endpoint (with specify2 set to coord).
The color to use. Active when color is set to custom.
Endpoint (with specify2 set to vertex).
on | off
all | obj | dom | bnd | 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.
vertex | coord
vertex | coord
Starting point (with specify1 set to vertex).
this | part-instance feature
xyplane | work-plane feature
For information about the selresult and contributeto properties, see Selections of Geometric Entities.
Additional properties are available with the Design Module, see LineSegment.
The following attributes are available:
Table 3-104: Valid attributes
on | off
Example
The following commands create a block in 3D and a line segment from a vertex in that block to a point with the coordinates (0, 1, 2):
Code for Use with Java
Model model = ModelUtil.create("Model");
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1", 3);
g.create("blk1", "Block");
g.create("ls1", "LineSegment");
g.feature("ls1").set("specify1", "vertex");
g.feature("ls1").set("specify2", "coord");
g.feature("ls1").selection("vertex1").set("blk1(1)", new int[]{1});
g.feature("ls1").set("coord2", new double[]{0, 1, 2});
g.run();
Code for Use with MATLAB
model = ModelUtil.create('Model');
model.component.create('comp1');
g = model.component('comp1').geom.create('geom1', 3);
g.create('blk1', 'Block');
g.create('ls1', 'LineSegment');
g.feature('ls1').set('specify1', 'vertex');
g.feature('ls1').set('specify2', 'coord');
g.feature('ls1').selection('vertex1').set('blk1(1)', 1);
g.feature('ls1').set('coord2', [0, 1, 2]);
g.run;
See Also
 BezierPolygon