Import DXF
Import geometry objects from a DXF file to a 2D geometry.
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();
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 a DXF CAD drawing, the property type is set to dxf and the following properties are available:
Read-only property that returns all layers in the DXF file. Access it using model.component(<ctag>).geom(<tag>).feature(<ftag>).
getStringArray('alllayers')
;
none | custom | integer between 1 and the number of colors in the current theme
solid | curve | off
The color to use. Active when color is set to custom.
on | off
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.
on | off
all | dom | bnd | pnt | off
The file specified by filename can be of any of the following formats:
The imported objects are represented using the COMSOL geometry modeler.
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>.
Compatibility
The following property is also supported:
solid | face | curve | off
Alias for convert. The value face is equivalent to solid.