Anda di halaman 1dari 37

IntroductiontoModelingwith CATIAV5

AdvancedModeling

DIVISIONOFMACHINEDESIGN DEPARTMENTOFMANAGEMENTANDENGINEERING LINKPINGSUNIVERSITET SE58183LINKPING,SWEDEN

LINKPING2009

Preface
In this work the authors have tried to gather in an ordered fashion the knowledge and experience they have developed while working with CATIA V5. The intent was to provide students with a short guide that would give useful hints on how to use CATIA V5 in a more efficient and prolific way. Modern CAD systems are so much more than a digital drawing board! Due to obvious space limitations, this compendium can not be as detailed and exhaustive as other more specific available literature can be. In the following chapters the reader will find overviews on several different workbenches and descriptions on theoretical modelling techniques that the authors have developed while using CATIA V5 in their research projects. After an initial short crash course aimed at providing the necessary skills in the main modelling workbenches, the reader will be taught: how to add flexibility to a CAD model in order to be able to reuse it as many times as possible; how to ensure model robustness; how to add the designers knowledge to the model; how to connect the CAD system to other tools for analysis or optimization. At the end of each chapter there will be exercises with step-by-step instructions to guide the reader and to underline the most important aspects. To more effectively learn more about how to work in different CATIA workbenches the following sources are recommended: CATIA help is a detailed source with rich information about all workbenches and functions combined with useful tutorials. Enter the help by either clicking on CATIA V5 Help or clicking on F1 after entering a function. CATIA compendium is a step by step tutorial useful when a detail insight is wanted for an entire workbench. Lastly use the internet to find solutions. Google is a helpful search engine finding solutions in different discussion boards just by typing in what one is searching for. Use the following CATIA forums: http://www.catiav5forum.de http://www.coe.org/ In the authors plan, this compendium will be successively updated and reworked, to keep it in line with their own expertise and understanding of the possibilities offered by CATIA V5.

Table of Contents
1 Modeling for Re-Use ........................................................................................................ 7 1.1 Re-Use Modeling Definition...................................................................................... 7 1.1.1 Robot Example................................................................................................... 8 1.1.2 Aircraft Example .............................................................................................. 11 1.2 How to set up a Re-Usable Model ........................................................................... 14 CATIA Knowledgeware .......................................................................................... 15 2.1.1 Engineering Knowledge Language (EKL)....................................................... 16 2.1.2 Visual Basic for Applications (VBA) .............................................................. 19 2.1.2.1 Debugging Tips ............................................................................................ 21 2.2 Knowledge Advisor ............................................................................................ 22 2.2.1 Formula Function........................................................................................ 22 2.2.2 Rule Function.............................................................................................. 23 2.2.2.1 To set a value to parameters using EKL ...................................................... 25 2.2.2.2 To activate and deactivate objects using EKL ............................................. 25 2.2.3 Reaction Function ....................................................................................... 25 2.2.3.1 To set a value to parameters using VB scripts ............................................. 27 2.2.3.2 To activate and deactivate objects using VB scripts .................................... 28 2.2.4 Check Function ........................................................................................... 28 2.2.5 Parameter Set Function ............................................................................... 28 2.2.6 Relation Set Function.................................................................................. 29 2.2.7 Parameterization Methodologies...................................................................... 29 2.2.7.1 Parameter Overview..................................................................................... 31 2.2.7.2 When Creating Parameters........................................................................... 33 2.2.8 Power Copy Instances................................................................................. 33 2.2.8.1 Manually Initiated Power Copies................................................................. 33 2.2.8.2 Automatically Initiated Power Copies ......................................................... 33 2.3 Tutorials ................................................................................................................... 34 2.3.1 Parametric LEGO Exercise .............................................................................. 34 2.3.2 Parametric Planetary Gear Exercise................................................................. 34 Interface Modeling ......................................................................................................... 35 3.1 Excel-CATIA Interfacing......................................................................................... 35 3.1.1 How to Connect................................................................................................ 35 3.1.2 Tutorial ............................................................................................................. 35 3.2 Matlab - Excel Interfacing........................................................................................ 35 Computer Aided Engineering (CAE) ........................................................................... 36 4.1 Tutorial ..................................................................................................................... 36 Optimization ................................................................................................................... 37 5.1 Tutorial ..................................................................................................................... 37

4 5

1 Modeling for Re-Use


