Creating a Knowledge Pattern to Instantiate a Module

You can use the Knowledge Pattern command to instantiate a module.


Before you begin:

To view an example, import the GAS_TURBINE_KnowledgePattern_Module ---.000.3dxml file located in win_b64\startup\Knowledgeware\PKT Samples\KnowledgePatternWithModule.

This 3dxml file illustrates how to instantiate FIN_DESIGN Module on a surface following a given pattern. Each FIN instance varies depending on its position on the base surface and relative to the limiting surface.

Refer to the Readme.txt file to understand how to execute the scenario of module instantiation using the Knowledge Pattern command.

  1. From the Compass, click 3D Modeling Apps and select Engineering Rules Capture.
  2. From the Engineering Rules Capture section, click Knowledge Pattern .
    The Knowledge Pattern Editor opens.
  3. In the Knowledge Pattern Editor, enter the following code:

    let i (Integer)
    let moduleInst (Visualizable)
    let l (List)
    i = 1
    
    // Iterate through list of points to instantiate Fin module from local resource.
    for i while i <= GEOMETRICAL_SETS\Relations.1\FIN_POINT_POSITION_PATTERN\FIN_POSITION_POINT_LIST.Size()
    {
    moduleInst = CreateOrModifyTemplate("FIN_DESIGN1",`Gas_Turbine_3DShape ---.000` ,GEOMETRICAL_SETS\
    Relations.1\FIN_MODULE_INST_PATTERN\FIN_MODULE_INSTANCE_LIST, i)
    if(moduleInst <> NULL)
     {
       	//Set inputs to module
    	moduleInst.SetAttributeObject("SURFACE_BASE", INPUTS\Revolute.1 )
    	moduleInst.SetAttributeObject("FIN_POSITION", GEOMETRICAL_SETS\Relations.1\
    FIN_POINT_POSITION_PATTERN\FIN_POSITION_POINT_LIST[i])
    	moduleInst.SetAttributeObject("SURFACE_OUTER_LIMIT", INPUTS\Revolute.2)	
    }
    	
    /* Finalizes the instantiation */
    	EndModifyTemplate(moduleInst)
    moduleInst.Name = "FIN_INSTANCE." + ToString(i)
    }
    

  4. Click OK to validate.