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:
- An Applicative Attribute consists of a unique name, and an associated value, which can only belong to one of the following types: a
CATUnicodeString , an int, or a double.
- The only valid selection objects for retrieving a CATIPersistentSubElement interface are the ones corresponding to: a face (
CATIRSur ), an edge (
CATIWireREdge ,
CATIBorderREdge ) or a vertex (
CATIBorderFVertex ).
- 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
-
Adds a new attribute.
Role: This method creates an attribute given a name and a value.
Note:
- Although the attribute will be visible from the current selection object, the user does not have any control on the design-level on which the attribute will be effectively added. Indeed, the attribute will be added to the last feature where the element corresponding to the current CATIBRepAccess had the same connexity, for stability reasons.
- It is not possible to add an attribute if an attribute with the same name has been added previously.
- 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
-
Retrieves the value of an attribute.
Role: This method retrieves the value of an attribute, given its name.
Note:
- The retrieved value is the latest added one as seen from the current design-level.
- 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
-
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:
- The value of attribute i in oAttrNameList is stored as element i in oCkeAttrValList.
- If the name of an attribute is already defined in a parent of the CATIPersistentSubElement, then the corresponding value is the one of the child, i.e. the value on the latest design-level.
- 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
-
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:
- The value of attribute i in oAttrNameList is stored as element i in oCkeAttrValList.
- 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
-
Retrieves the names of all the attributes.
Role: This method retrieves the names of all the attributes corresponding to the current CATIBRepAccess.
Note:
- The name of an attribute is unique for a given selection object. It can therefore be considered as the identifier of the attribute.
- If the name of an attribute is already defined in a parent of the CATIPersistentSubElement, then the corresponding value is the one of the child, i.e. the value on the latest design-level.
- If you need to retrieve all attributes as well as their respective values, use
GetAttributes for faster performance.
- 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
-
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:
- If you need to retrieve all direct attributes as well as their respective values, use
GetDirectAttributes for faster performance.
- 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
-
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
-
Removes an attribute.
Role: This method removes an attribute given its name.
Note:
- If an attribute has been defined at many different design levels, only one will be removed.
- Attributes transferred to a CATIMmiBRepAttributeSynchronize after a synchronisation (see
CATIMmiBRepAttributeSynchronize.SynchronizeBRepAttributes ) cannot be removed. Remove them or change their value before synchronisation if needed.
- 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
-
Removes multiple attributes at once.
Role: This method removes each attribute of a list from a given design level.
Note:
- As with the RemoveAttribute method, if an attribute has been defined at many different design levels, only one will be removed.
- As with the RemoveAttribute method, attributes transferred to a CATIMmiBRepAttributeSynchronize after a synchronisation
(see
CATIMmiBRepAttributeSynchronize.SynchronizeBRepAttributes ) cannot be removed. Remove them or change their value before synchronisation if needed.
- 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
-
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
-
Sets the values of every attribute in a list.
Role: This method sets each attribute of a list to a given value.
Note:
- Attribute i in iAttrNameList will be set to the value corresponding to element i in iCkeAttrValList.
- If the name of the attribute does not already exist, it is created and its value is set.
- 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