1.1 Re-Use Modeling Definition
Traditionally CAD tools have been used in the design of products in later phases or as of recently more as stand alone tools in the conceptual phase to assist engineers with outputs such as weight, mass inertia, centre of gravity and possible clashes between different parts. To be able to perform such an analysis, traditional CAD modeling techniques is believed to be not very efficient but nevertheless sufficient. However to be able to insert a geometric model in an optimization framework and also be able to efficiently modify the model to represent different types of concepts, new ways to perform CAD Modeling have to be explored. To further develop the depicted method in, geometric modeling has been divided into two categories. One category will describe the morphological levels of geometric modeling while the second category will reflect on how to effectively increase, reuse or replace the number of geometric objects. Different morphological models which will be discussed in this section are displayed in Figure 1-1, with increasing modeling complexity for each step in the pyramid.

b Script Based Relation

if shape = sq h { h = 10, b = h } else { h = 10, b = 2*h } b

Mathematic Based Relation b Parameterization

h = 10 b = 2*h h = 10 h b = 20

Fixed Object

Figure 1-1 The morphological pyramid visualizing the stages of geometric modeling.

Morphologic geometric objects can be divided in four stages: 1. Fixed Objects (FO) are essentially objects not being able to change shape. These objects are intentionally or non-intentionally static and have therefore a fixed set of geometric output. This stage has zero morphological value. 2. Parameterization is made on geometric objects of which the values are able to change, hence not having a static set of output. Because of lack of relations between the various geometric objects it is not realistic to use models based only on parameterization other than cases of non complex geometries. 3. An effective way to decrease the number of input parameters is to set up relations between the geometric objects of a model. This can be done strictly mathematically referred to as Mathematic Based Relation (MBR) in Figure 1-1. 4. Script Based Relations (SBR) models created by writing the relations using the various programming languages provided, described in Figure 1-1. The main advantage SBR has over MBR is the ability to involve non numerical parameters. The relations described in stage 3 and 4 can either be directly written in the CAD software or in an outside tool connected via the CAD API (application programming interface). The

advantages of applying the geometric relations outside the CAD tool will be further discussed in the application chapter. The main shortcomings of only using morphological based models in the automatic design process is that the numbers of objects are fixed during the simulation and a methodology on how to make the models efficiently reusable and/or replaceable is underdeveloped as addressed by many experts. To describe the following topological process two new terms are introduced namely template and constraint. A template refers to an initial model to be reinitiated and constraints are conditions which have to be satisfied by the initiated instances. The different levels of initiating geometric instances are viewed in the topological pyramid in Figure 1-2.

Figure 1-2 The topological pyramid visualizing the stages of geometric initialization.

The topological pyramid consists of the following stages: 1. As can be seen in Figure 1-2 only the template is defined in the first stage Automatic Initialization (AI) and the constraint definition is left out. A common function used in most CAD systems known in some cases as the pattern tool is used to generate and degenerate the number of objects automatically. The re-initiated instances lack in two areas namely not having unique set of parameters and therefore following the template model slavishly and also not being able to be context dependent due to missing constraint definition. Because of these critical shortcomings the AI method has not been used in this work. 2. Context dependency for initiated instances is achieved by producing template and constraint manuals. The manuals contain complete construction procedures of the template and to which geometric features they are constrained to. These definitions enable the template to be manually initiated into different contexts as seen in stage 2 as Generic Initialization (GI) and thereby increase the level of reusability in a created geometric model. 3. Generic Automatic Initialization (GAI) is achieved when pre-defined functions can automatically generate or delete the instances depending on user parameter input.

1.1.1 Robot Example


The main task of the geometric model in this framework was to allow designers to easily change the geometric structure parts and also have access to a very large component library. To achieve the topological features described earlier the model has been divided into three sub assemblies, namely the skeleton assembly MDF (Master Datum File), the component

