Import mphbin/mphtxt
Import geometry objects from a file using COMSOL Multiphysics geometry formats: binary or text.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"Import");
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>).importData();
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>,"Import") to create a geometry import feature. When the property filename is set to a file recognized as an MPHBIN- or MPHTXT-file, the property type is set to native and the following properties are available:
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
all | obj | dom | bnd | edg | 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.
on | off
all | dom | bnd | edg | pnt | off
Show selections, when selindividual is on, of individual objects in physics, materials, and so on; in part instances; or in 3D from a plane geometry.
The file specified by filename can be of any of the following formats:
The imported objects are represented using COMSOL’s geometry kernel or the CAD Import Module’s geometry kernel (Parasolid).
The method
model.component(<ctag>).geom(<tag>).feature(<ftag>).importData()
imports the file again.
If selresult is set to on, a selection is created for all resulting entities of each type (object, domain, boundary, edge, and point), for use in the geometry sequence. To access the object selection, use model.geom(<tag>).selection(<ftag>), where <tag> is the geometry tag and <ftag> is the feature tag. To access the other selections, use model.geom(<tag>).selection(<ftag>.<lvl>), where <tag> is the geometry tag, <ftag> is the feature tag, and <lvl> is one of dom, bnd, edg, or pnt (edg is not available for DXF import in 2D). If, in addition, selresultshow is set to a value other than off, all or some of these selections appear for use outside the geometry sequence. To access these selections, use model.selection(<tag>_<ftag>_<lvl>), where <tag> is the geometry tag, <ftag> is the feature tag, and <lvl> is one of dom, bnd, edg, or pnt (edg is not available for DXF import in 2D).
If selindividual is set to on, a selection is created for all resulting entities of each type (object, domain, boundary, edge, and point) of each individual object, for use in the geometry sequence. To access the object selections, use model.geom(<tag>).selection(<otag>), where <otag> is a tag derived from the name of the imported object. For standard object names of the form <ftag>(<n>), where <n> is an object number, the corresponding <otag> is <ftag>_<n>. To access the other selections, use model.geom(<tag>).selection(<otag>_<lvl>), where <otag> is a tag derived from the name of the imported object. If, in addition, selindividualshow is set to a value other than off, all or some of these selections appear for use outside the geometry sequence. To access these selections, use model.selection(<tag>_<otag>_<lvl>), where <otag> is a tag derived from the name of the imported object. For standard object names of the form <ftag>(<n>), where <n> is an object number, the corresponding <otag> is <ftag>_<n>.
The following attributes are available:
Table 3-101: Valid attributes
on | off