Skip to main content

IModel Interface

Namespace: NextDesign.Core

Description​

Provides access to design model information in NextDesign.

Area​

NameDescription
ModelAPI group for accessing models.

Inherits From​

NameDescription
IObjectRepresents an identifiable object.

Derived Types​

NameDescription
IFrameAn access object for frame information.
IInteractionElementAn access object for interaction model element information.
Defines properties common to elements that represent interactions.
IFeatureAn access object for product feature information.
IProductLineModelAn access object for a product line development support model.
IConfigurationModelAn access object for a product configuration model.
IProjectProvides access to project information.
IInteractionAn access object for interaction model information.
IFeatureModelAn access object for a management model that structures product features.
IRelationshipAn access object for relationship information.
IProductAn access object for product information.

Properties​

NameDescription
ClassNameClass name
Gets the name of the Metaclass.
DescriptionDescription
ErrorsGets the collection of error information for this model.

The error information includes summary information.
HasErrorChecks whether this model has errors.
Returns True if this model has errors.

This evaluation includes summary information.
HasErrorWithChildrenChecks whether there are errors in this model or in any elements under the child elements owned by this model.
Returns True if there are errors in this model or in any elements under the child elements owned by this model.

This evaluation includes summary information.
IsDeletedChecks whether this instance has been deleted.
IsDeletingChecks whether this model is being deleted.
IsDirtyChecks whether this model is in a dirty state (unsaved).
Returns True if it is unsaved.
IsEditableChecks whether this instance is editable.
IsProductLineElementChecks whether this model is a product line model.
IsProxyChecks whether this instance is a proxy element.
A proxy element is generated in a distributed environment when the unit containing the information for this instance has not been loaded.
This cannot be used to determine whether an element is unloaded.
IsRealizedChecks whether the field values of this model have been loaded (realized).
IsUnitTopModelChecks whether this instance is the base model of a unit.
MetaclassClass
ModelPathModel hierarchy path of this instance
Returns a path string formed by joining the model hierarchy with the path separator ("/"), starting from the model root, the base point in a product line or unit, or a model whose parent element has not been loaded.

If the root node to which this instance belongs is a model whose parent element has not been loaded, "partial;" is added to the beginning of the path string joined by the path separator.
ModelUnitInformation about the unit (physical file) that manages this instance information
NameName
OwnerThe model that directly owns this instance
Returns null if this instance is a relationship or if no owning model exists.
OwnerProjectThe project that contains this instance

Methods​

NameDescription
AddErrorAdds error information to this model and returns the added error information.
AddNewModelAdds an instance of the specified class as a field value to the end of the specified field of this instance.
However, if the specified field has a maximum multiplicity of 1 and the field already contains an instance, the first instance is replaced.

An instance is added even if the specified class is an abstract class.
AddNewModelAtAdds an instance of the specified class as a field value to the specified field of this instance at the specified position.
Even if the specified class is an abstract class, an instance is added as a field value at the specified position.
AddNewModelToAdds an instance of the specified class as a field value to the specified field of this instance at the specified position.
Even if the specified class is an abstract class, an instance is added as a field value at the specified position.
As(IClass)Checks whether this instance is compatible with the specified class type.
Returns True if this instance is an instance of the specified class or one of its subclasses.
As(IPackage,string,bool)Checks whether this instance is compatible with the specified class type.
The specified class is identified under the package specified by the scope.
Returns True if this instance is an instance of the specified class or one of its subclasses.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
As(string,bool)Checks whether this instance is compatible with the specified class type.
Returns True if this instance is an instance of the specified class or one of its subclasses.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
AsIn(IEnumerable<IClass>)Checks whether this instance is compatible with any of the specified class types.
Returns True if this instance is an instance of any of the specified classes or one of their subclasses.
AsIn(IEnumerable<string>,bool)Checks whether this instance is compatible with any of the specified class types.
Returns True if this instance is an instance of any of the specified classes or one of their subclasses.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
AsIn(IPackage,IEnumerable<string>,bool)Checks whether this instance is compatible with any of the specified class types.
The specified class is identified under the package specified by the scope.
Returns True if this instance is an instance of any of the specified classes or one of their subclasses.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
AsIn(IPackage,string,bool)Checks whether this instance is compatible with any of the specified class types.
The specified class is identified under the package specified by the scope.
Returns True if this instance is an instance of any of the specified classes or one of their subclasses.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
AsIn(string,bool)Checks whether this instance is compatible with any of the specified class types.
Returns True if this instance is an instance of any of the specified classes or one of their subclasses.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
AssignFeatureAssigns the specified feature to this model.
AssignFeatureByNameAssigns the feature with the specified name to this model.
AssignFeaturesAssigns all specified features to this model.
AssignFeaturesByNameAssigns all features with the specified names to this model.
CanChangeMetaclassToDetermines whether the class of this model can be changed to the specified class.