assembly MDC (Master Definition Component) and the structure assembly MDS (Master Definition Structure). The model presented is built using CATIA V5R17. The geometric templates used are stored outside the geometric model and initiated parametrically using VB script as seen in Figure 1-3. The work flow to setup the geometric model is illustrated in following points: 1. The user starts by opening the geometric model, finding three empty sub-assemblies; MDF, MDC and MDS. 2. The first choice is to decide the number of axis of the robot. Upon this choice a reaction will call a VB script which creates the parts and imports the geometric objects from the MDF template to the MDF assembly. The constraints of each initiated instance are given by the translation and rotation of the previous instance. This process is made using the GAI method and the template is a MBR model. 3. To customize the skeleton of the robot the user has to define the start and end position, the rotational axis and the position of the component for each initiated instance in the MDF assembly. 4. By entering the name of the component in each initiated MDC instance a reaction will retrieve the component template from the MDC Template. This process is made using the GAI method and the template is a FO described only with a single geometric object see Figure 1-4. The constraints are retrieved from the MDF product which defines each component placement. 5. To define the robot structure, the MDS template is chosen parametrically. A reaction will then insert the chosen template in each axis, using data from the previously initiated MDF and MDS instances as constraints see Figure 1-3 and Figure 1-5. This insures each initiated instance to be context dependent. The topological process is as before GAI based and the templates are all SBR models.

Geometric Geometric Templates Templates

VB VB Script Script

Geometric Geometric Model Model


MDF MDF

MDF Template MDF Template


MDF.CATPart

MDC Template MDC Template FHA FHA


FHA17.CATPart FHA25.CATPart MDC MDC

CHA CHA
CHA20.CATPart CHA32.CATPart

MDS Template MDS Template MDS-T1 MDS-T1


Even_MDS.CATPart Odd_MDS.CATPart MDS MDS

MDS-T2 MDS-T2
Even_MDS.CATPart Odd_MDS.CATPart

MDS-T3 MDS-T3
Figure 1-3 Geometric Templates in pre-saved folders are initiated to the Geometric model with pre-defined VB scripts and customized with the design parameters retrieved from the instances.

The number of components available is increased easily as soon as a new component is added to MDC template. The new component can then be retrieved in the Geometric model by writing its name in a Component_Choice parameter as seen in Figure 1-4.

Figure 1-4 Actuators are generated parametrically.

The number of MDS templates is increased when a new type of geometric structure is constructed and a new folder created to contain the created parts Even_MDS.CATPart and Odd_MDS.CATPart.

VB VB Script Script Geometric Geometric Templates Templates

MDS-T1 MDS-T1

MDS-T2 MDS-T2

MDS-T3 MDS-T3

Figure 1-5 Different geometric models generated depending on various parametric inputs.

As seen in Figure 1-5the modular robot generated depends not only on the morphological parameters defining the shape of the structure but more importantly on the topological parameters. These parameters directly define the number of instances and indirectly the morphological shape as well, since each MDS template initiated has its own morphological design space.

1.1.2 Aircraft Example


An extensive amount of repetitive work occurs in the design of the structural parts of aircraft which makes this domain a great example of the GAI method. The construction of frames, stringers and windows are all of the same nature and the basic idea is that the same building method is repeated following the certain pattern. By automating this process the designer can use the same template to generate or delete structural elements.

Figure 1-6 Typical structural layout of transport aircraft.

Considering the number of similar elements that can be found in a transport aircraft (see

Figure 1-6) it is obvious that large savings in terms of time, and therefore money, can be achieved through automation of the design process. Through a design interface, the position, number, size and characteristics of the structural elements can be controlled. In the example below (Figure 1-7) it is shown how fuselage frames and stringers are controlled through a design interface modeled in MS Excel.

Figure 1-7 An Excel interface controls the frames and stringers arrangement.

Similarly to what have been previously described for the robot example, to control the structural layout of the aircraft, templates have been widely used. In order to guarantee a high degree of flexibility, the CAD model must be built in a correct way. Figure 1-8 shows the relational links between the different elements of the model. The input parameters govern directly the Datums Model (MDF) and the Surfaces Model (MDS). The MDF-model is a

wireframe model where all reference planes and lines, needed to define the aircraft and its structure, are defined. It is important to notice that all the structure components in the CAD model depend on both the MDF-model and MDS-model, that are depending instead only on the top level input parameters. The MDS surfaces model contains all the external surfaces together with the surfaces defining the air intake, the exhaust gases outlet, the engine bay and the payload bay (see Figure 1-9). These surfaces are required to specify the limits within which the general structural element is allowed to extend. The structure is obtained instancing a structural template element that is designed to adapt itself, given the following parameters that are specified in the MDF-model and MDS-model: The main direction along which to develop the structural element Two lines defining the start and end point Upper and lower surface between which the element is adapted Eventual surfaces defining cutouts.

