Pages

Showing posts with label KBE. Show all posts
Showing posts with label KBE. Show all posts

Sunday, June 19, 2011

How do you deal with a large assembly in CATIA?

Here are a few notes on the best practices for dealing with a large assembly in CATIA V5 (although this information can also be applied to other CAD systems as well).
Hide/Show
Temporarily hide model
Hide a partial model
Visualization mode
DMU Analysis
Creating Drawings
Node Deactivation
Update BOM
Update Assembly constraints
Unload
Design in context
Deactivate Component
Using knowledgeware rule
Improve Graphic Performance
Good = Hide Component
Better = Deactivate Node, Visualization Mode
Best = Unload unneeded components
Improve CPU Performance
Unload unneeded components
Use Deactivate component via Knowledgeware
You can only modify geometry when it is fully loaded and activated
 

Wednesday, July 14, 2010

How do you write a CATIA CATScript Macro?


A question I often get asked is "how do you create vba macros in Catia?" One solution is to write a script. No, not a script for a movie, a CATScript file! To create a CATScript macro for CATIA open Notepad and write your code, then save the file with whatever name you want and type extension .CATScript instead of .txt. Here is a simple CATScript you can use as an example. This CATScript will tell you which version of Catia you are currently using, including the service pack number. Copy and paste the code into Notepad then save as CatiaVersion.CATScript.


 

Sub CATMain()

Set SystemConfiguration1 = CATIA.SystemConfiguration

Msgbox "CATIA V" & SystemConfiguration1.Version & " R " & SystemConfiguration1.Release & " sp " & SystemConfiguration1.ServicePack
End Sub


Now you are on your way to writing your own CATScript macros and automating simple and repetitive processes!

Learn how to write CATScript macros Lesson 1.

Learn how to write CATIA CATSCRIPT MACROS

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)

    }

}

Monday, July 12, 2010

Catia NC Programming using Check Editor Knowledge Based Engineering


I use the check editor in Catia V5 to improve the quality of NC machining process files. All of my chamfer cuts on this particular part need to have a Tanto Fan axis. I use the code below:

`Far Side Chamfer 1\MfgParameter.5\Tool axis strategy` == "MfgTantoFan" AND
`Far Side Chamfer 2\MfgParameter.5\Tool axis strategy` == "MfgTantoFan" AND
`Near Side Chamfer 1\MfgParameter.5\Tool axis strategy`== "MfgTantoFan" AND
`Near Side Chamfer 2\MfgParameter.5\Tool axis strategy` == "MfgTantoFan" AND
`Near Side Chamfer 3\MfgParameter.5\Tool axis strategy` == "MfgTantoFan"

All of the machining operations in my part need to be climb cut. Therefore, I used this code in the Catia check editor to let me know if it somehow gets changed by accident.

`Rough Far Side.1\MfgParameter.5\Direction of cut` == "MfgClimb" AND
`Rough Far Side.2\MfgParameter.5\Direction of cut` == "MfgClimb"

Keep in mind you can't just use a plain old equals sign, you need to use the double equals. Also, it took me awhile to figure out the correct syntax for  "MfgClimb". I tried "Climb" and MfgClimb unsuccessfully before stumbling upon the successful solution.

I use a parameter to control the depth periphery (depth of cut) and the distance on the rough profile from the tool to the part. Here are the simple formulas for the check editor.

Depth_Periphery == -2mm AND RoughProfile == 1.5mm

/*Check created by Me 7/12/2010*/