Returns false if changing the model class would prevent the parent model from containing this model.
If this model is a relationship, returns false if the model at the relationship end can no longer contain it.
CanRelateChecks whether the specified model can be related through the specified field of this instance.
Returns True if the relationship can be created.
This method evaluates not only the field type but also the following field constraints.
[Constraints evaluated]
- Path constraint
- Type constraint
- Maximum multiplicity

Returns False if this instance or the model to be related is a deleted model or a temporary proxy.
Also returns False if any of the following fields is specified.
- Product line feature assignment field
- Field with the System.Core tag
- Ownership field
- Invalid field
CanRelateAnyChecks whether this instance can be related to the specified model.
Returns True if the relationship can be created through any reference field of this instance.
Returns False if this instance or the model to be related is a deleted model or a temporary proxy.
Ownership fields are not included.
ChangeMetaclassToChanges the class of this model to the specified class.

If changing the model class makes the class of the ownership relationship instance with the parent model unavailable, the class of the ownership relationship instance is changed to the first class found.
Field values that cannot be maintained by the changed class are also deleted.

Shapes that cannot be maintained by the changed class are deleted.
CountGets the number of values in the specified field.

This method does not evaluate IContextOption.PlModelAccessMode.
CreateAsyncValidationContextCreates an asynchronous validation context for this model.
DeleteDeletes this instance.
If this method is called for an instance that has already been deleted, nothing is done.

Deleting this instance causes the following changes to the model.
・The ownership relationship between this instance and its owner (parent element) is deleted.
・All reference relationships for which this instance is a relationship end are deleted.
・All elements under all child elements owned by this instance, and all reference relationships for which those elements are relationship ends, are deleted.
FindChildrenByClass(IClass,bool)Searches the instances owned by this instance for instances of the specified class.
This method evaluates IContextOption.PlModelAccessMode.
FindChildrenByClass(IPackage,string,bool,bool)Searches the instances owned by this instance for instances of the specified class.
The specified class is identified under the package specified by the scope.
This method evaluates IContextOption.PlModelAccessMode.

Returns a collection of instances of the specified class among the instances in the ownership relationship.
If the class specified by the class name is not found, an empty collection is returned.
An empty collection is also returned if no applicable instance exists.
FindChildrenByClass(string,bool,bool)Searches the instances owned by this instance for instances of the specified class.
This method evaluates IContextOption.PlModelAccessMode.

Returns a collection of instances of the specified class among the instances in the ownership relationship.
If the class specified by the class name is not found, an empty collection is returned.
An empty collection is also returned if no applicable instance exists.
FindChildrenByClassDisplayNameSearches the instances owned by this instance for instances of a class with the specified display name.
This method evaluates IContextOption.PlModelAccessMode.

Returns a collection of instances of classes with the specified display name among the instances in the ownership relationship.
Returns an empty collection if no applicable instance exists.
FindChildrenByClassTagGets instances of classes with the specified tag from among the instances owned by this instance.
This method evaluates IContextOption.PlModelAccessMode.

Returns a collection of instances of classes with the specified tag among the instances in the ownership relationship.
Returns an empty collection if no applicable instance exists.
FindChildrenByTagGets instances with the specified tag from among the instances owned by this instance.
This method evaluates IContextOption.PlModelAccessMode.

Returns a collection of instances with the specified tag among the instances in the ownership relationship.
Returns an empty collection if no applicable instance exists.
FindOwnerByClass(IClass)Gets the first owner instance of the specified class that contains this instance.

