Keywords  

isa Keyword  

Definition

Enables you to create a typed object or instantiate an object.

Syntax

or

where:

Example

import "E:\GPS.CATPart";
myGps isa CATPart
        {
        myPart isa Part
                 {
                     PartB isa BodyFeature
                             {
                                S0 isa Sketch.0 {} //Instance name
                                pad0 isa Pad("S0") //Object type
                              }
                  }
        }

context Keyword   

Definition

Enables you to define in which part of the specification tree the object will be created. The context keyword may be of use in 2 different cases:

  • It can indicate a document to be used. In this case, the "..." are used.
context "Mypart.CATPart" 
MyPart isa Part { }
   
  • It can reference an object contained in the document. In this case the path needs to be specified (between `...`).
context `My.CATPart\MyPart\PartBody` 
CC isa Cylinder { }

Syntax

  • context "Mypart.CATPart" 

or

  • context `My.CATPart\MyPart\PartBody` 

from Keyword   

Definition

Allows you to copy a document from an existing document without maintaining any link. 

Syntax

DocumentName isa DocumentType from FilePath

where:

DocumentType is either CATProduct, CATPart or model.
FilePath is the full path of the initial document. 

To enter a file path you can use Insert File Path from the contextual menu.

 

 Example

See Defining the Context

import Keyword  

Definition

Specifies a document file (.CATPart or .CATProduct) containing definitions to be reused or redefined in the document to be generated. All the features and feature values in the imported file become available to the document to be generated.

Importing a document is:

  • Of interest whenever you want to retrieve a consistent set of definitions from an already existing document (for a UDF definition for example.)
  • Required whenever you need to create a feature from a sketch (the script language prevents you from specifying a sketch).

Syntax

There are 2 ways to specify the file path:

To specify a file to be imported, you can use Insert File Path from the contextual menu. Selecting this command displays a file selection window. Quotation marks are automatically included but not the semicolon.

Example

publish Keyword

Definition

  Enables you to assign an object a name that will be used in the script.

Syntax

publish "!xxx" as yyy ;

Where:

  • xxx is the name of the object to be published. To select this object, it is highly recommended to use the contextual menu.
  • yyy is the name you want to assign to this object 

Example 

Publi isa CATProduct
{
     Publi isa Product
     {
           P isa Product
           {
                P1 isa Part
                {
                    PartBody isa Feature
                    {
                        Pa isa Pad{}
                    }
                }
           publish "Publi/P/!Selection_RSur:(Face:(Brp:(Pa;2);None:());Pa)" as mypadface; /*publishes
           the face of a pad under the name "mypadface"*/
           }
           Q isa Product
           {
              Q1 isa Part
              {
                  PartBody isa Feature
                  {
                      Cy isa Cylinder{}
                  }
              }
            publish "Publi/Q/!Selection_RSur:(Face:(Brp:(Cy;2);None:());Cy)" as mycylinderface;
            //publishes the face of a cylinder under the name "mycylinderface"
            }
            assembly constraints: contact("P\toto","Q\tutu");
       }
}