Tuesday, July 13, 2010

How do you write code for Catia’s Expert Check Editor?

I've been trying to use KBE (Knowledge Based Engineering) to try and automate a checking procedure on an NC machining process in CATIA V5. The customer requirement is for all cuts to be in the climb direction, not conventional. Using the expert check editor I can implement a checking system to easily make sure all machining operations are compliant with this requirement. Syntax is the trickiest part of the KWE language, so pay close attention to every key stroke you make when programming. Here are the steps:

Knowledgeware>Knowledge Expert Workbench>Expert Check Editor

Be sure to select the KWE Advanced Language from the pull down menu. Now enter the following code:

For All entry: FX:Mfg5AxisCurveMachining; CX:Mfg5AxisFlankContouring

Body entry: /* only interested in multi axis curve operations containing the word "Rough" */

if FX->Name()->Search("Rough")>=0

{

    if FX.MfgDirectionOfCut=="MfgClimb"

    {

        ThisCheck->AddTupleSucceeded (FX)

    }

    else

    {

        ThisCheck->AddTupleFailed (FX)

    }

}


 

/* only interested in multi axis curve operations containing the word "Finish" */


 

if FX->Name()->Search("Finish")>=0

{

    if FX.MfgDirectionOfCut=="MfgClimb"

    {

        ThisCheck->AddTupleSucceeded (FX)

    }

    else

    {

        ThisCheck->AddTupleFailed (FX)

    }

}


 

/* only interested in multi axis FLANK CONTOURING operations containing the word "Chamfer" */


 

if CX->Name()->Search("Chamfer")>=0

{

    if CX.MfgDirectionOfCut=="MfgClimb"

    {

        ThisCheck->AddTupleSucceeded (CX)

    }

    else

    {

        ThisCheck->AddTupleFailed (CX)

    }

}

No comments:

Post a Comment

I'd love to hear from you!