def optional_relation(self) -> Relation: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445) | o Property OptionalRelation() As Relation (Read Only) | | Returns the relation that can be used to compute the parameter. As this | relation might not exist, NULL may be returned, so a test is | required. | | Example: | This example checks if there is a relation to compute the param1 | parameter, and if no relation exists, displays a message | box: | | Set param1_rel = param1.OptionalRelation | If param1_rel is Nothing Then | MsgBox "No relation to compute param1" | End If :return: Relation :rtype: Relation """ return Relation(self.parameter.OptionalRelation)
def create_rule_base(self, i_name: str) -> Relation: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)) | o Func CreateRuleBase(CATBSTR iName) As Relation | | Creates a rulebase. | | Parameters: | | iName | The name of the rulebase. | | Returns: | The created rulebase. | See also: | ExpertRuleBase :param str i_name: :return: Relation :rtype: Relation """ return Relation(self.relations.CreateRuleBase(i_name))
def get_items(self): """ :return: [Relation()] """ relation_list = [] for i in range(self.relations.Count): relation = Relation(self.relations.Item(i + 1)) relation_list.append(relation) return relation_list
def item(self, index): """ .. warning:: The index when not a string must be it's python index (indexes in python start from 0). collection. The COM interface index starts at 1. .. note:: CAA V5 Visual Basic help | Item | o Func Item( CATVariant iIndex) As Relation | | Retrieves a relation using its index or its name from the Relations | collection. | Parameters: | iIndex | The index or the name of the relation to retrieve from | the collection of relations. | As a numerics, this index is the rank of the relation | in the collection. | The index of the first relation in the collection is 1, and | the index of the last relation is Count. | As a string, it is the name you assigned to the relation using | the | | activateLinkAnchor('AnyObject','Name','AnyObject.Name') property or when creating the relation. | Returns: | The retrieved relation | Examples: | This example retrieves the last relation in the relations | collection. | | Dim lastRelation As Relation | Set lastRelation = relations.Item(relations.Count) :param str or int index: :return: Relation() """ if isinstance(index, int): index += 1 return Relation(self.relations.Item(index))
def get_item_by_index(self, index): """ .. warning:: The index when not a string must be it's python index (indexes in python start from 0). collection. The COM interface index starts at 1. :param str/int index: relation name or index :return: item """ if isinstance(index, int): index += 1 return Relation(self.relations.Item(index))
def optional_relation(self): """ .. note:: CAA V5 Visual Basic help | OptionalRelation | o Property OptionalRelation( ) As Relation | | Returns the relation that can be used to compute the parameter. As | this relation might not exist, NULL may be returned, so a test is | required. | Example: | This example checks if there is a relation to compute the param1 | parameter, and if no relation exists, displays a message box: | | Set param1_rel = param1.OptionalRelation | If param1_rel is Nothing Then | MsgBox "No relation to compute param1" End If """ if self.has_relation(): return Relation(self.parameter.OptionalRelation)
def create_rule_base(self, name): """ .. note:: CAA V5 Visual Basic help | CreateRuleBase | o Func CreateRuleBase( CATBSTR iName) As Relation | | Creates a rulebase. | Parameters: | iName | The name of the rulebase. | Returns: | The created rulebase. | See also: | activateLinkAnchor('ExpertRuleBase','','ExpertRuleBase') :param str name: :return: Relation() """ return Relation(self.relations.CreateRuleBase(name))
def item(self, i_index: cat_variant) -> Relation: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)) | o Func Item(CATVariant iIndex) As Relation | | Retrieves a relation using its index or its name from the Relations | collection. | | Parameters: | | iIndex | The index or the name of the relation to retrieve from the | collection of relations. As a numerics, this index is the rank of the relation | in the collection. The index of the first relation in the collection is 1, and | the index of the last relation is Count. As a string, it is the name you | assigned to the relation using the | | AnyObject.Name property or when creating the relation. | | Returns: | The retrieved relation | Example: | This example retrieves the last relation in the relations | collection. | | Dim lastRelation As Relation | Set lastRelation = relations.Item(relations.Count) :param cat_variant i_index: :return: Relation :rtype: Relation """ return Relation(self.relations.Item(i_index))
def __getitem__(self, n: int) -> Relation: if (n + 1) > self.count: raise StopIteration return Relation(self.relations.item(n + 1))