Traverses the instances that own this instance toward the parent and returns the first instance found of the specified class.
Returns null if no applicable instance is found after searching up to the topmost parent element.
FindOwnerByClass(IPackage,string,bool)Gets the first owner instance of the specified class that contains this instance.
The specified class is identified under the package specified by the scope.

Traverses the instances that own this instance toward the parent and returns the first instance found of the specified class.
Returns null if no applicable instance is found after searching up to the topmost parent element.

Returns null if the class specified by the class name is not found.
If fuzzy matching is enabled and multiple classes match, returns the instance of the first class found.
FindOwnerByClass(string,bool)Gets the first owner instance of the specified class that contains this instance.

Traverses the instances that own this instance toward the parent and returns the first instance found of the specified class.
Returns null if no applicable instance is found after searching up to the topmost parent element.

Returns null if the class specified by the class name is not found.
If fuzzy matching is enabled and multiple classes match, returns the instance of the first class found.
FindRelatableModelsGets models that can be related to this model through the specified reference field.

If the base model of the search range is not specified, searches the entire project.

If the base model of the search range is specified, searches for relatable models among the models under that model element.
In this case, relationships are not included in the models returned. If the field references a relationship, call this method without specifying the base model of the search range.

Returns an empty collection if the specified field is not a reference field.
GetAllChildrenGets all owned instances that can be searched from this instance by depth-first traversal of ownership relationships.
This method evaluates IContextOption.PlModelAccessMode.

Returns a collection of all owned instances that can be searched by depth-first traversal of ownership relationships starting from this instance.
Returns an empty collection if no applicable instance exists.
GetAllErrorsWithChildrenGets all error information, including elements under the child elements owned by this model.
Returns an empty collection if no error information exists.

The error information includes summary information.
GetAssignedFeaturesGets all features assigned to this model.
GetChangeableMetaclassesGets all classes to which this model can be converted.
Returns an empty collection if no convertible classes exist.

Returns model classes that can be maintained by the parent model.
If this model is a relationship, returns relationship classes that can be maintained by the model at the relationship end.
GetChildrenGets the directly owned instances of this instance.
This method evaluates IContextOption.PlModelAccessMode.

Returns a collection of instances directly owned by this instance.
Returns an empty collection if no applicable instance exists.
GetDerivedFromRelationsOfIf this model is an element derived from the specified model, gets all such derivation relationships.
For example, if this model is an element derived from {Element A}, specifying {Element A} as the argument gets the corresponding derivation relationships.

This can be used for processing such as the following.
・When a requirement object and a specification object have a derivation relationship, get the relationship to the requirement object from the specification object side.

This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetDerivedModels(IPackage,string,bool)Gets instances derived from this instance by the specified relationship class.
The specified class is identified under the package specified by the scope.

This method evaluates IContextOption.PlModelAccessMode.

This method returns an empty collection in the following cases.
- No derived instance is related by the applicable derivation relationship
- The specified relationship class cannot be found
- The specified relationship class is not a derivation relationship
- A reference field to the derived instance by the specified derivation relationship class cannot be found
GetDerivedModels(IRelationshipClass)Gets instances derived from this instance by the specified relationship class.
This method evaluates IContextOption.PlModelAccessMode.
GetDerivedModels(string,bool)Gets instances derived from this instance by the specified relationship class.
If the relationship class is not specified (null), gets all derived instances.

This method evaluates IContextOption.PlModelAccessMode.

This method returns an empty collection in the following cases.
- No derived instance is related by the applicable derivation relationship
- The specified relationship class cannot be found
- The specified relationship class is not a derivation relationship
- A reference field to the derived instance by the specified derivation relationship class cannot be found
GetDerivedToRelationsOfIf the specified model is an element derived from this model, gets all such derivation relationships.
For example, if there is {Element B} derived from this model, specifying {Element B} as the argument gets the corresponding derivation relationships.

This can be used for processing such as the following.
・When a requirement object and a specification object have a derivation relationship, get the relationship to the specification object from the requirement object side.