Figure 1-8 Relational links in the aircraft model. Input parameters control both the Datums Model (MDF) and the Surfaces Model (MDS), while the structural elements are depending on both MDF and MDS.

The structure element template is used for all the structure parts of the aircraft: frames, beams and ribs. Widths and wall thicknesses of each element are governed by individual parameters, allowing for optimization of the structural design. The structure layout is not only morphing changing the distance between the elements, but parts can be added or removed at will (topological changes, see Figure 1-2). It should be noted that in some locations the instantiated part does not intersect the air intake/exhaust channel or the payload bay, while in some other it does. This is allowed by using the Functional Molded Parts (FMP) workbench, in which so-called Protected Features can be defined. If a protected feature intrudes within a given part, a cutout is automatically created. Without FMP the same operation would have required careful scripting, since the intersection calculation would incur into error every time there was no intersection between one part and one of the protected features.

Structure Template

Figure 1-9 One single structural element template is used to generate all different parts: ribs, frames and beams. Using FMP protected features can be defined and cutouts automatically created only when necessary.

1.2 How to set up a Re-Usable Model


This section will be completed in the coming compendium versions.

CATIA Knowledgeware

In CATIA V5 it is possible to use several programming languages for automating processes or adding knowledge to a model. Apart from Visual Basic for Applications (VBA) it is possible to adopt the Engineering Knowledge Language (EKL). Another option that will not be analyzed any further in this compendium is to use CAAV5 through which it is possible to access and modify core functions that are located deep down in the CATIA V5 System. Compared to the programming environments that will be described in this chapter, the biggest advantages of CAAV5 are that there are no limitations to what can be achieved and that the programming code is compiled before it can be executed, thus increasing the system performances. Figure 2-1 hereby shows how the three programming languages perform in terms of speed of execution as function of the number of functionalities that can be accessed and controlled. In other terms, how much can be done is plotted on the y-axis, while how fast the code runs is on the x-axis. One of the most important differences between EKL and VBA scripts is that using the first one, in order to point at instances their name and address must be explicitly written, while with VBA the name or address can be set as a variable of type string. For example, to change the offset value of a plane to 100mm using EKL:
Geometrical Set.1\Plane.1\Offset = 100mm

Using VBA the same could be achieved writing:


Name = Plane.1 Set geometricalSet1 = hybridBodies1.Item(Geometrical Set.1) Set hybridShapes1 = geometricalSet1.HybridShapes hybridShapes1.Item(Name).Offset.Value = 100

It appears clearly from this example that EKL is much more compact and requires far less lines of code to achieve the same result (Please note that this is only a portion of the code needed; more information on how to write scripts in EKL or VBA will be given in paragraph [REF]). The reason is that when using VBA the script must include instructions on how to navigate through the product or part structure, while that is not necessary with EKL. In paragraph 2.1.2 it is explained how to reflect the Specification Tree structure in the VBA code.
CAAV5
CATIA Functions Accessibility

VBA

EKL
Execution Speed

Figure 2-1 Performance difference between EKL, VBA and CAAV5.

2.1.1 Engineering Knowledge Language (EKL)


EKL is one of the programming languages that allow evaluating parameters and linking them with mathematical expressions in the Knowledge Advisor Workbench. There are different sub-types of EKL, each one for a specific usage (see Figure 2-2 below).

Figure 2-2 The different levels of Engineering Knowledge Language.

The Mathematical Engineering Language (M-EKL) includes the language operators and the numerical functions necessary to express the sets of equations used to valuate parameters in the Knowledge Advisor workbench. M-EKL comprises: Mathematical functions; Analysis Operators; Measures; Part measures.

A complete list can be found in the CATIA help under Knowledge Advisor Engineering Knowledge Language; hereby will only a few examples will be presented. When dealing with finite element analysis it can be useful to extract the maximum stress value that is measured in the whole model. This can be i.e. done by using the M-EKL Analysis Operator misesmax (Case: StaticSolution) as in the example:
misesmax.1=misesmax("Finite Element Model\Static Case Solution.1")

The distance-function is also very useful and common. It allows measuring the distance between two desired bodies of a part and storing the measure value in a given parameter. The syntax for the distance-function is similar to the one of most other Measure functions: distance (Body, Body): Length. In addition to the components included in M-EKL, the Core Engineering Language (CEKL) adds: Keywords for control structures, like if-then-else logical statements that can be written in i.e. rules and checks;

