mphselectbox
Select geometric entity using a rubberband/box.
Syntax
n = mphselectbox(model,geomtag,boxcoord,entity,...)
Description
n = mphselectbox(model,geomtag,boxcoord,entity,...) returns the indices of the geometry entities that are inside the rubberband domain (rectangle or box). This method looks only on the vertex coordinates and does not observe all points on curves and surfaces.
boxcoord set the coordinates of the selection domain, specified as a Nx2 array, where N is the geometry space dimension.
entity can be one of point, edge, boundary, or domain following the entity space dimension defined below:
domain: maximum geometry space dimension
boundary: maximum geometry space dimension 1
edges: 1 (for 3D geometries only)
The function mphpselectbox accepts the following property/value pairs:
When a model uses form an assembly, more than one vertex can have the same coordinate if the coordinate is shared by separate geometry objects. In that case you can use the adjnumber property to identify the domain that the vertices should be adjacent to.
Example
Find the domains using a box selection:
model = mphopen('model_tutorial_llmatlab');
coordBox = [-1e-3 11e-3;-1e-3 11e-3;9e-3 11e-3];
n = mphselectbox(model,'geom1',coordBox,'domain');
Find the boundaries inside the selection box:
n = mphselectbox(model,'geom1',coordBox,'boundary');
Find the boundaries inside the selection box that are adjacent to domain number 1:
n = mphselectbox(model,'geom1',coordBox,'boundary',...
'adjnumber',1);
Find geometric entity number in an assembly
model = mphopen('model_tutorial_llmatlab');
geom = model.component('comp1').geom('geom1');
geom.feature('fin').set('action','assembly');
geom.run('fin');
Find the boundaries within a box:
coordBox = [-1e-3,51e-3;-1e-3,51e-3;9e-3,11e-3];
n = mphselectbox(model,'geom1',coordBox,'boundary');
Find the boundary adjacent to domain 2:
n = mphselectbox(model,'geom1',coordBox,'boundary',...
'adjnumber',2);
See also
mphgetadj, mphgetcoords, mphselectcoords, mphviewselection