This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetDeriveRelationsOfGets all derivation relationships with the specified model.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
This method does not evaluate the direction of derivation.
GetDerivingModels(IPackage,string,bool)Gets source instances from which this instance is derived by the specified relationship class.
The specified class is identified under the package specified by the scope.

This method evaluates IContextOption.PlModelAccessMode.

This method returns an empty collection in the following cases.
- No source instance is related by the applicable derivation relationship
- The specified relationship class cannot be found
- The specified relationship class is not a derivation relationship
- A reference field to the source instance by the specified derivation relationship class cannot be found
GetDerivingModels(IRelationshipClass)Gets source instances from which this instance is derived by the specified relationship class.
This method evaluates IContextOption.PlModelAccessMode.
GetDerivingModels(string,bool)Gets source instances from which this instance is derived by the specified relationship class.
If the relationship class is not specified (null), gets all source instances.

This method evaluates IContextOption.PlModelAccessMode.

This method returns an empty collection in the following cases.
- No source instance is related by the applicable derivation relationship
- The specified relationship class cannot be found
- The specified relationship class is not a derivation relationship
- A reference field to the source instance by the specified derivation relationship class cannot be found
GetEditorGets the editor with the specified name corresponding to this instance.
This method evaluates IContextOption.EditorAccessMode.

Returns null if no applicable editor is found.

Depending on the EditorAccessMode setting, the latest model changes may not be synchronized.
Therefore, be aware that correct information may not be obtained from editors that have never been displayed since the model was changed.
GetEditorsGets all editors corresponding to this instance.
This method evaluates IContextOption.EditorAccessMode.

Returns an empty collection if no corresponding editor exists.

Depending on the EditorAccessMode setting, the latest model changes may not be synchronized.
Therefore, be aware that correct information may not be obtained from editors that have never been displayed since the model was changed.
GetFieldGets the value of the specified field of this instance.
If the multiplicity of the specified field is 2 or more, gets the first element of the field.
GetFieldAtGets the value at the specified index position of the specified field of this instance.
GetFieldStringGets the value of the specified field of this instance as a string.
If the specified field is a class type, gets the name of the first instance in the field.
If the multiplicity is 2 or more, gets the first element of the field.
GetFieldStringAtGets the value at the specified index position of the specified field of this instance as a string.
If the field at the specified index position is a class type, gets the name of the first instance in that field.
GetFieldValuesGets the value collection of the specified field.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable field value exists.
The data type of the field specified for this method must be a class type.
GetFieldValuesByFieldTagGets an enumeration of values of fields with the specified tag.
If multiple fields have the applicable tag, combines and returns the enumerations of values from all such fields.
This method does not evaluate IContextOption.PlModelAccessMode. Note that elements that are invalid in the product are also returned.

Returns an empty collection if no applicable field value exists.

The data type of a field with a tag targeted by this method may be any type. Therefore, the enumeration returned by this method is of object type.
When using it, you need to convert it to the appropriate data type.
GetOwnerFieldGets the field through which the owner model of this model contains this model.
Returns null if this model is a relationship or if no owner model exists.
GetOwnerRelationshipGets the relationship with the owner model of this model.
Returns null if this model is a relationship or if no owner model exists.
GetOwnersGets all owner instances that can be traversed through ownership relationships from this instance.
Returns a collection of instances in the parent direction from the instance that owns this instance.
Returns an empty collection if no parent element exists.
GetProductApplyConditionGets the product application condition expression for this model.

A product application condition expression is a logical expression that treats "feature name variables" as Boolean variables.
In a configuration, when a feature is selected, the corresponding "feature name variable" is evaluated as true.
A "feature name variable" is written in a format that encloses the feature name or unique feature name in "[" and "]".
A product application condition expression can also use the following logical operators and "(",")" to specify the order of evaluation.
- AND : Logical conjunction
- OR : Logical disjunction
- NOT : Negation

Example:
・The following product application condition expression evaluates to true when the feature named "Adaptive Cruise Control" or "Front Camera" is selected in the configuration.
   [Adaptive Cruise Control] OR [Front Camera]

