All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

MecModInterfaces Interface CATIPersistentSubElement

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---CATIPersistentSubElement
 

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIPersistentSubElement

Interface allowing the manipulation of Applicative Attributes.

This interface provides a convenient mechanism for adding, setting, retrieving and removing Applicative Attributes (i.e. basic, user-defined and persistent parameters) on feature sub-elements.
This interface can be retrieved directly from a CATIBRepAccess.

Note:



See also:
CATIBRepAccess, CATICkeParmFactory, CATIMmiBRepAttributeSynchronize


Method Index


o AddAttribute(CATUnicodeString&,CATICkeParm*)
Adds a new attribute.
o GetAttributeValue(CATUnicodeString&,CATICkeParm**)
Retrieves the value of an attribute.
o GetAttributes(CATListOfCATUnicodeString**,CATCkeListOfParm*)
Retrieves the names and the respective values of all attributes.
o GetDirectAttributes(CATISpecObject*,CATListOfCATUnicodeString**,CATCkeListOfParm*)
Retrieves the names and the respective values of all attributes which rely on a specific feature.
o GetListAttributesName(CATListOfCATUnicodeString**)
Retrieves the names of all the attributes.
o GetListOfDirectAttributesName(CATISpecObject*,CATListOfCATUnicodeString**)
Retrieves the names of all attributes which rely on a specific feature.
o GetVisPropertiesAccess(CATIVisProperties*&)
Provides access to the visual properties of the current sub-element.
o RemoveAttribute(CATUnicodeString&)
Removes an attribute.
o RemoveAttributes(CATListOfCATUnicodeString*,CATISpecObject*)
Removes multiple attributes at once.
o SetAttributeValue(CATUnicodeString&,CATICkeParm*)
Sets a new value to an existing attribute.
o SetAttributes(CATListOfCATUnicodeString*,CATCkeListOfParm)
Sets the values of every attribute in a list.

Methods


o AddAttribute
public virtual HRESULT AddAttribute( const CATUnicodeString& iName,
const CATICkeParm* iAttributeValue) = 0
Adds a new attribute.

Role: This method creates an attribute given a name and a value.

Note:


Parameters:
iName
The name of the attribute.
This is the name of the attribute, stored as a CATUnicodeString.
Note:
  • This name is unique, as it is used as the identifier of the attribute.


iAttributeValue
The value of the attribute.
This is the value of the attribute, which can be either a CATUnicodeString, an int, or a double, stored as a CATICkeParm_var.
Note:
  • A convenient way of creating the value of an attribute is by using the CATICkeParmFactory interface.


Returns:
  • S_OK if the attribute has been succesfully added.
  • E_FAIL if the attribute could not be added. In general, this happens when an attribute with the same name already exists. If this is the case, the value of the attribute can be modified using SetAttribute .
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if iName is an empty string.
  • E_INVALIDARG if iAttributeValue is NULL, or if the its type is neither a CATParmDictionary::StringType, a CATParmDictionary::IntegerType, nor a CATParmDictionary::RealType.

Note:
  • If the method fails for any of the above reasons, the attribute will not be added.

o GetAttributeValue
public virtual HRESULT GetAttributeValue( const CATUnicodeString& iName,
CATICkeParm** oAttributeValue) = 0
Retrieves the value of an attribute.

Role: This method retrieves the value of an attribute, given its name.

Note:


Parameters:
iName
The name of the attribute.
This is the name of the attribute, stored as a CATUnicodeString.
Note:
  • This name is unique, as it is used as the identifier of the attribute.


oAttributeValue
The retrieved value of the attribute.
This is the value of the attribute, which can be either a CATUnicodeString, an int, or a double, stored as a CATICkeParm_var.


Returns:
  • S_OK if the value of the attribute has been succesfully retrieved.
  • E_FAIL if the value of the attribute could not be retrieved. This can happen if the name of the attribute does not exist.
  • E_UNEXPECTED if the current selecting object is invalid.
  • E_UNEXPECTED if the retrieved value is not a valid data type. See SetAttribute and AddAttribute for valid data types.
  • E_INVALIDARG if iName is an empty string.
  • E_INVALIDARG if oAttributeValue is NULL or if *oAttributeValue is not NULL.

o GetAttributes
public virtual HRESULT GetAttributes(CATListOfCATUnicodeString** oAttrNameList,
CATCkeListOfParm* oCkeAttrValList)= 0
Retrieves the names and the respective values of all attributes.

Role: This method retrieves the names of all the attributes, as well as their respective values.

Note:


Parameters:
oAttrNameList
The names of the attributes.
This is a list containing the names of the attributes, each one being stored as a CATUnicodeString.
Note:
  • This list has the same size as oCkeAttrValList .


