All Frameworks  Object Hierarchy  This Framework  Indexes   

ExpertRuleBaseRuntime (Object)

Represents the Runtime part of the RuleBase.
The following example shows how to create the Rule Base RB1 from a newly created part document:
 Dim CATDocs As Document
 Set CATDocs   = CATIA.Documents
 Dim partdoc As PartDocument
 Set partdoc   = CATDocs.Add("CATPart")
 Dim part As Part
 Set part      = partdoc.Part
 Dim relations As Relations
 Set relations = part.Relations
 Dim Rulebase As ExpertRuleBaseRuntime
 Set RuleBase  = relations.CreateRuleBase("RB1")
 
See also:
Relations

Property Index

ReportDescriptionLength
Returns or sets the Report Description Length (For Text option only).
ReportOutPutFormat
Returns or sets the Report OutPut Format.
ReportPath
Returns or sets the Report output path.
ReportShowResult
Returns or sets the option for sorting the report.
RuleBaseEdition
Returns the editable object corresponding to this rulebase.
RuleSet
Returns the Set linked to the RuleBase.
SolveType
Returns or sets the solve option.
TextVisualization
Returns or sets the Report option for visualization.

Method Index

AccurateType
Returns as a string the type of component.
AddFact
Adds new fact to the rule base resolution.
AddRootOfFacts
Adds a new root of facts to the rule base.
Deduce
Launch a Forward chaining Solve on the current RuleBase.
Fingerprint
Returns the Fingerprint information.
GetNumberOfRootsOfFacts
Retrieves the number of roots of facts of the rule base.
GetRootsOfFacts
Retrieves all the roots of facts from the rule base.
ImportFromFile
Import from file.
ImportWithLink
Import with link to a document.
Import
Import from RuleSet.
RemoveRootOfFacts
Removes a root of facts from the rule base.
Report
Launch a Report.
SynchronizeStatus
Returns the Synchronize information.

Properties


o Property ReportDescriptionLength() As
Returns or sets the Report Description Length (For Text option only).
0
ShortText
1
LongText
o Property ReportOutPutFormat() As
Returns or sets the Report OutPut Format.
0
Html
1
Text
2
Print
3
Email
o Property ReportPath() As
Returns or sets the Report output path.
o Property ReportShowResult() As
Returns or sets the option for sorting the report.
0
ByRule
1
ByObject
2
ByState
o Property RuleBaseEdition() As (Read Only)
Returns the editable object corresponding to this rulebase. Be careful that, according to your licence, or the type of rulebase you're handling, you may not have the right to edit the rulebase.
Example:
 Dim aRBEdition As CATIAExpertRuleBase
 Set aRBEdition = aRBRuntime.RuleBaseEdition

 If not(aRBEdition is Nothing) Then
   ' .. action on the editable rulebase
 End if
 
o Property RuleSet() As (Read Only)
Returns the Set linked to the RuleBase. This is the main RuleSet that contains all the RuleBase components.
o Property SolveType() As
Returns or sets the solve option.
o Property TextVisualization() As
Returns or sets the Report option for visualization.
0
Passed
1
Failed
2
Both

Methods


o Func AccurateType() As
Returns as a string the type of component.
Returns:
A string among ("ExpertRuleBase", "ExpertRuleBaseRuntime")
o Sub AddFact( iFact)
Adds new fact to the rule base resolution.
Parameters:
iFact
Fact to be added
Example:
  Dim pad3 as Shape
  Dim rulebase as ExpertRuleBase

  Set pad3 = part.MainBody.Shapes.Item("Pad3")
  Set rulebase = part.Relations.Item("RuleBase")
  rulebase.AddFact (pad3)
 
o Sub AddRootOfFacts( iRootFacts)
Adds a new root of facts to the rule base.
Parameters:
iRootFacts
root of facts to be added.
o Sub Deduce()
Launch a Forward chaining Solve on the current RuleBase.
Example:
  Dim rulebase as ExpertRuleBase

  Set rulebase = part.Relations.Item("RuleBase")
  rulebase.Deduce ()
 
o Func Fingerprint() As
Returns the Fingerprint information. The fingerprint indicates if the last result of the rulebase is relevant regarding to the objects the rule base has checked. In other words, if the part has evolved since last Deduce, the fingerprint is false. Be careful : on volatile rulebases ( ExpertRuleBase.VolatileCopy ), it raises an error.
Example:
  on error resume next
  part.Relations.Item("RuleBase").Fingerprint ()
  on error goto 0
 
Returns:
Fingerprint information
o Func GetNumberOfRootsOfFacts() As
Retrieves the number of roots of facts of the rule base.
Returns:
Number of roots of facts.
o Sub GetRootsOfFacts( oRootsOfFacts)
Retrieves all the roots of facts from the rule base.
Parameters:
oRootsOfFacts
array of roots of facts.
o Sub ImportFromFile( iPath,
iForce)
Import from file.
Parameters:
iPath
CATBSTR : the path of the document user want to import.
iForce
Boolean : if True (= 1), then if imported rules allready exist in target document, rules of target document are replaced. if False (= 0), then if imported rules allready exist in target document, rules of imported document are ignored.*
Example:
  part.Relations.Item("RuleBase").ImportFromFile ("e:\importeddocument.CATProduct",0)
 
o Sub ImportWithLink( iRoot,
iForce)
Import with link to a document.
Parameters:
iRoot
CATIABase : the root user want to import into.
iForce
Boolean : if True (= 1), then if imported rules allready exist in target document, rules of target document are replaced. if False (= 0), then if imported rules allready exist in target document, rules of imported document are ignored.*
Example:
  part.Relations.Item("RuleBase").ImportWithLink (root,0)
 
o Sub Import( iRuleSet,
iForce)
Import from RuleSet.
Parameters:
iRuleSet
CATIAExpertRuleSet : the RuleSet user want to import.
iForce
Boolean : if True (= 1), then if imported rules allready exist in target document, rules of target document are replaced.
Example:
 Dim CATDocs As Documents
 Set CATDocs   = CATIA.Documents
 Dim partdoc As Document
 Set partdoc = CATDocs.Open("e:\TargetDocument.CATPart")
 Dim part As Part
 Set part      = partdoc.Part
 Dim productdoc As Document
 Set productdoc = CATDocs.Open("e:\ImportedDocument.CATProduct")
 Dim product As Product
 Set product      = productdoc.Product
 Dim ruleset As ExpertRuleSet
 Set ruleset    = product.Relations.Item("RuleBase").RuleSet.ExpertRuleBaseComponentRuntimes.ShallowItem(1)
 part.Relations.Item("RuleBase").Import (ruleset,0)
 
 
o Sub RemoveRootOfFacts( iRootFacts)
Removes a root of facts from the rule base.
Parameters:
iRootFacts
root of facts to be removed.
o Sub Report( reallyStartBrowser)
Launch a Report. The default output format is HTML
Parameters:
reallyStartBrowser
Boolean : if True (= 1), then the browser is started on the report
Example:
  part.Relations.Item("RuleBase").Report (0)
 
o Func SynchronizeStatus() As
Returns the Synchronize information. The synchronize status indicates for a linked rule base if the rulebase is synchronized. Be careful : on volatile rulebases ( ExpertRuleBase.VolatileCopy ), it raises an error.
Example:
  on error resume next
  part.Relations.Item("RuleBase").SynchronizeStatus ()
  on error goto 0
 
Returns:
Synchronize status

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