・The following product application condition expression evaluates to true when the feature named "Constant-Speed Driving" is not selected and "Millimeter-Wave Radar" is selected in the configuration.
   NOT [Constant-Speed Driving] AND [Millimeter-Wave Radar]
GetReferenceFieldsOfGets reference fields of this instance's class whose types can contain the specified model.
The fields obtained by this method are the same as those returned by Model.Metaclass.GetReferenceFieldOf(model.Metaclass).
Field constraints such as multiplicity and path constraints are not evaluated.
GetRefRelatedModels(IPackage,string,bool)Gets instances that have a reference relationship with this instance through the specified relationship class.
The specified class is identified under the package specified by the scope.

This method evaluates IContextOption.PlModelAccessMode.

This method returns an empty collection in the following cases.
- No instance is related by the applicable reference relationship
- The specified relationship class cannot be found
- A reference field for the specified relationship class cannot be found

If the specified relationship class is a self-reference relationship, both the source and destination relationships are evaluated.
GetRefRelatedModels(IRelationshipClass)Gets instances that have a reference relationship with this instance through the specified relationship class.
This method evaluates IContextOption.PlModelAccessMode.

If the specified relationship class is a self-reference relationship, both the source and destination relationships are evaluated.
GetRefRelatedModels(string,bool)Gets instances that have a reference relationship with this instance through the specified relationship class.
If the relationship class is not specified (null), gets all instances that have reference relationships.

This method evaluates IContextOption.PlModelAccessMode.

This method returns an empty collection in the following cases.
- No instance is related by the applicable reference relationship
- The specified relationship class cannot be found
- A reference field for the specified relationship class cannot be found

If the specified relationship class is a self-reference relationship, both the source and destination relationships are evaluated.
GetRelatableFieldsOfGets reference fields through which this instance can be related to the specified model.
The fields obtained by this method are evaluated against field constraints.
Therefore, fields that do not satisfy the following constraints are excluded.
[Constraints evaluated]
- Path constraint
- Maximum multiplicity
GetRelatingFieldsOfGets all fields in the class of this instance that contain the specified model as a field value.
The fields obtained by this method are returned regardless of whether they are ownership or reference fields.
GetRelationGets the relationship of the specified field.
This method evaluates IContextOption.PlModelAccessMode.

Returns null if the specified field does not have a valid relationship.
If the multiplicity of the specified field is 2 or more, gets the relationship to the first element of the field.
GetRelationAtGets the relationship at the specified position of the specified field.
This method evaluates IContextOption.PlModelAccessMode.
GetRelationsGets the relationship collection of the specified field.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetRelationsByClassTagGets instances of relationship classes with the specified tag from all fields of this instance.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetRelationsByClassTagOfGets relationships with the specified model that are created by relationship classes with the specified tag, from all fields of this model.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetRelationsByFieldOfGets relationships with the specified model in the specified field.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetRelationsByFieldTagGets relationships of fields with the specified tag.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetRelationsByFieldTagOfGets relationships with the specified model from fields with the specified tag.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetRelationsByTagGets relationships with the specified tag in the specified field.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
GetRelationsOfGets all relationships with the specified model.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.
This method gets all relationships regardless of whether they are ownership relationships or reference relationships.
GetRelationsOfWhereGets relationships with the specified model that match the specified condition for this instance.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.

The relationships to retrieve can be determined arbitrarily by an evaluation function.
GetRelationsWhereGets all relationships of this instance that match the specified condition.
This method evaluates IContextOption.PlModelAccessMode.

Returns an empty collection if no applicable relationship exists.

The relationships to retrieve can be determined arbitrarily by an evaluation function.
GetRepresentationsInEditorGets all representation information corresponding to this instance in the specified editor.
This method evaluates IContextOption.EditorAccessMode.

Returns an empty collection if no applicable element exists.

