General Commands > About General Commands > model.attr()

model.attr()
Model entity list methods such as copying, duplicating, clearing, and removing model entities.
Syntax
model.attr() returns a model entity list. The string attr denotes a method name for accessing the model entity list.
model.attr().clear() removes all tagged model entities.
model.attr().copy(<tag>, <copytag>) creates a new model entity with the tag <tag>, which is a copy of the model entity with the tag <copytag>. The <copytag> should be combination of tags separated by slashes to uniquely identify the entity. For example, pg1/surf1/htgh1 identifies model.result("pg1").feature("surf1").feature("htgh1"). How to interpret the combined tag depends on the context. The difference between duplicate and copy is that copy can use a source anywhere in the model, whereas duplicate requires that the source is in the same list. Not all model entities support the copy operation. The difference between copy and copyTo is that copyTo copies the entity to a specific position in the list, whereas copy copies to a default position in the list. Not all model entities support the copyTo operation.
model.attr().copy(<tag>, <copytag>, <modeltag>) creates a copy and assigns it to the model <modeltag>.
model.attr().copyTo(<tag>, <copytag>, <insertafter>) creates a copy and inserts it in the list after the entity with tag <insertafter>. If <insertafter> is an empty string, the entity is inserted first in the list. Not all model entities support the copyTo operation.
model.attr().duplicate(<tag>, <copytag>) creates a new model entity with the tag <tag> which is a duplicate of the model entity with tag <copytag>. Not all model entities support the duplicate operation.
model.attr().duplicateTo(<tag>, <copytag>, <insertafter>) creates a new model entity and inserts it in the list after the entity with tag <insertafter>. If <insertafter> is an empty string, the entity is inserted first in the list. Not all model entities support the duplicateTo operation.
model.attr().get(<tag>) returns the entity with tag <tag> from the entity list model.attr().
model.attr().remove(<tag>) removes the model entity with tag <tag>.
model.attr().size() returns the number of model entities.
model.attr().tags() returns a string array with the tags of all model entities.
model.attr().uniquetag(<tag>) returns a unique tag in the list context.
See also
model