Specific functions and commands, for instance to show the user pop-up windows for messages or inputs; Additional logical operators as =>, which means implies; Formulas; Design Tables; Rules and checks, included in the Knowledge Advisor workbench; Constraint satisfaction feature in the Product Engineering Optimizer workbench (PEO). It can be worth to quickly browse through the syntax of the control structures available in C-EKL. First of all the if-statement that for a Rule can be written as:
if condition statements [else elsestatements ]

or
if condition { statements } [else if condition-n [ { elseifstatements } ] ] . . . [else [ { elsestatements } ] ]

It is important to note that there is a significant difference in how Rules and Checks handle these structures. Since Checks only handles parameters, an if-statement would become for instance:
Relations\Formula.1\Activity == false

The result would be that if Relations\Formula.1\Activity is equal to false then the Check condition is satisfied or else some action(s) are trigged (i.e. a warning message window can be displayed). See paragraph [REF] for more details. Next is the for-statement which allows writing loops with the control condition written at the beginning of the statement. The control condition can be either based on an element x belonging to a list or an algebraic expression where a counter variable is increased at the end of each execution of the body of the loop. The syntax is as follows:
for condition { [ { body statements } ] }

Another type of loop can be obtained using the while-statement, where the execution is repeated until a control statement becomes false. The syntax is:
while condition { [ { body statements } ] }

The Advanced Engineering Language (A-EKL) includes most of the operators, keywords and functions of C-EKL. It can be used to create design objects enriched by a knowledge type. A-EKL is the level of language to manipulate them as knowledge objects through tightly integrated knowledge artifacts: Actions and Reactions in the Knowledge Advisor workbench (see paragraph [REF] for more details); Expert Rules in the Knowledge Expert workbench (not included in this compendium);

Behaviors in the Business Process Knowledge Template workbench (BKT) (not included in this compendium); Patterns in the Product Knowledge Template workbench (PKT) (not included in this compendium); A-EKL also provides a full set of functionalities to manipulate V5 features as Knowledge Objects: Knowledge Objects: basic attributes and methods; Search capabilities; Value pointers manipulation; Applications-specific services (constructors).

Very useful among these are the constructors that allow creating several different types of geometrical elements: Point constructors; Line constructors; Plane constructors; Surface constructors; Circle constructors; Direction constructors; Wireframe constructors.

Hereby a few examples will be provided. Please note that for each geometrical element, all the different ways of defining them that can be used when manually modeling are also available for scripting (see Part Design or Generative Shape Design workbenches in the Basic Modeling compendium). For example, to create a point the following constructors are available: point (x: Length, y: Length, z: Length): Point pointbetween (pt1: Point, pt2: Point, ratio: Real, orientation: Boolean): Point pointoncurve (crv: Curve, pt: Point, distance: Length, orientation: Boolean): Point pointoncurveRatio (crv: Curve, pt: Point, ratio: Real, orientation: Boolean): Point pointonplane (pln: Plane, pt: Point, dx: Length, dy: Length): Point pointonsurface (sur: Surface, Pt: Point, Dir: Direction, dist: Length): Point center (circle): Point pointtangent (Curve, Direction): Point extremum (Curve, Direction, Boolean, Direction, Boolean, Direction, Boolean): Point extremum (Surface, Direction, Boolean, Direction, Boolean, Direction, Boolean): Point extremum (Solid, Direction, Boolean, Direction, Boolean, Direction, Boolean): Point centerofgravity (Body,...): Point curvaturecenter (crv: Curve, pt: Point): Point So, in order to construct a point as the center of a given circle the code would be:
Geometrical Set.1\Point.1 = circle (Geometrical Set.1\Circle.1)

To construct a point on a curve 15mm from a reference point:


Geometrical Set.1\Point.2 = pointoncurve (Geometrical Set.1\Spline.1, Geometrical Set.1\Point.1, 15mm, true)

Similar code is used to construct other geometrical elements using the other available methods. Refer to the CATIA V5 help for more details. For example, to create a line passing through a point and parallel to a given direction, the following code can be used:
Geometrical Set.1\Line.1 = line (`Geometrical Set.1\Point.1` , direction (`zx plane`), 0mm, 50mm, true)

