Commands
Import ECAD
Purpose
Import geometry objects from an ECAD file in 2D and 3D using the ECAD Import Module
Syntax
model.geom(<tag>).feature().create(<ftag>,"Import");
model.geom(<tag>).feature(<ftag>).set(property,<value>);
model.geom(<tag>).feature(<ftag>).getType(property);
model.geom(<tag>).feature(<ftag>).getStringMatrix("layerprop");
model.geom(<tag>).feature(<ftag>).importData();
Description
Use model.geom(<tag>).feature().create(<ftag>,"Import") to create a geometry import feature.
When the property filename is set to a file recognized as an ECAD file, the property ecadtype is automatically initialized to either gds, ipc2581, or odb++. The following properties are available:
gds | ipc2581 | odb++ | unknown
all | layer | none
The grouping of the imported layers, where all returns one single object, and layer gives you one object per layer. In 2D, all is the same as layer.
full3d | shell
on | off
on | off
on | off
auto | relative
on | off
all | obj | dom | bnd | edg | pnt | off
Show selections 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.
on | off
all | dom | bnd | off
Show layer selections in physics, materials, and so on, and in part instances (when sellayer is on). This property is not available in a work plane’s Plane Geometry.
on | off
The file specified by filename can be of any of the following formats:
The imported objects are represented using COMSOL’s geometry modeler.
The property ecadtype determines which properties are available, see Table 3-2 for supported types. The property ecadtype is read only, and it is automatically initialized from the property filename, according to Table 3-2.
The property importlayer determines which layers to import. It is a string array of the same length as the number of layers, holding the strings on or off. The property is initialized with a valid default when setting the property filename.
To inspect available layers in a file, use the method
model.geom(<tag>).feature(<ftag>).getStringMatrix("layerprop");
It returns a String[][], with the same number of rows as the number of layers, that contains information about each layer.
The property height determines the height of all layers. It is a string array of the same length as the number of layers, holding string representations of the layer height, for example 1[mm]. The property is initialized with a valid default when setting the property filename.
The property manualelevation controls how imported layers are positioned in the Z direction. When manualelevation is off, the imported layers are stacked on top of each other with no gaps, so the Z positions are computed from the height property. When manualelevation is on and grouping is set to layer or none, the imported layers are positioned in the Z direction as specified by the elevation property. To switch to manual control of elevations it is recommended to first set manualelevation to on, then set the values for the height and elevation properties.
The property elevation determines the Z-position of all layers. It is a string array of the same length as the number of layers, holding string representations of the layer elevation. The property is initialized with a valid default on these occasions:
when setting the property manualelevation to off,
when manualelevation is off, and the value of the height property is changed,
when manualelevation is off, and the value of the importtype property is changed.
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. 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.
If sellayer is set to on, a selection is created for all resulting entities of the types object, domain, and boundary, of each layer, for use in the geometry sequence. To access the object selections, use model.geom(<tag>).selection(<ftag>_<otag>), where <otag> is a tag derived from the name of the imported layer. <otag> is derived by replacing space and dot characters with underscore characters and removing other characters that are not numbers or uppercase or lowercase English characters (A–Z and a–z). Additionally, if required to make <otag> unique, _<m> is appended, where <m> is an integer. To access the other selections, use model.geom(<tag>).selection(<ftag>_<otag>.dom) or model.geom(<tag>).selection(<ftag>_<otag>.bnd), where <otag> is a tag derived from the name of the imported layer. If, in addition, sellayershow 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>_<otag>_dom) or model.selection(<tag>_<ftag>_<otag>_bnd), where <otag> is a tag derived from the name of the imported layer.
If the file type is GDS, you can create additional selections for each imported cell by using the properties selcell and selcellshow.
Properties that are only available when ecadtype is gds.
auto | manual | off
on | off
on | off
all | dom | bnd | off
Show cell selections in physics, materials, and so on, and in part instances (when selcell is on). This property is not available in a work plane’s Plane Geometry.
on | off
When findarcs is auto or manual, line segments are combined to form arcs. If findarcs is manual, the properties arcdistancetol, arcradiustol, arcminangle, arcmaxangle, and findlines can be used to tune the arc recognition algorithm, otherwise the algorithm tries to determine optimal parameters.
Properties that are only available when ecadtype is ipc2581, odb++.
on | off
on | off
Offset used when ignoreoutsideboard is on. The file unit is used if no unit is specified.
on | off
on | off
on | off
on | off
on | off
on | off
You can use the net selection tag as a key when setting array elements in the other properties by using set(property,<ntag>, value), where <ntag> is a tag derived from the name of the net selection.
To access net selections, use model.selection(<tag>_<ftag>_<ntag>_dom) or model.selection(<tag>_<ftag>_<ntag>_bnd), where <ntag> is the tag of the net selection.