Depending on the EditorAccessMode setting, the latest model changes may not be synchronized.
Therefore, be aware that correct information may not be obtained from editors that have never been displayed since the model was changed.
GetRichTextFieldGets the value of the specified format of the specified rich text field.
Returns null if the specified format has no value.
GetRichTextFieldCustomDataGets the value of the custom format of the specified rich text field.
Returns null if the specified format is not found.
GetRichTextFieldFormatsGets a list of formats for which values are set in the specified rich text field.
The order of the list is undefined. Formats whose values are empty strings are also returned.
Is(IClass)Checks whether this instance is an instance of the specified class.
Returns True if it is an instance of the specified class.
Is(IPackage,string,bool)Checks whether this instance is an instance of the specified class.
The specified class is identified under the package specified by the scope.
Returns True if it is an instance of the specified class.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
Is(string,bool)Checks whether this instance is an instance of the specified class.
Returns True if it is an instance of the specified class.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
IsAppliedItemChecks whether this model is valid for the current product.
IsAppliedItemToChecks whether this model is valid for the specified product.
IsAppliedItemToByNameChecks whether this model is valid for the product with the specified name.
IsIn(IEnumerable<Class>)Checks whether this instance is an instance of any of the specified classes.
Returns True if it is an instance of any of the specified classes.
IsIn(IEnumerable<string>,bool)Checks whether this instance is an instance of any of the specified classes.
Returns True if it is an instance of any of the specified classes.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
IsIn(IPackage,IEnumerable<string>,bool)Checks whether this instance is an instance of any of the specified classes.
The specified class is identified under the package specified by the scope.
Returns True if it is an instance of any of the specified classes.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
IsIn(IPackage,string,bool)Checks whether this instance is an instance of any of the specified classes.
The specified class is identified under the package specified by the scope.
Returns True if it is an instance of any of the specified classes.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
IsIn(string,bool)Checks whether this instance is an instance of any of the specified classes.
Returns True if it is an instance of any of the specified classes.

For information about how to specify class names and the fuzzy match option, see the description of IModel.
IsRelatedAtFieldToChecks whether this instance has a reference relationship with the specified model through the specified field.
Returns True if a relationship exists.
IsRelatedToChecks whether this instance has a reference relationship with the specified model.
Returns True if a relationship exists.
MoveToMoves this instance so that it becomes a child element of the specified model.
If the destination parent element and field are the same as the current parent element and field, changes the order of elements in the specified field.
No exception is thrown even if the maximum multiplicity constraint of the destination field is violated.
NotifyFieldChangedNotifies that the value of the specified field has changed.
RelateRelates the specified model at the end of the specified field of this instance and returns the added relationship instance.
RelateAllRelates the specified model through all reference fields of this instance that can be related to the specified model, and returns a collection of all added relationship instances.
If a deleted model or temporary proxy is specified as the model to relate, no relationship is created.
If no relationship is created, an empty collection is returned.

This method excludes fields that do not satisfy the following constraints from the relationship targets.
[Constraints evaluated]
- Path constraint
- Type constraint
- Maximum multiplicity
- Operation availability
RelateAllDerivedFromRelates the specified model as the derivation source through all fields of this instance that can be related with the specified model as the derivation source, and returns a collection of all added relationship instances.
If a deleted model or temporary proxy is specified as the model to relate, no relationship is created.
If no relationship is created, an empty collection is returned.

This method excludes fields that do not satisfy the following constraints from the relationship targets.
[Constraints evaluated]
- Path constraint
- Type constraint
- Maximum multiplicity
- Operation availability
RelateAllDerivedToRelates the specified model as the derivation destination through all fields of this instance that can be related with the specified model as the derivation destination, and returns a collection of all added relationship instances.
If a deleted model or temporary proxy is specified as the model to relate, no relationship is created.
If no relationship is created, an empty collection is returned.

This method excludes fields that do not satisfy the following constraints from the relationship targets.
[Constraints evaluated]
- Path constraint
- Type constraint
- Maximum multiplicity
- Operation availability
RelateAtRelates the specified model at the specified position in the specified field of this instance and returns the added relationship instance.
RelateByClassTagRelates the specified model through reference fields that can be related by relationship classes with the specified tag, and returns a collection of all added relationship instances.
If a deleted model or temporary proxy is specified as the model to relate, no relationship is created.
If no relationship is created, an empty collection is returned.