oCkeAttrValList
The values of the attributes.
Contrary to oAttrNameListThis is a pointer to a list containing the values of the attributes. Each value is stored as a CATICkeParm_var.
Note:
  • The list oCkeAttrValList is actually a pointer to CATLISTV(CATBaseUnknown_var) ( see CATICkeRelationForwards.h for more details ). Because of the presence of a pointer in this definition, some extra care must be taken when calling this method.
  • This list has the same size as oAttrNameList.


Returns:
  • S_OK if the names and the values of the attributes have been properly found.
  • E_FAIL if oAttrNameList and oCkeAttrValList do not have the same size. In that case, both lists will be emptied before exiting.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if oAttrNameList is NULL (invalid list) or if the list is not empty. In that case, the list will be emptied before exiting.
  • E_INVALIDARG if oCkeAttrValList is NULL (invalid list) or if the list is not empty. In that case, the list will be emptied before exiting.
o GetDirectAttributes
public virtual HRESULT GetDirectAttributes( const CATISpecObject* iMechanicalFeature,
CATListOfCATUnicodeString** oAttrNameList,
CATCkeListOfParm* oCkeAttrValList)= 0
Retrieves the names and the respective values of all attributes which rely on a specific feature.

Role: This method retrieves the names of all the attributes on a specific feature, as well as their respective values.

Note:


Parameters:
iMechanicalFeature
The feature used in order to retrieve the attributes.
This can be seen as the design-level where the attributes are being looked for.

oAttrNameList
The names of the attributes.
This is a list containing the names of the attributes, each one being stored as a CATUnicodeString.
Note:
  • This list has the same size as oCkeAttrValList .


oCkeAttrValList
The values of the attributes.
This is a pointer to a list containing the values of the attributes, each one being stored as a CATICkeParm_var.
Note:
  • The list oCkeAttrValList is actually a pointer to CATLISTV(CATBaseUnknown_var) ( see CATICkeRelationForwards.h for more details ). Because of the presence of a pointer in this definition, some extra care must be taken when calling this method.
  • This list has the same size as oAttrNameList .


Returns:
  • S_OK if the names and the values of the attributes have been properly found.
  • E_FAIL if oAttrNameList and oCkeAttrValList do not have the same size. In that case, both lists will be emptied before exiting.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if iMechanicalFeature is not a valid ancestor for the CATIPersistentSubElement.
  • E_INVALIDARG if oAttrNameList is NULL (invalid list) or if the list is not empty. In that case, the list will be emptied before exiting.
  • E_INVALIDARG if oCkeAttrValList is NULL (invalid list) or if the list is not empty. In that case, the list will be emptied before exiting.
o GetListAttributesName
public virtual HRESULT GetListAttributesName(CATListOfCATUnicodeString** oAttributNameList) = 0
Retrieves the names of all the attributes.

Role: This method retrieves the names of all the attributes corresponding to the current CATIBRepAccess.

Note:


Parameters:
oAttributNameList
The names of the attributes.
This is a list containing the names of the attributes, each one being stored as a CATUnicodeString.

Returns:
  • S_OK if the names of the attributes have been properly found.
  • E_FAIL no attribute names could be retrieved.
  • E_UNEXPECTED if the current selecting object is invalid .
o GetListOfDirectAttributesName
public virtual HRESULT GetListOfDirectAttributesName( const CATISpecObject* iMechanicalFeature,
CATListOfCATUnicodeString** oAttributNameList) = 0
Retrieves the names of all attributes which rely on a specific feature.

Role: This method retrieves the names of all the attributes on a specific feature.

Note:

Parameters:
iMechanicalFeature
The feature used in order to retrieve the attributes.
This can be seen as the design-level where the attributes are being looked for.

oAttributNameList
The names of the attributes.
This is a list containing the names of the attributes, each one being stored as a CATUnicodeString.
Note:
  • This list has the same size as oCkeAttrValList .


Returns:
  • S_OK if the names and the values of the attributes have been properly found.
  • E_FAIL no attribute names could be retrieved.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if iMechanicalFeature is not a valid ancestor for the CATIPersistentSubElement.
  • E_INVALIDARG if oAttrNameList is NULL (invalid list) or if the list is not empty. In that case, the list will be emptied before exiting.
o GetVisPropertiesAccess
public virtual HRESULT GetVisPropertiesAccess(CATIVisProperties*& oVisPropertiesAccess) = 0
Provides access to the visual properties of the current sub-element.

Role: This method retrieves a CATIVisProperties interface from the current sub-element.

Parameters:
oVisPropertiesAccess
The retrieved CATIVisProperties interface.