To create a plane that is offset from a reference plane and passing through a given point:
Geometrical Set.1\Plane.2 = planeoffset (`Geometrical Set.1\Plane.1` , `Geometrical Set.1\Point.1`)

The Extensible Engineering Language (X-EKL) contains the applicative packages available in EKL and is also the way to add functions to the EKL language by two means: CAAV5 development (users development); User functions.

2.1.2 Visual Basic for Applications (VBA)


As the name suggests is Visual Basic for Applications (VBA) closely derived from Visual Basic (VB). Unlike VB, VBA is not a standalone application, but requires a host application within which the code ca be run. VBA can be used to control one application from another one, using Object Linking and Embedding (OLE) automation. OLE automation is a communication mechanism that allows controlling and manipulating different applications using COM communication. Therefore the same VBA code written in the CATIA editors can be used and works perfectly even inside other applications, for instance MS Excel. One practical difference is that when writing VBA code in a CATIA editor, the object CATIA (that describes the CATIA application) does not need to be defined, when writing the same script i.e. as an Excel macro the same object needs the following definition:
Set CATIA = GetObject( , CATIA.Application )

As anticipated at the beginning of the chapter, the VBA script must include instructions on how to navigate through the Specification Tree structure. Figure 2-3 here next presents the first levels objects that are accessible for a given Part Document.

Figure 2-3 Part Document Automation Objects.

As an example, let us assume that a given Part called Box.CATPart contains a parameter called Height whose value needs to be accessed and set equal to 100mm. With reference to Figure 2-3, the parameter will be found in the PartDocument Part Parameters. This is the path to be inserted in the VBA script:
Set CATIA = GetObject("", "CATIA.Application") Set PartDocuments = CATIA.Documents Set Box_Item = PartDocuments.Item("Box.CATPart") Set Box_Part = Box_Item.Part Set Box_Parameters = Box_Part.Parameters Set Height = Box_Parameters.Item("Height") Height.Value = 100 Box_Part.Update

The first row will only be needed if the script is written to be executed in an application outside CATIA. The methods .Documents, .Part and .Parameters are the ones that allow moving downwards in the Specification Tree of the model. The final line shows the method .Update that triggers the update of the model in order to refresh the geometries in accordance to the new parameter value. Compare the structure pictured in Figure 2-3 with the code lines here above and with the Specification Tree structure in Figure 2-4.

Figure 2-4 Specification Tree of Box.CATPart.

2.1.2.1 Debugging Tips Debugging functionalities like Step Through or similar are not available when writing scripts in a CATIA editor. If working on a longer and more complex script, it can therefore be advisable to write the code first in another VBA editor (i.e. Excel) where debugging the code can be mush easier. The Excel VBA editor has an extremely helpful tool. All objects can be monitored and analyzed in depth using the Add Watch command. When stepping through a script, as soon as the object is defined and given a value, all properties and methods available can be visualized.

2.2

Knowledge Advisor

The workbench of the Knowledge Advisor is visualized in Figure 2-5. The functions and tree objects important for this course are further explained in following sections.

Rule Function Parameter Set Parameters Derived Variable Relation Set Check Function Reaction Function

Parameter Set Function Relation Set Function

Rule Reaction Check

Formulas

Object Parameters

Derived Object Variables Formula Function

Figure 2-5 The user interface of Knowledge Advisor.

2.2.1

Formula Function

When selecting the formula function one is able to create or modify parameters. This is further visualized in Figure 2-6.

Type of Parameter

No. of Values

Figure 2-6 The Formula function window.

Here the user starts by defining the type of Parameter to create and then creating the Parameter to finally assign a value or add a formula to the Parameter. The Parameters are then featured under a Parameter Set, apart from the object Parameters such as Circle, Point and Line which are featured under a Geometric Set as Object Parameter. Every created Parameter in Formula function is called a Parameter unless it is given Relation with use of Formula, Rule, Reaction or any other application. A Relation based Parameter is called a Derived Variable. A Relation based Object Parameter is therefore called Derived Object Variable. The Derived Variables and Derived Object Variables have distinct icons as seen Figure 2-5.

2.2.2

Rule Function

Here a Rule is created using the Engineering Knowledge Language of CATIA. The Rule created is visualized under a Relation Set in the models tree.

Figure 2-7 The Rule function script editor window.

