Previous Topic: ISCModelProperty InterfaceNext Topic: Saving the Model


Deleting Non-Scalar Property Values

To remove all the values from a non-scalar property, remove the property itself from the ISCModelPropertyCollection using the Remove method. To remove a specific value from a non-scalar property, use the RemoveValue method of the ISCModelProperty interface. As with accessing the non-scalar property values, the property value is identified using the ValueId parameter. ValueId can either be the zero-based index of the value, or the name of the member if the property type is a structure.

Note: For r7.3, CA ERwin DM does not support naming non-scalar property members.

Example 25

The following example illustrates how to delete non-scalar property values using C++ if there is a model object and a transaction is open:

ISCModelPropertyCollectionPtr propColPtr = scObjPtr->GetProperties();
CString csPropName = "Some Property Name";
ISCModelPropertyPtr scPropPtr = propColPtr->GetItem(COleVariant(csPropName));
long index;   // index of a member in a non-scalar property
index = 0;    // Set to the first element
// …
bRetVal = scPropPtr->RemoveValue(index);   // remove single value from the property

The following example illustrates how to delete non-scalar property values using Visual Basic .NET if there is a model object and a transaction is open:

Dim scProp As SCAPI.ModelProperty
scProp = scObj.Properties("Some Property Name")
bRetVal = scProp.RemoveValue(index)  ' Remove single value from the property