Returns:
  • S_OK if the CATIVisProperties interface has been sucessfully retrieved.
  • E_FAIL if the retrieval of CATIVisProperties interface failed.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if oVisPropertiesAccess is not NULL.
o RemoveAttribute
public virtual HRESULT RemoveAttribute( const CATUnicodeString& iName) = 0
Removes an attribute.

Role: This method removes an attribute given its name.

Note:


Parameters:
iName
The name of the attribute to remove.


Returns:
  • S_OK if all the specified attribute has been properly removed.
  • E_FAIL if the attribute could not be properly removed.
  • S_FALSE if the attribute has not been removed because it was part of an import.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if iName is an empty string.
o RemoveAttributes
public virtual HRESULT RemoveAttributes( const CATListOfCATUnicodeString* iAttrNameList= NULL,
const CATISpecObject* iMechanicalFeature= NULL )= 0
Removes multiple attributes at once.

Role: This method removes each attribute of a list from a given design level.

Note:


Parameters:
iAttrNameList
The names of the attributes to remove.
This is a list containing the names of the attributes, each one being stored as a CATUnicodeString.
Note:
  • When set to NULL, all attributes will be removed at once from the specified design-level.


iMechanicalFeature
The feature where the attributes will be removed from.
This can be seen as the design-level, where the attributes are actually stored.
Note:
  • When set to NULL, the attributes will be removed from the current design-level.

Returns:
  • S_OK if all the specified attributes have been properly removed.
  • E_FAIL if one or more attributes in iAttrNameList have not been properly removed.
  • S_FALSE if one or more attributes in iAttrNameList have not been removed because they were part of an import.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if iAttrNameList is not NULL and empty.
  • E_INVALIDARG if the specified iMechanicalFeature is invalid.
  • E_INVALIDARG if iAttrNameList and iMechanicalFeature are both not NULL at the same time.
o SetAttributeValue
public virtual HRESULT SetAttributeValue( const CATUnicodeString& iName,
const CATICkeParm* iAttributeValue) = 0
Sets a new value to an existing attribute.

Role: This method modifies the value of an existing attribute, given the existing attribute's name and the new value.

Parameters:
iName
The name of the attribute.
This is the name of the attribute, stored as a CATUnicodeString.

iAttributeValue
The value of the attribute.
This is the value of the attribute, which can be either a CATUnicodeString, an int, or a double, stored as a CATICkeParm_var.
Note:
  • A convenient way of creating the value of an attribute is by using the CATICkeParmFactory interface. *
  • A convenient way of creating the value of an attribute is by using the CATICkeParmFactory interface.


Returns:
  • S_OK if the attribute has been succesfully set.
  • E_FAIL if the attribute could not be set.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if iName is an empty string.
  • E_INVALIDARG if iAttributeValue is NULL, or if the its type is neither a CATParmDictionary::StringType, a CATParmDictionary::IntegerType, nor a CATParmDictionary::RealType.

Note:
  • If the method fails for any of the above reasons, the attribute will not be modified.

o SetAttributes
public virtual HRESULT SetAttributes( const CATListOfCATUnicodeString* iAttrNameList,
const CATCkeListOfParm iCkeAttrValList)= 0
Sets the values of every attribute in a list.

Role: This method sets each attribute of a list to a given value.

Note:


Parameters:
iAttrNameList
The names of the attributes.
This is a list containing the names of the attributes, each one being stored as a CATUnicodeString.
Note:
  • This list has the same size as iCkeAttrValList .


iCkeAttrValList
The values of the attributes.
This is a pointer to a list containing the values of the attributes, each one being stored as a CATICkeParm_var.
Note:
  • The list iCkeAttrValList is actually a pointer to CATLISTV(CATBaseUnknown_var) ( see CATICkeRelationForwards.h for more details ). Because of the presence of a pointer in this definition, some extra care must be taken when calling this method.
  • This list has the same size as iAttrNameList .


Returns:
  • S_OK if the values of the attributes have been properly set.
  • E_FAIL if the value of an attribute belonging to iAttrNameList could not be retrieved, set or added.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if iAttrNameList is NULL (invalid list) or if the list is empty.
  • E_INVALIDARG if iCkeAttrValList is NULL (invalid list) or if the list is empty.
  • E_INVALIDARG if iAttrNameList and iCkeAttrValList do not have the same size.

Note:
  • If the method fails for any of the above reasons, none of the attributes in iAttrNameList will be set or added.


This object is included in the file: CATIPersistentSubElement.h
If needed, your Imakefile.mk should include the module: CATMecModInterfaces

Copyright © 2003, Dassault Systèmes. All rights reserved.