generative_knowledge.pdf

(885 KB) Pobierz
Generative Knowladge
Generative Knowledge
© Dassault Systèmes 1994-99. All rights reserved.
16078252.009.png 16078252.010.png 16078252.011.png 16078252.012.png 16078252.001.png 16078252.002.png 16078252.003.png
Preface
The CATIA Generative Knowledge product provides you with an easy way to describe the data
used to create documents and to store this data in a script file so that it can be re-used later
on. Here are the benefits of using the generative script:
the script code itself is small in size (a few K)
the syntax is easy to grasp
it executes rapidly from CATIA
it allows you to add knowledgeware information in the form of expert rules and checks to
a document and store the whole data in a readable file.
Moreover, it offers a full compatibility with external documents by providing you with an import
capability. Features belonging to external documents can be referred to and instantiated in a
script. Of course, a document which has been generated from a script can be modified
interactively.
The present version of the product covers a broad range of mechanical features as well as
some knowledgeware features.
16078252.004.png
Getting Started
The scenario which is developed below helps you begin learning a new area of the CATIA knowledgeware
capabilities. It is broken down into steps and all the instructions required by the user are supplied for each
steps.
This scenario is just a quick look at the Generative Knowledge product capabilities. From any stage of this
basic scenario you can access in-depth information by using the links to the Reference Library.
To carry out the scenario below, you don't need to have any initial sample on hand as you create your initial
data from a script.
The basic methods for writing a script are conceptually simple and straightforward, they don't require any
prerequisite knowledge but it is better if you already dabble in some other script languages manipulating
objects and properties.
1.
Select the Infrastructure->Generative Knowledge command from the Start menu,
then click the icon. The Generative Script Editor is displayed.
2.
Copy/Paste the script below from your browser to the Script editor:
Box isa CATPart {
BoxPart isa Part
{
PartBody isa Body
{
Box1 isa Box // Create a Box
{
Width = 20.0mm ;
Height = 50.0mm ;
Length = 10.0mm ;
}
// Create a Hole
Hole1 isa Hole ( "Face:(Brp:(Box1;2);None:())",
-8.752977,-11.014908,15.00000 )
{
Diameter=5.0;
}
// Create a Hole
Hole2 isa Hole( "Face:(Brp:(Box1;2);None:())",
20.185869,-10.918053,15.00000 )
{
Diameter=10.0;
}
}
}
3.
Save your script file by using the File->SaveAs function of the script editor (this step is optional but
recommended).
16078252.005.png
4.
Click Generate. The following document is generated in the geometry area.
Three geometric features have been created: Box1, Hole1 and Hole2. You can double-click the features
created to display their parameter values and compare them with the values specified in the script. Here are a
few comments about the resulting document with respect to the initial script:
Objects are created with the isa function.
2.
At creation, features are assigned default parameter values.
3.
Parameter values can be (re-) defined in the script in statement blocks surrounded by curly braces.
4.
In the Hole creation instruction, the complicated expression within the parentheses defines a point.
Don't worry about it, you won't have to type such an expression. It is captured from the geometry area.
See Capturing Data from the Geometry Area.
.
16078252.006.png 16078252.007.png
16078252.008.png
Zgłoś jeśli naruszono regulamin