This method excludes fields that do not satisfy the following constraints from the relationship targets.
[Constraints evaluated]
- Path constraint
- Type constraint
- Maximum multiplicity
- Operation availability
RelateByFieldTagRelates the specified model through reference fields of this instance with the specified tag, and returns a collection of all added relationship instances.
If a deleted model or temporary proxy is specified as the model to relate, no relationship is created.
If no relationship is created, an empty collection is returned.

This method excludes fields that do not satisfy the following constraints from the relationship targets.
[Constraints evaluated]
- Path constraint
- Type constraint
- Maximum multiplicity
- Operation availability
RelateWhereRelates the specified model through all reference fields of this instance that match the specified condition, and returns a collection of all added relationship instances.
If a deleted model or temporary proxy is specified as the model to relate, no relationship is created.
If no relationship is created, an empty collection is returned.

The reference fields to relate can be determined arbitrarily by an evaluation function.
However, even if a field matches the evaluation function, no relationship is created and the method completes normally if the field meets any of the following conditions.
・The field violates the path constraint
・The field type is not compatible with the given model
・The field exceeds its multiplicity
・The field that matches the condition is one of the following non-operable fields
- Product line feature assignment field
- Field with the System.Core tag
ReleaseAllAssignedFeaturesReleases the assignments of all features assigned to this model.
If feature assignments are released by this call, the product application condition expression is also deleted.
ReleaseAssignedFeatureReleases the assignment of the specified feature to this model.
ReleaseAssignedFeatureByNameReleases the assignment to this model of the feature with the specified name.
ReleaseAssignedFeaturesReleases the assignments to this model of all specified features.
ReleaseAssignedFeaturesByNameReleases the assignments to this model of all features with the specified names.
RemoveErrorDeletes error information added to this model.
If null or error information not contained in this model is specified as the error information to delete, nothing is done and the method completes normally.
RemoveFieldDeletes the value of the specified field of this instance.
If the specified field is an ownership field, the specified model is deleted.
If the specified field is a reference field, only the reference relationship is deleted and the model is retained.

If the model specified for deletion is not contained in the specified field, nothing is done and the method completes normally.
RemoveFieldAtDeletes the field value at the specified position of this instance.
If the specified field is an ownership field, the model at the specified position is deleted.
If the specified field is a reference field, only the reference relationship at the specified position is deleted and the model is retained.
SetFieldSets the specified value in the specified field of this instance.
An exception is thrown if a value that cannot be set in the specified field is specified.<br/>If the multiplicity of the specified field is 2 or more, sets the first element of the field.
SetFieldAtSets the specified value at the specified index position of the specified field of this instance.
An exception is thrown if a value that cannot be set in the specified field is specified.
No exception is thrown even if the field's maximum multiplicity constraint or path constraint is violated.
SetInitFieldSets the initial value defined in the metamodel for the specified field of this instance.
If no initial value is specified for the field in the metamodel, sets the default value for the field type.

If this method is called for a class-type ownership field, the IModel set as the field value is deleted.
If this method is called for a class-type reference field, the relationship with the IModel set as the field value is deleted (the IModel used as the field value is retained without being deleted).
SetProductApplyConditionSets the product application condition expression for this model.
If the product application condition expression uses the name of a feature that has not been assigned to this model, the feature is assigned automatically.
If the condition expression does not use the name of a feature already assigned to this model, the feature assignment is released automatically.
If an empty string is specified for the condition expression, all feature assignments are released.
SetRichTextField(string,string,string,string)Sets a value for the specified format of the specified rich text field.
The textValue specification is ignored, and the value for the "text" format is also generated automatically and set at the same time.
SetRichTextField(string,string,string)Sets a value for the specified format of the specified rich text field.
If the "html" format is specified, the value for the "text" format is also generated automatically and set at the same time.
SetRichTextField(string,string)[Obsolete]
Does nothing.
SetRichTextFieldCustomDataSets a value for the custom format of the specified rich text field.