The script is written in the editor window. A Dictionary is incorporated to assist the user with basic scripts. In Parameter section one can access all parameters in the model tree. These parameters are further divided in different parameter types as seen under Member of Parameters. Finally under Member of all the Parameters selected in Member of Parameters are viewed. By double clicking on these members, the script will be attached in the editor. A Rule is a set of instructions, generally based on conditional statements, whereby the relationship between parameters is controlled. A rule is executed when one of its input parameters has changed or when one of its input features has changed and if you require the update of the rule. The consequence is that it is impossible for you to completely control when the rule is to be fired. As a result, rules can only manipulate parameters and features and are to be used to control the status of a design (change of parameters and geometry). To visualize how a Rule and also a Reaction is set up the EKL and VB scripts will be set up to perform the same task. The first task will be to assign a Length Parameter depending on which string Parameter is chosen. The second example is to activate and deactivate an object depending on which Integer Parameters are chosen, see Figure 2-8.

Figure 2-8 Two Rule functions are created using the EKL script.

As can be seen there are two Rules made to perform separate tasks. The scripts used are further depicted below. 2.2.2.1 To set a value to parameters using EKL
if H == "H1" { Height = 5 mm } else { Height = 4 mm }

2.2.2.2 To activate and deactivate objects using EKL


if X == 2 and Y == 2 { PartBody\Pad.3\Activity = true } else if X < 3 { PartBody\Pad.3\Activity = false } else { PartBody\Pad.3\Activity = true }

2.2.3

Reaction Function

Here a Reaction is created using the Engineering Knowledge Language or Visual Basic Language of CATIA. The Reaction created is visualized under a Relation Set in the models tree. The reaction is a feature that reacts to events on its sources by triggering an action. It is

designed to cope with the rules and the behaviors limitations and to create more associative and reactive design.

Figure 2-9 The Reaction function script editor window.

The script is written in the editor window. A Dictionary is incorporated to assist the user with basic scripts just as the Rule function. However if the VB action is chosen then another editor environment will be shown and the script is written following the VB syntax instead of EKL, please compare the following examples with the Rule section.

Figure 2-10 Two Reactions are created using VB script.

As can be seen in Figure 2-10 there are two Reactions made to perform separate tasks. The scripts used are further depicted bellow. 2.2.3.1 To set a value to parameters using VB scripts
Set documents1 = CATIA.Documents Set partDocument1 = documents1.Item("P1.CATPart") Set part1 = partDocument1.Part Set parameters1 = part1.Parameters Set H_T = parameters1.Item("HT") Set H_ = parameters1.Item("H") If H_T.Value = H1 Then H_ = 5 mm Else H_ = 5 mm End If part1.Update

2.2.3.2 To activate and deactivate objects using VB scripts


Set documents1 = CATIA.Documents Set partDocument1 = documents1.Item("P1.CATPart") Set part1 = partDocument1.Part Set parameters1 = part1.Parameters Set bodies1 = part1.Bodies Set body1 = bodies1.Item("PartBody") Set shapes1 = body1.Shapes Set Pad1 = shapes1.Item("Pad.3") Set Y1 = parameters1.Item("Y") Set X1 = parameters1.Item("X") If X1.Value = 2.000000 and Y1.Value = 2.000000 Then part1.activate Pad1 Elseif X1.Value < 3.000000 Then part1.Inactivate Pad1 Else part1.activate Pad1 End If part1.Update

2.2.4

Check Function

Here a Check is created using the Engineering Knowledge Language of CATIA. The Check created is visualized under a Relation Set in the models tree. A Dictionary is incorporated to assist the user with basic scripts just as the Rule function.

Figure 2-11 The Check function script editor window.

2.2.5

Parameter Set Function

By clicking on the Parameter Set Function a Parameter Set is created in which a set of Parameters can be stored in the model tree. An example of how such a division might look like is visualized in Figure 2-12.

Figure 2-12 Parameters ordered in a hierarchal fashion by using Parameter Sets.

2.2.6

Relation Set Function

By clicking on the Relation Set Function a Relation Set is created in which a set of Relations can be stored in the model tree.

2.2.7 Parameterization Methodologies


In CATIA for every object created there are to modify the object parametrically. These objects can either consist of one or several parameters.

Figure 2-13 Parameters linked to a point object.

