The ModelUtil.scanModel method is an advanced tool that scans the raw data (XML) of the model file for a certain node type and collects the tag and label of all nodes that it finds. In most cases, the node type argument is the same as the corresponding API class name of the node. The reason for using this tool is to quickly scan several MPH files for simple information, such as a list of available materials or functions. If you need more sophisticated access to the model, it is easier to open the model file and process the content. Although you need extra time to open the model, scanning with this tool is very limited. It cannot handle backward compatibility, for example, so scanning of older files may not work.
Other examples of extra attributes are "entityComments" and
"entityAuthor", returning the comment and author of each node, respectively.
The scanModel method does not support returning values of settings from, for example,
"getString(name)" methods.
The insert method can be used to insert materials with the following syntax:
The next example inserts the materials tagged mat5 and
mat10 into the materials of component
comp1:
.The insert method returns results from the insert operation.