The value of the custom format is not displayed in the UI. It can be retrieved and set only through the API.
SetRichTextFieldValuesSets an Html value in the specified rich text field.
The textValue specification is ignored, and the value for the "text" format is also generated automatically from the htmlValue value and set at the same time.
TakeMoves the specified model to the specified field of this instance.
The parent element of the model being moved becomes this instance.
No exception is thrown even if the maximum multiplicity constraint of the destination field is violated.
UnRelateRemoves the reference relationship with the specified model in the specified field of this instance.
If multiple relationships exist in the applicable field, all of them are removed.
If no relationship with the specified model exists, nothing is done and the method completes normally.
UnRelateAllRemoves all reference relationships between this instance and the specified model.
If no relationship with the specified model exists, nothing is done and the method completes normally.
Relationships through fields that meet the following conditions are also not removed, and the method completes normally.
・Relationship through a field for product line support
・Relationship through a field with the System.Core tag
UnRelateAllDerivedFromRemoves all relationships in which the specified model of this instance is the derivation source.
If no relationship with the specified model exists, nothing is done and the method completes normally.
Relationships through fields that meet the following conditions are also not removed, and the method completes normally.
・Relationship through a field for product line support
・Relationship through a field with the System.Core tag
UnRelateAllDerivedToRemoves all relationships in which the specified model of this instance is the derivation destination.
If no relationship with the specified model exists, nothing is done and the method completes normally.
Relationships through fields that meet the following conditions are also not removed, and the method completes normally.
・Relationship through a field for product line support
・Relationship through a field with the System.Core tag
UnRelateByClassTagRemoves relationships with the specified model through reference fields that can be related by relationship classes with the specified tag.
If no relationship with the specified model exists, nothing is done and the method completes normally.
Relationships through fields that meet the following conditions are also not removed, and the method completes normally.
・Relationship through a field for product line support
・Relationship through a field with the System.Core tag
UnRelateByFieldTagRemoves relationships with the specified model through reference fields of this instance with the specified tag.
If no relationship with the specified model exists, nothing is done and the method completes normally.
Relationships through fields that meet the following conditions are also not removed, and the method completes normally.
・Relationship through a field for product line support
・Relationship through a field with the System.Core tag
UnRelateWhereRemoves all reference relationships between this instance and the specified model that match the specified condition.

The relationships to remove can be determined arbitrarily by an evaluation function.
However, relationships that meet the following conditions are not removed, and the method completes normally.
・The relationship matching the condition is a relationship for product line support
・The field at the relationship end matching the condition has the System.Core tag
ValidateValidates this model.
Recursively validates this model and all elements under the child elements owned by this model.
All previous error information is cleared when this method is executed.

[When this method is executed for a project (IProject)]
・If the project contains unloaded model files, error information indicating this is added to the model that serves as the base point of the design model (the model displayed at the root of the Model Navigator). This informs the caller that not all models in the project could be validated because unloaded model files exist.
・This also includes models that cannot be reached through the project's ownership relationships because the project contains unloaded model files (models whose parent is unloaded).

[Validation contents]
・Standard validation defined by the application
・Validation extended by extension validation events
Validate(ValidationOptions)Validates this model.
Depending on the option settings, validates only this model, or recursively validates this model and all elements under the child elements owned by this model.
All previous error information is cleared when this method is executed.

[When this method is executed for a project (IProject)]
・If the project contains unloaded model files, error information indicating this is added to the model that serves as the base point of the design model (the model displayed at the root of the Model Navigator). This informs the caller that not all models in the project could be validated because unloaded model files exist.
・This also includes models that cannot be reached through the project's ownership relationships because the project contains unloaded model files (models whose parent is unloaded).

[Validation contents]
・Standard validation defined by the application and enabled by the options
・If the options specify that an event is issued during model validation, validation extended by extension validation events

Extension Methods​

NameDescription
IsDesignModelChecks whether this model is the design model root (the root model of the Model Navigator).
IsProductLineElementChecks whether this model is a product line element.
IsReadonlyChecks whether this model is read-only.
Returns False if the model unit corresponding to this model cannot be obtained.

Remarks​

In V5.1, loading of field values was changed to be deferred. Therefore, if a field value is accessed before it is loaded, execution waits until loading is complete.
Accessing a large number of models individually may reduce responsiveness depending on the loading state of the models.
This can be avoided by calling IProject.RealizeAll() in advance.

See Also​

NameDescription
Edit modelsEdits various NextDesign model information through the API.