In this example the parameters available for a Point object is viewed and as shown there are 5 parameters available: Three of which are Length parameters for deciding the length of the X, Y and Z parameters, i.e. 200mm, 50mm etc One Boolean parameter which decides the activation state of the Point feature, i.e. True or False. One parameter which defines the Point parameter itself. This parameter can be used to i.e. construct a Line.

Figure 2-14 Parameters linked to a spline object.

In this example the parameters available for a Spline object is viewed and as shown there exists 5 parameters available: Two of which are Real parameters for deciding the strengths of the Tension.2 and Tension.3 parameters, i.e. 1 and 1.2. One parameter which defines the Y axis which is used to form the Spline. The value of this parameter cannot be altered though it is a dead object. One Boolean parameter which decides the activation state of the Spline feature, i.e. True or False. One parameter which defines the Spline parameter itself. This parameter can be used to i.e. construct a Surface.

Figure 2-15 Parameters linked to a pad object.

In this example the number of parameters has increased significantly compared to the previous examples. The main reason being that the object under study, a Pad, consists partly on the feature Sketch in turn is built upon several other objects. 2.2.7.1 Parameter Overview Depending on which hierarchal level one stands in the number parameters under study will vary. For visualization a product tree consisting of several Parts will be discussed. In the following picture the top product level is defined object in work. On this level all features and parameters in this specific Product can be accessed.

Figure 2-16 The parameters accessible when the top level product is defined "Object In Work".

In the next picture a Part is defined as the object in work. On this level only the features and parameters under this specific Part can be accessed, more specifically meaning that the objects on a higher hierarchal level cannot be accessed.

Figure 2-17 The parameters accessible when the part is defined "Object In Work".

2.2.7.2 When Creating Parameters When creating Parameters try to follow the following points: Assign logical name to the Parameters. Order the Parameters in a logical sequence. Create additional Parameter Sets if the overview of the Parameters is lost due to a large number of Parameters.

2.2.8

Power Copy Instances

By using the Power Copy function a template is created which can be initiated either manually or automatically according to the topological pyramid as referred in Re-Use Modeling Definition. A specific case is prepared in Parametric Planetary Gear to demonstrate the capabilities of Power Copies. 2.2.8.1 Manually Initiated Power Copies This section will be completed in the coming compendium versions. 2.2.8.2 Automatically Initiated Power Copies This section will be completed in the coming compendium versions.

2.3 Tutorials
2.3.1 Parametric LEGO Exercise
Due to the size of the step-by-step instructions for this exercise the authors chose not to append them hereby. They can be found on the courses TeamCenter side (https://tccweb.tcc.ikp.liu.se/tmkt57-v09/default.aspx). Here two different variants are available: Parametric_Lego.pdf is a document that contains the instructions as successive pictures;

2.3.2 Parametric Planetary Gear Exercise


Due to the size of the step-by-step instructions for this exercise the authors chose not to append them hereby. They can be found on the courses TeamCenter side (https://tccweb.tcc.ikp.liu.se/tmkt57-v09/default.aspx). Here two different variants are available: Planet_Gear_Tutorial.pdf is a document that contains the instructions as successive pictures;

3 Interface Modeling
3.1 Excel-CATIA Interfacing
Matlab is a common tool in the industry. The friendly interface of Matlab enables engineers to easily generate codes helping them to increase the efficiency level of their work, i.e. automation process for textual editing.

3.1.1 How to Connect


This section will be completed in the coming compendium versions.

3.1.2 Tutorial
This section will be completed in the coming compendium versions.

3.2 Matlab - Excel Interfacing


This section will be completed in the coming compendium versions.

4 Computer Aided Engineering (CAE)


CAD models can be used to effectively achieve integration between physics based analysis tools by connecting them to a common geometry, though most physics based analysis models are in need of geometrical input. By connecting the analysis tools to one geometric source it can be assured that the geometric modifications will affect all involved models in the framework simultaneously. Using a CAD tool to generate a geometric model has the advantage of enabling the designer to increase the level of detail of the model throughout the design process, unlike code based geometries which need extensive coding to generate geometries.

4.1 Tutorial
This section will be completed in the coming compendium versions.

5 Optimization
A fast way to search through the design space is by incorporating various optimization algorithms into the design process. The main pre-conditions are: 1. The models have to be parametrically definable. 2. The models should be flexible and robust. 3. A robust interface should exist between the models.

5.1 Tutorial
This section will be completed in the coming compendium versions.