pycatia.general_knowledge_interfaces.expert_rule_base_runtime¶
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-09-25 14:34:21.593357
Warning
The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.
- class pycatia.general_knowledge_interfaces.expert_rule_base_runtime.ExpertRuleBaseRuntime(com_object)¶
Note
CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
System.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectKnowledgeInterfaces.KnowledgeObjectKnowledgeInterfaces.KnowledgeActivateObjectKnowledgeInterfaces.RelationExpertRuleBaseRuntimeRepresents the Runtime part of the RuleBase.The following example shows how to create the Rule Base RB1 from a newlycreated part document:Dim CATDocs As DocumentSet CATDocs = CATIA.DocumentsDim partdoc As PartDocumentSet partdoc = CATDocs.Add(“CATPart”)Dim part As PartSet part = partdoc.PartDim relations As RelationsSet relations = part.RelationsDim Rulebase As ExpertRuleBaseRuntimeSet RuleBase = relations.CreateRuleBase(“RB1”)See also:Relations- accurate_type() str ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func AccurateType() As CATBSTRReturns as a string the type of component.Returns:A string among (“ExpertRuleBase”, “ExpertRuleBaseRuntime”)
- Return type:
str
- add_fact(i_fact: AnyObject) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub AddFact(AnyObject iFact)Adds new fact to the rule base resolution.Parameters:iFactFact to be addedExample:Dim pad3 as ShapeDim rulebase as ExpertRuleBaseSet pad3 = part.MainBody.Shapes.Item(“Pad3”)Set rulebase = part.Relations.Item(“RuleBase”)rulebase.AddFact (pad3)
- Parameters:
i_fact (AnyObject) –
- Return type:
None
- add_root_of_facts(i_root_facts: AnyObject) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub AddRootOfFacts(AnyObject iRootFacts)Adds a new root of facts to the rule base.Parameters:iRootFactsroot of facts to be added.
- Parameters:
i_root_facts (AnyObject) –
- Return type:
None
- deduce() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub Deduce()Launch a Forward chaining Solve on the current RuleBase.Example:Dim rulebase as ExpertRuleBaseSet rulebase = part.Relations.Item(“RuleBase”)rulebase.Deduce ()
- Return type:
None
- fingerprint() bool ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func Fingerprint() As booleanReturns the Fingerprint information. The fingerprint indicatesif the last result of the rulebase is relevant regarding to theobjects the rule base has checked. In other words, if the parthas evolved since last Deduce, the fingerprint is false.Be careful : on volatile rulebases ( ExpertRuleBase.VolatileCopy ), it raises an error.Example:on error resume nextpart.Relations.Item(“RuleBase”).Fingerprint ()on error goto 0Returns:Fingerprint information
- Return type:
bool
- get_number_of_roots_of_facts() int ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func GetNumberOfRootsOfFacts() As longRetrieves the number of roots of facts of the rule base.Returns:Number of roots of facts.
- Return type:
int
- get_roots_of_facts(o_roots_of_facts: tuple) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub GetRootsOfFacts(CATSafeArrayVariant oRootsOfFacts)Retrieves all the roots of facts from the rule base.Parameters:oRootsOfFactsarray of roots of facts.
- Parameters:
o_roots_of_facts (tuple) –
- Return type:
None
- import_(i_rule_set: ExpertRuleSet, i_force: bool) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub Import(ExpertRuleSet iRuleSet,boolean iForce)Import from RuleSet.Parameters:iRuleSetCATIAExpertRuleSet : the RuleSet user want to import.iForceBoolean : if True (= 1), then if imported rules allready exist in target document, rules of target document are replaced.Example:Dim CATDocs As DocumentsSet CATDocs = CATIA.DocumentsDim partdoc As DocumentSet partdoc = CATDocs.Open(“e:/TargetDocument.CATPart”)Dim part As PartSet part = partdoc.PartDim productdoc As DocumentSet productdoc = CATDocs.Open(“e:/ImportedDocument.CATProduct”)Dim product As ProductSet product = productdoc.ProductDim ruleset As ExpertRuleSetSet ruleset = product.Relations.Item(“RuleBase”).RuleSet.ExpertRuleBaseComponentRuntimes.ShallowItem(1)part.Relations.Item(“RuleBase”).Import (ruleset,0)
- Parameters:
i_rule_set (ExpertRuleSet) –
i_force (bool) –
- Return type:
None
- import_from_file(i_path: str, i_force: bool) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub ImportFromFile(CATBSTR iPath,boolean iForce)Import from file.Parameters:iPathCATBSTR : the path of the document user want to import.iForceBoolean : if True (= 1), then if imported rules allreadyexist in target document, rules of target document arereplaced. if False (= 0), then if imported rules allreadyexist in target document, rules of imported document are ignored.*Example:part.Relations.Item(“RuleBase”).ImportFromFile(“e:/importeddocument.CATProduct”,0)
- Parameters:
i_path (str) –
i_force (bool) –
- Return type:
None
- import_with_link(i_root: AnyObject, i_force: bool) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub ImportWithLink(AnyObject iRoot,boolean iForce)Import with link to a document.Parameters:iRootCATIABase : the root user want to import into.iForceBoolean : if True (= 1), then if imported rules allready existin target document, rules of target document are replaced.if False (= 0), then if imported rules allready exist intarget document, rules of imported document are ignored.*Example:part.Relations.Item(“RuleBase”).ImportWithLink(root,0)
- Parameters:
i_root (AnyObject) –
i_force (bool) –
- Return type:
None
- remove_root_of_facts(i_root_facts: AnyObject) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub RemoveRootOfFacts(AnyObject iRootFacts)Removes a root of facts from the rule base.Parameters:iRootFactsroot of facts to be removed.
- Parameters:
i_root_facts (AnyObject) –
- Return type:
None
- report(really_start_browser: bool) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub Report(boolean reallyStartBrowser)Launch a Report. The default output format is HTMLParameters:reallyStartBrowserBoolean : if True (= 1), then the browser is started on the reportExample:part.Relations.Item(“RuleBase”).Report (0)
- Parameters:
really_start_browser (bool) –
- Return type:
None
- property report_description_length: int¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property ReportDescriptionLength() AsCatDescriptionLengthTypeReturns or sets the Report Description Length (For Text optiononly).0ShortText1LongText
- Returns:
enum cat_description_length_type
- Return type:
int
- property report_output_format: int¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property ReportOutPutFormat() As CatOutPutFormatTypeReturns or sets the Report OutPut Format.0Html1Text2Print3Email
- Returns:
enum cat_out_put_format_type
- Return type:
int
- property report_path: str¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property ReportPath() As CATBSTRReturns or sets the Report output path.
- Return type:
str
- property report_show_result: int¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property ReportShowResult() As CatShowResultTypeReturns or sets the option for sorting the report.0ByRule1ByObject2ByState
- Returns:
enum cat_show_result_type
- Return type:
int
- property rule_base_edition: ExpertRuleBase¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property RuleBaseEdition() As ExpertRuleBase (Read Only)Returns the editable object corresponding to this rulebase. Be carefulthat, according to your licence, or the type of rulebase you’re handling, youmay not have the right to edit the rulebase.Example:Dim aRBEdition As CATIAExpertRuleBaseSet aRBEdition = aRBRuntime.RuleBaseEditionIf not(aRBEdition is Nothing) Then‘ .. action on the editable rulebaseEnd if
- Return type:
- property rule_set: ExpertRuleSet¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property RuleSet() As ExpertRuleSet (Read Only)Returns the Set linked to the RuleBase. This is the main RuleSet thatcontains all the RuleBase components.
- Return type:
- property solve_type: int¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property SolveType() As CatSolveTypeReturns or sets the solve option.
- Returns:
enum cat_solve_type
- Return type:
int
- synchronize_status() bool ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func SynchronizeStatus() As booleanReturns the Synchronize information. The synchronize status indicatesfor a linked rule base if the rulebase is synchronized.Be careful : on volatile rulebases ( ExpertRuleBase.VolatileCopy ), it raises an error.Example:on error resume nextpart.Relations.Item(“RuleBase”).SynchronizeStatus ()on error goto 0Returns:Synchronize status
- Return type:
bool
- property text_visualization: int¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
- o Property TextVisualization() As CatVisualizationTypeReturns or sets the Report option for visualization.0Passed1Failed2Both
- Returns:
enum cat_visualization_type
- Return type:
int