grip reference guide - home - siemens plm...

156
GRIP Reference Guide

Upload: dinhanh

Post on 13-Aug-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

GRIP Reference Guide

Page 2: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

Table of Contents

Introduction ....................................................................................................................... 1 What Is GRIP ....................................................................................................................................... 1 Developing and Executing Programs ................................................................................................... 1

Creating a GRIP Program ......................................................................................................................... 1 Compiling a GRIP Program ...................................................................................................................... 2 Linking GRIP Object Files ........................................................................................................................ 2 Running a GRIP Program ......................................................................................................................... 3 Debugging a GRIP Program ..................................................................................................................... 4 Using GRADE .......................................................................................................................................... 4 Other GRADE Options ............................................................................................................................. 5

Language and Conventions .............................................................................................. 6 Overview .............................................................................................................................................. 6

Language and Conventions ....................................................................................................................... 6 GRIP Statements ....................................................................................................................................... 6 GRIP Programs ......................................................................................................................................... 6 GPAs and EDAs........................................................................................................................................ 7 GRIP Subroutines ..................................................................................................................................... 7 Programming Techniques ......................................................................................................................... 8 Conditional Branching .............................................................................................................................. 8

Statement Format Conventions ............................................................................................................ 8 Introduction ............................................................................................................................................... 8 Vocabulary Words .................................................................................................................................... 9 Numerical Values and Expressions ........................................................................................................... 9 Object Variables ........................................................................................................................................ 9 Strings ..................................................................................................................................................... 10 Positional Modifiers ................................................................................................................................ 10 Statement Labels ..................................................................................................................................... 10 Optional Fields ........................................................................................................................................ 11 Multiple Choices ..................................................................................................................................... 11 Repeated Elements .................................................................................................................................. 11 Number List ............................................................................................................................................ 11 Object List ............................................................................................................................................... 12 String Lists .............................................................................................................................................. 12

Data Types ......................................................................................................................................... 12 Introduction ............................................................................................................................................. 12 Numerical Data ....................................................................................................................................... 13 Objects .................................................................................................................................................... 14 Strings ..................................................................................................................................................... 14

Arrays ................................................................................................................................................ 15 Introduction ............................................................................................................................................. 15 Subrange Operator .................................................................................................................................. 15

Expressions ........................................................................................................................................ 17 Introduction ............................................................................................................................................. 17 Arithmetic Expressions ........................................................................................................................... 18 Array Expressions ................................................................................................................................... 18 String Expressions................................................................................................................................... 19

Continuation and Comments .............................................................................................................. 19 Introduction ............................................................................................................................................. 19 Continuations .......................................................................................................................................... 20 Comments ............................................................................................................................................... 20

Global Parameter Access ................................................................................................................... 21 Introduction to GPAs .............................................................................................................................. 21 Access Type ............................................................................................................................................ 21 Data Types .............................................................................................................................................. 22 Data Range .............................................................................................................................................. 22

Sample GRIP Program ....................................................................................................................... 22

Page 3: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

Declarations and Functions ............................................................................................ 26 Declarations ....................................................................................................................................... 29

Introduction ............................................................................................................................................. 29 Declaration Statement List ...................................................................................................................... 29 Number ................................................................................................................................................... 29 String ....................................................................................................................................................... 30 Entity ....................................................................................................................................................... 30 Data ......................................................................................................................................................... 30 Environment Variables............................................................................................................................ 31 Detect Undeclared Variables ................................................................................................................... 32

Strings ................................................................................................................................................ 32 String Overview ...................................................................................................................................... 32 String Statement List ............................................................................................................................... 33 ASCII Value of a Character .................................................................................................................... 33 Return String with ASCII Value of n ...................................................................................................... 34 Create Blank Characters .......................................................................................................................... 34 Compare Strings ...................................................................................................................................... 34 Return Current Date ................................................................................................................................ 34 Position of Characters in a String ............................................................................................................ 35 Convert Real Number to Character String .............................................................................................. 35 Convert Real Number to Character String .............................................................................................. 36 Convert Integer to Character String ........................................................................................................ 36 Convert Integer to Character String ........................................................................................................ 36 Number of Characters in a String ............................................................................................................ 37 Replace Characters in a String ................................................................................................................ 37 Extract Portion of a Character String ...................................................................................................... 38 Return Current Time ............................................................................................................................... 38 Convert String to a Real Number ............................................................................................................ 38

Positional Modifiers ........................................................................................................................... 39 Introduction ............................................................................................................................................. 39

Curve and Surface Position Functions ............................................................................................... 41 Introduction ............................................................................................................................................. 41 Curve and Surface Position Statement List ............................................................................................. 41 Parameter Position on a Curve ................................................................................................................ 41 Position on a Curve ................................................................................................................................. 41 Geometric Properties of a Curve at Parameter ........................................................................................ 42 U, V Parameters of a Point on a Surface ................................................................................................. 42 Position on a Surface ............................................................................................................................... 42

Vector Functions ................................................................................................................................ 45 Introduction ............................................................................................................................................. 45 Vector Statement List .............................................................................................................................. 45 Dot Product of Two Vectors ................................................................................................................... 46 Length of a Vector (Magnitude) .............................................................................................................. 46 Cross Product of Two Vectors ................................................................................................................ 46 Vector Tangent to a Curve ...................................................................................................................... 47 Scaled Vector .......................................................................................................................................... 47 Surface Partial Derivative with Respect to the U Parameter ................................................................... 48 Surface Partial Derivative with Respect to the V Parameter ................................................................... 48 Geometric Properties of a Face at a Parameter ........................................................................................ 48 Vector Normal to a Surface ..................................................................................................................... 49 Unit Vector.............................................................................................................................................. 49

Edit Curve .......................................................................................................................................... 49 Introduction ............................................................................................................................................. 49 Edit Curve Statement List ....................................................................................................................... 49 Trim Curve Using Bounding Objects ...................................................................................................... 50 Trim Curve by Given Arclength ............................................................................................................. 52

Page 4: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

Point and Curve Creation .............................................................................................. 53 Introduction ........................................................................................................................................ 53

Point and Curve Creation Statement List ................................................................................................ 53 Point ................................................................................................................................................... 55

Create Point ............................................................................................................................................. 55 Create Point Statement List ..................................................................................................................... 56 Intersection Point .................................................................................................................................... 56 Three Dimensional Vector Offset ........................................................................................................... 57 Position on an Arc ................................................................................................................................... 57 Offset Point ............................................................................................................................................. 57 Coordinates ............................................................................................................................................. 58 End Point ................................................................................................................................................. 59 Polar Offset Point .................................................................................................................................... 59 Pattern Point ............................................................................................................................................ 60 Center of a Circle .................................................................................................................................... 60

Line .................................................................................................................................................... 61 Introduction ............................................................................................................................................. 61 Create Line .............................................................................................................................................. 61 Parallel at a Distance ............................................................................................................................... 61 Parallel/Perp to a Line, Tangent to a Curve ............................................................................................ 62 Through a Point, at an Angle .................................................................................................................. 62 Point, Tangent to a Curve ........................................................................................................................ 62 Tangent to Two Curves ........................................................................................................................... 63 Through a Point, Parallel/Perpendicular to a Line................................................................................... 63 Through a Point, Perpendicular to a Curve/Surface ................................................................................ 64 Between Two Existing Points ................................................................................................................. 64 Between Two Specified Points ............................................................................................................... 64

Circle.................................................................................................................................................. 65 Introduction ............................................................................................................................................. 65 Create Circle Statement List ................................................................................................................... 65 Center Point, Radius ............................................................................................................................... 65 Center Point, Tangent to a Line .............................................................................................................. 65 Center Point, Point on the Arc ................................................................................................................ 66 Through Three Points .............................................................................................................................. 66 Center Coordinates, Radius ..................................................................................................................... 67

Point Sets ........................................................................................................................................... 67 Introduction ............................................................................................................................................. 67 Create Point Sets Statement List ............................................................................................................. 67 Chordal Tolerance Method...................................................................................................................... 68 Control Vertex Method ........................................................................................................................... 68 Equal Arc Length Method ....................................................................................................................... 69 Equal Parameter Method ......................................................................................................................... 69 Geometric Progression Method ............................................................................................................... 70 Input Arc Length Method ........................................................................................................................ 70 Knot Point Method .................................................................................................................................. 71

Fillet ................................................................................................................................................... 71 Introduction ............................................................................................................................................. 71 Fillet Statement List ................................................................................................................................ 71 Two Objects, Center Point ...................................................................................................................... 71 Two Objects, Positional Modifiers .......................................................................................................... 73 Three Objects .......................................................................................................................................... 74 Special Conic Sections ............................................................................................................................ 77 Geometric Statement List ........................................................................................................................ 77 Parabola .................................................................................................................................................. 78 Hyperbola ................................................................................................................................................ 79 Ellipse ..................................................................................................................................................... 80

General Conics ................................................................................................................................... 81 Introduction ............................................................................................................................................. 81 Create General Conic Statement List ...................................................................................................... 81 Five Points .............................................................................................................................................. 82 Four Points, One Slope ........................................................................................................................... 83 Three Points, Two Slopes ....................................................................................................................... 84 Three Points, Anchor Point ..................................................................................................................... 85 Two Points, Anchor Point, Rho Value .................................................................................................... 86 Six Coefficients ....................................................................................................................................... 87

Page 5: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

Derived Curves .................................................................................................................................. 88 Isoparametric Curve On a Face ............................................................................................................... 88 Spline ...................................................................................................................................................... 89 Approximate Curves ............................................................................................................................... 93 Offset Curves .......................................................................................................................................... 94 Intersections & Cross Sections ................................................................................................................ 95 Project Points/Curves .............................................................................................................................. 97 Silhouette Curves .................................................................................................................................... 97

Create B-spline .................................................................................................................................. 99 Introduction ............................................................................................................................................. 99 Create B-spline Statement List ................................................................................................................ 99 Create Spline Using a Fitting Method ..................................................................................................... 99 Point Method ......................................................................................................................................... 100 Curve Method ....................................................................................................................................... 101 Simplify Curves .................................................................................................................................... 102 Create Edge Vertex Points .................................................................................................................... 102 Create Edge Curves of a Body, Face, or Edge ...................................................................................... 102

Sheet Body Creation ..................................................................................................... 104 Introduction ...................................................................................................................................... 104 Surfaces ............................................................................................................................................ 104

Surfaces Overview ................................................................................................................................ 104 Surfaces Function List........................................................................................................................... 104 Create Surface of Revolution ................................................................................................................ 105 Create Tabulated Cylinder .................................................................................................................... 105 Create Ruled Surface............................................................................................................................. 106 Create Fillet Surface .............................................................................................................................. 107

Create Free Form Body .................................................................................................................... 109 Introduction ........................................................................................................................................... 109 Create Free Form Body Statement List ................................................................................................. 109 Swept .................................................................................................................................................... 109 Curve Mesh ........................................................................................................................................... 110 Create Bounded Plane ........................................................................................................................... 110

Create Cylinder Sheet Body ............................................................................................................. 111 Introduction ........................................................................................................................................... 111 Create Cylinder Sheet Body Statement List .......................................................................................... 111 Arc, Bounding Plane ............................................................................................................................. 111 Center Point, Line ................................................................................................................................. 112 Center Point, Radius ............................................................................................................................. 112 Center Point, Radius, Two Bounding Planes ........................................................................................ 112 Radius, Between Two Surfaces ............................................................................................................. 113

Create Cone Sheet Body .................................................................................................................. 114 Introduction ........................................................................................................................................... 114 Create Cone Sheet Body Statement List ............................................................................................... 114 Circle, Height, Vertex Half-angle ......................................................................................................... 114 Two Circles ........................................................................................................................................... 114 Center Point, Existing Line ................................................................................................................... 115 Vertex Point, Vertex Half-angle, Bounding Points ............................................................................... 115

Create Sphere Sheet Body ............................................................................................................... 116 Introduction ........................................................................................................................................... 116 Create Sphere Statement List ................................................................................................................ 116 Arc ........................................................................................................................................................ 116 Center, Radius ....................................................................................................................................... 116 Tangent To Three Planes ...................................................................................................................... 117

Create Plane ..................................................................................................................................... 118 Introduction ........................................................................................................................................... 118 Create Plane Statement List .................................................................................................................. 118 Plane of A Curve ................................................................................................................................... 118 Parallel at a Distance ............................................................................................................................. 119 Perpendicular to a Curve, at a Point ...................................................................................................... 119 Three Points .......................................................................................................................................... 119 Two Lines ............................................................................................................................................. 120 Plane: Parallel to a Plane, Thru a Point ................................................................................................. 120 Plane: Perpendicular to a Plane, Thru a Line ........................................................................................ 120 Principal Plane ...................................................................................................................................... 121 Identify Base Face ................................................................................................................................. 121 Create Offset Body ................................................................................................................................ 121

Page 6: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

Create B-Surface .............................................................................................................................. 122 Introduction ........................................................................................................................................... 122 Create B-Surface Statement List ........................................................................................................... 122 Through Points ...................................................................................................................................... 123 Through Curves .................................................................................................................................... 124 Conic ..................................................................................................................................................... 124 Through Curve Mesh ............................................................................................................................ 129 Swept .................................................................................................................................................... 131 Extract ................................................................................................................................................... 133 Create Sheets from Curves .................................................................................................................... 134

Features .......................................................................................................................... 135 Introduction ...................................................................................................................................... 135

Features Statements List ....................................................................................................................... 135 Feature Creation Statements ............................................................................................................ 137

Introduction ........................................................................................................................................... 137 Feature Creation Statement List ............................................................................................................ 137 Block ..................................................................................................................................................... 137 Extruded Solid ...................................................................................................................................... 138 Prism ..................................................................................................................................................... 138 Sew ....................................................................................................................................................... 139 Solid Cone ............................................................................................................................................. 139 Solid Cylinder ....................................................................................................................................... 140 Solid of Revolution ............................................................................................................................... 141 Solid Sphere .......................................................................................................................................... 141 Torus ..................................................................................................................................................... 142 Tube or Cable ........................................................................................................................................ 143

Feature Operations ........................................................................................................................... 143 Introduction ........................................................................................................................................... 143 Feature Operation Statement List .......................................................................................................... 144 Blend/Chamfer ...................................................................................................................................... 144 Cut Solid ............................................................................................................................................... 145 Fix Blend/Chamfer ................................................................................................................................ 145 Intersect ................................................................................................................................................. 145 Section .................................................................................................................................................. 146 Split ....................................................................................................................................................... 146 Subtract ................................................................................................................................................. 147 Unite ..................................................................................................................................................... 147 Solid Containment................................................................................................................................. 148 Subdivide a Face with a Curve .............................................................................................................. 149 Move Face ............................................................................................................................................. 149 Solid Box Coordinates .......................................................................................................................... 149 Return Edge or Face Identifiers ............................................................................................................ 150

Page 7: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

1

Introduction

What Is GRIP GRIP is a programming language that allows you to automate most operations in NX and its associated modules. GRIP is an

acronym for Graphics Interactive Programming. By using a vocabulary of English-like words, it is similar in many ways to

interpretive BASIC or FORTRAN. In some cases, GRIP can perform advanced, customized operations, in a more efficient

manner than using interactive NX. You can perform almost any operation using GRIP that you can perform interactively. For

example, commands are available to create geometric and drafting objects, control system parameters, perform file management

functions and modify existing geometry.

To get started, see the overview for Developing and Executing Programs. For GRIP language information, see Language and

Conventions and Declarations & Functions.

For reference information about the various symbols that modify GRIP statements, see: Global Parameter Access Symbols and

Entity Data Access Symbols.

For debugging and handling errors, see User Exits and Errors . Note: The maximum size of a GRIP program can be different

depending upon the memory and swap size available on the machine doing the compiling and linking.

If you can't find a major or minor word or a symbol, see Word & Symbol Lists.

For a list of benefits of using GRIP, click here.

Developing and Executing Programs You can develop and run GRIP programs in three ways:

Standard Program Development You can develop GRIP programs using typical development tools. For more information about standard program development,

start with Creating a GRIP Program.

Automating with GRADE Batch You can automate the compile, link, and run process with an NX provided tool called GRADE Batch.

Automating with Batch (Windows) and Script (UNIX) Files You can also automate the development process using batch files on a Windows system or script and command files on a UNIX

system.

Creating a GRIP Program The first step in the development of a GRIP program or subprogram is to create the source file. The source file consists of an

assortment of statements, labels, and comments arranged in a logical manner to perform various tasks.

Statements The GRIP language consists of four types of statements: statements, declarations, functions, and symbols. Some statements

require multiple parameters. This allows one statement to create an object or perform an operation in several different ways.

Creating a Source File You can create a source file using the NX text editor, the system editor, or any other means of creating an ASCII text file.

Using the NX Text Editor To create and edit your GRIP source file, you can use the Edit command in GRADE. This allows you to edit a file with the

currently specified operating system editor (for example, vi). If the file does not reside in your current directory, enter the full

path and filename.

You can also enter a single line edit command by specifying: e <filespec>, where "filespec" can be either the full pathname or

just the filename if the file is in your current directory. You don't need to include the ".grs" extension. The Edit command

automatically appends a ".grs" extension to the filename.

Page 8: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

2

Customizing the Editor You can customize the editor to default to the editor of your choice by setting the environment variable

UGII$EDITOR/UGII_EDITOR to the executable name of the editor.

Compiling a GRIP Program The second step in the GRIP development process is to convert your source file to an object file. The object file consists of a

special code generated by the GRIP compiler. During this step, the compiler analyzes each line of your source program generates

a list which consists of statements, labels, variables, and any errors recognized by the compiler. If the compiler detects no errors,

it generates and saves an object file.

Before You Compile When the GRIP compiler converts the source file statements it produces a listing. This listing can consist of source statements,

variable storage locations, labels, and errors (the default option) or errors only. Before you compile, you can determine the

contents of this listing using option 7, Compile Listing in GRADE.

You can also change the default compile option to "errors only" by setting the environment variable UGII_ERRONLY to 1.

Compiling and Linking in GRADE To start the compiler, use the Compile option in GRADE.

Compiling a Single File To compile a single file, enter a single line compile command by specifying: c <filespec>, where filespec is a full pathname or

just a filename if it resides in your current directory. You can exclude the .grs file extension.

Compiling Multiple Files To compile multiple files, specify a file template, such as *.grs. This compiles all the files in your current directory with a .grs

extension.

When the Compile is Complete If the GRIP source file compiles without any errors, the compiler automatically generates a GRIP object file and files it in the

default directory.

If errors occur, the object file is not created and the system lists the errors as set in option 7, Compile Listing.

Identifying Interactive vs. Batch Programs GRIP programs can operate in two modes: interactive or batch. Batch programs cannot contain interactive programming

statements. If the program compiles successfully, the last line of the compiler listing specifies if the program can be run in

interactive, batch or in interactive only. If the program is run in either mode the line reads: UNIVERSAL LINK FILE. If the

program can be run only in the interactive mode the line reads: INTERACTIVE LINK FILE.

Linking GRIP Object Files The third step of GRIP program development is the linking of previously generated object files into an executable module. The

executable module consists of the main program and any subprograms that are arranged in such a manner as to allow data to pass

from one segment of the program to another. During this process, the linker generates a listing that contains the main program

name and the names of all subprograms in the order in which they are referenced. If the link operation completes without errors,

the linker generates and files an executable module.

Referencing Subroutines The Link option links the object file of a main GRIP program with the object files of any subroutines that can be referenced. If a

subroutine file does not reside in your current directory, enter the full file specification. You can specify a wildcard such as

"*.grs" or just "*". You can issue a single line link:

l <filespec>

Where "filespec" can be either the full pathname or just the filename if the file is in your current directory. You do not need to

include the ".gri" file extension.

When you choose this option, the system prompts you to enter the file specifications for the main programs only. The names of

the subprograms are not included because they are automatically resolved by the Link routine. You can specify a file template,

such as *.gri.

Locating Subroutines Using a Search File You can link object files together even if they reside in different directories or on different volumes. To do so, use a text file

named gri.sea which consists of directory specifications where the object files reside.

The search path for the gri.sea file is:

The current directory

Page 9: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

3

The $UGII_UTIL directory

When linking an executable, the search path for an object file is:

The current directory

The first directory in the gri.sea file

The second directory in the gri.sea file, etc.

Understanding the Linker Listing When a GRIP program is compiled, the object file created is in two parts, the program area and the data area. The program area

contains the compiled program instructions, and the data area contains the program variables. In the linker listing, these two

program areas are indicated by the headings PROG and DATA. In addition the listing contains two fields for each of these areas

which indicate the sector number (SECT) and starting address or displacement (DISP). This process is repeated for subprograms

as well as main programs.

Sample Linker Listing The following listing shows the linker output with errors.

UNIGRAPHICS GRIP LINKER

PROGRAM NAME PROG PROG DATA DATA

SECT DISP SECT DISP

FLOWCHART 0 0 0 245

INTERACTION 0 315 1 140

PROCESS IS UNDEFINED

OFF-PAGE 1 248 2 404

DECISION 3 194 4 86

SPECIAL 4 239 5 131

GUIDE-LINE 5 255 5 442

1 LINKER ERRORS

PROGRAM SIZE = 0 0

LINKING TERMINATED

Without errors, the linker output listing displays as:

UNIGRAPHICS GRIP LINKER

PROGRAM NAME PROG PROG DATA DATA

SECT DISP SECT DISP

FLOWCHART 0 0 0 245

INTERACTION 0 315 1 140

PROCESS 1 248 2 99

OFF-PAGE 1 248 3 404

DECISION 4 194 5 86

SPECIAL 5 239 6 131

GUIDE-LINE 6 255 6 442

LINKING COMPLETE

PROGRAM SIZE = 6 491

An NX sector is 512 words long and the starting address of the area is from (0-511). Also indicated is the total program size in

sectors and words. The successfully linked program above has 6 sectors and 491 words.

Running a GRIP Program The fourth step in GRIP program develepment is running your program. Your program consists of the previously linked

executable module. You can accomplish this step, as well as the compile and link steps, interactively or in batch processing. You

cannot, however, run a GRIP program in GRADE.

Running Interactively within a Unigraphics NX Session To run a GRIP program within a Unigraphics NX session:

Select File->Execute Open->GRIP.

Running Using GRADE or the GripBatch Command You can also run a GRIP program using GRADE or the gripbatch command provided your GRIP program does not require any

interactive commands.

Active Part May Be Required to Run Program When you execute a GRIP program, it may require an active NX part. Therefore, first retrieve an active part before executing

your program.

Starting the Most Recently Linked Executable To start the executable module previously created by linking a program:

Select File->Execute Open->GRIP.

Page 10: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

4

When you choose this option, the system prompts you to enter the file specification of the GRIP program you wish to execute.

System Saves Path of Running GRIP Program When you run a GRIP program, the system stores its directory path as the default path for starting GRIP programs. This saves

you the trouble of entering the path each time you run a GRIP program.

Errors During execution, certain run-time errors may occur. For a list of errors, see Errors.

Debugging a GRIP Program The final step in the program development process is debugging your GRIP program. The GRIP compiler and linker

automatically generate debuggable code.

To debug GRIP code while running a program, select File->Execute Open->Debug Grip. The system prompts you to specify a

file to debug.

Using Debug Options Once you've specified a file to debug, the system displays the main Debug GRIP menu containing the following options:

Single Step

Single Step/Into

Set Breakpoints

Clear Breakpoints

Examine Variables/Entities

Set Variable

List Option

Continue

Program Abort

Using the Menu Header The menu header lists the following program information:

(subprogram) = name of the current subprogram

(line #) = the current line number of the program

(reason stopped) = the reason for suspending the program

Suspended Execution The debugger suspends execution for one of the following four reasons. Each is listed with its abbreviation as it appears on the

menu:

Initial Entry (INIT ENTRY)

Breakpoint (BREAKPOINT)

Single Step (SINGLE ST.)

Single Step/Into (STEP/INTO)

Using GRADE GRADE (GRIP Advanced Development Environment) is a separate, executable program that allows you to perform a variety of

GRIP functions from your current native file system.

Starting GRADE On Windows, to start GRADE, select Start->All Programs->NX <version>->NX Tools->NX Open Grip. On Unix, you can also

enter the GRADE command from the operating system.

Functions include:

1) Edit 6) Send Output to [CRT]

Page 11: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

5

2) Compile 7) Compile Listing [ALL]

3) Link 8) Change Editor [VI]

4) Change Directory 9) Grade Batch

5) List Directory 0) Turn Menu on/off

q) QUIT

Selecting Options To select a GRADE option, enter the option number or the capitalized letter in each option name. For example, to list the

contents of your current directory, enter 5 or the letter S (List Directory).

The main Grade menu displays the default settings for Options 6-8.

You can use a file template for many of the options, such as *.grs. However, you cannot use file lists. To use file lists, use the

operating system command, GRIPBATCH, or the Grade Batch option.

Exiting GRADE To exit GRADE and return to the operating system, enter q.

Other GRADE Options

Change Directory Changes the current directory.

List Directory Lists the contents of the current directory. You can specify a file template.

Send Output To Changes current listing device. Output from compile and link commands are directed to the specified device. Enter the

corresponding value for the desired device as follows: (Also see &LDEV .)

1) SCREEN (CRT)

2) LINE PRINTER (LP)

3) FILE

4) SUPPRESS OUTPUT (NULL)

Compile Listing Toggles compiler listing mode between All and Errors Only. The All option produces a listing which consists of GRIP source

statements, variable storage locations, labels, array sizes, and errors. Errors Only produces a listing which consists of only

compilation errors.

Change Editor Allows you to specify a different editor (for example, vi) as the current editor.

Page 12: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

6

Language and Conventions

Overview

Language and Conventions This topic contains links to topics that describe the conventions for creating and using GRIP programs and the symbols and

conventions used to present each GRIP statement. It covers GRIP Statements, GRIP Programs, Global Parameter Access and

Entity Data Access Symbols, GRIP Subroutines, Programming Techniques, and Conditional Branching.

You can also link to the following GRIP language topics:

Statement Format Conventions

Data Types

Arrays

Expressions

Continuation & Comments

Global Parameter Access

Your ability to design, author, and make productive use of GRIP programs is, to a great extent, dependent upon your

understanding of the capabilities and rules of the GRIP language.

In this section, you can find a general description of the principles of using GRIP. This is an introduction and does not consider

every circumstance that may arise from your application of GRIP to your own discipline.

GRIP Statements To use GRIP statements, you must abide by the format rules of GRIP and of each statement.

Each GRIP statement uses the same general format as described below:

Major word/parameters

A major word is a specific GRIP function, such as LINE, or LAYER. All objects are defined as a function of a major word. A

major word, if followed by any descriptive parameters, must be immediately followed by a slash (/). Major words can be a

maximum of six characters long.

Minor words are GRIP parameters which also perform a specific function. Minor words are used in the parameters fields,

following a major word and a slash, to modify or specify one of several options of a function.

For example, if you want to create a LINE in GRIP, there are several different ways to define it. If you want the line to be parallel

to an existing line you would use the major word LINE and the minor word PARLEL, along with several other parameters to

define the line. A minor word may be a maximum of six characters long.

In addition, GRIP can assign values (objects, characters, numbers, etc.) to variables:

Variable=Major word/parameters

Variables may also be used in the parameter field:

Variable 1=Major word/Variable 2, minor word,Variable 3

As an example, the following statement would create a line between the coordinates of its end points. The line created is assigned

to the variable LN1 and can now be referred to as LN1 in other statements.

LN1=LINE/0,0,0,1,1,1

LN1 could be deleted using the GRIP DELETE statement an its name:

DELETE/LN1

GRIP Programs GRIP programs consist of three main parts: declarations, statements, and termination.

Page 13: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

7

Declarations consist of four specialized words (ENTITY, STRING, NUMBER, DATA) which are used to define variables and

default values for use in the statement part of a program. These words reserve space where objects, numerical values, and

characters can be stored when they are assigned to the defined variables. For example, if you want to define a variable to which

you want to assign a string 30 characters long, you must declare the variable using the word STRING as follows:

STRING/STR(30)

The statements part of a program consists of the GRIP statements used to perform the program function(s). The most common

use of GRIP is to create and manipulate geometry.

Example The following example creates four lines to form a box. The program contains the declaration of the variables

(LN1,LN2,LN3,LN4) that the created lines are assigned to, and the statements to create them.

This program creates the same box, no matter how many times it is run because the numerical values which define its shape are

"hard coded" in the statements. You can use GRIP programming techniques to replace the hard coded values with variables. This

would allow this program to create any shape of box based on the value of the variables.

ENTITY/LN1,LN2,LN3,LN4

LN1=LINE/0,0,0,2,0,0

LN2=LINE/2,0,0,2,2,0

LN3=LINE/2,2,0,0,2,0

LN4=LINE/0,2,0,0,0,0

HALT Statement To complete the program, it must be properly terminated. Every GRIP program must contain the HALT statement.

ENTITY/LN1,LN2,LN3,LN4

LN1=LINE/0,0,0,2,0,0

LN2=LINE/2,0,0,2,2,0

LN3=LINE/2,2,0,0,2,0

LN4=LINE/0,2,0,0,0,0

HALT

GPAs and EDAs In addition to the GRIP statements, two other symbols are provided to give a program access to the settings and parameters of the

NX system and individual objects. These are Global Parameter Access Symbols (GPAs) and Entity Data Access Symbols

(EDAs). GPAs and EDAs use a different format than GRIP statements. Since they are used to extract and assign data, they are

used in conjunction with an equals (=) sign. For example, you can use a GPA to set the color of all newly created objects:

&ENTCLR=&RED

GPAs and EDAs always begin with an ampersand (&) and can be a maximum of six characters long.

Example To control the color of the lines of the box created in the previous sample program, the following example was created.

ENTITY/LN1,LN2,LN3,LN4

GPA Color Assignment &ENTCLR=&RED

LN1=LINE/0,0,0,2,0,0

LN2=LINE/2,0,0,2,2,0

LN3=LINE/2,2,0,0,2,0

LN4=LINE/0,2,0,0,0,0

HALT

GRIP Subroutines GRIP subroutine techniques are supported for programming. A main GRIP program can use several separate GRIP subroutines

during program execution. This technique can help you manage extremely large GRIP programs by creating and/or editing

smaller segments.

A subroutine, or subprogram, is composed in the same manner as any other GRIP program, except for the beginning and end.

The program must begin with the PROC statement and end with the RETURN statement. PROC is used to pass variable

information between the subroutine and the main program. RETURN tells GRIP to go back to the program that initiated the

subroutine.

The main program calls the subroutine using the CALL statement.

The maximum number of unique externals/subroutine calls in a GRIP program is 50. The maximum number of arguments per

subroutine is 25.

Page 14: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

8

Programming Techniques GRIP supports many programming techniques found in other languages. GRIP programs normally execute from top to bottom,

performing the function of one statement after another. A programming technique called branching allows you to control this

process. You may create labels, as addresses, where the program execution can be guided using the branching statements. GRIP

supports both conditional and unconditional branching.

Conditional Branching The conditional branching statements allow you evaluate the circumstances present in the program at a specific moment, and

perform different functions based on those circumstances.

Unconditional Branching The unconditional branching statement is used to jump over sections of a program, which under certain circumstances, you may

want to omit. The unconditional jump is usually used to get out of a portion of the program to which you conditionally branched.

Example For example, you may want to delete a line if its font is dashed, change its font to solid if it is currently phantom or centerline,

and take no action if its font is solid. The following is a portion of a program which would accomplish this task.

RESP=&FONT(LN1)

JUMP/L30:,L20:,L10:,L10:,RESP

L10:&FONT(LN1)=&SOLID

JUMP/L30:

L20:DELETE/LN1

L30:

.

.

.

The variable RESP is assigned a numerical value equal to the current font of the object LN1; 1 equals solid, 2 equals dashed, 3

equals phantom, 4 equals centerline. The JUMP statement then uses the value of RESP to determine to which label (L10:, L20:,

or L30:) it should jump.

There are four labels following the slash in the JUMP statement. If RESP is equal to 1, the JUMP statement jumps to the first

label (L30:). If RESP is equal to 2, the JUMP statement jumps to the second label (L20:), and so on. Therefore if the line is

already solid, the next several statements are jumped over because the program execution goes immediately to L30:. If LN1 is

dashed, program execution jumps to the DELETE statement where LN1 is deleted. If the line is phantom or centerline, program

execution jumps to where the line font is changed to solid.

The JUMP/L30:,L20:,L10:,L10:,RESP statement is conditional because it is based on current circumstances. The JUMP/L30:

statement is unconditional because it causes a jump to L30: under any circumstance.

GRIP does not support recursion.

GRIP allows a total of 1000 labels per subroutine. The DO loop generates two labels, the CALL command generates one label,

and the IFTHEN/ELSE/ELSEIF/ENDIF uses two labels plus one for every ELSEIF. These labels count against the total you can

use.

Statement Format Conventions

Introduction This topic describes the symbols and conventions used to present each different type of GRIP statement.

The words item and field are used synonymously referring to variables and expressions that are delimited by commas and/or

parentheses.

Statement Labels

Positional Modifiers

Multiple Choices

Numerical Values and Expression

Number List

Object Variables

Object List

Page 15: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

9

Optional Fields

Repeated Elements

String Lists

Strings

Vocabulary Words

Vocabulary Words GRIP vocabulary words are printed in bold capital letters (for example, BSURF) . Vocabulary words are either Major or Minor

words in GRIP. Vocabulary words are defined in the software, and cannot be changed. You cannot create or modify a vocabulary

word.

A major word is a specific GRIP function, such as LINE, or LAYER. All objects are defined as a function of a major word. A

major word, if followed by any descriptive parameters, must be immediately followed by a slash (/). Major words can be a

maximum of six characters long.

The following list contains a few of the words reserved for the GRIP language:

Major

Words

Minor

Words

CIRCLE PERPTO

HATCH XSMALL

CSYS TANTO

For a complete list of these words, see the major word list and the minor word list.

Numerical Values and Expressions Numerical values and expressions are printed in lower case letters as shown by the word "angle":

L1=LINE/point,ATANGL,angle

Unless otherwise specified, GRIP accepts any number up to 214748367.

Unless otherwise specified, GRIP accepts any valid numerical expression which produces a valid NX number as a result.

Expressions can be numerical or a combination of numbers and variables. For example, the statement above could be written in

any of the following ways:

L1=LINE/point,ATANGL,(A+B)

L1=LINE/point,ATANGL,A

L1=LINE/point,ATANGL,(45+B)

L1=LINE/point,ATANGL,(45+2)

Object Variables Object variables are printed in lower case letters and underlined, as shown by the variable point in the following statement:

L1=LINE/point,ATANGL,angle

The variable point may be replaced with the name of a previously defined point or a nested point definition.

You can use the name of the previously defined as follows:

PT1=POINT/0,0

LN1=LINE/PT1,ATANGL,45

The definition of PT1 could be nested in the line definition as follows:

LN1=LINE/(POINT/0,0),ATANGL,45

or

LN1=LINE/(PT1=POINT/0,0),ATANGL,45

Any valid statement may be nested by using parenthesis ().

The nested expression must create the correct object. For example, you could not nest the definition of a line where the statement

was expecting a point.

Page 16: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

10

Strings Strings or text string expressions are printed with lower case letters in single quotes, as indicated by 'string':

N1=NOTE/(origin),'string'

A variable declared as a string may be used anywhere a string expression is required. The single quotes in this case must be

omitted.

The following example shows the use of the NOTE statement to create a note on a part. The values following the slash define the

origin of the note. The text for the note can be defined in the note statement or by assigning the text to a variable (N). The

variable must be declared as a string with the number N(5) representing the number of characters in the string.

STRING/N(5)

$$

$$ USING A STRING OF CHARACTERS IN SINGLE QUOTES

$$

NOTE/1,1,'LINES'

$$

$$ USING THE PREVIOUSLY DEFINED STRING VARIABLE

$$ "N"

$$

N='LINES'

NOTE/1,1,N

Positional Modifiers Positional modifiers are printed with capital letters in double quotes.

POINT/ENDOF,"PMOD3",obj

A positional modifier indicates the relative positive or negative X, Y or Z position of subject "B" to subject "A". As in the

statement above; at which end of (ENDOF) the object (obj) the point should be created.

There are six (6) positional modifiers. Each one is identified by a specific minor word:

XSMALL

YSMALL

ZSMALL

XLARGE

YLARGE

ZLARGE

The X and Y positional modifiers refer to relationships in the XC-YC plane of the Work Coordinate System and are used for two

dimensional specifications. In this case, PMOD2 appears in the statement format. When any of the positional modifiers are valid,

PMOD3 appears in the statement format.

Statement Labels Statement labels are designated by the word label followed by a colon (:) in the statement format as is shown in the following

statements:

NEXTE/IFEND,label:

DO/label:,index variable,start,end,increment

JUMP/label:

The label designates a user-defined symbol that program execution goes to under the specified circumstances.

Labels may be up to 32 characters long. The first character must be alphabetic, and the first six characters must be unique.

Underscores are valid characters for labels. Labels must always end with a colon (:).

Labels are treated independently of reserved words. You may use reserved words as labels and still use the reserved words later

in your program (for example, CREATE:, FETCH:, or FILE:).

In the examples in this manual, labels are always written in upper case letters.

Example This example demonstrates the use of labels in a program.

A1: $$ STATEMENT LABEL

I=J+.250

.

.

.

IF/I==.5,JUMP/A2: $$ CONDITIONAL JUMP

Page 17: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

11

NOTE/0,I,'ABC'

JUMP/A1: $$ UNCONDITIONAL JUMP

A2: $$ STATEMENT LABEL

NOTE/I,0,'XYZ'

Optional Fields Optional fields are enclosed in brackets [ ]. For example, if the "Z" coordinate in the POINT definition below is zero it may be

omitted.

POINT/X,Y[,Z]

Many times the comma is also included in the brackets. As in the example above, when the Z value is omitted, the comma is also

not required.

Multiple Choices Multiple choices for a field are enclosed in braces and separated by vertical lines, as shown in the following.

LINE/point,{LEFT|RIGHT|point},TANTO,curve

LEFT, RIGHT, and POINT are multiple choices and are mutually exclusive. You must use only one of the choices. For example:

LN1=LINE/PT1,LEFT,TANTO,CRV1

Repeated Elements Repeated elements are indicated by a plus sign to the right of the item.

CRV1=SPLINE/{point}+

The plus sign indicates that the fields inside of the braces may be repeated any number of times. For example:

CRV1=SPLINE/PT1,PT2,PT3,PT4

Number List A number list may consist of any combination of numerical values such as constants, variables, ranges, arrays and subranges of

arrays up to 100 entries. Lists may be created containing more than 100 entries, however, they may cause errors when used

within other GRIP statements. In the individual statement the request may appear as layer list, type list, etc. and is printed in

lower case letters. In the following statement, the number list requested is defined by the words: layer list.

LAYER/{[WORK,n],

[ACTIVE,{REST|layer list[,CAT,'cat']}],

[REF,{REST|layer list[,CAT,'cat']}],

[INACT,{REST|layer list[,CAT,'cat']}]}

The statement above may appear as follows to control the layer status. The list of layers is activated (ACTIVE).

LAYER/WORK,2,ACTIVE,3..8,12,13,18,21

The following list consists of the various numerical types which may be used in a number list.

Value Type

1,3,6,9 Numerical constants

X1,B3,Y1,A(3) Numerical variables

1..10,3..6 Number ranges

VALU An array declared as NUMBER/VALU(10)

VALU(2..8) An array subrange

Example The following example demonstrates the use of a number list.

NUMBER/LYR(10)

DATA/LYR,14,15,16,17,18,19,20,21,22,23

L1=8

L2=10

LAYER/WORK,1,ACTIVE,2..6,L1,L2,LYR(1..4),$

INACT,7,9,11..13,LYR(5..10),24..256

Page 18: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

12

In the example above, layer 1 is made the work layer, layers 2 thru 6, 8, 10 and 14 thru 17 are active and the remaining layers are

inactive.

Object List An object list may consist of any combination of previously declared object variables, arrays and subranges of arrays up to 100

objects. Lists may be created containing more than 100 objects, however, they may cause errors when used within other GRIP

statements.

BPLANE/ent list1[ ,HOLE,ent list2]

The object list may use a subrange, however, there are some statements which do not allow the use of a subrange operator. For

example, you could specify the points in a spline with the following statement where the value of K would be set by a DO loop or

interactively (possibly depending on the number of points the user selected).

SPL=SPLINE/P(1..K)

Example In the following example, LN1, LN3, all of the array SURF and members 2 thru 6 of the array CR are deleted.

ENTITY/LN1,LN2,LN3,SURF(10),CR(10)

.

.

.

DELETE/LN1,LN3,SURF,CR(2..6)

String Lists A string list may consist of any combination of literals enclosed in single quotes and previously declared string variables, arrays

and subranges of arrays. In the individual statement the request may appear as string list, option list, message list, etc. and are

printed in lower case letters.

In the following CHOOSE statement, the string list represents the title and options of a menu that appears on the message

monitor:

CHOOSE/string list,[DEFLT,n,]response

Example This example demonstrates the use of the CHOOSE statement to create a menu.

STRING/OPTS(4,18)

DATA/OPTS,'CHOOSE FONT','SOLID','DASHED','PHANTOM'

CHOOSE/OPTS,RESP

In the STRING declaration, the array OPTS consists of four options that can be up to 18 characters long. The DATA declaration

is used to assign the four strings to the OPTS array positions. In the CHOOSE statement, the first position in OPTS is the title for

the menu. The next three positions create options 1, 2, and 3 respectively.

The menu appears as shown.

Menu Created Using the CHOOSE Statement

Data Types

Introduction There are three data types in the GRIP language:

Page 19: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

13

Numerical Data

Objects

Strings

The variable names for these data types, regardless of type, cannot exceed 32 characters. The first character of the variable name

must be alphabetic. The first six characters must be unique. Only these first six characters are listed at the end of the compiler

listing. Underscores are valid characters for variables. In addition, Fortran-like arrays of up to three dimensions may be defined

for Numerical and Object data types. Strings can be up to two dimensional. Most major words may be used as variables, but if

defined as a variable, it cannot be used as a major word in that same routine. Major words that are invalid in batch processing are

also invalid as variables.

The following shows examples of variables and whether they compile:

Example Variable Name Will it Compile?

Obj_Counter Yes, but appears as OBJ_CO at the end of the

compiler listing.

Entity_Counter No. ENTITY is a reserved word that appears in the

program.

This_is_a_long_name_that_won't_compile No. More than 32 characters.

1 Yes.

Numerical Data Numerical data includes constants and variables. A numerical constant in GRIP may not contain blanks and must be fully

contained in one line of program.

A numerical constant may have one of the following two formats:

mantissa

mantissa E (exponent)

The exponential numeric format is not supported by the READ statement.

Mantissa The mantissa is a number consisting of one or more of the digits (0 thru 9). This number may include a decimal point and may

also be prefixed by a + or - sign (if no sign exists a positive number is assumed). The maximum number of meaningful digits for

a mantissa is 15.

Exponent (E) The exponent (E) represents the power to which the number ten is to be raised. The exponent may contain a maximum of two

digits and may also be prefixed by a + or - sign (if no sign exists a positive number is assumed). The approximate range of the

exponent is from -79 to +75.

The resulting value can be thought of as:

(numerical constant = mantissa times ten to the power of "E").

The approximate magnitude of a numerical constant ranges from:

(5.4 * 10-79 to 7.2 * 1075).

Example The following values are shown raised to an exponent with their equivalent, non-exponential values.

With Exponents Without Exponents

.123456789E9 123456789.

.05E-2 .0005

+5E+02 500.

.005E3 5.

Page 20: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

14

Objects Variables declared as objects may assume the value of any NX object. An object may be geometric such as a point, line, or arc, or

it may be a drafting aid such as a dimension, label, or note.

Object variables must be declared using the ENTITY declaration. Objects may be declared in arrays. This technique can be very

helpful in managing sets of objects. If an array is used, the objects can then referred to by specifying just the name of the array.

ENTITY/P(2),LN1

P(1)=POINT/0,0

P(2)=POINT/2,3

The line LN1 can now be created by defining just the name of the object array which represents its end points:

LN1=LINE/P

The line will be created from P(1) to P(2). Now the points can easily be deleted:

DELETE/P

Strings A string is a sequence of characters used in notes, dimensions, and messages, or wherever text is required. The three ways to

express a string are:

String Literals

String Variables

String Expressions

String Literal A string literal is a sequence of characters enclosed in single quotes. Any sequence of characters may be contained in a string,

including blanks. A string literal must be entirely contained on one line of program. Since the maximum length of a line is 80

characters, the longest string literal is 78 characters, which allows for the leading and trailing single quotes.

To display a single quote, you must enter two successive single quotes. For example:

Assignment Resulting Value

'This is a STRING literal' This is a STRING literal

'Here' 's another STRING' Here's another STRING

In the first string, the resulting value is exactly the same as the assignment. However, in the second string, two single quotes were

used in the contraction, Here' 's, to display the correct result (Here's).

String Variable A string variable must be declared (using the STRING/ declaration) before it can be used. The rules for assigning values to a

string variable are precisely the same as for the string literal.

Example The following is an example using strings.

STRING/A(24),B(22)

.

.

.

A='This is a STRING literal'

B='Here"s another STRING'

NOTE/1,1,A

The two declared string variables are assigned a literal string using the equals sign. The variable is then used instead of the literal

in the NOTE statement.

String Expression A string expression is where more than one string literal or string variable is added together. Since a string or a string variable

may be 132 characters long but a string literal may be only 78 characters long, the way to achieve this is through summation.

String literals and variables can be added using the plus (+) sign. The following table shows examples of string expressions.

Assignment Resulting Value

A='part 1'+' and part 2' part 1 and part 2

Page 21: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

15

B='part 0, '+ A part 0, part 1 and part 2

Arrays

Introduction Arrays are ordered lists of variables that can be addressed individually or as a group. One, two, or three dimensional arrays may

be defined for numbers and objects. String arrays can be two dimensional.

An array is defined as a variable. The declarations (NUMBER, STRING, ENTITY) are used to create the arrays in a GRIP

program. The array is then used later in the program for assigning values (either, objects, strings, or numerical values). Numerical

variables do not need to be declared, however, a numerical array must be declared using the NUMBER declaration.

Arrays are written as the variable, then the size of the dimensions of the array in parentheses:

Variable(1st Dimension,2nd Dimension,3rd Dimension)

Example For example, if you wanted to declare a single dimensional object array for four lines, it could be declared as follows:

ENTITY/LN(4)

The last parameter of a STRING array is always the maximum number of characters in each string:

Variable(No. of Strings,Max No. Characters per String)

The following example would declare four strings of a maximum of twenty characters per string.

STRING/STR(4,20)

When you use the variable STR in you program, you only need to refer to the first position of the two dimensional array:

STR(1)='This is a string'

You can set numerical arrays equivalent to other numerical arrays of the same dimension and size. However, ENTITY and

STRING arrays cannot be set equivalent to other arrays. For example:

NUMBER/A(5),B(5)

A=B

is valid.

STRING/ST1(3,20),ST2(3,20)

ST1=ST2

is invalid and will not compile.

Subrange Operator It is often desirable to refer to portions of an array rather than the entire array. This can be accomplished by the use of the

subrange operator "..". For example, if variable A is a one dimensional array of 15, then the 7th through the 12th elements can be

referred to by A(7..12).

The subrange operator may be used with any of the data types. The first value of the subrange represents the lower limit and

second value represents the upper limit of the range to be addressed. Only one subrange operator can be used in a single reference,

therefore, in multi-dimensional arrays, only one of the dimensions can be addressed in a single reference.

Example The following example shows the use of both one and two dimensional arrays. The range of the array is defined at the time it is

declared.

GRIPSW/ DECLRV

NUMBER/ NUM1X5(5), NUM4X4(4,4), TMPCNT

ENTITY/ ENT1X5(5), ENT4X4(4,4)

STRING/ STR1X5(5,132), STR4X4(4,4,132)

DATA/NUM4X4, 11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42,$

43, 44

NUM1X5(1..3) = NUM4X4(2,1..3)

ENT1X5(1) = POINT / NUM1X5(1..3)

ENT1X5(2) = POINT / NUM4X4(4,2..4)

TMPCNT = 2

BLANK / ENT1X5(1..TMPCNT)

STR1X5(1) = 'HELLO'

Page 22: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

16

STR1X5(2) = 'WORLD'

NOTE / 1,1, STR1X5(1..2)

HALT

The lines are created between a range of points. The points are then deleted by referring to the array variable.

Methods of Expressing Limits There are three methods of expressing the upper and lower limits of a subrange operator. These methods are the constant array

subrange, the fixed array subrange, and the variable array subrange.

Constant Array Subrange A constant array subrange has the upper and lower limits as constants or arithmetic expressions that do not include variables.

For example:

N (1..3)

N (3*2..10)

N (2*2..3+4)

Fixed Array Subrange In a fixed array subrange, the lower limit is a simple variable and the upper limit includes the same variable added to a constant

or an arithmetic expression.

For example:

N(I..I+3)

N(K,L..L+5)

N(I,J,K..K+(5*2))

Variable Array Subrange With a variable array subrange, the upper and lower limits may be expressed in the form of constants, variables, and arithmetic

expressions.

For example:

N(I..I*2)

N(ABSF(X+3).. (J-2)**K)

N(I..J)

Properly used, constant and fixed array subranges may be used anywhere in a GRIP program where subscripted arrays are

applicable. Variable array subranges, however, are limited to functions which have number, object, or string lists and some

functions which use arrays.

Assume that the following arrays have been defined:

ENTITY/E1(50),E2(10,10)

NUMBER/N1(200),N2(10,10),N3(5,10)

The following table shows some uses of subrange operators.

Statement Comment

N3 = N1(I..J)

Valid. No

compilation

error. At run

time, error

checks will be

made on array

bounds and the

subrange.

N1(6..10) = N1(1..5) Valid

assignment.

POINT/N1(20..22) Valid.

POINT/N1(I..I+2) Valid.

POINT/N1(J..K)

Invalid to use

variable array

subrange in a

POINT

Page 23: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

17

definition.

HATCH/E1(J..K)

Valid. Variable

subrange can be

used with

HATCH

statement.

GROUP/E2(1..I,1..J)

Invalid. Only

one array

subrange can be

used in a

multidimensional

array.

When some statements use a subrange of objects, they will generate a run time error if each array position is not assigned an

object. This can happen when the objects are loaded into the array during program execution. The following example shows the

use of a subrange operator with the IDENT statement to prompt the user to select a number of points to create a spline. These

points are assigned to the OBJ array.

ENTITY/OBJ(25),SP1

L10:IDENT/'PICK SPLINE POINTS',OBJ,CNT,NUM,RESP

JUMP/L10:,TERM:,,,,RESP

SP1=SPLINE/ENT(1..NUM)

The SPLINE statement will generate a run time error if all array positions specified are not assigned points during user selection

(IDENT).

You can overcome this situation by using the minor word CNT in the IDENT statement to cause the system to count the number

of objects selected and assign them to a numerical variable (NUM). You then use the variable as the subrange operator in the

SPLINE statement.

Therefore, if the user selects 14 points, the SPLINE statement SP1=SPLINE/OBJ(1..NUM) translates to

SP1=SPLINE/OBJ(1..14). This causes only those array positions which were assigned objects to be addressed.

Limits on Subrange of Objects For a subrange of objects, there is a 1000 object limit per subrange. To specify more than 1000 objects, use the following syntax

(this example specifies 2050 objects):

E(2050)

E(1..1000),E(1001..2000),E(2001..2050)

Expressions

Introduction Expressions are used to manipulate variables with mathematical functions. An expression can add two strings together, subtract

several numerical values and/or variables, or set one array equal to another, etc. Expressions may be used in place of simple

variables or constants.

For example, an arithmetic expression could be used to create a horizontal line 2 inches long from a specified point:

ENTITY/LN1

LN1=LINE/X,Y,X+2,Y

The line would begin at the specified X and Y and end at X+2 and Y. X+2 is an arithmetic expression.

These expressions are evaluated before the statement containing them is executed.

The three types of expressions are:

Arithmetic

Array

String

Page 24: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

18

Arithmetic Expressions An arithmetic expression is the combination of constants, variables, and arithmetic operators. The following is a list of the

arithmetic operators and their functions:

Operator Operation Performed

+ Addition

- Subtraction

* Multiplication

/ Division

** Exponentiation

= Set Equal To, Assign

The hierarchy (order of evaluation) of these operators is shown below. The operators with the highest priority are at the top and

the operators with the lowest priority are at the bottom. However, in cases where operators of equal priority appear in an

expression, the system will evaluate the expression from left to right.

Operator Operation Performed

** Exponentiation

+ & - Unary Addition & Subtraction

/ & * Division & Multiplication

+ & - Binary Addition & Subtraction

= Assignment

The words unary and binary refer to the number of items effected by the operators + and -. Unary refers to an operation which is

performed on one value only, such as a simple negation (A = -3). Binary refers to an operation which is performed on two values,

such as the addition or subtraction of two numbers.

The order in which the operations in an expression are performed can be controlled by the use of parentheses. Expressions within

parentheses will be evaluated before expressions without parentheses. In addition, if expressions in parentheses are nested within

expressions in parentheses, the expression in the innermost set of parentheses is evaluated first. The use of parentheses in the

evaluation of numerical expressions is shown below.

Expression Value

4 + 2 * 5 - 12 / 3 10

( 4 + 2 ) * 5 - 12 / 3 26

4 + 2 * ( 5 - 12 / 3 ) 6

4 + 2 * ( ( 5 - 12 ) / 3 ) -2 / 3

Array Expressions Array expressions provide a convenient method of performing addition or subtraction operations on arrays, or of setting one array

equal to another. The arrays in the computation must be singly dimensioned and of the same size and type. Using an array

expression is the same as performing the operation on each individual element of the array.

The following is an example of using an array expression.

NUMBER/A(3),B(3),C(3)

Variable Definition A(1) = 1

A(2) = 2

A(3) = 3

B(1) = 4

B(2) = 5

B(3) = 6

Page 25: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

19

Add all of the previously defined variables in a single array expression. C(1), C(2), and C(3) would now be defined as variables.

C = A + B

Add all of the previously defined variables using individual operations.

C(1) = A(1) + B(1)

C(2) = A(2) + B(2)

C(3) = A(3) + B(3)

Both of the methods shown above would result in the following values for the variable "C":

C(1) = 5, C(2) = 7, C(3) = 9

Arrays may also be negated by using an array expression.

String Expressions A string expression is the summation of two or more string literals, string variables, or any combination of the two. Adding

(concatenated) strings is accomplished by using a plus ("+") between the two values to be joined together.

The following shows how a string expression would be used.

STRING/STR(3,132)

STR(1)='DRILL SIZE ='+'.375 DIA.'

STR(2)='SPOTFACE* '+STR(1)

STR(3)=STR(2)+' $$POSITION 4'

PRINT/STR(3)

The PRINT statement would write the following text to the screen:

SPOTFACE* DRILL SIZE =.375 DIA. $$POSITION 4

Continuation and Comments

Introduction GRIP provides the means to manipulate line formats to continue a statement on more than one line, and to add program

documentation comments which will be ignored during program execution. To make your program easy to edit and trouble-shoot,

and make your program readable by other users, you can use spacing and comments to provide documentation in your program.

Some GRIP statements are quite long, and can become difficult to read if written without any spacing. GRIP statements ignore

spaces within the parameter fields, therefore you can add them without affecting program execution. Spaces are counted only in

regards to the number of characters per line.

For example, the following PARAM statement which creates a menu on the message monitor can be written in several ways. The

first version below is valid for execution, but can be difficult to read:

PARAM/'ENTER CIRCLE DIMENSIONS','X COORD',X,$

'Y COORD',Y,'RADIUS',RAD,'START ANG',STANG,$

'END ANG',ENANG,RESP

The same statement is easier to read when written as follows:

PARAM/'ENTER CIRCLE DIMENSIONS',$

'X COORD',X,$

'Y COORD',Y,$

'RADIUS',RAD,$

'START ANG',STANG,$

'END ANG',ENANG,RESP

You can document your program by using Comments as follows:

$$

$$ GET CIRCLE INFORMATION

$$

PARAM/'ENTER CIRCLE DIMENSIONS',$

'X COORD', X,$

'Y COORD', Y,$

'RADIUS', RAD,$

'START ANG', STANG,$

'END ANG', ENANG,RESP

In this case, the comment GET CIRCLE INFORMATION was added just before the menu (PARAM statement) used to get the

information to define the circle. Later in the program, just before the CIRCLE statement that creates the circle, the comment

CREATING CIRCLE could be added.

Page 26: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

20

L10: $$ REJECT

$$

$$ GET CIRCLE INFORMATION

$$

PARAM/'ENTER CIRCLE DIMENSIONS',$

'X COORD', X,$

'Y COORD', Y,$

'RADIUS', RAD,$

'START ANG', STANG,$

'END ANG', ENANG, RESP

JUMP/L10:,TERM:,,RESP

$$

$$ CREATING CIRCLE

$$

CR1=CIRCLE/X,Y,RAD,START,STANG,END,ENANG

Continuations Since there is a maximum of 80 characters allowed in a line of program, statements longer than 80 characters must be continued

on the next line. This is done by using the continuation symbol which is the dollar sign ($). Logical positions for continuation

symbols in a line of program are before or after function symbols.

For example:

L1=LINE/point,$

ATANGL,angle

Is equivalent to:

L1=LINE/point,ATANGL,angle

There is no practical limit to the number of lines that can be used for one GRIP statement.

Continuation cannot take place in the middle of a parameter field. Continuation should take place immediately preceding or

following a comma. For example, the following continuation is INVALID because it happened in the middle of the field:

LN1=LINE/point,ATAN$

GL,angle

The next continuation is valid but not recommended because the comma starting the second line can be to easily overlooked

during editing:

LN1=LINE/point,ATANGL$

,angle

The next continuation is recommended:

LN1=LINE/point,ATANGL,$

angle

Comments Putting comments throughout a program can be done by using the comment symbol, which is the double dollar sign ($$). A

comment may be on a line by itself or it may be on a line with a program statement. The comment symbol indicates to the

processor that the remainder of this line is to be ignored. Therefore, if a comment is to be on a line by itself, it is recommended

that the double dollar sign starts in the first position. This will help prevent the accidental insertion of data which could cause an

error in compilation.

P1=POINT/X,Y,Z

.

.

.

$$ DEFINE A REFERENCE POINT(a line with comments only)

$$ (blank lines for spacing)

$$

$$

P2=POINT/X,Y,Z $$ COMMENTS (program and comments)

$$

LN1=LINE/X1,Y1, $

$$ COMMENTS (continuation and comments)

X2,Y2

HALT

Page 27: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

21

Global Parameter Access

Introduction to GPAs Global Parameter Access (GPA) symbols provide a means of accessing certain functional data which is used by the NX system.

A GPA symbol always begins with a ampersand (&) and is a maximum of six characters long. GPAs are defined in the system

and may not be altered.

Each GPA symbol is associated with either a unique global parameter or a constant and has an access type, a data type, and a data

range. The following list contains a few of the GPA symbols which are available:

Operation Symbol Access Type Data Type Range

Grid size &GSIZE RW N GE 0

Line density &DENS RW N [1..3]

Normal &NORMAL C N =1

Heavy &HEAVY C N =2

Thin &THIN C N =3

For more information on GPA symbols, refer to GPA Symbol Format Summary and Global Parameter Access Symbols.

Access Type The access type of a GPA symbol determines the type of access operation which can be performed. GPAs contain data which can

be read, written over, or used to set the value of other GPAs. If a GPA has READ/WRITE access, you can obtain its value, or

write a new value to it. To maintain the integrity of the data base, the value of some GPAs cannot be changed. In this case the

GPA will have a READ ONLY access type. Some GPAs are used only to assign values to other GPAs. In this case the GPA will

have a CONSTANT access type.

Access Type Description

Read Only (RO) Value may be obtained but not altered.

Read/Write (RW) Value may be obtained or altered.

Constant (C) Value may be used to set other GPAs.

Example The READ capability for GPA symbols, implies that the value of the GPA being addressed may be obtained (fetched from the

system) and used for various purposes in a GRIP program.

STRING/PNAME(30),USERID(30)

$$

$$ OBTAIN THE CURRENT PARTNAME

$$

PNAME = &PNAME

$$

$$ OBTAIN THE USER ID

USERID = &USERID

Example The WRITE capability for GPA symbols, implies that the value of the GPA being addressed may be changed (altered) by a GRIP

program.

$$ SET TOLERANCE TYPE TO GPA CONSTANT &NOTOL

$$

&TOLER=&NOTOL

$$

$$ SET THE DIMENSIONAL FRACTION TYPE TO DECIMAL

$$

&FTYPE=&DECIM

$$

$$ SET THE NUMBER OF DIMENSIONAL DECIMAL

$$ PLACES

$$

&DDECPL=4

Page 28: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

22

The GPAs &TOLER, &FTYPE, and &DDECPL all have an access type of READ/WRITE allowing them to be assigned values

in a program.

Data Types The data type of a GPA specifies how the value returned from a READ will be treated; as an object, number, or string. If you are

writing to a GPA, the value assigned must be the same data type as the GPA.

The data types for GPA symbols are shown in the table below.

Data

Type

Description

N Numerical

E Object

S String

N(i) Numerical array of dimension (i)

Data Range The data range represents the set of values the global parameter may assume. For example, the GPA symbol &DENS which

controls the density of curves, has a data range of 1,2 or 3. These values may be directly assigned to the GPA &DENS, or the

corresponding GPA constants &NORMAL, &HEAVY, and &THIN may be used instead.

For example:

&DENS = &HEAVY

is equivalent to the statement

&DENS = 2.

As future enhancements may change the meaning of a value for a GPA symbol, it is strongly recommended that GPA constants

be used whenever possible. For example, setting &TOLER = 4 currently indicates a bilateral single line tolerance for subsequent

dimensions. However, a future enhancement may associate a different tolerance type with the number 4. Therefore,

(&TOLER=&BILS is preferable to &TOLER=4).

Some numerical ranges accept user defined values instead of fixed integers as above. The range may be plus or minus any valid

NX number, or any real number greater than or equal to zero, or any real number greater than zero.

For example, the grid size (&GSIZE) has a range of any valid NX number greater than zero. The arrowhead size (&ASIZE) has a

range of any valid NX number greater than zero. It must be greater than zero since a zero length arrowhead would not make sense.

The following abbreviations are used to refer to numerical ranges.

Numerical Range Abbreviation

Greater Than Zero GT 0

Greater Than or Equal to Zero GE 0

Any Valid NX Number infinity

Error checking is performed on GPA symbols during compilation and execution to ensure proper access type, data type and data

range. The access type and data type will be checked during compilation and the data range will be checked during execution.

For example, &DENS is of access type RW and data type N. The assignment &DENS='THIN' is an attempt to assign a string

value to &DENS instead of a numerical value. This would result in an error during the compilation phase. Attempting to set the

value of a GPA symbol with an access type of RO, will also result in an error during compilation. For example, the assignment

&USERID='MANAGER' would result in an error since &USERID is a READ ONLY type of GPA.

The data range of a GPA symbol, however, will be checked at run time only. For example, the GPA symbol &FONT has a data

range of 1 thru 4. The assignment &FONT = 6 would compile with no errors, but would result in an error at execution time.

Sample GRIP Program The following sample program is presented as an example of how a GRIP program may be organized.

Page 29: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

23

Although many of the statements in the GRIP program on the following page have not yet been explained, the example offers

something specific with which to relate to the contents of the various sections of this manual. The program generates the lines

and arcs which develops the word GRIP as shown below.

The Lines and Arcs Created by the Sample Program

1 $$

2 $$ THIS PROGRAM CREATES THE WORD 'GRIP'

3 $$ USING LINES AND ARCS

4 $$

5 ENTITY/P1,P2,G(9),R(5),I(3),P(4)

6 $$

7 $$ LETTER 'G' DEFINITION

8 $$

9 G(1)=LINE/.325,.5,.7,.5

10 G(2)=LINE/.45,1,0,.2,1,0

11 G(3)=LINE/-.05,.75,0,-.05,.25,0

12 G(4)=LINE/PARLEL,G(2),YSMALL,1

13 G(5)=LINE/.7,.25,0,.7,.5,0

14 G(6)=CIRCLE/.45,.75,.25,START,0,END,90

15 G(7)=CIRCLE/CENTER,(P1=POINT/.2,.75),$

16 RADIUS,.25,START,90,END,180

17 DELETE/P1

18 G(8)=CIRCLE/CENTER,(P1=POINT/.2,.25),$

19 (P2=POINT/.2,0),START,180,END,270

20 DELETE/P1,P2

21 G(9)=CIRCLE/.45,.25,.25,START,270,END,360

22 $$

23 $$ LETTER 'R' DEFINITION

24 $$

25 R(1)=LINE/1.3,.5,.8,.5

26 R(2)=LINE/1.3,.5,1.55,0

27 R(3)=LINE/.8,1,.8,0

28 R(4)=LINE/.8,1,1.3,1

29 R(5)=CIRCLE/1.3,.75,.25,START,270,END,90

30 $$

31 $$ LETTER 'I' DEFINITION

32 $$

33 I(1)=LINE/1.65,1,2.4,1

34 I(2)=LINE/PARLEL,I(1),YSMALL,1

35 I(3)=LINE/2.025,1,2.025,0

36 $$

37 $$ LETTER 'P' DEFINITION

38 $$

39 P(1)=LINE/3,.5,2.5,.5

40 P(2)=LINE/2.5,1,2.5,0

41 P(3)=LINE/2.5,1,3,1

42 P(4)=CIRCLE/3,.75,.25,START,270,END,90

43 $$

44 $$ GROUP THE INDIVIDUAL LETTERS

45 $$

46 GROUP/G

47 GROUP/R

48 GROUP/I

Page 30: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

24

49 GROUP/P

50 $$

51 HALT

Sample Program Explanations The following are explanations of the sample program statements.

Seq.

No

Statement/Explanation

1 $$

A comment line. Left blank for clarity.

2 $$ THIS PROGRAM CREATES THE WORD 'GRIP'

A comment line. Anything following a $$ is considered

a comment.

5 ENTITY/P1,P2,G(9),R(5),I(3),P(4)

An object declaration statement. Defines object

variables P1, P2 and four object arrays, G, R ,I, and P.

Up to 9 objects can be stored in array G, 5 in array R, 3

in array I, and 4 in array P.

9 G(1)=LINE/.325,.5,.7,.5

Defines G(1) as a line through two two-dimensional

points with work coordinates of XC=.325, YC=.5 and

XC=.7,YC=.5.

10 G(2)=LINE/.45,1,0,.2,1,0

Defines G(2) as a line through two three dimensional

points with work coordinates of XC=.45, YC=1, ZC=0

and XC=.2, YC=1, and ZC=0.

12 G(4)=LINE/PARLEL,G(2),YSMALL,1

Defines G(4) as a line parallel to line G(2), at a 1 inch

offset in the negative YC (YSMALL) direction.

14 G(6)=CIRCLE/.45,.75,.25,START,0,END,90

Defines G(6) as a circle with its center at the work

coordinates XC=.45, YC=.75, with a radius of .25,

starting at 0 degrees and ending at 90 degrees.

15 G(7)=CIRCLE/CENTER,(P1=POINT/.2,.75)RADIUS,$

.25,START,90,END,180

Defines G(7) as a circle with its center at the point P1, a

radius value of .25, starting at 90 degrees, and ending at

180 degrees. Notice the use of the continuation line

symbol $. This allows the line to be continued on the

next program line. The statement (P1=POINT/.2,.75) is

known as a `nested' object definition because the point

definition is contained in (or 'nested' in) the circle

definition. The point could have been defined on a

separate line, which would have been as follows:

P1=POINT/.2,.75

G(7)=CIRCLE/CENTER,P1,RADIUS,.25,START,90,$

END,180

17 DELETE/P1

Deletes the point defined in line 15.

18 G(8)=CIRCLE/CENTER,(P1=POINT/.2,.25),

Page 31: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

25

(P2=POINT/.2,0),START,180,END,270

Defines G(8) as a circle with its center at the point P1,

passing through the point P2, starting at 180 degrees

and ending at 270 degrees. The point P2 determines the

radius of the circle.

46 GROUP/G

Groups the objects contained in the array G.

51 HALT

The HALT statement stops the GRIP program and

returns to the NX interactive system. Each main GRIP

program must contain a HALT statement.

Page 32: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

26

Declarations and Functions

This topic covers the declarations and functions in GRIP that are used to define and manipulate user-defined variables. The GRIP

functions also deal with extracting and/or performing mathematical operations on the characteristics of objects and characters.

These declarations and functions have been defined in this section:

Declarations

String Functions

Positional Modifiers

Curve and Surface Position Functions

Vector Functions

Edit Curve

The declarations in GRIP are used to define and initialize user defined variables. Variables are one of three data types: ENTITY,

NUMBER, or STRING. The DATA declaration is used to initialize, or preset values for the variables before the rest of the

program executes. Declarations must precede any other lines of code in a GRIP program.

The GRIP functions perform operations which are not normally found in interactive NX. Functions do not, by themselves, create

any objects; however, they can be invaluable in performing mathematical calculations needed to model geometry. Most GRIP

functions follow the following format:

Major word(variable(s))

Some functions use scalars. Scalars are numerical values used to position the application of a function on a curve or a surface.

For example, the CPOSF function returns the coordinates of a point at a distance along a curve. The distance is defined as a

scalar value of the total length of the curve. To place the coordinate calculation on the curve, the scalar value must be between 0

and 1. Any value beyond the range of 0 to 1 places the calculation on the extensions of the curve. The format of a function using

scalars is generally as follows:

Major word(object,scalar(s))

When data is returned from a function, like the CPOSF function above, it should be assigned to a variable. That variable must

have the proper data type and contain enough positions or dimensions to handle the information. For example, the variable which

is assigned the coordinates calculated by the CPOSF function must be declared as a three position numerical array. The format of

this assignment is generally as follows:

NUMBER/variable(3)

Variable=major word(object,scalar(s))

The CPOSF function would calculate the coordinates of a point along a line and assign them to an array as follows:

ENTITY/LN1,PT1

NUMBER/NUM(3)

LN1=LINE/0,0,4,3

NUM=CPOSF(LN1,.5)

PT1=POINT/NUM

PRINT/NUM

HALT

The above program displays the following output to the listing device:

2.0000,1.5000,.0000

and draws the following line and point.

Page 33: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

27

Line and Mid Point Using CPOSF

Function Statement Format

DECLARE NUMERICAL VARIABLE NUMBER/name(dim1[,dim2[,dim3]])

[,name(dim1[,dim2[,dim3]])]+

DECLARE STRING VARIABLE STRING/name([dim1,[dim2]],n)

[,name([dim1[,dim2]],n)]+

DECLARE ENTITY VARIABLE ENTITY/name[(dim1[,dim2[,dim3]])]

[,name[(dim1[,dim2[,dim3]])]]+

INITIALIZE VALUES FOR STRING

AND NUMERICAL VARIABLES

DATA/name,value[,value]+[,name,value[,value]+]+

ACCESS ENVIRONMENT VARIABLES string = ENVVAR/'variable'{,ASK|,SET,'value'}

[,IFERR,label:]

DETECT UNDECLARED VARIABLES GRIPSW/DECLRV

CREATE BLANK CHARACTERS BLSTR(n)

RETURN STRING WITH ASCII VALUE

OF n

CHRSTR(n)

RETURN CURRENT DATE DATE

CONVERT REAL NO. TO CHARACTER

STRING

FSTR(n)

CONVERT REAL NO. TO CHARACTER

STRING (More Than 8 Chars)

FSTRL(n)

CONVERT INTEGER TO CHARACTER

STRING

ISTR(n)

CONVERT INTEGER TO CHARACTER

STRING (More Than 8 Chars)

ISTRL(n)

REPLACE CHARACTERS IN A STRING REPSTR('object string'

,'search string'

,'replacement string',pos)

EXTRACT PORTION OF A

CHARACTER STRING

SUBSTR('object string',pos,count)

RETURN CURRENT TIME TIME

Page 34: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

28

RETURN ASCII VALUE OF

CHARACTER

ASCII('string',pos)

COMPARE STRINGS CMPSTR('string1','string2')

FIND STRING START POSITION FNDSTR('object string','search string',pos)

NUMBER OF CHARS IN A STRING LENF('string')

CONVERT STRING TO A REAL

NUMBER

VALF('string')

PARAMETER POSITION ON A CURVE num = CPARF/obj,{point|x,y,z}

POSITION ON A CURVE OR CURVE

EXTENSION

CPOSF(obj,scalar)

GEOMETRIC PROPERTIES OF A

CURVE AT PARAMETER

CPROPF(obj,parameter)

U, V PARAMETERS OF A POINT ON A

SURFACE

SPARF/obj,{point|X,Y,Z},u,v

POSITION ON A SURFACE SPOSF(obj,u,v)

DOT PRODUCT OF TWO VECTORS DOTF(A,B)

LENGTH OF A VECTOR (Magnitude) VLENF(A)

CROSS PRODUCT OF TWO VECTORS CROSSF(vector1,vector2)

VECTOR TANGENT TO A CURVE CTANF(obj,scalar)

SCALED VECTOR SCALVF(scalar,vector)

SURFACE PARTIAL DERIVATIVE

WITH RESPECT TO THE u

PARAMETER

SDDUF(obj,u,v)

SURFACE PARTIAL DERIVATIVE

WITH RESPECT TO THE v

PARAMETER

SDDVF(obj,u,v)

VECTOR NORMAL TO A SURFACE SNORF(obj,u,v)

GEOMETRIC PROPERTIES OF A FACE

AT A PARAMETER

SPROPF(obj,u,v)

UNIT VECTOR UNITF(A)

TRIM CURVE USING BOUNDING

OBJECTS

obj = CRVTRM/curve,REF,{pt1|x,y,z},FIRST,limit1

[,REF,{pt1|x,y,z}]

[,INT,{pt2|x,y,z}]

[,NOTRIM]

[,SECOND,limit2[,REF,{pt1|x,y,z}]

[,INT,{pt2|x,y,z}][,NOTRIM]]

,STATUS,status

[,IFERR, label:]

TRIM CURVE BY GIVEN ARCLENGTH CTRIM/obj,dist,{START|END|point}

or

CTRIM/TOTAL,obj,length,{START|END|point}

Page 35: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

29

Declarations

Introduction Declarations define the variables which are used in a program. You can specify the variable name, data type, and any initial

values you want assigned to the variables. All declarations must precede the first line of executable code.

The declaration statement GRIPSW prevents the program from compiling if it contains undeclared simple variables.

The following table summarizes the format of declaration statements. See the Function List for a complete description of their

use.

Declaration Format Summary

NUMBER NUMBER/name(dim1[,dim2[,dim3]]) [,name(dim1[,dim2[,dim3]])]+

STRING STRING/name([dim1,[dim2]],n) [,name([dim1[,dim2]],n)]+

ENTITY ENTITY/name[(dim1[,dim2[,dim3]])] [,name[(dim1[,dim2[,dim3]])]]+

DATA DATA/name,value[,value]+[,name,value[,value]+]+

GRIPSW GRIPSW/DECLRV

Declaration Statement List

Function Major Word

Number NUMBER

String STRING

Entity ENTITY

Data DATA

Environment Variables ENVVAR

Detect Undeclared Variables GRIPSW/DECLRV

Number

Synopsis NUMBER/name(dim1[,dim2[,dim3]])[,name(dim1[,dim2[,dim3]])]+

Description Used to establish arrays for numerical variable. There are two types of numerical variables: subscripted and non-subscripted.

Non-subscripted variables are also referred to as simple variables. They do not need to be declared because GRIP assumes that all

undeclared variables in a program are simple numerical variables.

For example, the declaration NUMBER/NUM(3) defines a subscripted three position, single dimension array variable. Numerical

values can be assigned to NUM(1), NUM(2), and NUM(3). However, the variable SIZE is simple and non-subscripted, and does

not need to be declared. See the following program:

NUMBER/NUM(3)

SIZE=.25

NUM(1)=1.0625

NUM(2)=2.25

NUM(3)=1

HALT

Parameters

Parameter Description

Page 36: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

30

name The name of the variable.

dim1 The number of columns in the array.

dim2 The number of rows in the array.

dim3 The number of layers in the array.

String

Synopsis STRING/name([dim1,[dim2]],n)[,name([dim1[,dim2]],n)]+

Description Used to define single string variables and string variable arrays. String variables contain literal data that can be used in notes,

dimensions, messages, or anywhere text is required.

Parameters

Parameter Description

name A string variable or a string array of one or two dimensions.

n Number of characters which may be assigned to the string variable or string array element. n must

be greater than 0 and less than or equal to 132.

dim1,dim2 The number of storage locations or elements assigned to the string array name. For example, the

declaration STRING/STR(10,10,20) defines a two dimensional string array STR, containing 100

elements (10 x 10), with each element capable of storing a maximum of 20 characters.

Entity

Synopsis ENTITY/name[(dim1[,dim2[,dim3]])][,name[(dim1[,dim2[,dim3]])]]+

Description Defines object variables and arrays. Any of the NX objects that can be defined in GRIP, can be assigned to an object variable. A

group or boundary can also be assigned to an object variable.

Parameters

Parameter Description

name A simple object variable or an object array of one, two or three dimensions.

dim1,dim2,dim3 The number of elements assigned to the variable array name. Initially, all object variables and

array elements are undefined. That is, if an object variable is declared, but not defined before

it is used in a GRIP statement, an execution error results. See example below.

Data

Synopsis DATA/name,value[,value]+[,name,value[,value]+]+

Description Initializes the values of numerical and string variables. The string and numerical variables included in a DATA statement must

first be declared using the STRING and NUMBER declarations. If the variable is an array, the fields following the variable name

are assigned in order of the array. For example, the first field is assigned to the first position in the array, the second field is

assigned to the second position in the array, etc. If the variable is two

Page 37: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

31

NUMBER/NUM(2,2)

DATA/NUM,10,20,30,40

The declarations above would create the following assignments.

Variable Value Assigned

NUM(1,1) 10

NUM(1,2) 20

NUM(2,1) 30

NUM(2,2) 40

If a string variable array is being initialized, all the strings in the array must be initialized, or a compilation error occurs. When

you use a DATA statement in a subprogram (see PROC), the DATA variables are only initialized the first time the subprogram is

called.

Parameters

name Name of a previously declared string or number variable.

value Value to be assigned to the specified variable. The type of data, string or numerical, must match the

declaration type of the specified name.

The data item list may consist of items of the following types:

Variable Type Form Example

Simple String variable,'string' STR,'ENTER'

String Array array,'string' MES,'OPTION1','OPTION2'

Simple Number variable,value X,5

Number Array array,list A,-1,2,8

Individual elements of an array may be addressed in a DATA declaration:

NUMBER/NUM(3,3)

STRING/STR(4,20)

DATA/NUM(1,3),2.5,NUM(2,1),5.625,STR(3),'BOLT CIRCLE'

HALT

The values assigned to numerical variables and arrays must be constants and the subscripts used to specify array elements must

also be constants. A variable length subrange cannot be used in a DATA statement.

For example, these statements assign 'ENTER' to STR, -1,2,5 to A(1), A(2), A(3) respectively and 3 to B(1).

NUMBER/A(3),B(10)

STRING/STR(50)

DATA/STR,'ENTER',A,-1,2,5,B,3

HALT

Environment Variables

Synopsis string = ENVVAR/ 'variable'{,ASK|,SET,'value'}[,IFERR,label:]

Description Provides access to environment variables. Translates, sets, or creates the specified environment variable. The environment

variable must already exist when doing a query. When setting an environment variable, a new one is created if one does not exist;

otherwise, the variable's value is modified. In all cases where an error has not occurred, this command returns the latest

translation of the specified environment variable in the form of a string. When an error occurs, an error message is given or the

IFERR is branched on, and nothing is returned.

Parameters

Parameter Description

variable A string representing the environment variable to access. This string is case sensitive in the UNIX

operating system.

Page 38: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

32

ASK Minor word that specifies the translation of an environment variable.

SET Minor word that specifies the creation or setting of an environment variable.

value A string representing the value of the environment variable to use in the set operation.

IFERR,label: Specifies a label to which program execution jumps if an error occurs.

Detect Undeclared Variables

Synopsis GRIPSW/DECLRV

Description The statement is used for compiler directives. If used with the minor word directive DECLRV, it prevents the program from

compiling if the program contains undeclared simple variables. This ensures that all variables are declared before they are used in

the program. This reinforces the data assignment to the correct variable types.

During compilation, if the compiler comes across an undefined simple variable, it generates error number 62, UNDEFINED

VARIABLE.

You can place the GRIPSW statement anywhere in the declaration section, but it must come before the first executable statement.

For example, this declaration:

NUMBER/a,b

GRIPSW/DECLRV

STRING/STR(2,30),NAME(6)

.

.

a = 10

.

.

would have the same result as this:

GRIPSW/DECLRV

NUMBER/a,b

STRING/STR(2,30),NAME(6)

.

.

a = 10

.

.

Parameters

Parameter Description

DECLRV Minor word which detects undeclared variables.

Strings

String Overview This topic covers the GRIP functions that manipulate character strings. These functions are either character or number valued.

Character Valued Functions Character-valued functions generate or manipulate characters in a string. For example, the BLSTR function creates blank spaces

in a string. Since blanks are a form of a text character, BLSTR is character valued.

Number Valued Functions Number valued functions return numerical values concerning characteristics pertaining to the specified characters. For example,

the ASCII function returns the ASCII equivalent of a specified character string in decimal form. Since GRIP considers this a

number, ASCII is a number valued function.

Page 39: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

33

The character and number valued functions have been divided into two sections. The character valued functions are listed first.

String Statement List

Character-Valued Functions

Function Major Word

Create Blank Characters BLSTR

Return String with ASCII Value of n CHRSTR

Return Current Date DATE

Convert Real Number to Character String FSTR

Convert Real Number to Character String FSTRL

Convert Integer to Character String ISTR

Convert Integer to Character String ISTRL

Replace Characters in a String REPSTR

Extract Portion of a Character String SUBSTR

Return Current Time TIME

Number-Valued Functions

Function Major Word

ASCII Value of a Character ASCII

Compare Strings CMPSTR

Position of Characters in a String FNDSTR

Number of Characters in a String LENF

Convert String to a Real Number VALF

ASCII Value of a Character

Synopsis ASCII('string',pos)

Description Returns the ASCII value of the character specified by pos, in decimal form. The ASCII Conversion Table, contains a complete

list of ASCII characters and their corresponding decimal values. If pos is less than one or greater than the number of characters in

the string, the error message INVALID CHAR POS displays.

Parameters

Parameter Description

'string' The literal string or string variable name of the string to be accessed.

pos The character position of the character whose ASCII value is returned. Spaces (blanks) are counted

in arriving at the position. The pos must be an integer value greater than zero.

Page 40: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

34

Return String with ASCII Value of n

Synopsis CHRSTR(n)

Description Returns a single character string that has a value equal to the value n to a receiving variable or GRIP statement. The receiving

variable must be declared as a string.

Parameters

Parameter Description

n An integer which represents the value of the character to be returned. You can use any valid value

from 0 to 255. However, when displaying characters to the CRT in NX, we recommend that you

only use values of printable characters. For a list of printable ASCII characters, see the ASCII

Conversion Table.

Create Blank Characters

Synopsis BLSTR(n)

Description Generates the number of blank characters, spaces, specified by the value n. The value of n must be from 0 to 132 inclusive.

Parameters

Parameter Description

n The number of characters to be created. The number must be a positive integer value between 0 and

132 inclusive.

Compare Strings

Synopsis CMPSTR('string1','string2')

Description Performs a lexical comparison of characters in a similar position in two strings. This comparison is based on the ASCII values

contained in the ASCII Conversion Table. If the two strings are identical a 0 is returned. If the two strings are not identical and

the character in string1 lexically precedes the character in string2, a -1 is returned, if string1 follows string2, a 1 is returned.

Parameters

Parameter Description

'string1' The literal string or string variable name of a string which is evaluated against string2.

'string2' The literal string or string variable name of a string which is evaluated against string1.

Return Current Date

Synopsis DATE

Page 41: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

35

Description Returns the current date as a ten or twelve character literal string. The format of the string is set by &FULLDT. &FULLDT

supports the following formats:

mm--dd--yy

mm--dd--yyyy

mm-dd-yyyy

If you do not set &FULLDT, the DATE command defaults to the following format:

mm--dd--yy

Position of Characters in a String

Synopsis FNDSTR('target string','search string',pos)

Description Returns the start position of a search string within a target string. The returned value is an integer which represents the start

position of the first occurrence of the search string. The search is made from the position specified by pos to the end of the target

string or until the first occurrence of the search string is found. If the search string is not found, a 0 is returned.

Parameters

Parameter Description

'target string' The literal string or string variable name of a string which is searched.

'search string' The set of character(s) which is searched for in the target string.

pos Position in the target string where the search begins. Spaces (blanks) are counted in arriving at the

search location. The pos value must be an integer greater than zero.

Convert Real Number to Character String

Synopsis FSTR(n)

Description Converts a real number into a character string. The maximum number of characters which this function can return is eight,

including the decimal point and minus sign. To return more than eight characters, use the FSTRL statement.

The resulting string has a leading zero when the number is less than one, but greater than negative one. You may use &DECPL to

control the number of decimal places that appear to the right of the decimal point.

Please note the following items.

This function rounds up rather than truncating digits when specifying less than the significant number of digits with &DECPL or

with the default number of decimal places if &DECPL is not used. For example, if you set &DECPL=0, then FSTR(2.5) rounds

up to 3.

If you set &DECPL = 0, the decimal point does not return in the string.

Parameters

Parameter Description

n Real number which is to be converted to a character string. This function returns a maximum of 8

characters (including the decimal point and minus sign). If you attempt to convert a real number

which generates more than eight characters, then this command returns a string of nines (e.g.

'9999999') which indicates an overflow error.

Page 42: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

36

Convert Real Number to Character String

Synopsis FSTRL(n)

Description Converts a real number into a character string. The maximum number of characters which this function can return is 30,

including the decimal point and minus sign.

The 30 character limit is set so that you can use the string in the MESSG statement directly (MESSG has a limit of 60 characters

per line). For example:

MESSG/'I = ' + FSTRL(i)

The resulting string has a leading zero when the number is less than one, but greater than negative one.

You may use &DECPL to control the number of decimal places that appear to the right of the decimal point. The default number

of decimal places is 4 (if &DECPL is not used).

Please note the following items:

This function rounds up rather than truncating digits when specifying less than the significant number of digits with &DECPL or

with the default number of decimal places if &DECPL is not used. For example, if you set &DECPL=0, then FSTRL(2.5) rounds

up to 3.

If you set &DECPL = 0, the decimal point returns in the string.

Parameters

Parameter Description

n Real number which is to be converted to a character string. This function returns 30 characters

(including the decimal point and minus sign).

Convert Integer to Character String

Synopsis ISTR(n)

Description Converts the integer portion of a real number into a character string. The maximum number of characters which this function can

return is eight and the value of n must be any valid NX number. To return more than eight characters, use the ISTRL statement.

Parameters

Parameter Description

n Real number whose integer portion is converted to a character string. The non-integer (to the right

of the decimal point) portion gets truncated.

Convert Integer to Character String

Synopsis ISTRL(n)

Description Converts the integer portion of a real number into a character string. The maximum number of characters which this function can

return is 30.

The 30 character limit is set so that you can use the string in the MESSG statement directly (MESSG has a limit of 60 characters

per line). For example:

MESSG/'R = ' + ISTRL(r)

Page 43: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

37

Parameters

Parameter Description

n Real number whose integer portion is converted to a character string. The non-integer (to the right

of the decimal point) portion gets truncated.

Number of Characters in a String

Synopsis LENF('string')

Description Returns the number of characters in a string. A string may be declared as containing a maximum of 132 characters, but the actual

number of characters in the string may be less than 132. Leading and trailing as well as imbedded blanks are counted.

Parameters

Parameter Description

'string' The literal string or string variable name of a string whose length in characters is returned.

Replace Characters in a String

Synopsis REPSTR('target string','search string','replacement string',pos)

Description Replaces a specific character string with another. In this function the target string is the string to be altered, the search string is

the string to be found and the replacement string the new string. The pos value specifies a position in the string where the search

is to begin. The search continues to the last position in the string or until the first occurrence of the search string is found. If the

search string is not found, the target string is returned unchanged. If pos is less than one or greater than the number of characters

in the string, the error message INVALID CHAR POS displays.

Parameters

Parameter Description

'target string' The literal string or string variable name of the string to be altered.

'search string' The set of character(s) which gets searched for in the specified target string. Only the first

occurrence of the search string, past the starting position (pos), is replaced.

'replacement string' The set of character(s) which replaces the search string characters. The number of characters in

the search and replacement strings do not have to be equal.

pos Character position in the target string where the search begins. Pos must be an integer value

greater than zero. Spaces (blank characters) are counted in determining a character's position in

the target string. The positions are counted from left to right with the first character in the string

being 1.

Page 44: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

38

Figure 1-3 Numeric Positions of Characters in a String

Extract Portion of a Character String

Synopsis SUBSTR('target string',pos,count)

Description Extracts a specified portion of a character string. The starting position in the target string is specified by the value pos and the

number of characters to be extracted is specified by the value count. If the character count exceeds the number of characters in

the target string, the substring which returns is the target string.

Parameters

Parameter Description

'target string' The literal string or string variable name of the string from which the specified characters are

copied.

pos Character position in the object string where the copying of characters begins. Spaces (blanks) are

counted in arriving at the starting position. The pos must be an integer value greater than zero.

count The number of consecutive characters to be copied. Spaces (blanks) are counted in the count. The

count must be an integer value greater than zero.

Return Current Time

Synopsis TIME

Description Returns the current time as a five character literal string HH:MM.

Convert String to a Real Number

Synopsis VALF('string')

Description Converts a string representing a numerical value into a real floating point number. The string must be in the numeric form with a

maximum of 132 characters including the decimal point. This function is the reciprocal of the FSTR and FSTRL functions.

When non-numeric characters follow a number in the string, it is truncated at the first non-numeric character before the

conversion. The only exception is the letter E which VALF interprets as scientific notation.

Parameters

Parameter Description

Page 45: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

39

'string' The literal string or string variable name of a string which gets converted to a real number.

Positional Modifiers

Introduction Positional Modifiers are minor words which specify the relative direction of one position and/or object to another. These

modifiers are valuable in the definitions of geometric objects where multiple solutions exist. Positional modifiers are based on the

Cartesian coordinate system and interpreted with respect to the WCS. Positional modifiers apply to a large number of geometric

objects and each modifier is associated with a numerical value which may be used instead of the word.

The use of positional modifiers may fail in certain cases. If this occurs, try a user defined reference point instead. Refer to the

specific command being used for the correct implementation of the reference point.

The six positional modifier minor words are:

XSMALL, YSMALL, ZSMALL

XLARGE, YLARGE, ZLARGE

Many of the modifiers such as left, right, in, out, etc., are applicable to a limited number of geometric objects and are covered in

the specific section where they apply.

Positional modifiers may be used in GRIP Statements only where the statement format allows. The word PMOD is used to tell

you to enter one of the positional modifiers. The X, Y and Z modifiers are classified as two and/or three dimensional. As shown

below, the two dimensional modifiers "PMOD2" are a subset of the three dimensional modifiers "PMOD3". "PMOD2" modifiers

are used in situations where only the X and Y directions are a factor. An example is where the WCS and the current view must be

coincident such as in the construction of dimensions or drafting objects.

XSMALL - 1 - PMOD2/PMOD3

YSMALL - 2 - PMOD2/PMOD3

ZSMALL - 3 - PMOD3

XLARGE - 4 - PMOD2/PMOD3

YLARGE - 5 - PMOD2/PMOD3

ZLARGE - 6 - PMOD3

The first character of each word, X, Y, and Z, represents the corresponding axis of the Cartesian coordinate system. The values

SMALL and LARGE represent the negative and positive directions of the Cartesian coordinate system respectively.

This example shows the use of a positional modifier to tell GRIP at which end of a line (LN1) it should create a point (P1).

ENTITY/PT1,LN1

Object Definitions LN1=LINE/-1,3,-2,3,6,-3

PT1=POINT/ENDOF,ZSMALL,LN1

Result The point PT1 is defined at the coordinates of 3, 6 and -3 which is at the end of the line with the smallest Z value (-3 is smaller

than -2).

Positional modifiers are general direction indicators which are used to minimize or eliminate ambiguity. In the example above,

for instance, XLARGE or YLARGE would have produced the same point.

Another application of the positional modifier is the creation of an object at a given distance from another. For example, in the

definition of a line parallel to an existing line, a positional modifier is required to specify on which side of the existing line the

new line is created. See the example below.

Example This example shows how a positional modifier is used to tell GRIP which side of the existing line (LN(1)) to create another line

(LN(2) and LN(3)) parallel to it at a specified distance (.75).

ENTITY/LN(3)

Object Definitions LN(1)=LINE/-1,-1,1,1

LN(2)=LINE/PARLEL,LN(1),YLARGE,.75

LN(3)=LINE/PARLEL,LN(1),YSMALL,.75

Page 46: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

40

Parallel Lines Using Positional Modifiers

Example This example depicts the use of positional modifiers using numerical values instead of minor words.

ENTITY/LN(4),FLT(4)

Create a Square LN(1) =LINE/0,0,1,0

LN(2) =LINE/1,0,1,1

LN(3) =LINE/1,1,0,1

LN(4) =LINE/0,1,0,0

Fillet All Corners of the Square FLT(1)=FILLET/4,LN(4),5,LN(1),RADIUS,.25

FLT(2)=FILLET/1,LN(2),5,LN(1),RADIUS,.25

FLT(3)=FILLET/1,LN(2),2,LN(3),RADIUS,.25

FLT(4)=FILLET/4,LN(4),2,LN(3),RADIUS,.25

The FILLET statements above, using numerical values, are equivalent to the following FILLET statements, using the positional

modifier words.

FLT(1)=FILLET/XLARGE,LN(4),YLARGE,LN(1),RADIUS,.25

FLT(2)=FILLET/XSMALL,LN(2),YLARGE,LN(1),RADIUS,.25

FLT(3)=FILLET/XSMALL,LN(2),YSMALL,LN(3),RADIUS,.25

FLT(4)=FILLET/XLARGE,LN(4),YSMALL,LN(3),RADIUS,.25

If a numerical value less than one or greater than six is substituted for a positional modifier, the error message INVALID

MODIFIER is displayed.

PT4 is defined as a point at the end of a 1.8 inch vector which starts at PT3 and is parallel to LN1 in the ZLARGE direction.

ENTITY/PT1,PT2,LN1,PT3,PT4

Object Definitions PT1=POINT/1,-1,1

PT2=POINT/-1,1,-1

LN1=LINE/PT1,PT2

PT3=POINT/0,0,0

Use of Position Modifiers PT4=POINT/PT3,VECT,LN1,ZLARGE,1.8

The definition of PT4 may also be written as follows:

Use of Numerical Equivalent to ZLarge PT4 = POINT/PT3,VECT,LN1,6,1.8

The line LN2 is created parallel to LN1, at an offset distance of 1 in the positive Z direction.

ENTITY/PT1,PT2,LN1,LN2

Other Definitions PT1=POINT/0,0

PT2=POINT/1,1

LN1=LINE/PT1,PT2

Use of Positional Modifier LN2=LINE/PARLEL,LN1,6,1

Page 47: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

41

Curve and Surface Position Functions

Introduction This topic covers the GRIP functions that provide a means of obtaining positional information about a curve or surface.

Curve and Surface Position Statement List

Function Major Word

Parameter Position on a Curve CPARF

Position on a Curve or Curve Extension CPOSF

Geometric Properties of a Curve at Parameter CPROPF

U, V Parameters of a Point on a Surface SPARF

Position on a Surface SPOSF

Parameter Position on a Curve

Synopsis num = CPARF/obj,{point|x,y,z}

Description Returns the parameter value along a curve nearest to the specified point or coordinates. If the point is not on the curve, the

position is calculated by projecting the point, normal to the curve, onto the curve. If this projection cannot reach the curve, the

parameter at the end of the curve closest to the point is returned.

Parameters

Parameter Description

obj An existing object along which the position is calculated. The object may be a line, an arc, a conic

or a spline.

point An existing point near the curve which defines the desired position.

x,y,z Three numerical values or a three-position numerical array which represents the coordinates, in the

WCS, of the point near the curve which defines the desired position.

Position on a Curve

Synopsis CPOSF(obj,scalar)

Description Returns the coordinate values of a point on a curve at a specified parameter along the curve from its starting point.

Parameters

Parameter Description

obj An existing object along which the position is calculated. The object may be a line, an arc, a conic

or a spline.

scalar A numerical value which represents the parameter along the curve where the position is calculated.

The parameter range along the curve is specified between 0 to 1, where 0 is the beginning of the

Page 48: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

42

curve and 1 is the end of the curve.

Geometric Properties of a Curve at Parameter

Synopsis CPROPF(obj,parameter)

Description Returns the point, tangent, unit principal normal, unit binormal, torsion, and radius of curvature of a curve at a given parameter.

The parameter is assumed to be normalized.

This statement returns a fourteen element array containing the point (1-3), tangent (4-6), unit principal normal (7-9), unit

binormal (10-12), torsion (13), and radius of curvature (14).

The following statements also allow you to obtain similar data:

CPARF allows you to obtain the parameter of a curve at a given point.

CPOSF and CTANF statements allow you to calculate a point on a curve and tangent at that point given a parameter.

The CTANF statement does not correctly scale the tangent returned for a normalized parameter. The CPROPF statement

correctly scales the tangent it returns.

Parameters

Parameter Description

obj Object identifier of the curve.

parameter Parameter value on curve at which to calculate the data.

U, V Parameters of a Point on a Surface

Synopsis SPARF/obj,{point|X,Y,Z},u,v

Description Returns the U and V surface parameters of a point on a surface which has the closest distance to a given point. If the point is on

the surface, the u and v parameters are those of the point. The output from this function may subsequently be used as input to

either the surface position function, SPOSF, or the surface normal function, SNORF.

All NX surfaces are valid for SPARF and SPOSF.

Parameters

Parameter Description

obj A previously defined surface.

point A previously defined point which is used to calculate the position from which the U and V

parameters are returned.

X,Y,Z The X, Y, and Z coordinates of a point which is used to calculate the position from which the U and

V parameters are returned.

u,v Variables which are assigned the u and v values returned. These values may be used later in the

program by referring to the variables.

Position on a Surface

Synopsis SPOSF(obj,u,v)

Page 49: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

43

Description Returns the coordinates of a point on a surface at a position defined by the specified U and V parameters.

All NX surfaces are valid for SPARF and SPOSF.

Parameters

Parameter Description

obj A previously defined surface which is used to calculate the position from the specified U and V

values.

u,v Scalar values representing percentages of the surface in the respective direction, where 0 is the

beginning of the surface and 1 is the end of the surface. A scalar value of .75 therefore, represents

3/4 of the surface and a scalar value of .5 specifies the midpoint of the surface in the respective

direction of parameterization.

The u and v scalar values are applied to the various surfaces depending on the order of the curves

used to generate the surface and/or the type of surface used. For detailed information on the u and v

directions, refer to the section on the development of the specific surface type.

As with the CPOSF function, the desired point may lie on the surface or on an extension of the surface.

Surface of Revolution, Sphere, and Cone The U scalar pertains to the generating curve, and the V scalar pertains to the circular grid lines. For information on extensions in

the U direction, refer to the specific object type in the CPOSF function discussed earlier. For the V direction, refer to arcs and

ellipses under CPOSF.

Position on a Surface of Revolution

Tabulated Cylinder For the tabulated cylinder, the U scalar pertains to the generating curve, and the V scalar pertains to the directrix. Extensions off

the surface are generated according to the type of curve in each direction. The generating curve may be any NX object, therefore,

the extension my be calculated in several different ways. For information on extensions in the generating curve direction, refer to

the specific object type in the CPOSF function.

Since the directrix must always be a line, extensions are always generated based on its length. For example, a scalar value of 1.25

would return the coordinates of a point on the line extension 1/4 of the line length past the endpoint of the line. Similarly, a scalar

value of -.25 would return the coordinates of a point on the line extension 1/4 of the line length before the start point of the line.

Therefore, obtaining the desired coordinates is dependent on knowing the direction in which the line was constructed.

Page 50: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

44

Position on a Tabulated Cylinder

Ruled Surface and Cylinder The U scalar pertains to the two generating curves, and the V scalar pertains to the rulings. Since two curves are used to generate

a ruled surface, the U scalar value is applied to both curves. The desired position lies on the surface, on a line connecting the two

calculated positions based on the U scalar. The distance "up" the line is dependent on the V scalar. The V direction is dependent

on the order in which the generating curves were selected. Zero lies at the first curve selected, and one lies on the second.

Position on a Ruled Surface

Fillet Surface For the fillet surface, the U scalar pertains to the circular grid lines and its direction is from surface 1 to surface 2. The V scalar

pertains to the two splines forming the edge curves of the fillet surface.

Page 51: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

45

Position on a Fillet Surface

Scuptured Surface For the sculptured surface, the U scalar pertains to the primary curves,and the V scalar pertains to the cross curves. The directions

of both U and V depend on the order in which the curves were selected. In addition, the extension of sculptured surface is

developed in the same manner as the surface itself, which depends on such factors as order of selection, curvature, etc. Therefore,

determining where the position on a surface extension lies may be only an approximation.

Position on a Sculptured Surface

Vector Functions

Introduction This section covers the GRIP functions which manipulate vectors. Vector functions are categorized as scalar valued and vector

valued. Scalar valued functions produce single values representing the product of two vectors or the length of a vector. Vector

valued functions produce the three component values necessary for magnitude and direction.

The scalar valued and vector valued functions have been divided into two sections. The scalar valued functions are listed first.

The functions are listed alphabetically, by function, in each sub-section.

Vector Statement List

Function Major Word

Dot Product of Two Vectors DOTF

Length of a Vector (Magnitude) VLENF

Cross Product of Two Vectors CROSSF

Vector Tangent to a Curve CTANF

Scaled Vector SCALVF

Surface Partial Derivative with Respect to the UParameter SDDUF

Surface Partial Derivative with Respect to the V Parameter SDDVF

Geometric Properties of a Face at a Parameter SPROPF

Page 52: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

46

Vector Normal to a Surface SNORF

Unit Vector UNITF

Dot Product of Two Vectors

Synopsis DOTF(A,B)

Description Multiplies the corresponding components of two vectors and adds the products.

Using the function as shown below, where A and B are arrays, each consisting of the three components of a vector,

C=DOTF(A,B)

is equivalent to the following expression:

C=A(1)*B(1)+A(2)*B(2)+A(3)*B(3)

Parameters

Parameter Description

A,B Two-, three-position numerical arrays which represent vectors which are used to calculate the DOT

product.

Length of a Vector (Magnitude)

Synopsis VLENF(A)

Description Returns the length (magnitude) of a vector.

Using the function as shown below, where A is an array consisting of the three components of a vector,

D=VLENF(A)

is equivalent to the following expression:

D=SQRTF(A(1)*A(1)+A(2)*A(2)+A(3)*A(3))

Parameters

Parameter Description

A A three-position numerical array which represents the components of a vector.

Cross Product of Two Vectors

Synopsis CROSSF(vector1,vector2)

Description Returns the cross product of two vectors. Using the function as shown below, where A and B are arrays, each consisting of the

three components of a vector,

NUMBER/A(3),B(3),C(3)

C=CROSSF(A,B)

is equivalent to the following expressions:

Page 53: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

47

C(1) = A(2)*B(3)-A(3)*B(2)

C(2) = -(A(1)*B(3)-A(3)*B(1))

C(3) = A(1)*B(2)-A(2)*B(1)

Parameters

Parameter Description

vector1,vector2 Two-, three-position numerical arrays which represents the components of vectors.

Vector Tangent to a Curve

Synopsis CTANF(obj,scalar)

Description Returns the components of a vector tangent to a curve at a point a specified distance from the curve's starting point. As in the

curve position function, CPOSF, the object may be a line, an arc, a conic, or a spline. The scalar value for the CTANF function

works exactly the same as the scalar value in the CPOSF function. For information concerning the object dependent

considerations of the scalar value, refer to the desired object type in the CPOSF function.

Parameters

Parameter Description

obj An existing object along which the position for the vector is calculated. The object may be a line,

an arc, a conic or a spline.

scalar A numerical value which represents the percentage distance along the curve where the position is

calculated. The distance along the curve is specified as a percentage of the total curve length, where

0 is the beginning of the curve and 1 is the end of the curve. A scalar value of .75 therefore,

represents 3/4 of the total curve length and a scalar value of .5 specifies the midpoint of the curve.

Scaled Vector

Synopsis SCALVF(scalar,vector)

Description Multiplies the components of a vector by a scalar.

Using the function as shown below, where A and B are arrays, each consisting of the three components of a vector,

NUMBER/A(3),B(3)

DATA/A,1,2,3

B=SCALVF(3,A)

is equivalent to the following expressions:

B(1)=A(1)*3

B(2)=A(2)*3

B(3)=A(3)*3

Parameters

Parameter Description

scalar Any valid NX real number which multiplies the vector components to produce a new vector.

vector An existing numerical array which represents the components of a vector.

Page 54: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

48

Surface Partial Derivative with Respect to the U Parameter

Synopsis SDDUF(obj,u,v)

Description Returns the components of a vector which represent the surface partial derivative with respect to the U parameter. The vector

components are determined at a position on the surface specified by the U and V parameters. The U and V parameters are scalar

values representing percentages of the surface in the respective direction. Detailed explanations of how the u and v values apply

to the various surfaces, are given in the SPOSF function.

All NX surfaces are valid for the SDDUF function:

Parameters

Parameter Description

obj An existing surface which is used to calculate the partial derivative.

u,v Scalar values which can be any NX real number which define the location of the derivative

calculation in U and V parameter space. The scalar values located on the surface are from 0 to 1.

Any value beyond that range lies on the extensions of the surface.

Surface Partial Derivative with Respect to the V Parameter

Synopsis SDDVF(obj,u,v)

Description Returns the components of a vector which represent the surface partial derivative with respect to the V parameter. The vector

components are determined at a position on the surface specified by the U and V parameters. The U and V parameters are scalar

values representing percentages of the surface in the respective direction. For detailed explanations of how the U and V values

apply to the various surfaces, see the SPOSF function.

Parameters

Parameter Description

obj An existing surface which is used to calculate the partial derivative.

u,v Scalar values which can be any NX real number which define the location of the derivative

calculation in U and V parameter space. The scalar values located on the surface are from 0 to 1.

Any value beyond that range lies on the extensions of the surface.

Geometric Properties of a Face at a Parameter

Synopsis SPROPF(obj,u,v)

Description Returns the surface parameters, the point on the surface, the first and second partial derivatives, the unit normal, and the radii of

curvatures.

This statement returns a twenty element array containing the point (1-3), the first derivative with respect to u (4-6), the first

derivative with respect to v (7-9), the second derivative with respect to u (10-12), the second derivative with respect to v (13-15),

the unit normal (16-18), and the radii of curvature [(19) = maximum radius and (20) = minimum radius]. For more information

on radius of curvature, see Info->Analysis->Face Analysis in the Gateway Online Help.

The following statements also allow you to obtain similar data:

SPARF allows you to obtain the parameters of a face at a given point.

SPOSF, SNORF, SDDUF, and SDDVF allow you to calculate the point, normal, and first derivatives on a face given a parameter.

Page 55: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

49

Parameters

Parameter Description

obj Object identifier of face.

u U parameter.

v V parameter.

Vector Normal to a Surface

Synopsis SNORF(obj,u,v)

Description Returns the components of a vector normal to the surface at a position specified by the U and V scalars. All NX surfaces are valid

for SNORF. Detailed explanations of how the U and V values apply to the various surfaces, are given in the SPOSF function.

Parameters

Parameter Description

obj An existing surface which is used to calculate the normal vector.

u,v Scalar values which can be any NX real number which define the location of the normal vector

calculation in U and V parameter space. The scalar values located on the surface are from 0 to 1.

Any value beyond that range lies on the extensions of the surface.

Unit Vector

Synopsis UNITF(A)

Description Converts the supplied components of a vector to unitized components.

Using the function as shown below, where A is an array, consisting of the three components of a vector,

Edit Curve

Introduction This topic covers the GRIP commands that trim curves. You can trim an existing curve using one or two bounding objects with

the CRVTRM command or you can trim a curve by a specified arclength with the CTRIM command.

Edit Curve Statement List

Function Major Word

Trim Curve Using Bounding Objects CRVTRM

Trim Curve by Given Arclength CTRIM

Page 56: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

50

Trim Curve Using Bounding Objects

Synopsis obj = CRVTRM/curve,REF, {pt1|x,y,z},FIRST,limit1[,REF,{pt1|x,y,z}]

[,INT,{pt2|x,y,z}][,NOTRIM][,SECOND,limit2

[,REF,{pt1|x,y,z}][,INT,{pt2|x,y,z}][,NOTRIM]] ,STATUS,status[,IFERR, label:]

Description Allows you to trim an existing curve using one or two bounding objects such as points, curves, and faces.

A null object (&NULENT) is returned unless the curve is trimmed into two segments. If you remove the center part of a curve

and allow the two ends of the curve to remain, then one end retains the original object identifier and the other end receives an

object identifier which is returned by the CRVTRM command.

Parameters

Parameter Description

curve An existing curve to be trimmed.

REF Minor word indicating that a reference point follows. That reference point can either be a point

object, or three coordinates. The segment of the curve that is closest to the reference point is

trimmed when you have a single bounding curve. When you have two bounding curves there are

two cases that can occur: the reference point is inside the bounding curves or outside the bounding

curves. In Figure below, the two straight lines are the bounding curves and the arc is the curve to

trim. The "plus" signs indicate the reference points. When the reference point is outside the

bounding curve, all segments outside the bounding curves are trimmed. When the reference point

is inside the bounding curves, all segments inside the bounding curves are trimmed.

pt1 An existing reference point object that defines what section of the curve is removed or extended.

x,y,z Coordinates specifying a reference point if an existing point is not used.

FIRST Required minor word indicating that the first bounding object follows.

limit1 Specifies the first boundary object.

REF Minor word indicating that a reference point follows. That reference point can either be a point

object, or three coordinates.

pt1 An existing reference point object that defines what end of the curve is removed.

x,y,z Coordinates specifying a reference point if an existing point is not used.

INT Optional minor word indicating that a reference point for the intersection between the curve and

the bounding object follows. The reference point is used when multiple intersections exist. That

reference point can either be a point object or three coordinates.

pt2 An existing reference point object for the intersection between the curve and the bounding object.

Page 57: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

51

x,y,z Coordinates specifying a reference point if an existing point is not used.

NOTRIM Optional minor word indicating not to trim the associated bounding object. If the bounding object

is not a curve (i.e. a point or face), then no trim is performed whether NOTRIM is used or not.

SECOND Optional minor word indicating that the second bounding object follows.

limit2 Specifies the second boundary object.

REF Minor word indicating that a reference point follows. That reference point can either be a point

object, or three coordinates.

pt1 An existing reference point object that defines what end of the curve is removed.

x,y,z Coordinates specifying a reference point if an existing point is not used.

INT Optional minor word indicating that a reference point for the intersection between the curve and

the bounding object follows. The reference point is used when multiple intersections exist. That

reference point can either be a point object or three coordinates.

pt2 An existing reference point object for the intersection between the curve and the bounding object.

x,y,z Coordinates specifying a reference point if an existing point is not used.

NOTRIM Optional minor word indicating not to trim the associated bounding object. If the bounding object

is not a curve (i.e. a point or face), then no trim is performed whether NOTRIM is used or not.

STATUS Required minor word indicating a trim status value follows.

status Required variable which indicates the trim status value as follows:

-5 = invalid boundary object

-4 = invalid trim object

-3 = can't find intersection between bound obj 2 and curve to trim.

-2 = can't find intersection between bound obj 1 and curve to trim.

-1 = unable to allocate enough memory

0 = unable to perform trim

1 = only curve to trim was trimmed

2 = curve to trim and limiting object 1 were trimmed.

3 = curve to trim, limiting obj 1 and limiting obj 2 were trimmed.

4 = curve to trim and limiting obj 2 were trimmed.

IFERR,label: Specifies a label to which program execution jumps if an error occurs during trim. This is optional.

See Also The CTRIM statement allows you to trim a curve by a specified arclength.

Results of CRVTRM Example

Page 58: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

52

Trim Curve by Given Arclength

Synopsis CTRIM/obj,dist,{START|END|point}

or

CTRIM/TOTAL,obj,length,{START|END|point}

Description Allows you to trim a curve by a specified arclength. There are two formats you can use with the CTRIM command.

Parameters

Parameter Description

TOTAL Minor word which indicates that the trim by total arclength method is requested.

obj Object to be trimmed.

length The desired total arclength of the resultant curve. This value cannot be less than or equal to 0.0.

dist The arclength increment to trim from the curve. This value can be positive or negative, but should

not have a negative value equal to or greater than the entire curve arclength.

START Indicates that the start of the curve is to be trimmed.

END Indicates that the end of the curve is to be trimmed.

point A previously defined point to indicate the end of the curve to trim. The end of curve closest to this

point is trimmed.

See Also The CRVTRM statement allows you to trim a curve using bounding objects.

Page 59: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

53

Point and Curve Creation

Introduction This topic covers the GRIP statements used to create point and curve objects. Also included is a statement which allows you to

trim a curve using bounding objects.

Point and Curve Creation operations fall into the following categories:

Point

Line

Circle

Point Sets

Fillet

Geometry

General Conic

B-Spline

Specifying Modeling Tolerances If a Modeling Application statement allows you to specify a distance or angle tolerance value and you do not provide one, the

default is the value set in the NXoption for Preferences->Modeling. You can read and set these tolerance values using the

&DISTOL and &ANGTOL GPAs.

If a Modeling Application statement performs an approximation and that statement does not allow the minor word TOLER, the

system uses the tolerance value set in Unigraphics NX.

Point and Curve Creation Statement List

Function Statement Format

POINT (Center Of Circle) obj = POINT/CENTER,circle

(Position On Arc) obj = POINT/circle,ATANGL,angle

(End Point) obj = POINT/ENDOF,"PMOD3",obj

(Intersection Point) obj = POINT/[{"PMOD2"|point}],INTOF,obj1,obj2

[,IFERR,label:]

(Offset Point) obj = POINT/point,DELTA,dx,dy,dz

(Polar Offset Point) obj = POINT/point,POLAR,dist,angle

(Three Dimensional Offset Vector) obj = POINT/point,VECT,line,"PMOD3",dist

(Coordinates) obj = POINT/x,y[,z]

(Pattern Point) obj = POINT/x,y,[z,]PATPNT

LINE (Parallel At A Dist) obj = LINE/PARLEL,line,"PMOD3",offset

(Parallel/Perp To Line, TAngent To Curve) obj = LINE/{PARLEL|PERPTO},line,

{"PMOD3"|point},TANTO,curve

(Thru A Pt, At An Angle) obj = LINE/point,ATANGL,angle

(Point, Tangent To A Curve) obj = LINE/point1,{LEFT|RIGHT|point2},

TANTO,curve

Page 60: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

54

(Tangent To Two Curves) obj = LINE/{LEFT|RIGHT|point},TANTO,curve1

,{LEFT|RIGHT|point},TANTO,curve2

(Thru A Point, Parallel/Perp To A Line) obj = LINE/point,{PARLEL|PERPTO},line

(Thru A Point, Perp To A Curve) obj = LINE/point1,point2,PERPTO,curve

(Between Two Existing Curves) obj = LINE/point1,point2

(Between Two Specified Points) obj = LINE/x1,y1[,z1],x2,y2[,z2]

CIRCLE (Center Point, Radius) obj = CIRCLE/CENTER,point,RADIUS,r

[,START,start angle,END,end angle]

(Center Point, Tangent To A Line)

obj = CIRCLE/CENTER,point,

TANTO,line

[,START,start angle,END,end angle]

(Center Point, Point On Arc) obj = CIRCLE/CENTER,point1,point2

[,START,start angle,END,end angle]

(Through Three Points) obj = CIRCLE/point1,point2,point3

(Center Coords, Radius) obj = CIRCLE/x,y,[z,]r

[,START,start angle,END,end angle]

POINT SETS (Chordal Tolerance Method) CPSET/CHORD,obj,tolerance,results

(Equal Parameter Method) CPSET/EPARAM,obj,n

[,PART,a,b],results

(Equal Arc Method) CPSET/EARCL,obj,n[,PART,a,b],results

(Input ArcLength Meth) CPSET/ARCLEN,obj,arclength,results

(Geometric Progression Method) CPSET/GEOM,obj,n,RATIO,r[,PART,a,b],results

(Control Vertex Method) CPSET/VERT,obj,results

(Knot Point Method) CPSET/KNOT,obj,results

FILLET (Two Objects, Center Point) obj = FILLET/obj1,obj2,CENTER,point,RADIUS,r

[,NOTRIM][,IFERR,label:]

(Three Objects)

obj = FILLET/[{IN|OUT|TANTO}],obj1,

[{IN|OUT|TANTO}],obj2,

[{IN|OUT|TANTO}],obj3,

CENTER,point[,NOTRIM]

[,IFERR,label:]

(Two Objects, Positional Modifiers) obj = FILLET/"PMOD3",line1,"PMOD3",line2,

RADIUS,r[,NOTRIM][,IFERR,label:]

PARABOLA obj = PARABO/point,focal length

,dymin,dymax[,ATANGL,angle]

ELLIPSE

obj = ELLIPS/point,semimajor,semiminor

[,ATANGL,angle]

[,START,angle,END,angle]

HYPERBOLA obj = HYPERB/point,semitransverse,semiconjugate

,dymin,dymax[,ATANGL,angle]

GENERAL CONIC (Five Points) obj = GCONIC/point1,point2,point3,point4,point5

(Four Points, One Slope) obj = GCONIC/point1,point2,point3,point4,

VECT,x,y,z

(Three Points, Two Slopes) obj = GCONIC/point1,point2,point3,VECT

Page 61: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

55

,x1,y1,z1,x2,y2,z2

(Three Points, Anchor Point) obj = GCONIC/point1,point2,point3,

ANCHOR,point4

(Two Points, Anchor Point, Rho Value) obj = GCONIC/point1,point2,ANCHOR,point3,rho

SIX COEFFECIENTS obj = GCONIC/number list

ISOPARAMETRIC CURVE ON FACE obj = ISOCRV/obj{,UDIR|VDIR},num1

[,TOLER,num2][,CNT,num3][,IFERR,label:]

SPLINE BY KNOT POINTS

obj = SPLINE/[CLOSED,]

{point[,{VECT,dx,dy,dz|

TANTO,curve|angle}]}+

SPLINE BY APPROX. CURVES obj = SPLINE/APPROX,[{BLANK|DELETE}]

[,TOLER,t] obj list

OFFSET CURVES

obj list = OFFCRV/obj list1,{dist|height,ang}

,ref point[,STEP,n1][{,EXT[,n2]|,FILLET}]

[,GROUP]

INTERSECTION CURVE

obj = INTSEC/surf1,WITH,surf2 [,TOLER,tl]

[,lsurf1,lpoint1,lsurf2,lpoint2[,VECT,x,y,z]]

[,IFERR,label:]

SILHOUETTE CURVES obj = SILHO/body[,CNT,count][,IFERR,label:]

PROJECT POINTS/CURVES

obj list = PROJ/obj list1,ON,obj list2

[,TOLER,t][,VECT,vect]

[[,ASSOC [,obja] ] | [,MOVE]]

B-CURVE (Fit Method)

obj list = BCURVE/FIT,{obj list1,num list1}

[,WGHT,num list2],

{SEGS|TOLER},num1[,DEGREE,num2]

[,START,{VECT,dx,dy,dz|TANTO,

{curve|angle}}]

[,END,{VECT,dx,dy,dz|TANTO,

{curve|angle}}]

,STATUS,numa[,IFERR,label:]

B-SPLINE (Point Method)

obj list = BCURVE/obj list1[,VERT[,num list]]

[,DEGREE,num[,CLOSED]]

[,IFERR,label:]

B-SPLINE (Curve Method)+

obj list = BCURVE/obj list1,ENDOF

{,obj list2|,num list}

[,DELETE|,BLANK]

[,IFERR,label:]

SIMPLIFY CURVES obj list = SIMCRV/obj list1

[,BLANK|,DELETE][,TOLER,t][,CNT,c]

CREATE EDGE VERTEX POINTS obj list = EDGVER/obj[,CNT,c][,IFERR,label:]

CREATE EDGE CURVES obj list = SOLEDG/obj[,CNT,c][,IFERR,label:]

Point

Create Point The Point statement creates a point using several different methods. You can enter the coordinates of a point (coordinates may be

variables) or defined points relative to existing geometry (e.g. the center of a circle).

Page 62: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

56

You may also find it quite helpful to define points using subscripted names in an array (e.g. P(1), P(2), etc.). In this way you can,

in most instances, use the array to define the entire series of points in other GRIP statements.

For example, if you declare an object array: P(2), and define points, P(1) and P(2), you can define a line as being created at P. See

the following example.

ENTITY/P(2),L1

P(1)=POINT/0,0

P(2)=POINT/1,0

L1 =LINE/P

The line, L1 is created from P(1) to P(2). You could also delete the points by specifying the array.

DELETE/P

Create Point Statement List

Function Major Word

Center of a Circle POINT

Intersection Point POINT

Three Dimensional Vector Offset POINT

Position on Arc POINT

Offset Point POINT

Coordinates POINT

End Point POINT

Polar Offset Point POINT

Pattern Point POINT

Intersection Point

Synopsis obj = POINT/[{"PMOD2"|point},]INTOF,obj1,obj2[,IFERR,label:]

Description Creates a point at the intersection of two previously defined objects. A reference point must be specified to indicate the desired

point in the case of multiple intersections of the two objects. The intersection is determined by looking down the z-axis of the

WCS.

Parameters

Parameter Description

PMOD2 A two dimensional positional modifier which may be used to indicate which intersection to use

when multiple intersections exist. The direction is in reference to the work coordinate system.

point Reference point, closest to the desired intersection, which may be used instead of the positional

modifier, when both objects are curves. If the desired point is the intersection of a curve and a

surface or plane, a previously defined point must be used.

A positional modifier is used to assign a reference point. This calculated reference point may not

yield the expected results.

INTOF Minor word that indicates that the point defined is a unique intersection of two objects.

obj1,obj2 Two existing objects which are not parallel in the work view. Object one must be a curve. Object

two may be a curve, face, body with a single face, or a plane.

IFERR,label: Specifies label to which program execution jumps if no intersection is found.

Page 63: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

57

Three Dimensional Vector Offset

Synopsis obj = POINT/point,VECT,line"PMOD3",dist

Description Creates a point offset from previously defined point along a three dimensional vector at a specified distance. The vector is

specified in the form of a previously defined line. A positional modifier is used to specify the direction along the line the distance

should be measured. The positional modifier is used to determine what direction the point is offset in at the given positive

distance. The distance is not used to determine the direction of the offset. To create two offset points one in the positive direction

and one in the negative, then the _LARGE and _SMALL modifiers need to be specified in two separate commands.

Parameters

Parameter Description

point A previously defined point from which the new point is established.

VECT Minor word that indicates that the new point is established at a specified distance along a vector

which is parallel to a line.

line An existing line to which the vector is parallel.

PMOD3 A three dimensional positional modifier which indicates which end of the object to use. The

direction is in reference to the work coordinate system.

dist The distance, along the vector, from the previously defined point.

Position on an Arc

Synopsis obj = POINT/circle,ATANGL,angle

Description Creates a point at an angle on the circumference of an arc or circle. The angle is measured counterclockwise from zero degrees in

the work coordinate system.

Parameters

Parameter Description

circle An existing circle.

ATANGL Minor word that indicates that the point defined is on a circle at a specified angle. The point may lie

on either the existing portion of the circle or on the circle extension.

angle The desired angle as measured from the positive X axis of the work coordinate system.

Offset Point

Synopsis obj = POINT/point,DELTA,dx,dy,dz

Description Creates a point offset in work coordinate values delta from a previously defined point.

Parameters

Parameter Description

point A previously defined point from which the new point is established.

Page 64: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

58

DELTA Minor word that indicates that the new point is established at specified distances from the

previously defined point.

dx,dy,dz The delta distances, from the previously defined point, in each of the three axes. The distances are

relative to the work coordinate system.

Example Creating two points offset delta values in X, Y, and Z from a previously defined point.

Declarations ENTITY/PT1,PT2,PT3

Geometry Definition PT1=0,0

Point Definition PT2=POINT/PT1,DELTA,1,1, 0

PT3=POINT/PT1,DELTA,-.5,1,0

A Point at Delta Distances from a Previously Defined Point

Coordinates

Synopsis obj = POINT/x,y[,z]

Description Creates a point by specifying its coordinates in XC, YC, and ZC. The ZC value is optional. If it is omitted, the point lies on the

current work plane.

Parameters

Parameter Description

x,y,z The X,Y and Z coordinates of the work coordinate system. If the optional Z coordinate is omitted,

the Z coordinate of the point is equal to zero.

Example Create several points by specifying coordinates.

Declarations ENTITY/PT1,PT2,PT3

Point Definition PT1=POINT/0,0

PT2=POINT/1,0,1

P T3=POINT/1,0

Page 65: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

59

Points Defined by Coordinate Values

End Point

Synopsis obj = POINT/ENDOF,"PMOD3",obj

Description Creates a point at the end of a previously defined object. A positional modifier is used to define which end of the object is desired.

Parameters

Parameter Description

ENDOF Minor word that indicates that the point defined assumes the coordinate values at the end of an

object.

PMOD3 A three dimensional positional modifier which indicates which end of the object to use. The

direction is in reference to the work coordinate system.

obj An existing object which may be any one of the following curves: line, circle, conic or spline.

Polar Offset Point

Synopsis obj = POINT/point,POLAR,dist,angle

Description Creates a point offset by polar values from a previously defined point. Polar values represent an angle measured in the current

work plane, counterclockwise from the positive X axis, and a distance along that angle.

Parameters

Parameter Description

point A previously defined point from which the new point is established.

POLAR Minor word that indicates that the new point is established at a specified distance and an angle from

the previously defined point.

dist The radial distance from the previously defined point.

angle The angle in degrees measured from the positive X axis of the work coordinate system.

The new point assumes the same Z value as the previously defined point.

Page 66: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

60

Pattern Point

Synopsis obj = POINT/x,y,[z,]PATPNT

Description Creates a pattern point by specifying its coordinates in XC, YC, and ZC. The ZC value is optional. If it is omitted, the pattern

point lies on the current work plane.

You can create pattern points anywhere in the pattern master part. You can subsequently use them to manipulate, position,

dimension, etc., the pattern object.

Parameters

Parameter Description

x,y,z The x,y and z coordinates of the work coordinate system. If the optional z coordinate is omitted, the

z coordinate of the pattern point is equal to zero.

PATPNT Minor word specifying the creation of a pattern point.

Center of a Circle

Synopsis obj = POINT/CENTER,circle

Description Creates a point at the center of a previously defined circle.

Parameters

Parameter Description

CENTER Minor word that indicates that the point defined is the center of a circle.

circle An existing circle.

Example Creating a point at the center of a previously defined circle.

Declarations ENTITY/CR1,PT1

Geometry Definition CR1=CIRCLE/0,0,1

Point Definition PT1=POINT/CENTER,CR1

Page 67: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

61

A Point at the Center of a Circle

Line

Introduction The LINE statement creates lines using several different methods. You can define a line between end points or by using

geometric construction principles to create lines in relation to other existing geometry.

Create Line

Function

Parallel at a Distance

Parallel/Perpendicular to a Line, Tangent to a Curve

Through a Point, at an Angle

Point, Tangent to a Curve

Tangent to Two Curves

Through a Point, Parallel/Perp to a Line

Through a Point, Perpendicular to a Curve/Surface

Between Two Existing Points

Between Two Specified Points

Parallel at a Distance

Synopsis obj = LINE/PARLEL,line,"PMOD3",offset

Description Creates a line parallel to an existing line at a specified distance. A positional modifier is used to indicate which side of the

existing line the new line is created on.

If XLARGE, XSMALL, YLARGE, YSMALL, are specified, the distance is offset in the current work plane.

If ZLARGE or ZSMALL is specified the distance is offset parallel to the current Z axis.

Parameters

Parameter Description

PARLEL Minor word that indicates that the new line is parallel to an existing line.

line An existing line to which the new line is to be parallel.

PMOD3 The positional modifier PMOD3 establishes the relationship of the new line to the existing line, with

respect to the work coordinate system.

offset The distance from the existing line to the new line.

The length of the new line is made the same as the existing line.

Page 68: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

62

Parallel/Perp to a Line, Tangent to a Curve

Synopsis obj = LINE/{PARLEL|PERPTO},line,{"PMOD3"|point},TANTO,curve

Description Creates a line parallel or perpendicular to a previously defined line which is tangent to a previously defined curve.

Parameters

Parameter Description

PARLEL Minor word that indicates that the new line is parallel to an existing line.

PERPTO Minor word that indicates that the new line is perpendicular to an existing line.

line An existing line to which the new line is parallel or perpendicular.

PMOD3 The positional modifier PMOD3 may be used to establish the side of the existing curve, with

respect to the work coordinate system, to which the new line is tangent.

point A previously defined point may be used in place of the positional modifier to approximate the point

of tangency.

TANTO Minor word that indicates that the new line is made tangent to an existing curve.

curve An existing curve to which the new line is tangent.

Through a Point, at an Angle

Synopsis obj = LINE/point,ATANGL,angle

Description Creates a line thru a previously created point at a specified angle. The angle is measured counterclockwise from the current

positive X axis. The line is created, and the angle is measured in a plane containing the point which is parallel to the current work

plane.

Parameters

Parameter Description

point A previously defined point through which the line runs.

ATANGL Minor word that indicates that the angle of the line is to be specified.

angle The angle of the line, in degrees, which is measured from the positive X axis of the work

coordinate system to the line. A positive angle rotates the line counterclockwise about the specified

point and a negative angle rotates the line clockwise.

Point, Tangent to a Curve

Synopsis obj = LINE/point1,{LEFT|RIGHT|point2},TANTO,curve

Description Creates a line from specified point tangent to a previously defined curve. You may specify either a point or use the minor words

RIGHT or LEFT to define which side of the curve the line should be tangent to.

If you use RIGHT or LEFT, position yourself at the point looking at the curve.

Page 69: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

63

Parameters

Parameter Description

point1 A previously defined point from which the line starts.

LEFT,RIGHT Positional modifiers which may be used to indicate which side of the existing curve the line is

tangent to, as viewed from the point to the curve. LEFT and RIGHT are not recommended for

splines.

point2 A previously defined point may be used in place of the positional modifier to approximate the

point of tangency.

TANTO Minor word that indicates that the new line is to be tangent to an existing curve.

curve An existing curve to which the new line is tangent.

Tangent to Two Curves

Synopsis obj = LINE/[{LEFT|RIGHT|point}],TANTO,curve1,[{LEFT|RIGHT|point}],TANTO,curve2

Description Creates a line tangent to two previously defined curves. A previously defined point or the minor words, RIGHT or LEFT, are

used to specify which side of the curve the line should be tangent to.

Parameters

Parameter Description

LEFT & RIGHT Positional modifiers which may be used to indicate which side of the existing curves the line is

tangent to, as viewed from the first curve to the second curve. LEFT and RIGHT are not

recommended for splines.

point A previously defined point may be used in place of the positional modifier to approximate the

point of tangency.

TANTO Minor word that indicates that the line is to be tangent to existing curves.

curve1, curve2 Existing curves to which the line is tangent.

Through a Point, Parallel/Perpendicular to a Line

Synopsis obj = LINE/point,[{PARLEL|PERPTO}],line

Description Creates a line thru a previously defined point which is either parallel or perpendicular to a specified line. The line is created either

parallel or perpendicular to the specified curve depending upon which minor word (PARLEL or PERPTO) is used.

Parameters

Parameter Description

point A previously defined point from which the perpendicular line starts or through which the parallel

line runs.

PARLEL Minor word that indicates that the new line is to be parallel to an existing line.

PERPTO Minor word that indicates that the new line is to be perpendicular to an existing line.

line An existing line to which the new line is parallel or perpendicular.

Page 70: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

64

If PARLEL is used the new line is the same length as the existing line if the projected point falls between the existing line

endpoints. Otherwise, the end closest to the point is extended to the point.

Through a Point, Perpendicular to a Curve/Surface

Synopsis obj = LINE/point1,point2,PERPTO,curve

Description Creates a line from a previously defined point which is perpendicular to a curve or surface. A second point is used to specify the

approximate intersection of the line and the curve/surface.

Parameters

Parameter Description

point1 A previously defined point from which the perpendicular line starts, if the point is not on the curve.

If the point is on the curve the line runs through the point.

point2 A previously defined point which indicates the approximate intersection of the perpendicular line

and the curve.

PERPTO Minor Word that indicates that the new line is to be perpendicular to an existing curve.

curve An existing curve or surface to which the line is perpendicular.

Between Two Existing Points

Synopsis obj = LINE/point1,point2

Description Creates a line between two previously defined points. A point array may be used to define the two points.

Parameters

Parameter Description

point1, point2 Two previously defined points between which the line is created. The start point of the line is

point1 and the end point is point 2.

Between Two Specified Points

Synopsis obj = LINE/x1,y1[,z1],x2,y2[,z2]

Description Creates a line by specifying the coordinates of the end points of the line.

The Z value at both positions is optional. Therefore, if only the X and Y coordinates of an end point are specified, the current

depth setting is assumed for the Z coordinate. If both Z values are omitted, the line lies in a plane parallel to the X-Y plane of the

work coordinate system.

Parameters

Parameter Description

x1,y1,z1,x2,y2,z2 The coordinate values of two points between which the line is created. The start point of

the line is at coordinates x1,y1,z1 and the end point is at coordinates x2,y2,z2.

Page 71: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

65

Circle

Introduction A CIRCLE is created in a counterclockwise direction from the positive X axis of the work coordinate system. The start and end

angles of the arc may be specified in some of the circle definitions. However, if the start and end angles are omitted or are not

considered in the definition statement, a full circle is created.

Create Circle Statement List

Function Major Word

Center Point, Radius CIRCLE

Center Point, Tangent to a Line CIRCLE

Center Point, Point on Arc CIRCLE

Through Three Points CIRCLE

Center Coordinates, Radius CIRCLE

Center Point, Radius

Synopsis obj = CIRCLE/CENTER,point,RADIUS,r[,START,start angle,END,end angle]

Description Defines a circle with a specified radius using a previously defined point as its center. You may also define start and

Parameters

Parameter Description

CENTER Minor word that indicates that the center of the circle is an existing point.

point A previously defined point which establishes the center of the circle.

RADIUS Minor word that indicates that the radius of the circle is to be specified.

r A positive value which establishes the circle radius.

START Indicates that the starting angle for the arc is to be specified.

start angle The starting angle of the arc as measured from the positive X axis of the work coordinate system.

END Indicates that the ending angle for the arc is to be specified.

end angle The ending angle of the arc as measured from the positive X axis of the work coordinate system.

Center Point, Tangent to a Line

Synopsis obj = CIRCLE/CENTER,point,TANTO,line[,START,start angle, END,end angle]

Description Creates a circle which is tangent to a specified line using a previously defined center point. The arc lies in the plane containing

the center point and the line. You may also define start and end angles for the circle.

Page 72: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

66

Parameters

Parameter Description

CENTER Minor word that indicates that the center of the circle is an existing point.

point A previously defined point which establishes the center of the circle.

TANTO Minor word that indicates that the circle is to be tangent to an existing object.

line An existing line which the circle is to be tangent to.

START The optional parameter START indicates that the starting angle for the arc is to be specified.

start angle The starting angle of the arc as measured from the positive X axis of the work coordinate system.

END The optional parameter END indicates that the ending angle for the arc is to be specified.

end angle The ending angle of the arc as measured from the positive X axis of the work coordinate system.

If the plane defined by the line and center point are not parallel to the WCS, the system ignores the start and end angles and

creates a full circle.

Center Point, Point on the Arc

Synopsis obj = CIRCLE/CENTER,point1,point2[,START,start angle,END,end angle]

Description Creates a circle by specifying a previously defined point on its arc (point is used to calculate the radius), whose center point is

also previously defined. You may also define start and end angles for the circle.

Parameters

Parameter Description

CENTER Minor word that indicates that the center of the circle is an existing point.

point1 A previously defined point which establishes the center of the circle.

point2 A previously defined point which the arc passes through. The point may lie on a non-constructed

portion of the arc.

START The optional parameter START indicates that the starting angle for the arc is to be specified.

start angle The starting angle of the arc as measured from the positive X axis of the work coordinate system.

END The optional parameter END indicates that the ending angle for the arc is to be specified.

end angle The ending angle of the arc as measured from the positive X axis of the work coordinate system.

Through Three Points

Synopsis obj = CIRCLE/point1,point2,point3

Description Creates a circle thru three previously defined points. The points are used to calculate the plane of the arc.

Parameters

Parameter Description

point1,point2,point3 Three previously defined points which the arc passes through. The arc is constructed in

a counterclockwise direction (with respect to the WCS Z-axis) from point1 (start) to

Page 73: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

67

point 3 (end). The second point, point 2, may lie on either the constructed or the non-

constructed portion of the arc. If the three points are collinear an error message is

displayed.

Center Coordinates, Radius

Synopsis obj = CIRCLE/x,y,[z,]r[,START,start angle,END,end angle]

Description Creates circle by defining the X, Y, and Z coordinates in work coordinates and the radius. The Z coordinate is optional. The plane

of the arc is made parallel to the plane of the current WCS.

Parameters

Parameter Description

x,y,[z] The coordinate values of the circle center point. If the optional Z coordinate is omitted, the center

point assumes the Z value of the currently set depth.

r A positive value which establishes the circle radius.

START The optional parameter START indicates that the starting angle for the arc is to be specified.

start angle The starting angle of the arc as measured from the positive X axis of the work coordinate system.

END The optional parameter END indicates that the ending angle for the arc is to be specified.

end angle The ending angle of the arc as measured from the positive X axis of the work coordinate system.

Point Sets

Introduction Point Sets (CPSET) statements create a series of point objects spaced along an existing curve. The created points are assigned to

an object array, referred to as results. Distribute the points along a portion of the curve by specifying start and end parameters of

the curve. These parameters are obtained using the CPARF statement.

Create Point Sets Statement List

Function Major Word

Chordal Tolerance Method CPSET

Equal Parameter CPSET

Equal Arc Length CPSET

Input Arc Length CPSET

Geometric Progression CPSET

Control Vertex CPSET

Knot Point CPSET

Page 74: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

68

Chordal Tolerance Method

Synopsis CPSET/CHORD,obj,tolerance,results

Description Creates a set of points along a curve using a specified chordal tolerance.

The resulting points represent ends of linear segments from which the corresponding section of the curve does not deviate more

than the specified chordal tolerance.

The resulting points are not "smart," meaning they are not associative to the curve from which they were created. If the curve is

modified, the points do not change.

Parameters

Parameter Description

CHORD Minor word specifies the use of the chordal tolerance to create the point set.

obj The object identifier of the curve on which the points are created.

tolerance The chordal tolerance.

results Array containing the identifiers for the newly created points.

Example Creating a chordal tolerance point set.

ENTITY/CRV, PTS(1000)

NUMBER/CTOL, INDX, PTCNT, USRESP

INIT:

CTOL = 0.1

DO/I1:, INDX, 1, 1000

I1: PTS(INDX) = &NULENT

STEP1:

IDENT/'Select Curve', CRV, USRESP

JUMP/HALT:, HALT:, USRESP

STEP2:

PARAM/'Specify Chordal Tolerance', 'Tolerance = ', CTOL,&

USRESP

JUMP/STEP1:, HALT:, USRESP

STEP3:

CPSET/CHORD,CRV,CTOL,PTS

PTCNT = 0

DO/S3B:, INDX, 1, 1000

S3B: IF/PTS(INDX) <> &NULENT,PTCNT = PTCNT + 1

MESSG/'Number of Points Returned = ' + ISTR(PTCNT)

DO/S3C:, INDX, 1, PTCNT

IFTHEN/PTS(INDX) <> &NULENT,&

BLANK/PTS(INDX)

PTS(INDX) = &NULENT

ENDIF

S3C:

JUMP/STEP1:

HALT:

HALT

Control Vertex Method

Synopsis CPSET/VERT,obj,results

Description Creates a series of points that represent the control vertices of a B-spline or B-surface.

Page 75: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

69

Parameters

Parameter Description

VERT Minor word indicating that the point set is to be the control vertices of a B-spline or a B-surface.

obj An existing B-spline or B-surface object along which the points are created.

results An object array to which the created points are assigned.

Equal Arc Length Method

Synopsis CPSET/EARCL,obj,n[,PART,a,b],results

Description Creates a series of points spaced along all, or a portion, of an existing curve. The points are equally spaced along the curve using

an arc length calculation method. This method calculates the length of each segment along the curve and is most useful for curve

which contain radical changes in curvature. For simple spacing, however, the Equal Parameter Method may prove faster.

Parameters

Parameter Description

EARCL Minor word that indicates that the points are spaced using the Equal Arc Length Method.

obj An existing object or object variable which represents the object that the points are spaced along.

n A positive numerical value or variable which represents the number of points desired.

PART Minor word that indicates that the points are to be spaced along a portion of the curve.

a A numerical value or variable between 0 and 1 which represents the parameter distance along the

curve where the point spacing begins (this is also where the first point is created).

b A numerical value or variable between 0 and 1 which represents the parameter distance along the

curve where the point spacing ends (this is also where the last point is created).

results An object variable or array to which the created points are assigned.

Equal Parameter Method

Synopsis CPSET/EPARAM,obj,n[,PART,a,b],results

Description Creates a series of points spaced along all, or a portion, of an existing curve. The points are equally spaced along the curve using

a parameter calculation method. This method uses the parameter spaces of the curve to calculate the point spacing. In curves with

radical changes in curvature, this may produce undesirable results, and the Arc Length Method should be used.

Parameters

Parameter Description

EPARAM Minor word that indicates that the points are spaced using the Equal Parameter Method.

obj An existing object or object variable which represents the object that the points are spaced along.

n A positive numerical value or variable which represents the number of points desired.

PART Minor word that indicates that the points are to be spaced along a portion of the curve.

Page 76: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

70

a A numerical value or variable between 0 and 1 which represents the parameter distance along the

curve where the point spacing begins (this is also where the first point is created).

b A numerical value or variable between 0 and 1 which represents the parameter distance along the

curve where the point spacing ends (this is also where the last point is created).

results An object variable or array to which the created points are assigned.

Geometric Progression Method

Synopsis CPSET/GEOM,obj,n,RATIO,r[,PART,a,b],results

Description Creates a series of points spaced along all, or a portion, of an existing curve. The points are spaced along the curve using the

geometric progression calculation method. This method spaces points along a curve where the space between points increases

geometrically based on a ratio value.

Parameters

Parameter Description

GEOM Minor word that indicates that the points are spaced using the Geometric Progression Method.

ent An existing object or object variable which represents the object that the points are spaced along.

n A positive numerical value or variable which represents the number of points desired.

RATIO Minor word that indicates that the value in the following field is the ratio value.

r A positive numerical value which represents the ratio used to increase the distance between points

as they are spaced along the curve.

PART Minor word that indicates that the points are to be spaced along a portion of the curve.

a A numerical value or variable between 0 and 1 which represents the parameter distance along the

curve where the point spacing begins (this is also where the first point is created).

b A numerical value or variable between 0 and 1 which represents the parameter distance along the

curve where the point spacing ends (this is also where the last point is created).

results An object variable or array to which the created points are assigned.

Input Arc Length Method

Synopsis CPSET/ARCLEN,obj,arclength,results

Description Distributes a series of points along an existing curve according to an input arclength. The calculation begins from the starting

point of the curve.

Parameters

Parameter Description

ARCLEN Minor word indicating that the point set is to be created along an existing curve according to an

input arc length.

obj Existing curve object upon which points are distributed.

arclength The input arclength. This value must be greater than 0.0 or less than or equal to the total arclength

Page 77: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

71

of the existing curve.

results Object array containing the newly created points.

Knot Point Method

Synopsis CPSET/KNOT,obj,results

Description Creates a series of points that represent the knot points of a B-spline.

Parameters

Parameter Description

KNOT Minor word indicating that the point set is to be the knot points of a B-spline.

obj An existing B-spline object along which the system creates the points.

results An object array to which the created points are assigned.

Fillet

Introduction The Fillet statement creates an arc of a specified radius (if filleting three objects the radius is calculated) between two objects.

Fillets are created counterclockwise from the positive X direction of the work coordinate system.

The Fillet statement trims the objects being filleted to the endpoints of the fillet. Trim can be suppressed by specifying the

optional minor word NOTRIM.

Fillet Statement List

Function Major Word

Two Objects, Center Point FILLET

Three Objects FILLET

Two Objects, Positional Modifiers FILLET

Two Objects, Center Point

Synopsis obj = FILLET/obj1,obj2,CENTER,point,RADIUS,r[,NOTRIM][,IFERR,label:]

Description Creates a fillet between two objects by specifying the objects (e.g. two lines), a point which lies in the same area as the center of

the fillet radius, and the radius value.

The center point should be in the general vicinity of the fillet radius center. If two perpendicular lines are being filleted, the point

can be anywhere in the quadrant which contains the desired fillet radius. However, if you want to fillet other objects, defining the

proper point can be more difficult.

Page 78: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

72

Parameters

Parameter Description

obj1,obj2 The two existing objects to be filleted. The objects do not have to intersect, but the maximum

distance between the two points of tangency must be less than or equal to twice the specified

radius of the fillet. The fillet is constructed counterclockwise from the first object to the second

object.

CENTER Minor word that indicates that a point is to be supplied which approximates the location of the

fillet center.

point A previously defined point which approximates the location of the fillet center. If the indicated

center is invalid, the error message NO FILLET is displayed. The approximate point is projected

onto the fillet plane along the plane's Z axis.

r A positive value that determines the fillet radius. If the radius is invalid, the system displays the

NO FILLET error message.

NOTRIM If the NOTRIM parameter is included the objects remain unchanged, if omitted the objects are

trimmed to the points of tangency.

IFERR,label: Specifies a label to which program execution jumps if an error occurs.

Example Creating a fillet between two previously defined lines. NOTRIM suppresses trimming the lines. A previously defined point (PT1)

is used to specify the fillet radius center.

Without the point (PT1), this fillet statement could generate four different fillets, one in each quadrant formed as the lines cross.

The point (PT1) clearly lies in the lower quadrant which is where the fillet is created.

Declaration ENTITY/PT1,LN1,LN2,FLT1

Geometry Definition PT1 =POINT/0,0

LN1 =LINE/0,1.5,1,-.5

LN2 =LINE/1,1.5,-1,-.5

Fillet Definition FLT1=FILLET/LN1,LN2,CENTER,PT1,RADIUS,.5,NOTRIM

Two Object Fillet without Trimming

Example Creating a fillet between two previously defined lines. A previously defined point (PT1) is used to specify the fillet radius center.

Without the point (PT1), this fillet statement could generate four different fillets, one in each quadrant formed as the lines cross.

The point (PT1) clearly lies in the lower quadrant which is where the fillet is created.

Declaration

Page 79: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

73

ENTITY/PT1,LN1,LN2,FLT1

Geometry Definition

PT1 =POINT/0,0

LN1 =LINE/0,1.5,1,-.5

LN2 =LINE/1,1.5,-1,-.5

Fillet Definition FLT1=FILLET/LN1,LN2,CENTER,PT1,RADIUS,.5

Two Object Fillet with Trimming

Two Objects, Positional Modifiers

Synopsis obj = FILLET/"PMOD3",line1,"PMOD3",line2,RADIUS,r[,NOTRIM][,IFERR,label:]

Description Creates a fillet between two previously defined objects. The fillet radius center is located by specifying its position relative to the

objects using positional modifiers. The fillet is created counterclockwise from the first to the second object.

Parameters

Parameter Description

PMOD3 A positional modifier which is used to indicate which side of the existing line the fillet lies on.

The direction is in reference to the work coordinate system.

line1,line2 The two existing lines to be filleted. The lines do not have to intersect, but must be co-planar and

the maximum distance between the two points of tangency must be less than or equal to twice the

specified radius of the fillet. The fillet is constructed counterclockwise from the first line to the

second line.

RADIUS Minor word that indicates that the radius of the fillet is to be specified.

r A positive value which establishes the fillet radius. If the radius is invalid, the error message NO

FILLET displays.

NOTRIM If the NOTRIM parameter is included the objects remain unchanged, if omitted the objects are

trimmed to the points of tangency.

IFERR,label: Specifies a label to which program execution jumps if an error occurs.

Example Creating a fillet between two lines where the center of the fillet is defined using positional modifiers.

Declaration ENTITY/LN1,LN2,FLT1

Geometry Definition LN1 =LINE/-1,0,1,0

LN2 =LINE/0,-1,0,1

Fillet Definition

Page 80: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

74

FLT1=FILLET/XSMALL,LN2,YLARGE,LN1,RADIUS,.5,$

NOTRIM

Lines Filleted in the Second Quadrant

Example Creating a fillet between two lines by specifying the fillet center using positional modifiers.

Declaration ENTITY/LN1,LN2,FLT1

Geometry Definition LN1 =LINE/-1,0,1,0

LN2 =LINE/0,-1,0,1

Fillet Definition FLT1=FILLET/XLARGE,LN2,YSMALL,LN1,RADIUS,.5,$

NOTRIM

Lines Filleted in the Fourth Quadrant

Three Objects

Synopsis obj =

FILLET/[{IN|OUT|TANTO/}],obj1,[{IN|OUT|TANTO/}],obj2,[{IN|OUT|TANTO/}],obj3,CENTER,point[,NOTRIM]

[,IFERR,label:]

Description Creates a fillet between three previously defined objects which may be any combination of points, lines, arcs, conics, and B-

splines. The radius required to make the fillet tangent to all three objects is automatically calculated.

The objects do not have to intersect, be planar, or be co-planar with each other. The fillet is constructed counterclockwise from

the first object to the third object. The second object does not have to be tangent to the constructed portion of the fillet.

Page 81: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

75

You must specify a previously defined point in the vicinity of the fillet radius center. The point specifies which of several

possible fillets is to be created.

Parameters

Parameter Description

IN,OUT,TANTO If the following object is a circle, the minor word IN, OUT or TANTO may be used to

indicate the location of the circle with respect to the fillet. If the point of tangency is between

the circle center and the fillet center, OUT must be specified. If the circle center is between

the fillet center and the point of tangency, IN must be specified. If the fillet center is between

the circle center and the point of tangency, TANTO must be specified. The default is OUT.

obj1,obj2,obj3 Three existing objects to be filleted. They may be any combination of points, lines, arcs,

conics, or B-splines.

CENTER Minor word that indicates that a point is to be supplied which approximates the location of the

fillet center.

point A previously defined point which approximates the location of the fillet center.

NOTRIM If the NOTRIM parameter is included the objects remain unchanged. If omitted, the objects

are trimmed to the points of tangency.

Care must be taken when using the trim feature since the second object disappears.

IFERR,label: Specifies a label to which program execution jumps if an error occurs.

Example Creating a fillet tangent to three circles. The statement utilizes the IN and OUT minor words to define the point of tangency.

OUT is specified for CR3 because its center is outside of the fillet.

IN is specified for CR1 because its center is inside of the fillet.

Declaration ENTITY/CR1,CR2,CR3,PT1,FLT1

Geometry Definition CR1 =CIRCLE/0,0,.5

CR2 =CIRCLE/-1.5,-.25,.5

CR3 =CIRCLE/1.5,.75,.5

PT1 =POINT/1,-.5

Fillet Definition FLT1=FILLET/OUT,CR3,IN,CR1,OUT,CR2,CENTER,PT1,$

NOTRIM

Fillet Three Circles without Trimming

Example Creating a fillet tangent to a a line and two B-splines.

NOTRIM suppresses the curve trimming.

Page 82: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

76

Declaration ENTITY/LN1,SPLN1,SPLN2,PT(7),FLT1

Geometry Definition PT(1)=POINT/0,1

PT(2)=POINT/-2,-2

PT(3)=POINT/-.5,0

PT(4)=POINT/-1,3

PT(5)=POINT/2,-2

PT(6)=POINT/.5,0

PT(7)=POINT/1,3

LN1=LINE/-1,2,1,2

SPLN1=SPLINE/PT(2..4)

SPLN2=BCURVE/PT(5..7)

Fillet Definition FLT1=FILLET/SPLN2,LN1,SPLN1,CENTER,PT(1),NOTRIM

Filleting a Line and Two B-splines Without Trimming

Example Creating a fillet tangent to three objects. The statement utilizes the IN minor word to define the point of tangency on the circle

(CR1).

IN is specified for CR1 because its center is inside of the fillet.

Declaration ENTITY/CR1,LN1,LN2,PT1,FLT1

Geometry Definition CR1 =CIRCLE/0,2,.5

PT1 =POINT/0,1.75

LN1 =LINE/0,0,1,2

LN2 =LINE/0,0,-1,2

Fillet Definition FLT1=FILLET/LN1,IN,CR1,LN2,CENTER,PT1,NOTRIM

Page 83: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

77

Three Object Fillet without Trimming

Example Creating a fillet tangent to three objects. The statement utilizes the IN minor word to define the point of tangency on the circle

(CR1).

IN is specified for CR1 because its center is inside of the fillet.

Declaration ENTITY/CR1,LN1,LN2,PT1,FLT1

Geometry Definition CR1 =CIRCLE/0,2,.5

PT1 =POINT/0,1.75

LN1 =LINE/0,0,1,2

LN2 =LINE/0,0,-1,2

Fillet Definition FLT1=FILLET/LN1,IN,CR1,LN2,CENTER,PT1

Three Object Fillet with Trimming

Special Conic Sections This topic describes three functions for creating specific conic sections: hyperbola, parabola, and ellipse.

Geometric Statement List

Function Major Word

Parabola PARABO

Page 84: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

78

Hyperbola HYPERB

Ellipse ELLIPS

Parabola

Synopsis obj = PARABO/point,focal length,dymin,dymax[,ATANGL,angle]

Description Creates a parabola by specifying a previously defined point which represents the vertex, a focal length, and an X and Y value

which limit the length of the curve.

Parameters

Parameter Description

point A previously defined point which establishes the vertex.

focal length The desired distance from the vertex to the focus.

dymin The minimum "Y" distance, in the coordinate system of the parabola, which controls the sweep of

the curve below the axes of symmetry.

dymax The maximum "Y" distance, in the coordinate system of the parabola, which controls the sweep of

the curve above the axes of symmetry.

If the value entered for the minimum Y distance is greater than the value entered for the maximum

Y distance, the system automatically reverses the two values.

ATANGL The optional minor word ATANGL indicates that the parabola is to be rotated about the vertex.

angle The angle at which the parabola rotates about the vertex. The angle is measured in degrees from the

positive X axis of the work coordinate system to the axis of symmetry. A positive angle rotates the

parabola counterclockwise and a negative angle rotates the parabola clockwise. If not specified the

axis of symmetry, as a default, is parallel to the X axis of the work coordinate system.

Example Creating a parabola by specifying a vertex point, a focal length, limiting X and Y values, and a rotation angle.

Declaration ENTITY/PT1,PARA1

Geometry Definition PT1 =POINT/0,0

Parabola Definition PARA1=PARABO/PT1,.25,-.5,1,ATANGL,30

TERM:HALT

Page 85: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

79

A Parabola Rotated

Hyperbola

Synopsis obj = HYPERB/point,semitransverse,semiconjugate,dymin,dymax[,ATANGL,angle]

Description Creates a hyperbola by specifying a previously defined point as the hyperbola center, a semi-conjugate and semi-transverse value,

and maximum x and minimum y values which limit the length of the curve. You may also define a rotation angle.

Parameters

Parameter Description

point A previously defined point which is the center point or intersection of the asymptotes.

semitransverse One half of the transverse axis length.

semiconjugate One half of the conjugate axis length.

dymin The minimum "Y" distance, in the coordinate system of the hyperbola, which controls the

sweep of the curve below the major axis.

dymax The maximum "Y" distance, in the coordinate system of the hyperbola, which controls the

sweep of the curve above the major axis.

If the value entered for the minimum Y distance is greater than the value entered for the

maximum Y distance, the System automatically reverses the two values.

ATANGL The optional minor word ATANGL indicates that the hyperbola is to be rotated about its center

point.

angle The angle at which the hyperbola is rotated about its center. The angle is measured in degrees

from the positive X axis of the work coordinate system to the major axis of the hyperbola. A

positive angle rotates the hyperbola counterclockwise and a negative angle rotates the

hyperbola clockwise.

Example Creating a hyperbola by specifying a center point, the semiconjugate and semitransverse values, maximum x and minimum y,

and a rotation angle.

Declarations ENTITY/PT1,HYP1

Geometry Definition PT1=POINT/0,0

Ellipse Definition

Page 86: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

80

HYP1=HYPERB/PT1,1,.5,1,-.5,ATANGL,30

A Rotated Hyperbola

Ellipse

Synopsis obj = ELLIPS/point,semimajor,semiminor[,ATANGL,angle][,START,angle,END,angle]

Description An ellipse is a form of a conic and is created by specifying half of the major axis (semi-major) and half of the minor axis (semi-

minor). Ellipses are created in a counterclockwise direction from the positive X axis of the work coordinate system. The start and

end angles may be specified to obtain only a partial ellipse, however, if they are omitted a full ellipse is created.

Parameters

Parameter Description

point A previously defined point which is the center of the ellipse.

semimajor One half of the length of the major axis.

semiminor One half of the length of the minor axis.

ATANGL The optional minor word ATANGL indicates that the ellipse is to be rotated about its center at a

specified angle. If the ATANGL parameter is not specified, the major axis is made parallel to the X

axis of the work coordinate system.

angle The angle at which the ellipse is rotated about its center. The angle is measured in degrees from the

positive X axis of the work coordinate system to the major axis of the ellipse. A positive angle

rotates the ellipse counterclockwise and a negative angle rotates the ellipse clockwise.

START The optional parameter START indicates that the starting angle for the ellipse is to be specified.

start angle The starting angle of the ellipse as measured from the positive X axis of the work coordinate system.

END The optional parameter END indicates that the ending angle for the ellipse is to be specified.

end angle The ending angle of the ellipse as measured from the positive X axis of the work coordinate system.

If the value entered for the semimajor axis is greater than the value entered for the semiminor axis, the System automatically

reverses the two values.

Example Creating an ellipse where the start and end angles have been specified, therefore a partial ellipse is created. A rotation angle (45)

has also been specified.

Declaration

Page 87: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

81

ENTITY/PT1,ELPS1

Geometry Definition PT1 =POINT/0,0

Ellipse Definition ELPS1=ELLIPS/PT1,1,.5,ATANGL,45,START,30,END,330

An Ellipse that is Truncated and Rotated

General Conics

Introduction The GCONIC statement produces a Unigraphics NX general conic. Based on the supplied data, any form of the GCONIC

statement (except statements containing a RHO value) generates one of the following geometric objects.

CIRCLE

HYPERBOLA

ELLIPSE

PARABOLA

The GCONIC statement is a vehicle to supply NXwith the necessary values to use the general quadratic conic equation to

calculate the conic.

Ax2 + Bxy + Cy2 + Dx + Ey + F = 0

The GCONIC statement provides six methods of generating a general conic. The first five methods use previously defined points,

vectors, etc. and the sixth uses the coefficients of a general conic.

Create General Conic Statement List

Function Major Word

Five Points GCONIC

Four Points, One Slope GCONIC

Three Points, Two Slopes GCONIC

Three Points, Anchor Point GCONIC

Two Points, Anchor Point, Rho Value GCONIC

Six Coefficients GCONIC

Create Isoparametric Curve On a Face ISOCRV

Page 88: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

82

Spline SPLINE

Approximate Curves SPLINE

Offset Curves OFFCRV

Intersections & Cross Sections INTSEC

Silhouette Curves SILHO

Project Points/Curves PROJ

Five Points

Synopsis obj = GCONIC/point1,point2,point3,point4,point5

Description Creates a conic by specifying five previously defined points. A parabola, ellipse, or hyperbola is created depending upon the

position of the points defined. All of the specified points lie on the conic, however the conic may not be drawn through all of the

points.

Parameters

Parameter Description

point1,point2,point3,point 4,point 5 Five previously defined points which are on the curve. All of the points must

be co-planar; however, no three of the points may be collinear. The conic is

created in the plane established by the five points. The points must be

specified individually if an array is used.

Example Creating a conic through five previously defined points. In this case, the conic is created counterclockwise from P(1) to P(5).

Even though the points, P(1) through P(5), are in an object array, they must be specified individually in the GCONIC statement.

Declaration ENTITY/P(5),GC1

Geometry Definition P(1)=POINT/1.8,1.6

P(2)=POINT/1,1.3

P(3)=POINT/.8,.6

P(4)=POINT/1.7,.7

P(5)=POINT/2.3,.9

Conic Definition GC1=GCONIC/P(1),P(2),P(3),P(4),P(5)

Page 89: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

83

General Conic Using Five Points

Four Points, One Slope

Synopsis obj = GCONIC/point1,point2,point3,point4,VECT,x,y,z

Description Creates a general conic by specifying four previously defined points and a vector which is the direction of tangency (slope) at the

first point.

Parameters

Parameter Description

point1,point2,point3,point4 Four previously defined points which are on the curve. All of the points must

be co-planar, however, no three of the points may be collinear. The points

must be specified individually if an array is used.

VECT Minor word that indicates that a tangent vector is to be specified.

x,y,z The three components of a vector which may be specified individually or as

an array. The specified vector represents the tangent of the conic at the first

point.

Example Creating a general conic by specifying four previously defined points and a vector which represents the slope of the conic at the

first point.

Declarations ENTITY/P(4),GC1

NUMBER/XYZ(3)

DATA/XYZ,1,2,0

Geometry Definition P(1)=POINT/1,1

P(2)=POINT/2,1.5

P(3)=POINT/3,1.75

P(4)=POINT/4,1.875

Conic Definition GC1=GCONIC/P(1),P(2),P(3),P(4),VECT,XYZ

Page 90: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

84

General Conic Using Four Points and a Vector

Three Points, Two Slopes

Synopsis obj = GCONIC/point1,point2,point3,VECT,x1,y1,z1,x2,y2,z2

Description Creates a general conic by specifying three previously defined points and two vectors which represent the slopes of the conic at

the first and last point.

Parameters

Parameter Description

point1,point2,point3 Three previously defined points which are on the curve. All of the points must be

coplanar, however, they may not be collinear. The points must be specified individually

if an array is used.

VECT Minor word that indicates that two tangent vectors are to be specified.

x1,y1,z1,x2,y2,z2 The six components of two vectors which may be specified individually, as two arrays,

or any combination of the two. The specified vectors represent the tangents of the conic

at the first and last points respectively.

Example Creating a general conic through three points controlled by a beginning and ending slope.

Declaration ENTITY/P(3),GC1

Geometry Definition P(1)=POINT/1,1

P(2)=POINT/2,1.5

P(3)=POINT/3,1

Conic Definition GC1 =GCONIC/P(1),P(2),P(3),VECT,1,2,0,1,-2,0

Page 91: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

85

General Conic Using Three Points and Two Vectors

Three Points, Anchor Point

Synopsis obj = GCONIC/point1,point2,point3,ANCHOR,point4

Description Creates a general conic by specifying three previously defined points containing the conic and a fourth point which serves as an

anchor. The first and the third points are the beginning and end of the conic, respectively.

Parameters

Parameter Description

point1,point2,point3 Three previously defined points which are on the curve. All of the points must be

coplanar, however, points 1,2 and 3 may not be collinear. The points must be specified

individually if an array is used.

ANCHOR Minor word that indicates that a known anchor point is to be specified.

point4 A previously defined point which is called the anchor point. Imaginary lines from this

point to the first and third points forms angles which represent the tangents of the conic

at the beginning and end respectively.

Example This example demonstrates the creation of a general conic through three points and controlled by a fourth, anchor point.

Declaration ENTITY/P(4),GC1

Geometry Definition P(1)=POINT/-1.5,-.5

P(2)=POINT/0,0

P(3)=POINT/1,-.5

P(4)=POINT/0,-1

Conic Definition GC1 = GCONIC/P(1),P(2),P(3),ANCHOR,P(4)

Page 92: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

86

General Conic Created Using Three Points and an Anchor

Two Points, Anchor Point, Rho Value

Synopsis obj = GCONIC/point1,point2,ANCHOR,point3,rho

Description Creates a general conic by specifying two previously defined points, an anchor point (previously defined), and a RHO value. The

first two points are the beginning and ending points respectively.

Parameters

Parameter Description

point1,point2 Two previously defined points which are on the curve. The points must be specified individually

if an array is used.

ANCHOR Minor word that indicates that a known anchor point is to be specified.

point3 A previously defined point which is called the anchor point. Imaginary lines from this point to the

first and third points forms angles which represent the tangents of the conic at the beginning and

end respectively.

rho The projecting discriminator which is a number greater than zero and less than one. This value

represents a percentage of the normal distance from the anchor point to an imaginary line between

points one and two. The resulting conic is tangent to a theoretical line at this point which is

parallel to the line between points one and two.

Example Creating a general conic by specifying two points, an anchor point, and a RHO value.

Declaration ENTITY/P(3),GC1

Geometry Definition P(1)=POINT/-1.5,-.5

P(2)=POINT/0,0

P(3)=POINT/1,-.5

Conic Definition GC1 = GCONIC/P(1),P(2),ANCHOR,P(3),.75

Page 93: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

87

General Conic Using Two Points, an Anchor and a Number

Six Coefficients

Synopsis obj = GCONIC/number list

Description Creates a general conic by specifying the six coefficient values which are used in the general quadratic conic formula to calculate

the conic:

AX2+BXY+CY2+DX+EY+F=0

Parameters

Parameter Description

number list The number list must contain six fields of real numbers. The numbers may previously defined

variables.

Example Creating a general conic by specifying the six numerical coefficients to be used in the quadratic general conic formula to

calculate the conic.

GC1 is a circle with a radius of 1 and the center at coordinates 0,0,0.

GC2 is a parabola with its vertex at -1.1875,.6875,0 and a focal length of .3536. The maximum and minimum "Y" distances, in

the coordinate system of the parabola, are 1 and -1 respectively.

Declaration ENTITY/GC1,GC2

NUMBER/COEF(6)

DATA/COEF,1,2,1,3,-1,4

Conic Definition GC1=GCONIC/1,0,1,0,0,-1

GC2=GCONIC/COEF

Page 94: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

88

General Conic Using Six Coefficients

Derived Curves

Isoparametric Curve On a Face

Synopsis obj = ISOCRV/obj{,UDIR|VDIR},num1[,TOLER,num2][,CNT,num3][,IFERR,label:]

Description Creates an isoparametric curve at given parametric values (u,v) on a face. The minor words UDIR and VDIR represent the (u,v)

parametric values.

The resulting isoparametric curve is not a "smart" curve. In other words, it is not associative to the face from which it is created.

If the face is modified, the curve does not change.

You cannot create isoparameter curves of constant v from a blend.

Parameters

Parameter Description

ISOCRV Major word specifies the creation of an isoparametric curve.

obj The face object identifier on which the curve is created.

UDIR Minor word indicates that the isoparametric curve is to have a constant u parameter.

VDIR Minor word indicates that the isoparametric curve is to have a constant v parameter.

num1 The parameter value at which to create the curve. This value must be greater than 0.0, less than

1.0.

TOLER Optional minor word specifies the use of a tolerance value. The tolerance is only used when the

input face is a foreign face or an offset of a non-analytic face.

num2 The tolerance value. This value must be greater than 0.0.

CNT Optional minor word indicates the number of curves created is reported to the calling program.

You may only get multiple curves if the face is trimmed.

num 3 The number of curves created.

IFERR,label: Specifies a label to which program execution jumps if an error occurs.

Page 95: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

89

Example Creating a B-surface type sheet body, then use the ISOCRV statement to create two isoparametric curves, one in each direction.

ENTITY/BS,CRVS(10),PT

NUMBER/SPAR,CRVCT

$$

$$ Create a b-surface for use in isoparameter curve creation.

$$

&ENTCLR = &GREEN

$$

CRVS(1) = LINE/4.0,0.0,4.0,0.0,0.0,4.0

PT = POINT/2.0,0.0,0.0

CRVS(2) = CIRCLE/CENTER,PT,RADIUS,2.0,START,0.0,END,180.0

$$

BS = BSURF/CURVE,CRVS(1..2)

$$

$$ We always create a curve at parameter 0.5.

$$

SPAR = 0.5

$$

$$ Create constant U curve.

$$

&ENTCLR = &CYAN

$$

CRVS = ISOCRV/BS,UDIR,SPAR,TOLER,0.001,CNT,CRVCT,IFERR,ERR:

$$

$$ Create constant V curve.

$$

&ENTCLR = &YELLOW

$$

CRVS = ISOCRV/BS,VDIR,SPAR,TOLER,0.001,CNT,CRVCT,IFERR,ERR:

$$

JUMP/LEND:

$$

ERR:

MESSG/'CREATION ERROR'

$$

LEND:

HALT

Spline

Synopsis obj = SPLINE/[CLOSED,]{point[,{VECT,dx,dy,dz|TANTO,curve|angle}]}+

Description Spline allows you to create a spline through a series of previously defined points. The resulting spline is generated by cubic (third

order) polynomials. The optional minor word CLOSED causes the first point to be automatically assumed as the last point and

the spline to be closed. In a closed spline, the starting slope is forced to be equal to the slope at the ending point. If the CLOSED

minor word is omitted, the spline is open even if the first and last points are coincident and the starting and ending slopes are not

forced to be the same.

A maximum of 102 arguments may be stated in the spline definition. If each knot point, for example, has an associated vector,

tangency point, or angle, only 51 knot points could be used in the statement. Subranges can be used to exceed this limitation.

The format below shows the series of options (except the minor word CLOSED) which are repeated for each point in the spline.

At least two points must be specified.

Using the Approximate Curves method creates a spline which approximates a list of previously defined objects. The spline can be

created to a tolerance, or by approximating each spline segment for each object in the list.

Parameters

Parameter Description

CLOSED Minor word that indicates that the spline is closed on itself whether or not the first and last points

are coincidental. The beginning and ending of the spline is also tangent at the first point.

point An object list or array which represents a series of previously defined points that the spline passes

through.

The following parameters represent various ways of controlling the slope of the spline at each point in the object list/array.

Several slopes can be specified and are matched with points in order beginning with the first point in the object list.

Page 96: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

90

You can repeat point and tangent specifications as many times as needed in a single statement (up to 102 arguments). You can

specify more points than tangents parameters.

VECT Minor word that indicates that the slope of the spline at the previous point is to be defined as a Vector by

the values in the next three fields.

dx,dy,dz Three work coordinate values which represent the components of the slope vector.

TANTO Minor word that indicates that the slope of the spline at the previous point is to be defined as being

tangent to a specified curve.

curve A previously defined object which is used to define the slope of the spline.

angle Numerical value which defines the slope of the spline at the previous point in degrees measured

counterclockwise from the positive X Axis.

Definition of the slope of the spline can be performed in any one of the three mutually exclusive manners above. You may mix

the methods in any SPLINE statement as long as you use only one method for any one point.

Example Creating a spline with no slope controls specified. In this case, the spline is fit through the points as smoothly as possible. An

open and closed splines are created with the same points.

Declarations ENTITY/P(4),SPLN(2)

Geometry Definition P(1)=POINT/-1,0

P(2)=POINT/0,0

P(3)=POINT/1,.866

P(4)=POINT/2,.75

Spline Definition SPLN(1)=SPLINE/P

SPLN(2)=SPLINE/CLOSED,P

An Open and Closed Spline through the Same Points

Example Creating a spline with no slope controls specified. In this case, the spline is fit through the points as smoothly as possible. Open

and closed splines are created with the same points.

Declarations ENTITY/P(4),SPLN(2)

Geometry Definition P(1)=POINT/0,0

P(2)=POINT/1,-1

P(3)=POINT/2,0

P(4)=POINT/1,1

Spline Definition SPLN(1)=SPLINE/P,P(1)

SPLN(2)=SPLINE/CLOSED,P

Page 97: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

91

A Closed and Open Spline Where the End Points Are Coincident

Example Creating a spline using the minor word VECT followed by the three component values of the desired vector. The spline, at this

point, is tangent to the specified vector.

Declarations ENTITY/P(5),SPLN1

Geometry Definition

P(1) =POINT/-1,0

P(2)=POINT/0,0

P(3)=POINT/1,.866

P(4)=POINT/2,.75

P(5) =POINT/3,1.5

Spline Definition SPLN1=SPLINE/P(1),P(2),VECT,1,2,0,P(3),P(4),$

VECT,-1,-2,0,P(5)

A Spline Constrained by Vectors

Example Creating a spline using the minor word TANTO and an existing curve. The curve tangent of the spline, at this point, is parallel to

the curve tangent of the specified curve at its closest end point.

Declarations ENTITY/CR(3),P(3),SPLN1

Geometry Definition CR(1)=CIRCLE/-2,0,.5,START,270,END,330 CR(2)=CIRCLE/0,1,.5,START,180,END,270

CR(3)=CIRCLE/1.5,0,.5,START,180,END,270

P(1)=POINT/-1,-1

P(2)=POINT/0,0

P(3) =POINT/1,-1

Spline Definition

Page 98: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

92

SPLN1=SPLINE/P(1),TANTO,CR(1),P(2),TANTO,CR(2),$

P(3),TANTO,CR(3)

A Spline Constrained by Curves and Vectors

Example Creating a spline by specifying an angle at which the spline is to be tangent. The angle is measured with respect to the X axis of

the work coordinate system.

Declarations ENTITY/P(4),SPLN1

Geometry Definition P(1)=POINT/-1,0

P(2)=POINT/0,0

P(3)=POINT/1,.866

P(4)=POINT/2,.75

Spline Definition SPLN1=SPLINE/P(1),90,P(2),300,P(3),90,P(4),300

A Spline Constrained by Angles

Example Demonstrates the use of subrange operators to exceed the knot point limitations in the SPLINE command. This example

demonstrates that the statement

SPLINE/P(1..9),VECT,V(1..6),P(10..11),A(5..6)

is equivalent to

SPLINE/P(1),VECT,V(1),V(2),V(3), $

P(2),VECT,V(4),V(5),V(6), $

P(3),P(4),P(5),P(6),P(7),P(8),P(9), $

P(10),A(5),P(11),A(6)

The following statement found at the end of the program demonstrates how to avoid exceeding the maximum of 102 arguments.

Page 99: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

93

SPL3=SPLINE/P(1..500),VECT, V(1..1500),P(501..1000),A(1..500)

Declarations ENTITY/P(1000),SPL1,SPL2,SPL3

NUMBER/V(1500),A(500),I,J

&ENTCLR = &RED

J = 1

DO/L1:,I,1,1000

P(I) = POINT/I,J,-J

IF/J==1,JUMP/ELSE1:

J = 1

JUMP/END1:

ELSE1:

J=-1

END1:

L1:

DO/L2:,I,1,500

V(I*3-2) = -1.0

V(I*3-1) = 0.0

V(I*3) = 0.0

L2:

DO/L3:,I,1,500

A(I) = 180.0

L3:

SPL1 = SPLINE/P(1),VECT,V(1),V(2),V(3), $

P(2),VECT,V(4),V(5),V(6), $

P(3),P(4),P(5),P(6),P(7),P(8),P(9), $

P(10),A(5),P(11),A(6)

MESSG/'SPLINE #1'

&ENTCLR = &CYAN

SPL2 = SPLINE/P(1..9),V(1..6),P(10..11),A(5..6)

MESSG/'COMPARE SPLINE #2'

BLANK/SPL1,SPL2

$$

&ENTCLR = &YELLOW

SPL3 = SPLINE/P(1..500),VECT, V(1..1500),P(501..1000),A(1..500)

HALT

Approximate Curves

Synopsis obj = SPLINE/APPROX,[{BLANK|DELETE}][,TOLER,t]obj list

Description Creates a spline which approximates a list of previously defined objects. The spline can be created to a tolerance, or by

approximating each curve segment for each object in the list.

You can approximate only lines, arcs, splines and conics with splines.

Parameters

Parameter Description

APPROX Minor word that indicates that the spline is to be created by approximating a series of existing

objects.

BLANK Minor word that indicates that the objects in the object list are to be blanked when the spline is

created.

DELETE Minor word that indicates that the objects in the object list are to be deleted when the spline is

created.

If neither BLANK or DELETE are specified, the objects in the object list are not modified.

Therefore, the spline lies over the objects on the CRT.

TOLER Minor word that indicates that a tolerance is to be specified to create the spline. If none is specified,

the default is the value set in the NXoption Preferences->Modeling. You can also read and set this

tolerance using the GPAs &DISTOL.

t A numerical value greater than zero which represents the tolerance which is used to calculate the

spline. The tolerance is the maximum cylindrical distance between the spline and the original curves

at any point.

Page 100: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

94

obj list A list or array of existing objects which are to be approximated by a spline. The objects must be

contiguous.

Offset Curves

Synopsis obj list = OFFCRV/obj list1,{dist|height,ang},ref point[,STEP,n1][{,EXT[,n2]|,FILLET}][,GROUP]

Description Allows you to create offset curves. These offset curves are created from a chainable list of planar curves consisting of lines, arcs,

conics, and/or B-splines. The offset curves lie on the same plane as the curves in the object list, unless a height and angle are

specified (height and angle creates a draft angle as the curves are offset).

The draft angle offset takes place perpendicular to the plane containing the original objects. The draft angle is measured from a

line which is also perpendicular to the plane.

Conics and B-splines are offset as splines. The accuracy of the offset is defined by the step value.

Parameters

Parameter Description

obj list1 A list or array of existing objects consisting of lines, arcs, conics, and/or splines. The objects must

all lie in the same plane.

dist A numerical value or variable which represents the offset distance. A positive distance is offset in

the direction of the reference point (ref point, in the following field)

height A numerical value or variable which represents the distance that the curves are offset. The distance

is measured perpendicular to the plane containing the original curves.

angle A numerical value or variable which represents the "draft angle". The angle is measured from a

vector pointing away from, and perpendicular to, the plane containing the original objects.

ref point An existing point which defines the positive offset direction. The direction points from the

beginning end point of the first object in the object list to the reference point. If these two points are

coincidental an error occurs.

STEP Minor word that indicates that the value in the following field represents the chordal stepping

distance along a conic or B-spline that establishes offset points to approximate the curve with a

spline. The system offsets the curve at each of these points, using the offset distance (or height and

angle) as measured along a vector which is normal to the curve at that point. The system then

creates a spline through these points which approximates the curve. Using a small step value

produces a more consistent spline, however, it also takes more time to calculate and produces more

knot points in the resulting spline.

The default step size is one unit in the measuring system (inch or metric).

n1 A positive numerical value which represents the step used to approximate conics during the offset

operation.

EXT Minor word that indicates that offset curves are to be extended to their intersections to maintain the

connectivity of the set of offset curves.

n2 A positive numerical value which represents how far offset curves can be extended at each end to

remain connected. The extension factor is a multiple of the offset distance.

For example, an extension factor of 2 allows the curve to be extended, at each end, up to 2 times the

offset distance. If the maximum extension does not causes the curves to connect, the system adds a

line to fill the gap.

FILLET Minor word that indicates that the connectivity of offset curves is maintained by adding an arc

where necessary. When you use fillet, the curves are not extended.

GROUP Minor word that indicates that the offset curves are created in a group. See example below for

important information on using the GROUP option.

Page 101: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

95

Example: When a GROUP option is used, a group is returned, i.e.:

Statement grp1=OFFCRV/crvs(1..count), distan, refpt, FILLET, GROUP

And if you don't use the GROUP option, an Array is returned:

Statement ary1=OFFCRV/crvs(1..count), distan, refpt, FILLET

Intersections & Cross Sections

Synopsis obj =

INTSEC/surf1,WITH,surf2[,TOLER,tl][,lsurf1,lpoint1,lsurf2,lpoint2[,VECT,x,y,z]][,IFERR,label:]

Description Generates curves at the intersection of two single face surfaces (sheet bodies) and/or planes. In general, the curves go from edge

to edge of the surfaces being intersected.

If the surfaces have been trimmed, the resulting surface intersection or cross section curves are trimmed to the trimmed edges of

the surfaces and to any holes in the surfaces.

The intersection curves can be limited (or extended) by specifying suitable limiting surfaces, points, and a direction vector.

Analytic intersection curves (lines, arcs, or conics) are produced where possible. Otherwise, the curves produced are B-splines.

The resulting curves are returned as a group object, even if only one curve is generated.

Parameters

Parameter Description

surf1 A previously defined single face surface (sheet body) or plane that is to be intersected with another

surface or plane to produce the intersection curve.

WITH Minor word indicating that the second single face surface is to be specified in the next field.

surf2 A previously defined single face surface (sheet body) or plane which is intersected with surf1 to

produce the intersection curve.

TOLER Minor word that indicates that a tolerance be used to create the intersection. If none is specified,

the default is the value set in the NXoption Preferences->Modeling. You can also read and set this

tolerance using the GPA &DISTOL.

t A numerical value greater than zero which is used to create the intersection curves. The system

attempts to create intersection and cross section curves which differ from the true intersection

curves by no more than this value.

lsurf1 An existing surface (sheet body) or plane which is used to limit the length of the intersection

curve. The curve begins tracing where this surface intersects the two surfaces being intersected.

lpoint1 An existing point used to help determine the start point for the trace curve in cases of ambiguity.

lsurf2 An existing surface (sheet body) or plane which is used to limit the length of the intersection

curve. The curve stops tracing where this surface intersects the two surfaces being intersected.

lpoint2 An existing point used to help determine the end point for the trace curve in cases of ambiguity.

VECT Minor word that indicates that a vector be specified to control the direction of the trace for the

intersection curve.

x,y,z Numerical components of a vector which controls the trace direction of the intersection curve. The

curve is traced in the direction that the vector points.

VECT,x,y,z need only be specified in cases where the direction of intersection may be ambiguous.

For example, the direction from one limit point to another limit point on a spherical or cylindrical

surface.

VECT,x,y,x has no effect if no limiting objects are used.

IFERR,label: Specifies a label to which program execution jumps if an error occurs during intersection.

Page 102: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

96

In general, all intersection curves (or cross section curves) are created, unless limiting surfaces are specified.

The system may not find an intersection curve if the faces just touch one another and do not fully intersect. For example, this may

occur in the case of a fillet sheet body and the faces being filleted.

Example Creating an intersection between a ruled surface (RSURF) and a B-surface (BSURF). Limiting planes and points are specified to

limit the surface intersection curve that is created. GRP is a group containing the curve.

Statement GRP=INTSEC/RSURF,WITH,BSURF,PL1,PNT1,PL2,PNT2

INT1=&GENT(GRP,1)

UNGRP/GRP

Surface to Surface Intersection

Example Demonstrates the cross sectioning of a trimmed cylinder (CYL1) with a plane (PL1). All cross section curves are created. A

tolerance of 0.01 is specified. GRP is a group containing the curves.

Statement GRP=INTSEC/CYL1,WITH,PL1,TOLER,.01

DO/ L10:, I, 1, &GCOUNT(GRP)

L10: ICRV(I) = &GENT(GRP,I)

UNGRP/GRP

Cross Section of a Trimmed Cylinder by a Plane

Page 103: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

97

Project Points/Curves

Synopsis obj list = PROJ/obj list1,ON,obj list2[,TOLER,t][,VECT,vect][[,ASSOC [,obja] ] | [,MOVE]]

Description Projects previously defined points, lines, arcs, conics, and/or B-splines onto existing faces and/or planes. The projection takes

place along a single vector direction or along face normals if the optional vector direction is not specified. A projected curve is

automatically trimmed to the holes and edges of the face on which it is projected.

The results are returned as an object list to a variable which should be defined large enough to receive the entire object list.

Otherwise the object list is truncated to satisfy the size of the return variable.

You can create an associated curve projection using the optional minor word ASSOC. This means that if the face/plane or input

curves/points are modified, the projected curves are also modified.

Parameters

Parameter Description

obj list1 An existing curve/point, array of curves and points, or list of curves and points which is projected to

the face(s) and plane(s). Maximum number allowed is 1000. To work around this limitation, a

program can either project 1000 entities onto 1000 entities at a time, or project a single entity onto a

single entity one at a time.

ON Minor word indicates that the objects in the first object list are projected onto the faces/planes in the

following object list.

obj list2 An existing face/plane, array of faces and planes, or list of faces and planes onto which the objects

in the first list are projected. Maximum number allowed is 1000.

TOLER Minor word that indicates the value in the following field represents a tolerance which is used to

approximate the curves on the faces. If none is specified, the default is the value set in the NX

option Preferences->Modeling. You can also read and set this tolerance using the GPAs &DISTOL.

The projection along face normals or along a vector produces an exact projection when projecting

onto a plane.

t A positive numerical value or variable which represents the tolerance used to approximate the curve

on the face.

VECT Minor word that indicates that the curves and points are projected along a single vector defined in

the following field. If the vector parameters are not specified, points and curves are projected along

face normals.

The projection is only along the direction specified. The vector is not automatically reversed to

resolve a projection.

vect A three position numerical array which represents the projection vector. The vector values are

measured in the WCS.

ASSOC Optional minor word indicating that the results are an associated curve projection feature.

obja The return area for the object identifier that represents the associative curve projection set. This

identifier can only be used as input into the PROJ command.

MOVE Minor word that indicates that the original curves and/or points are to be deleted as they are

projected to the faces and planes.

Silhouette Curves

Synopsis obj = SILHO/body[,CNT,count][,IFERR,label:]

Description Creates all possible silhouette curves for the specified body. The curves are view dependent and lie on the body. The resulting

curves are created as a group object, even if only one curve is generated.

Page 104: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

98

Parameters

Parameter Description

body This parameter can be any NXbody.

CNT An optional minor which indicates that a count of the curves created is desired.

count A variable which is assigned the number of curves created.

IFERR,label: Specifies a label to which the program jumps if an error occurs.

Example Creating the silhouette curves of a sphere.

Declarations ENTITY/CR1,SPHR1,GRP

Geometry Definition CR1 = CIRCLE/1,1,1

SPHR1 = SPHERE/CR1

Silhouette Definition GRP = SILHO/SPHR1,CNT,count

Comfiguration 1 - A Sphere with Silhouette Curves

Configuration 2 - A Sphere with Silhouette Curves (as Group objects)

Page 105: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

99

Create B-spline

Introduction The BCURVE statement can create different types of B-splines: Bezier and B-spline. The system automatically decides which

curve to create based upon the input data.

In Unigraphics NX, the degree of a B-spline must be between 1 and 24. The degree for a Bezier curve is one less than the number

of points specified. So, for a Bezier curve, the minimum number of points is two (minimum degree of one) and the maximum

number of points is 25 (maximum degree of 24 + 1).

For a B-spline curve, the minimum number of points must be one more than the degree specified using the minor word DEGREE.

For example, if you specify a B-spline with a degree of five, you must specify at least six points in your object list.

Create B-spline Statement List

Function Major Word

Create Spline Using a Fitting Method BCURVE/FIT

Point Method BCURVE/PT

Curve Method BCURVE/CRV

Simplify Curves SIMCRV

Create Edge Vertex Points EDGVER

Create Edge Curves of a Body, Face, or Edge SOLEDG

Create Spline Using a Fitting Method

Synopsis obj list = BCURVE/FIT,{obj list1,|num list1}[,WGHT,num

list2],{SEGS|TOLER},num1[,DEGREE,num2][,START,{VECT,dx,dy,dz|TANTO,{curve|angle}}][,END,{VECT,dx,

dy,dz|TANTO,{curve|angle}}],STATUS,numa[,IFERR,label:]

Description Creates a spline by "fitting" the curve to the data points. This method reduces the amount of data needed to define the curve.

Since the curve is not forced to pass through the data points, the spline definition is simplified. The system does not store

defining points for curves created using the spline creation function. However, these points are stored for B-curve creation

functions.

You can either specify a list of object identifiers to use for the approximation or a list of WCS coordinates which correspond to

the points to be used.

You can also set various parameters such as the degree of the spline and the weight factor of the data points, etc.

Parameters

Parameter Description

obj list1 A list of point object identifiers to use as data points.

num list1 The list of WCS coordinates corresponding to the data points to use for the approximation, instead

of using objects.

WGHT Optional minor word indicates that the numbers in the following list are weights to assign to the

points.

num list2 Optional list of weights to assign to the points. Specifying a large value for the weight ensures that

the spline passes through or close to that data point. Assigning a weight of 0.0 ensures that a

particular point is ignored in the fitting process. This is useful for omitting "bad" data points. Note

that the spline always passes through the first and last points, regardless of any assigned weights.

The default weight factors are such that sparsely located points are more heavily weighted than

Page 106: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

100

densely located points.

SEGS This minor word specifies the use of the segment method. This method allows you to specify the

number of segments the spline is to contain. Given the number of segments, the system makes the

best fit possible without adding any more knot points. This method only gives you indirect control

over the allowable distance the curve may deviate from a data point. This option is faster than the

tolerance method since it requires much less computation.

The number of segments you should specify depends on the degree of the curve you want to

create, the shape of the data, and the degree of tolerance to achieve. A general rule of thumb is that

you need one segment for every time the slope varies as much as 90 degrees. You can use fewer

segments if the spline has a higher degree.

TOLER This minor word specifies the use of the tolerance method. This method allows you to specify the

maximum allowable distance the curve may deviate from a data point. The system attempts to

reduce the number of segments in the spline while ensuring that the maximum distance from any

raw data point to the created spline is less than the error value you specify. The error value is the

maximum distance from any data point to the created spline.

A tight tolerance causes the spline to be closer to the data points; which results in more spline

segments. If you use a very tight tolerance, the system produces a curve that actually passes

through the data points.

num1 Represents either the number of segments or the tolerance depending on the method requested.

DEGREE Optional minor word indicates that the following number is the degree to assign to the curve.

num2 Optional number that contains the degree. The default degree for the spline is three, but it can be

any value between 1 and 24.

START Optional minor word indicates that the following vector data is a tangent constraint on the start

point.

VECT Optional minor word indicates that the following three numbers dx,dy,dz are vector components to

use for a tangent constraint.

TANTO Optional minor word indicates that the following data is either a curve or an angle value from

which the tangent constraint is created.

curve Any curve object whose nearest end point is used to calculate the tangent constraint.

angle A numeric value that specifies the slope by an angle.

END Optional minor word indicates that the following tangent data is applied to the end point.

STATUS Required minor word indicates that the next variable contains the return status.

numa The variable in which to put the return code.

Status Values -1 = Memory allocation error

0 = Successful creation of curve

1 = Resultant curve did not meet tolerance, interpolation was done.

This is not considered an error.

2 = Not enough constraints for requested degree

3 = Degree not between 1 and 24

4 = Number of weights doesn't match number of data points

5 = Invalid tolerance value

6 = Invalid number of segments

7 = Unable to create curve

IFERR,label: Specifies a label to which program execution jumps if numa contains an error value.

Point Method

Synopsis obj list = BCURVE/objlist1[,VERT[,num list]][,DEGREE,num[,CLOSED]][,IFERR,label:]

Page 107: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

101

Description The point method creates a B-spline through a series of existing points using the BCURVE statement. The default creation mode

is to define the curve through the points. However, the minor word VERT causes the system to interpret the points as control

vertices. The optional number list included with the VERT parameter can assign weights to these vertices.

Parameters

Parameter Description

objlist1 A list or array of existing points which is used to create the curve.

VERT Minor word that indicates the points in the object list represent control vertices.

num list A numerical list or array which contains the positive weights which are assigned to each

corresponding point in the list.

DEGREE Minor word that indicates that the degree specified for the curve causes the creation of a B-spline

curve, unless the degree value meets the requirements of a Bezier curve.

num A positive numerical value or variable which represents the degree of the curve.

CLOSED Minor word that indicates the curve is to be closed; can only be used if the degree is specified.

IFERR,label: Specifies a label to which program execution jumps if the system cannot create the curve from

valid data.

Curve Method

Synopsis obj list = BCURVE/CURVE,objlist1[,ENDOF[,objlist2|,numlist]][,DELETE|,BLANK][,IFERR,label:]

Description Using the curve method converts existing curves (lines, arcs, or conics) to B-splines. The newly created B-spline lies on top of

the original curve, unless the minor words BLANK or DELETE are invoked.

Converting lines generates first degree Bezier curves.

Converting arcs and conics generates single segment quadratic splines, with the exception of arcs and ellipses with delta angles

greater than 120 degrees. In this case, a multiple segment spline of degree 4 is created.

Parameters

Parameter Description

CURVE Minor word that indicates the B-spline is created from existing curves.

entlist1 A list or array of existing curves which are converted to B-splines.

ENDOF Minor word that indicates the direction of the pole arrays are to be determined by the following

optional list or array. The direction of the data base parameters for each curve is the default for the

direction of the pole array.

entlist2 Optional list or array of existing points that are used as reference points to indicate the direction of

each pole array. The closest endpoint is the start of the pole array.

numlist Optional list or array of PMODs that indicates the direction of each pole array.

DELETE Minor word which indicates the original curves are to be deleted after the creation of the B-

splines.

BLANK Minor word which indicates the original curves are to be blanked after the creation of the B-

splines.

IFERR,label: Specifies a label to which program execution jumps if the system cannot create the curve from

valid data.

Page 108: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

102

Simplify Curves

Synopsis obj list = SIMCRV/obj list1[,BLANK|,DELETE][,TOLER,t][,CNT,c]

Description Allows you to create a string of best fit lines and arcs from a string of specified curves.

You can use the optional minor words BLANK and DELETE to blank or delete the original curves following the operation. If

you specify neither of these minor words, the system maintains the original curves.

The system returns an object list of arcs and lines created.

Parameters

Parameter Description

obj list1 A list of object identifiers for the curves to be simplified.

BLANK Optional minor word indicating that you want to blank the original curves.

DELETE Optional minor word indicating that you want to delete the original curves.

TOLER Optional minor word indicating that a distance tolerance value follows. If none is specified, the

default is the value set in the NXoption Preferences->Modeling. You can also read and set this

tolerance using the GPA &DISTOL.

t The distance tolerance which is used to best fit the lines and arcs to the specified curves.

CNT Optional minor word indicating that a number is to be returned.

c A variable that returns the number of objects created.

Create Edge Vertex Points

Synopsis obj list = EDGVER/obj[,CNT,c][,IFERR,label:]

Description Creates the vertex points for a specified edge. The system returns a list of vertex points created.

The objects returned in the object list are not order dependent. This command makes no claims as to which object appears first in

the object list. Use the SOLBOX and ENCONT commands to assist in identifying edges.

Parameters

Parameter Description

obj The object identifier of the edge.

CNT Optional minor word indicating that a number is to be returned.

c A variable which returns the number of vertex points created.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. For example, an error

occurs if obj is not properly defined.

Create Edge Curves of a Body, Face, or Edge

Synopsis obj list = SOLEDG/obj[,CNT,c][,IFERR,label:]

Page 109: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

103

Description Creates the edge curve(s) of a specified body, face, or edge. The system returns an object list of curves created.

The objects returned in the object list are not order dependent. This command makes no claims as to which object appears first in

the object list. Use the SOLBOX and ENCONT commands to assist in identifying edges.

Parameters

Parameter Description

obj The object identifier of the body, face, or edge.

CNT Optional minor word indicating that a number is to be returned.

c A variable which returns the number of edge curves created.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. For example, an error

occurs if obj is not properly defined.

Page 110: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

104

Sheet Body Creation

Introduction This section covers the GRIP statements used to create sheet bodies. Also included is a statement to identify the associated base

face of an offset body.

Sheet Body Creation operations fall into the following categories:

Surfaces

Free-Form

Cylinder

Cone

Sphere

Plane

B-Surface

Terminology The modeling terms introduced in this section:

Feature is a all-encompassing term that refers to all solids, bodies, and primitives.

A body is a collection of faces and edges. This includes both solid bodies and sheet bodies.

A solid body is a collection of faces and edges that "close up" to enclose a volume

A sheet is a body with a zero thickness, similar to a surface, made up of a collection of faces and edges that do not "close up" to

enclose a volume. Each sheet has an underlying surface type, such as a surface of revolution, cylinder, B-surface, etc., that

defines its shape.

A face is a region on the outside of a body, separated from other faces by strings of edges.

The statements in this chapter create sheet bodies based upon the type of underlying surface desired. For statements which create

B-surface type sheets, if the resulting body is closed in both U and V directions, it is a solid body. If the resulting body is closed

in one direction and the other direction has planar ends, then it also creates a solid body.

Specifying Modeling Tolerances If a Modeling Application statement allows you to specify a distance or angle tolerance value and you do not provide one, the

default is the value set in the NX option for Preferences->Modeling. You can read and set these tolerance values using the GPAs

&DISTOL and &ANGTOL.

If a Modeling Application statement performs an approximation and that statement does not allow the minor word TOLER, the

system uses the tolerance value set in NX.

Surfaces

Surfaces Overview To create the image file used to display shaded images of bodies, use the these options.

Surfaces Function List

Function Major Word

Create Surface of Revolution REVSRF

Create Tabulated Cylinder TABCYL

Page 111: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

105

Create Ruled Surface RLDSRF

Create Fillet Surface FILSRF

Create Surface of Revolution

Synopsis obj = REVSRF/obj,AXIS,line[,point][,start,end]

Description Creates a sheet body whose underlying surface type is a surface of revolution. You create this sheet body by specifying a

previously defined generating curve and a previously defined line which represents the axis of revolution.

The generating curve is revolved about the line in degrees measured from the generating curve.

You may specify a previously defined point to control the direction of rotation. Rotation is counterclockwise as viewed from the

end of the line nearest the specified point toward the opposite end.

If no point is specified, rotation is viewed based on the creation parameters of the line.

For example, if the line was defined from P1 to P2, then rotation is counterclockwise as viewed from P1 toward P2.

Parameters

Parameter Description

obj An existing curve which is rotated about an axis generating the body.

AXIS Minor word that indicates that a line is specified which becomes the axis of rotation.

line An existing line which serves as the axis of rotation.

point A previously defined point which may be used to control the direction of rotation. Rotation is

counterclockwise as viewed from the end of the line nearest the specified point to the opposite end.

If a point is not specified the ending parameters of the line are assumed.

start,end The starting and ending angles of rotation. If the start and end angles are not specified the default

values of 0 to 360 are used.

Create Tabulated Cylinder

Synopsis obj = TABCYL/obj,x,y,z[,start,end]

Description Creates a body whose underlying surface type is a tabulated cylinder. You create the body by specifying a previously defined

generating curve and a directrix in the form of a vector.

The generating curve is projected along the directrix to create the surface.

The vector components in X, Y, and Z establish the direction of the directrix and the length of the surface.

You may specify a start and end value which represent the distance along the directrix, from the generating curve, that the surface

is created.

Parameters

Parameter Description

obj An existing curve which serves as the generating curve.

x,y and z The X,Y and Z components of a vector, the directrix, along which the generating curve is moved to

create a surface.

start,end The start and end parameters determine the length of the tabulated cylinder as measured along the

specified vector. Each value is a distance along the vector from the origin of the generating curve.

Page 112: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

106

Therefore, the surface starts at a point equal to the origin of the generating curve plus the start value

and end at a point equal to the origin of the generating curve plus the end value.

If not specified, the default values for start and end parameters are zero for the start value and the length (magnitude) of the

specified vector for the end value.

Example Creating a tabulated cylinder type sheet body by specifying a generating curve and a directrix in the form of a vector.

Declarations ENTITY/P(4),SPLN1,TAB1

Geometry Definition P(1)=POINT/.5,1

P(2)=POINT/1.5,2

P(3)=POINT/2.5,.5

P(4)=POINT/3,1.5

SPLN1=SPLINE/P

Sheet Body Definition TAB1=TABCYL/SPLN1,0,0,1,0,1

A Tabulated Cylinder Type Sheet Body

Create Ruled Surface

Synopsis obj = RLDSRF/obj1,[point1],obj2[,point2]

Description Creates a body whose underlying surface type is a ruled B-surface. You create the body by assigning a one to one correspondence

between points on two curves and connecting the corresponding points with straight line rulings.

Parameters

Parameter Description

obj1,,obj2 Two existing curves. If point1 is omitted, its field must appear, but left blank.

point1,point2 Two previously defined points which may be used to indicate which ends of the respective curves

are associated in the ruling process. These points do not have to lie on the curve but must be

closest to the desired end. If a point is not specified, a default reference point corresponding to the

starting parameters of the curve are used.

If point1 is not specified two commas must be inserted between ent1 and ent2. For example:

Page 113: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

107

ENTITY/L(2),SURF1

L(1)=LINE/0,0,0,1

L(2)=LINE/0,1,1,1

SURF1=RLDSRF/L(1),,L(2)

As two different bodies may be generated between any two curves, caution must be exercised when specifying reference points

or assuming the default reference points.

Examples Creating a ruled B-surface type body between a line and a spline.

Declarations ENTITY/PT1,P(4),SPLN1,LN1,RSRF1

Geometry Definition PT1=POINT/-1,-1

P(1) =POINT/-1,0

P(2) =POINT/-.5,.25,.25

P(3)=POINT/.5,-.25,-.25

P(4) =POINT/1,0

SPLN1=SPLINE/P

LN1=LINE/1,-1,-1,-1

Body Definition RSRF1=RLDSRF/SPLN1,,LN1,PT1

Ruled B-surface Type Body Using a Reference Point

Create Fillet Surface

Synopsis obj =

FILSRF/surf1,surf2,point[,TOLER,tl],RADIUS,r1[,r2],[LINEAR|SSHAPE][,lsurf1,lpoint1,lsurf2,lpoint2

][,VECT,x,y,z][,RESULT,result][,IFERR,label:]

Description Creates a fillet sheet between two previously defined faces by defining a radius, an approximate center point, and an optional

tolerance. The resulting fillet sheet's underlying surface type is a B-surface.

The fillet can be limited between two limiting faces, and its generation direction can be controlled by specifying a vector.

If no limiting faces are specified, the fillet is generated from edge to edge of the faces being filleted. If no vector is specified, the

fillet is created from the start point to the end point.

Parameters

Parameter Description

surf1,surf2 The two existing faces to be filleted. The faces do not have to intersect, but the maximum distance

between any two points of tangency must be less than or equal to twice the specified radius of the

Page 114: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

108

fillet.

point A previously defined point which approximates the location of the fillet center and indicates the

quadrant where the fillet is created.

TOLER The optional minor word TOLER indicates that a maximum deviation tolerance value is to be

specified. If none is specified, the default is the value set in the NX option Preferences->Modeling.

You can also read and set this tolerance using the GPA &DISTOL.

tl The maximum allowed distance between the fillet edge and the indicated surfaces.

RADIUS Minor word that indicates that a radius or radii values are to be specified.

r1,r2 Fillet radii values. If the fillet has a constant radius only one radius value (r1) is needed. If the fillet

has a variable radius fillet, then two radius values are needed (r1,r2) where the start radius is r1 and

the end radius is r2.

LINEAR Minor word that specifies that a linearly varying variable radius fillet is to be created.

SSHAPE Minor word that specifies that an S-shaped variable radius fillet is to be created.

If neither LINEAR nor SSHAPE is specified, the default is a linearly varying radius. If only one

radius is specified (r1) or if both radii are the same (r1 and r2), the fillet is a constant radius fillet.

lsurf1 An existing sheet which is used to limit the length of the fillet. The fillet begins where this sheet

intersects the two faces being filleted.

lpoint1 An existing point which lies at the approximate center of the beginning of the fillet. This point

defines which intersection, if multiple intersections exist between the limiting sheet and the

filleting faces, is used to define the start of the fillet.

lsurf2 An existing sheet which is used to limit the length of the fillet. The fillet stops where this sheet

intersects the two faces being filleted.

lpoint2 An existing point which lies at the approximate center of the end of the fillet. This point defines

which intersection, if multiple intersections exist between the limiting sheet and the filleting faces,

are used to define the end of the fillet.

VECT Minor word that indicates that a vector is to be specified to control the direction in which the fillet

is created.

x,y,z Numerical components of a vector that controls the direction the fillet is created. The fillet is

created in the direction that the vector points.

When no vector is specified, the fillet is created from the start point to the end point. If there are

two possible paths between the start point and end point (e.g., between two points along the bottom

edge of a cylinder), the fillet is created along the shortest distance.

RESULT Minor word which indicates that a value is to be assigned to the subsequent argument based upon

the results of the fillet creation.

result A numerical value is assigned to this argument based upon the results of the fillet creation. This

information can be used in conjunction with IFERR, label:. For example, if the value 5 is returned,

an incomplete fillet was created due to the fillet radius exceeding the curvature of the sheets. In

this case you could either delete the incomplete fillet or continue. The values which can be

returned are as follows (negative values indicate errors in the input data, positive values indicate

errors in the fillet creation):

Value Error Returned

-7 Invalid surface type.

-6 Object is not a point.

-5 Tolerance too small.

-4 Tolerance too large.

-3 End radius too small.

-2 Start radius too small.

-1 Fixed radius too small.

Page 115: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

109

0 Successful fillet creation.

1 Not used.

2 Not used.

3 Not used.

4 Not used.

5 Cannot create entire fillet due to

fillet radius exceeding curvature of surfaces.

6 Out of memory.

7 Unable to create fillets.

IFERR,label: Specifies a label to which program execution jumps if an error occurs during filleting. Use this in

conjunction with the results parameter previously described.

If a value of 5 is returned to the result area, then IFERR,label: is not activated and no other error

message is given. This allows a partial fillet to be returned to the program.

Create Free Form Body

Introduction SSURF creates a free form body by specifying a series of curves. The body's underlying surface type is a B-surface. The body is

calculated based on the geometric shape of the specified curves.

There are two methods of creating this type of free form body, using either a Swept Surface Feature or Curve Mesh Feature

method.

The swept body is created by "sweeping" (extruding) a curve along another curve. This is similar to creating a tabulated cylinder,

except that the projection curve does not have to be a straight line.

A curve mesh is created by specifying a grid of primary and cross curves which the body passes through.

Both methods utilize a mesh of curves, however in the Swept method, the mesh is automatically created from the two previously

defined (generator and trajectory curves) as the sweeping action is calculated. Using the Curve Mesh method, all of the curves

must already exist.

Create Free Form Body Statement List

Function Major Word

Swept Surface Feature SSURF

Curve Mesh Feature SSURF

Create Bounded Plane BPLANE

Swept

Synopsis obj = SSURF/obj1,obj2,p,c[,ent3]

Description Creates a swept body by specifying a generating and trajectory curve. The generating curve is swept along the trajectory curve to

calculate a series of curves (number of curves are based on values you define) to be used to create a body.

An optional point may be specified to indicate the direction of the sweep. If you select the endpoint of the trajectory curve closest

to the generating curve, the body is as shown in Figure 1-9. If you select the endpoint of the trajectory curve farthest from the

generating curve, the sweep is in the opposite direction.

Page 116: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

110

The current U and V surface display parameters are applied to each patch formed between two crossing curves in the body.

Parameters

Parameter Description

obj1 An existing object which serves as the generator curve.

obj2 The trajectory curve along which the generator curve is swept.

p The number of primary curves to be generated along the trajectory curve.

c The number of cross curves to be generated along the generator.

obj3 An optional point specified to indicate the direction of the sweep.

Curve Mesh

Synopsis obj = SSURF/PRIMA,obj list1,CROSS,obj list2

Description Creates a free form body using the Curve Mesh method. You must specify a series of primary and cross curves through which to

calculate the body. You must specify at least two primary and two cross curves.

The primary and cross curves must either share end points or intersect.

If you would like to use a point as one of the cross curves, then you should use the BSURF command.

The current U and V surface display parameters are applied to each patch formed between two crossing curves in the body.

Parameters

Parameter Description

PRIMA Minor word that indicates that the following object list consists of curves in the primary "U"

direction.

obj list1 A list of existing curves in the primary direction.

CROSS Minor word that indicates that the following object list consists of curves in the cross "V" direction.

obj list2 A list of existing curves in the cross direction.

Although the primary curves and the cross curves are not exactly perpendicular, They should form a roughly rectangular network.

Both sets of curves must be specified in order, moving from one side of the body to the other.

The total number of primary and cross curves must not exceed 102.

The primary and cross curves may be specified using an array. You can use a sub-range operator containing variables. For

example the range of splines SPL(1..10) is valid, as is the range SPL(1..K).

Create Bounded Plane

Synopsis obj = BPLANE/obj list1[,HOLE,num list,obj list2][,TOLER,t]

Description Creates a sheet body, bounded by geometry, whose underlying surface type is a planar surface. You must specify a list of the

bounding objects and, if desired, a list of holes to be left in the sheet.

The total number of objects used to define the sheet boundary and holes must not exceed 1000.

All of the objects in the bounded plane statement must be coplanar.

Page 117: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

111

Parameters

Parameter Description

obj list1 The object list for the sheet body may consist of lines, arcs, conics, splines or B-curves.

HOLE The optional minor word HOLE provides a means of defining holes or voids in the sheet body.

num list A numerical list or array which is used to indicate the number of objects in each hole loop.

obj list2 An object list or array which represents the holes in the sheet body. The list of holes should consist

of a series of contiguous lines, arcs, conics, B-curves, and/or splines.

TOLER Minor word indicating that a tolerance value is to be specified to create the sheet body. If none is

specified, the default is the value set in the NX option Preferences->Modeling. You can also read

and set this tolerance using the GPA &DISTOL.

t A numerical value which represents the edge tolerance used to create the sheet body.

Create Cylinder Sheet Body

Introduction CYLNDR creates a sheet body whose underlying surface type is a cylinder. This cylinder is an analytical surface defined in terms

of its curvature (radius) and various parameters to limit or bound the sheet creation.

Create Cylinder Sheet Body Statement List

Function Major Word

Arc, Bounding Plane CYLNDR

Center Point, Line CYLNDR

Center Point, Radius CYLNDR

Center Point, Radius, Two Bounding Planes CYLNDR

Radius, Between Two Surfaces CYLNDR

Arc, Bounding Plane

Synopsis obj = CYLNDR/arc,plane,point

Description Creates a cylinder by specifying an existing arc and plane. The plane of the arc and the specified plane bound the sheet display.

The point specified is used to decide which side of the cylinder to keep, if and only if the the bounding planes cross, causing two

cylinder sections to be created. The half to which the point is nearest is kept.

Parameters

Parameter Description

arc An existing arc which serves as the generating curve, the directrix, and also as one of the bounding

planes. By definition, the axis of the cylinder, the generatrix, is normal to the plane of the arc.

plane An existing plane which serves as the other bounding plane.

point A previously defined point which may be needed to determine which portion of the cylinder is

created. Although the point is required in this cylinder definition, it is only significant when the

Page 118: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

112

existing plane and the plane of the arc are not parallel and the plane passes through the arc. This

condition causes a partial cylinder to exist on either side of the arc. The point serves to eliminate

one of the possibilities.

Center Point, Line

Synopsis obj = CYLNDR/CENTER,point,line

Description Creates a cylinder by specifying a center point and a line that lies on the sheet. The line is "revolved" about the point to generate

the sheet. The sheet is as long as the line. The axis of the cylinder passes through the specified point and is parallel to the

specified line.

Parameters

Parameter Description

CENTER Minor word that indicates that value in the next field is the center point of the cylinder.

point A previously defined point which is the center of the cylinder. The cylinder axis passes through this

point and is parallel to the sheet generating line specified in the next field.

line An existing line which is swept around the imaginary axis, which is parallel to the line, forming the

generatrix of the cylinder.

Center Point, Radius

Synopsis obj = CYLNDR/point,RADIUS,r

Description Creates a cylinder by specifying a radius and a previously defined point which lies on the axis. The cylinder length is from the

current depth to the specified point and the axis is parallel to the Z axis of the work coordinate system. The point, therefore, must

have a Z coordinate value that is not equal to the current depth.

Parameters

Parameter Description

point A previously defined point which lies on the axis of the cylinder. One of the two planes used to

limit the sheet (bounding planes) contains this point. The bounding planes are parallel. Since the

other bounding plane is the work plane of the WCS, the point should not have a Z value of zero. If

it does, the cylinder has no height.

RADIUS Minor word that indicates that the radius of the cylinder is to be specified.

r A positive value which establishes the cylinder radius.

Center Point, Radius, Two Bounding Planes

Synopsis obj = CYLNDR/point1,[VECT,x,y,z]RADIUS,r,plane1,plane2,point2

Description Creates a cylinder by specifying a previously defined center point, a radius, and two previously defined planes to limit the sheet

display. You may define the axis of the cylinder in terms of a vector. If you do not define a vector, the axis is parallel to the ZC

axis.

Page 119: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

113

You must specify a point which is used only if the bounding planes intersect causing two cylinder segments to be formed. In this

case the cylinder half nearest the point created (the other half is not created).

Parameters

Parameter Description

point1 A previously defined point which lies on the axis.

VECT The optional minor word VECT indicates that the attitude of the cylinder axis is specified by

vector components.

x,y,z The three component values of a vector which establishes the axis of the cylinder. If omitted the

default axis is parallel to the Z axis of the work coordinate system.

RADIUS Minor word that indicates that the radius of the cylinder is to be specified.

r A positive value which establishes the cylinder radius.

plane1,plane2 Two existing planes that serve as bounding planes for the cylinder.

point2 A previously defined point which may be needed to determine which portion of the cylinder is

created. Although the point is required in this cylinder definition, it is only significant when the

existing planes are not parallel and they intersect in the cylinder. This condition causes a partial

cylinder to exist on either side of the first plane. The cylinder half which is nearest the point is

created.

Radius, Between Two Surfaces

Synopsis obj = CYLNDR/surf1,surf2,CENTER,point1,RADIUS,r,plane1,plane2,point2

Description Creates a cylinder tangent to two previously defined sheets. The cylinder is bounded by two previously defined planes.

Parameters

Parameter Description

surf1,surf2 Two existing sheets to be filleted. The two sheets may consist of two planes, a plane and a

cylinder whose axis is parallel to the plane, or two cylinders with parallel axes.

CENTER Minor word that indicates that a point is supplied which approximates the location of the

cylinder axis.

point1 A previously defined point which lies in the general direction of the cylinder axis.

RADIUS Minor word that indicates that the radius of the cylinder is to be specified.

r A positive value which establishes the cylinder radius.

plane1,plane2 Two existing planes which serve as bounding planes for the cylinder.

point2 A previously defined point which may be needed to determine which portion of the cylinder is

created. Although the point is required in this cylinder definition, it is only significant when the

bounding planes are not parallel and their intersection is in the cylinder. This condition causes a

partial cylinder to exist on either side of plane1. The point serves to eliminate one of the

possibilities.

Page 120: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

114

Create Cone Sheet Body

Introduction CONE creates a sheet body whose underlying surface type is a cone. Cones are analytical surfaces. The basic elements required

to create a cone are: a vertex, a vertex angle and/or a radius, and a vector defining the vertex direction.

When a vertex angle is specified, the value is equal to half the included angle of the vertex. The angle is measured from the axis

of the cone to the cone side.

Create Cone Sheet Body Statement List

Function Major Word

Circle, Height, Vertex Half-angle CONE

Two Circles CONE

Center Point, Existing Line CONE

Vertex Pt, Vertex Half-angle, Bound Pts CONE

Circle, Height, Vertex Half-angle

Synopsis obj = CONE/arc,{"PMOD3"|point},d,ANGLE,a

Description Creates a cone by defining an existing circle and specify an angle which is one half of the vertex angle.

The height value is used to define how much of the cone is defined. The height is measured from the plane of the circle in the

direction of the vertex.

Either a point or a Positional Modifier (PMOD3) is required to define on which side of the plane of the circle the vertex lies.

Parameters

Parameter Description

arc An existing arc which serves as the generating curve (directrix) of the cone. By definition the axis

of the cylinder, the generatrix, is normal to the plane of the arc.

PMOD3 A positional modifier which may be used to indicate which side of the existing arc the vertex lies

on. The direction is referenced to the work coordinate system.

point A previously defined point may be used in place of the positional modifier to indicate which side of

the existing arc the vertex lies on. This point establishes a direction only and does not have to lie on

the cone or the axis.

d The distance, along the axis, from the existing arc to the base of the cone. This value establishes the

portion of the cone that is generated.

ANGLE Minor word that indicates that the vertex angle of the cone is to be specified.

a A value equal to one half of the vertex angle. This value establishes the generatrix of the cone.

Two Circles

Synopsis obj = CONE/arc1,arc2

Page 121: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

115

Description Creates a cone between two existing circles. The circles must lie in parallel planes. The cone is limited by the planes containing

the circles.

Parameters

Parameter Description

arc1,arc2 Two existing arcs which lie in parallel planes.

Center Point, Existing Line

Synopsis obj = CONE/CENTER,point,[VECT,x,y,z,]line

Description Creates a cone by specifying a center point and a line which lies on the cone. The line is "revolved" around a vector (which may

be defined) that passes through the specified point. The height of the cone is defined by the length of the specified line.

Parameters

Parameter Description

CENTER Minor word that indicates that a point in the following field is the center point of the cone. The

specified line is "rotated " about this point.

point A previously defined point which defines the center of the cone. The cone axis is defined parallel to

the specified vector and passes through this point.

VECT The optional minor word indicating that the attitude of the cone axis is to be specified by vector

components.

x,y,z The three component values of a vector which establishes the axis of the cone. If omitted the

default axis is parallel to the Z axis of the work coordinate system.

line An existing line which is swept around the imaginary axis forming the generatrix of the cone.

Vertex Point, Vertex Half-angle, Bounding Points

Synopsis obj = CONE/point1,[VECT,x,y,z,]ANGLE,a,point2,point3

Description Creates a cone by defining a vertex point, an angle equal to half of the desired vertex angle, and two points which define planes

normal to the cone axis that bounds the cone creation.

Parameters

Parameter Description

point1 A previously defined point which establishes the vertex of the cone.

VECT The optional minor word indicating that the attitude of the cone axis is to be specified by vector

components.

x,y,z The three component values of a vector which establishes the axis of the cone. If omitted the

default axis is parallel to the Z axis of the work coordinate system.

ANGLE Minor word that indicates that the vertex angle of the cone is to be specified.

a A value equal to one half of the vertex angle. This value establishes the generatrix of the cone.

Page 122: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

116

point2,point3 Previously defined points which lie in the bounding planes of the cone. The bounding planes are

normal to the cone axis.

Create Sphere Sheet Body

Introduction SPHERE creates a sheet body in which the underlying surface type is a sphere. A sphere is an analytical surface.

Create Sphere Statement List

Function Major Word

Arc SPHERE

Center, Radius SPHERE

Tangent To Three Planes SPHERE

Overview | Statement List | Example

Arc

Synopsis obj = SPHERE/arc

Description Creates a sphere by specifying a previously defined arc which represents a great circle of the sphere.

Parameters

Parameter Description

arc An existing arc which is used as the great circle of the sphere.

Center, Radius

Synopsis obj = SPHERE/CENTER,point1,RADIUS,r[,plane,point2]

Description Creates a sphere by specifying a previously defined point as its center, and specifying a radius. You may also limit the display of

the sphere by specifying a previously defined plane object and a previously defined point. The half of the sphere which is created

is on the same side of the plane as the point.

If the specified point lies on the plane, the error message, POINT LIES ON PLANE is displayed.

Parameters

Parameter Description

CENTER Minor word that indicates that the center of the sphere is an existing point.

point1 A previously defined point which establishes the center of the sphere.

RADIUS Minor word that indicates that the radius of the sphere is to be specified.

r A positive value which establishes the sphere radius.

Page 123: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

117

plane An existing plane which serves as a bounding plane.

point2 A previously defined point which determines which side of the bounding plane the partial sphere is

developed on.

Examples Creating a sphere by specifying a previously defined point and a radius.

There is no bounding plane specified.

Declarations ENTITY/PT1,SPHR1

Geometry Definition PT1 =POINT/0,0

Sphere Definition SPHR1=SPHERE/CENTER,PT1,RADIUS,1

A Sphere without a Bounding Plane

Tangent To Three Planes

Synopsis obj = SPHERE/TANTO,plane1,plane2,plane3,CENTER,point,RADIUS,r

Description Creates a sphere tangent to three planes by specifying the three previously defined planes and a previously defined point which

lies in the three dimensional quadrant (octant) of the center of the sphere.

For the sphere to be tangent to all three planes, the planes must all be at right angles to each other.

Parameters

Parameter Description

TANTO Minor word that indicates that the spherical fillet is to be tangent to three planes.

plane1,plane2,plane3 Three existing intersecting planes.

The sphere octant is tangent to planes 1 and 2 and a plane normal to planes 1 and 2

through the intersection point of the three planes.

CENTER Minor word that indicates that a point is to be supplied which approximates the

location of the sphere center.

Page 124: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

118

point A previously defined point which approximates the location of the sphere center and

determines which of eight possible spheres to create.

RADIUS Minor word that indicates that the radius of the sphere is to be specified.

r A positive value which establishes the sphere radius.

Create Plane

Introduction PLANE creates an unbounded plane object using several different methods, as listed below. You may specify several points, or

other existing geometry to establish the plane.

Plane objects have no origin (like a coordinate system) however, the object is displayed at a predictable point depending upon the

definition method used (e.g. if the plane is defined by three points, the object is displayed at the first point).

Create Plane Statement List

Function Major Word

Plane of an Arc or Conic PLANE

Parallel at a Distance PLANE

Perpendicular to a Curve, at a Point PLANE

Three Points PLANE

Two Lines PLANE

Parallel to a Plane, Thru a Point PLANE

Perpendicular to a Plane, Thru a Line PLANE

Principal Plane PLANE

Identify Base Face BASURF

Create Offset Body OFFSRF

Plane of A Curve

Synopsis obj = PLANE/obj

Description Creates a plane object on the plane of a previously defined curve (arc, conic, or planar spline). The plane is displayed at a specific

position relative to the specified object (e.g. at the center of a circle or ellipse, at the focal point of a parabola, etc.).

Parameters

Parameter Description

obj An existing curve (arc, conic, or planar spline) which is used to establish the orientation of the

plane.

Page 125: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

119

Parallel at a Distance

Synopsis obj = PLANE/PARLEL,plane,point,d

Description Creates a plane object by specifying three things:

a previously defined plane to which the new plane is parallel

a previously defined point that indicates on which side of the plane the new plane is created

a distance

Parameters

Parameter Description

PARLEL Minor word that indicates that the new plane is parallel to an existing plane.

plane The existing plane to which the new plane is parallel.

point A previously defined point which indicates on which side of the existing plane the new plane is

created.

If the reference point lies in the existing plane, the error message NO DIRECTION DEFINED is

displayed.

d The distance from the existing plane at which the new plane is to be created.

Perpendicular to a Curve, at a Point

Synopsis obj = PLANE/PERPTO,curve,THRU,point

Description Creates a plane object that is perpendicular to a previously defined curve which passes through a specified point. The plane is

perpendicular to the curve at the point which is the minimum distance point between the curve and the input point.

Parameters

Parameter Description

PERPTO Minor word that indicates that the plane is to be perpendicular to an existing line.

curve An existing curve to which the plane is perpendicular.

THRU Minor word that indicates that the plane is to be based upon a previously defined point.

point A previously defined point which defines the plane.

Three Points

Synopsis obj = PLANE/point1,point2,point3

Description Creates a plane object thru three previously defined points. These points must not be collinear.

Parameters

Parameter Description

Page 126: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

120

point1,point2,point3 Three non-collinear previously defined points which define the plane.

Two Lines

Synopsis obj = PLANE/line1,line2

Description Creates a plane object by specifying two previously defined lines. The plane is displayed where the lines intersect.

Parameters

Parameter Description

line1 An existing line which lies in the plane.

line2 An existing line to which the plane is parallel.

If the two lines are parallel the error message PARALLEL LINES is displayed.

Plane: Parallel to a Plane, Thru a Point

Synopsis obj = PLANE/PARLEL,plane,THRU,point

Description Creates a plane object parallel to a previously defined plane, passing through a previously defined point. The plane is displayed at

the specified point.

Parameters

Parameter Description

PARLEL Minor word that indicates that the new plane is parallel to an existing plane.

plane The existing plane to which the new plane is parallel.

THRU Minor word that indicates that the new plane is to pass through a previously defined point.

point A previously defined point which lies on the new plane at its origin.

Plane: Perpendicular to a Plane, Thru a Line

Synopsis obj = PLANE/PERPTO,plane,THRU,line

Description Creates a plane object which is perpendicular to a previously defined plane and passes thru a specified line. The line must not be

perpendicular to the previously defined plane.

Parameters

Parameter Description

PERPTO Minor word that indicates that the new plane is to be perpendicular to an existing plane.

plane The existing plane to which the new plane is perpendicular.

THRU Minor word that indicates that the new plane is to pass through an existing line.

line An existing line which lies in the new plane.

Page 127: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

121

If the line is perpendicular to the existing plane, the error message LINE PERP TO PLANE is

displayed.

Principal Plane

Synopsis obj = PLANE/{XYPLAN[,Z-coord]|YZPLAN[,X-coord]|XZPLAN[,Y-coord]}[,csys]

Description Creates a plane object parallel to one of the principal planes (XY, YZ, or ZX) of the work coordinate system, or a specified,

previously defined coordinate system. You may specify an offset distance from the desired principal plane. If no offset is

specified, the plane is created in the desired principal plane.

The plane object is displayed at (or parallel to) the origin of the specified coordinate system. The default coordinate system is the

WCS, therefore the plane is created on the specified principal plane if the csys option is omitted.

Parameters

Parameter Description

XYPLAN,YZPLAN,XZPLAN The principal planes of the work coordinate system or of a previously

defined coordinate system.

Z-coord,X-coord,Y-coord Coordinate values along the axis normal to the respective principal plane.

csys A previously defined coordinate system which is used instead of the work

coordinate system.

Identify Base Face

Synopsis obj = BASURF/obj[,IFERR,label:]

Description Allows you to identify the base face of a specified offset body. This statement returns the object identifier of the desired base face.

Parameters

Parameter Description

obj The offset body whose base face you wish to identify. If the specified object is not an offset body,

an error results.

IFERR,label: Indicates a label to which program execution jumps if an error occurs; for example, if the

specified offset surface does not have an associated base surface.

Create Offset Body

Synopsis obj = OFFSRF/obj,distance[,TOLER,edge curve tolerance]

Description Creates an offset body from a previously defined base face at a specified distance. When creating the offset body, the system also

generates edge curves. You may specify an edge curve tolerance to control how accurately the edge curves lie on the body.

Parameters

Parameter Description

Page 128: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

122

obj The existing base face from which the offset body is offset.

distance The distance from the base face along the face normals, at which the new offset body is created.

The distance may be positive or negative but not zero.

TOLER Minor word indicating that a tolerance is to be specified. If none is specified, the default is the

value set in the NX option Preferences->Modeling. You can also read and set this tolerance

using the GPA &DISTOL.

edge curve tolerance Controls how accurately the edge curve lies on the body. The smaller the tolerance value, the

better the edge curve lies on the body.

Create B-Surface

Introduction BSURF creates a body whose underlying surface type is a B-surface.

Create these bodies in three different ways: through a series of points, through a series of curves, and by converting an existing

sheet.

BSURF can create both solid bodies and sheet bodies. Solid bodies are created when you use the optional minor word CLOSED

and the resulting body is closed in both U and V directions, or closed in one direction and the other direction has planar ends.

Patches A patch is a portion of a sheet. Using more patches to create a sheet gives you more localized control over the curvature of the

sheet. B-surface can consist of either a single patch or multiple patches.

Type of B-surfaces Used There are many different types of B-surfaces. The ones used in NX are non-uniform rational B-surfaces, sometimes referred to as

NURB surfaces.

Characteristics of B-surfaces A B-surface has a degree in its U direction and a degree in its V direction. Degree is a mathematical concept; it actually refers to

the degree of the polynomial or rational functions that are used to describe the surface.

A higher degree surface is stiffer in the sense that you have to move its control vertices a long way to produce any appreciable

change in the shape of the surface. Lower degree surfaces are more pliable, and tend to follow their control vertices much more

closely.

In NX, the degree of a B-surface (in either direction) must be between 1 and 24. However, we recommend that you use cubics (a

degree of 3) when creating B-surfaces. Creating lower degree surfaces results in faster performance during subsequent operations

such as machining and display. Using higher degree surfaces reduces the chance of transferring data to other systems which may

not support them. Also, the creation of a high degree surface through many points may lead to unpredictable results.

Create B-Surface Statement List

Function Major Word

Through Points BSURF

Through Curves BSURF

Conic BSURF

Through Curve Mesh BSURF

Swept BSURF

Extract BSURF

Create Sheets from Curves AUTOSF

Page 129: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

123

Through Points

Synopsis obj =

BSURF/objlist,numlist1[,VERT[,numlist2]][,DEGREE,num1[,CLOSED],num2[,CLOSED]][,IFERR,label:]

Description Creates a B-surface using a series of existing points. The points in the list are placed in rows, based on the values in the first

number list which represent the number of points desired in each row.

The default creation mode is to define the surface "through" the points. However, the minor word VERT causes the system to

interpret the points as control vertices. The optional number list included with the VERT parameter can assign weights to these

vertices.

The system automatically decides whether to create a single or multi-patch surface based on the input data.

If the minor word DEGREE is not specified, the system creates a single patch surface. The degrees of a single patch surface are

equal to one less than the number of control vertices in that direction.

If DEGREE is specified, the resulting surface possesses the specified degree values. If the number of points/rows specified is

greater than the degree plus one in that direction, then the system creates a multi-patch surface.

Parameters

Parameter Description

objlist A list or array of existing points which is used to create the surface. The surface either passes

through the points or is controlled by them as vertices. The first point in the list represents the first

point in the first row, the second point represents the second point of the first row, and so on.

numlist1 A numerical list or array which represents the number of points in each row. The first number in

the num list determines the number of points in the first row, as specified in the previous object

list.

A single patch surface has degree based on the number of rows and points per row so maximum

rows and points per row is based on maximum degree = 24. A single patch surface can have from

2 to 25 rows, with each row containing from 2 to 25 points. The degree of the surface in the U

direction is one less than the largest number of points in a row.

A multi-patch surface is not limited in the number of rows and points per row. The degree of the

surface can vary between 1 and 24 in either U or V directions. The minimum number of points in

any row is forced to be one point greater than the surface degree in the U direction. The minimum

number of rows is forced to be one greater than the degree of the surface in the V direction.

VERT Minor word that indicates that the points in the object list represent control vertices.

numlist2 A numerical list or array which contains the positive weights which is assigned to each

corresponding point in the object list.

DEGREE Minor word that indicates that the degree of the surface is to be specified causing a multi-patch

surface to be created unless the degree values meet the requirements of a bezier surface.

num1 A positive numerical value or variable which represents the degree of the surface in the U

direction.

CLOSED Minor word which indicates the surface is to be closed in the U direction.

num2 A positive numerical value or variable which represents the degree of the surface in the V

direction.

CLOSED Minor word which indicates the surface is to be be closed in the V direction.

IFERR,label: Specifies a label to which program execution jumps if the system cannot create the surface from

valid data. This may occur if you are trying to create an extremely large multi-patch surface with

varying row counts.

Page 130: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

124

Through Curves

Synopsis obj = BSURF/CURVE,objlist1[,ENDOF,{,objlist2|,numlist}][,DEGREE,num[,CLOSED]][,IFERR,label:]

Description Creates a B-surface from a series of existing curves using the minor word CURVE. Open and closed curves cannot be mixed.

The surface size is limited by the patch type (single or multiple), as in the Through Points method described on page .

Parameters

Parameter Description

CURVE Minor word that indicates the B-surface is to be created from existing curves.

objlist1 A list or array of existing curves which are used as rows to create the surface. The surface passes

through these curves.

ENDOF Minor word indicating that the direction of the row pole arrays is to be determined by the

following optional list or array. The direction of the data base parameters for each curve is the

default for the direction of the pole array representing each row.

objlist2 An optional list or array of existing points that is used as reference points to indicate the direction

of each row pole array. The closest endpoint is the start of the row pole array.

numlist An optional list or array of PMODS that indicates the direction of each row pole array. Use the

numerical equivalent (1-6) for each desired PMOD.

DEGREE Minor word indicating that the degree of the surface is to be specified for the V direction. The

degree of the U direction determined by the degree of the curves.

num A positive numerical value or variable which represents the degree of the surface in the V

direction.

CLOSED Minor word that indicates the surface is to be in the V direction. If all the curves are closed, the U

direction is also closed.

IFERR,label: Specifies a label to which program execution jumps if the system cannot create the surface from

valid data.

Conic

Synopsis obj =

BSURF/CONSRF,num1,objlist,SPINE,obj1[,ENDOF,obj2][,RHO,nlist][,TOLER,num2][,APEX,obj3][,RESULT,nu

m3][,IFERR,label:]

Description Creates a B-surface using conic surface techniques. To completely define the surface, you must specify enough data to fulfill the

five conditions required to define a conic, such as 3 points and 2 slopes.

For a more detailed description of the various conic surface techniques refer to the Modeling Help.

Parameters

Parameter Description

CONSRF Minor word indicating that the B-surface is to be created using a conic surface technique.

num1 A number indicating the conic surface technique to be used.

Number Conic Surface Technique

1 5 point method

2 4 point, 1 slope method

Page 131: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

125

3 3 point, 2 slope method

4 3 point, apex method

5 2 point, apex, rho method

6 2 point, 2 slope, rho method

7 2 point, 1 slope, arc method

8 3 point, arc method

9 3 point, 2 slope fillet method

10 2 point, 2 slope, rho fillet method

objlist A list of objects whose interpretation depends on the surface creation technique previously specified, as

follows:

Method: 5 Point (num1 = 1)

Objects Interpretation

objlist[1] start edge curve

objlist[2] first interior curve

objlist[3] second interior curve

objlist[4] third interior curve

objlist[5] end edge curve

Method: 4 Point, 1

Slope (num1 = 2)

Objects Interpretation

objlist[1] start edge

curve

objlist[2] start slope

control curve

objlist[3] first interior

curve

objlist[4] second

interior curve

objlist[5] end edge

curve

Method: 3 Point, 2

Slope (num1 = 3)

Objects Interpretation

objlist[1] start edge

curve

objlist[2] start slope

control curve

objlist[3] shoulder

curve

objlist[4] end edge

curve

Page 132: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

126

objlist[5] end slope

control curve

Method: 3 Point, Apex

(num1 = 4)

Objects Interpretation

objlist[1] start edge

curve

objlist[2] shoulder

curve

objlist[3] end edge

curve

objlist[4] apex curve

Method: 2 Point, Apex,

Rho (num1 = 5)

Objects Interpretation

objlist[1] start edge

curve

objlist[2] end edge

curve

objlist[3] apex curve

Method: 2 Point, 2

Slope, Rho (num1 = 6)

Objects Interpretation

objlist[1] start edge

curve

objlist[2] start slope

control curve

objlist[3] end edge

curve

objlist[4] end slope

control curve

Method: 2 Point, 1

Slope, Arc (num1 = 7)

Objects Interpretation

objlist[1] start edge

curve

objlist[2] start slope

control curve

objlist[3] end edge

curve

Method: 3 Point, Arc

(num1 = 8)

Objects Interpretation

Page 133: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

127

objlist[1] start edge

curve

objlist[2] interior curve

objlist[3] end edge

curve

Method: 3 Point, 2

Slope Fillet (num1 = 9)

Objects Interpretation

objlist[1] first surface

objlist[2] curve on first

surface

objlist[3] shoulder

curve

objlist[4] second

surface

objlist[5] curve on

second

surface

Method: 2 Point, 2 Slope,

Rho Fillet (num1 = 10)

Objects Interpretation

objlist[1] first surface

objlist[2] curve on first

surface

objlist[3] second surface

objlist[4] curve on second

surface

SPINE Minor word

indicating

that a spine

curve is to

be

specified.

obj1 The spine

curve to be

used in

surface

creation.

Any curve

can be

specified.

ENDOF Minor word

indicating

that the

direction

along the

spine is to

be

specified.

obj2 A point

which is

closest to

Page 134: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

128

the end

point of the

spine that is

to be used

as the start

point.

RHO Minor word

indicating

that rho

information

is to follow.

The system

ignores this

input if the

specified

surface

creation

technique

does not

require it.

nlist A

numerical

list of rho

information

. The first

number in

this list

indicates

the rho

information

to follow.

Number Rho

Information

1 constant

rho

2 linear

variation of

rho

3 cubic

variation of

rho

4 least

tension rho

If nlist[1] = 1, then nlist[2] is a constant rho value.

If nlist[1] = 2 or nlist[1] = 3, then nlist[2] is the starting rho value and nlist[3] is the ending rho value.

If nlist[1] = 4, then no other input is expected.

TOLER Minor word indicating that a distance tolerance for surface creation is to be specified. If none is specified, the default is the value set in the NX option

Preferences->Modeling. You can also read and set this tolerance using the GPA &DISTOL.

num2 Tolerance which specifies the maximum allowable distance between a true theoretical conic surface and the B-surface approximation that the system

produces. Must be a positive value.

APEX Minor word indicating that the system is to create the apex curve. The system ignores this optional input if the specified surface creation technique does

not allow for it.

obj3 An object identifier of the apex curve, if the option is allowed by the specified surface creation technique. If not, this value is set to NULENT.

RESULT Minor word indicating that a return variable is to be provided to denote error conditions.

num3 A return variable for error messages. The possible values of this variable, and the associated error conditions, are as follows:

Page 135: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

129

Return

Variable

Error Condition

-7 Invalid object list of input objects for this creation method.

-6 Creation method out of range; num1 must be between 1 and 10.

-5 Invalid object list of control curve/surface objects.

-4 Invalid spine object.

-3 Invalid rho information, or missing when required.

-2 Non-positive tolerance.

-1 Unable to allocate enough memory.

0 Successful conic surface creation.

1 Unable to intersect control curve with section plane.

2 No longer returned.

3 No longer returned.

4 Invalid spine curve definition.

5 Unable to construct conic.

6 Maximum size B-surface exceeded.

7 No longer returned.

8 Unable to construct conic, conic spans more than 180 degrees.

9 No longer returned.

10 No longer returned.

11 No longer returned.

12 No longer returned.

13 Unable to build surface through conics.

14 Unable to compute apex point.

15 Iteration produced null patches, no surface created.

16 User abort, no surface created.

17 Unable to build sheet

These error conditions closely match those of the interactive NX option. Refer to the Modeling Help for more detailed

descriptions.

IFERR,label: Specifies a label to which program execution jumps if an error occurs.

Through Curve Mesh

Synopsis obj = BSURF/MESH,obj list1,WITH,obj

list2[,TYPE,num1][,TOLER,num2,num3][,RESULT,num4][,IFERR,label:]

Description Creates a B-surface from a collection of existing curves running in two different directions.

To create a curve mesh surface, you specify a collection of control curves known as primary and cross curves. A set of curves

running in one direction could be designated as the primary curves, while the curves running in a roughly perpendicular direction

would then be the cross curves. You can specify points for cross curves as long as they are the first and/or last objects specified in

the list.

Page 136: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

130

For a more detailed description of the curve mesh surface creation technique refer to the Modeling Help.

Parameters

Paramete

r

Description

MESH Minor word indicating that the B-surface is created from a mesh of existing curves.

obj list1 A numerical list or array of existing curves to be used as primary curves.

WITH Minor word which separates the primary curve object list from the cross curve object list.

obj list2 A numerical list or array of existing objects to be used as cross curves. Points may be included but

only as the first and/or last object in the list.

TYPE Minor word indicating that a mesh type is to follow.

num1 A positive numerical value or variable which represents the mesh surface creation method. If none

is specified, or the value specified is invalid, the default value is 3 (emphasize both directions).

Value Creation Method

1 emphasize primary curves

2 emphasize cross curves

3 emphasize both directions

TOLER Minor word indicating that tolerance values follows. If none is specified, the default is the value set in the NX option Preferences->Modeling. You can also read and set the distance and angle

tolerances using the GPA &DISTOL and &ANGTOL.

num2 A positive numerical value for the distance tolerance. This value determines how closely the surface conforms to the control curves.

num3 A positive numerical value for the intersection tolerance. The system checks the mesh of specified curves for intersection with one another. If the curves do not intersect, the minimum distance

between them must be smaller than this value or the system returns an error message.

RESULT Minor word indicating that a return area is to be provided for error messages.

num4 The return area for error messages. This variable may contain the following values representing the corresponding error messages.

Return

Variable

Error Condition

-3 Error in primary curve specification.

-2 Error in cross curve specification.

-1 Unable to allocate enough memory.

0 Successful surface creation.

1 Unable to approximate primary curve.

2 Unable to approximate cross curve.

3 Maximum size exceeded, no surface created.

4 Unable to convert to poles, no surface created

5 Curves cross or bad selection (intersection parameters are not monotonic increasing).

6 Curves do not intersect within input tolerance.

7 User abort, no surface created.

10 Warning, curve mesh may build surface with inconsistent normals.

Page 137: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

131

IFERR,label: Specifies a label to which program execution jumps if an error occurs.

Swept

Synopsis obj = BSURF/SWPSRF,TRACRV,obj list1[,ENDOF,obj list2],GENCRV,obj list3[,ENDOF,obj

list4][,BLEND,num1][,SPINE,obj1[,ENDOF,obj2]][,ORIENT{,obj3[,ENDOF,obj4]|,xc,yc,zc}][,SCALE{,obj5

[,ENDOF,obj6]|,num list}][,TOLER,num2,num3][,RESULT,num4][,IFERR,label:]

Description Creates a B-surface using sweeping techniques. B-surfaces created in this manner are known as sweep surfaces. A sweep surface

is defined as the shape swept out by a curve moving in a prescribed manner along a path in space. The moving curve is referred

to as the generator curve because it generates the surface as it moves. The path is referred to as the guide curve because it guides

the motion. You can define a sweep surface using either one, two, or three guide curves, and either one or two generator curves.

In the construction of a sweep surface, the directions in which the guide curves were constructed is irrelevant. Instead, the

direction of the sweep surface is determined by a point you specify to indicate the starting end of each curve. These points must

be specified in a consistent manner (on the same end) for all guide, generator, and spine curves. If you don't specify a point, the

direction defaults to the parametric start of the curve.

For a more detailed description of the sweep surface creation techniques refer to the Modeling Help.

Parameters

Parameter Description

SWPSRF Minor word indicating that the B-surface is created using a sweep surface technique.

TRACRV Minor word indicating that guide curves are to follow.

objlist1 An object list containing either one, two, or three guide curves.

ENDOF Minor word indicating that the directions of the guide curves are to be specified.

objlist2 Point objects used to indicate the starting end of each guide curve specified.

GENCRV Minor word indicating that generator curves are to follow.

objlist3 An object list of one or two generator curves.

ENDOF Minor word indicating that the directions of the generator curves are to be specified.

objlist4 Point objects used to indicate the starting end of each generator curve specified.

BLEND Minor word indicating that a blending method is to be specified. This is necessary when using

two generator curves.

num1 A numerical value indicating the blending method to be used between two generator curves.

1 = Linear

2 = Cubic

If only one generator curve is specified, the system ignores this information. If two generator

curves are specified but no blending method, or an invalid value is entered, the default is Linear.

SPINE Minor word indicating that the spine curve object is to follow.

obj1 Specifies the spine curve.

ENDOF Minor word indicating that the direction of the spine curve is to be specified.

obj2 Point object used to indicate the starting end of the spine curve.

ORIENT Minor word indicating that orientation information is to follow. This is required when only one

guide curve is specified. If only one guide curve is specified but the orientation information is

not, the method defaults to a Parallel Sweep. If more than one guide curve is specified along

Page 138: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

132

with orientation information, the system ignores this orientation information.

obj3 A point, curve, or surface used for constant orientation.

ENDOF Minor word indicating that the direction of the orientation curve is to be specified.

obj4 Point object used to indicate the starting end of the orientation curve. If the orientation object is

not a curve, then the system ignores this information.

xc,yc,zc Vector components used for constant orientation.

SCALE Minor word indicating that scale information is to follow. Scale information is required when

only one guide curve is specified. If only one guide curve is specified and scale information is

not, then the default is a constant scale of 1.0. If more than one guide curve is specified along

with scale information, the system ignores this scale information.

obj5 A point or curve used for scale control.

ENDOF Minor word indicating that the direction of the scale curve is to be specified.

obj6 Point object used to indicate the direction of the scale curve. If the scale object is not a curve,

then the system ignores this information.

num list Numerical list of scale information. The first element in this list is the scale method:

1 = Constant

2 = Linear blend

3 = Cubic blend

If the method is constant, then the second element is the constant scale value. If the method is a

blend, then the second and third elements are the start and end scale values.

TOLER Minor word indicating that tolerance values for surface creation are to be specified. If none are

specified, the default is the value set in the NX option Preferences->Modeling. You can also

read and set these tolerances using the GPAs &DISTOL and &ANGTOL.

num2 The distance tolerance for surface creation. This value must be positive. This tolerance is the

maximum allowable distance between a true theoretical sweep surface and the B-surface

approximation that the system produces. This value must be positive.

num3 The angle tolerance for surface creation in degrees. If no value or an invalid value is specified,

the default is 0.5 degrees.

RESULT Minor word indicating that a return variable is to be provided to denote error conditions.

num4 A return variable for error messages. The possible values of this variable and the associated

error conditions are as follows:

Return

Variable

Error Condition

-9 Invalid scale information.

-8 Invalid orientation information.

-7 Invalid guide curves in obj list1.

-6 Invalid data specifying ends of guide curves in obj list2.

-5 Invalid generator curves in obj list3.

-4 Invalid data specifying ends of gen curves in obj list4.

-3 Invalid orientation information.

-2 Invalid scale information.

-1 Unable to allocate enough memory.

0 Successful sweep surface creation.

Page 139: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

133

1 Unable to intersect guide curve with section plane.

2 No longer returned.

3 No longer returned.

4 Invalid spine curve definition.

5 Reference coordinate system unidentified.

6 Maximum size B-surface exceeded.

7 User abort, no surface created.

These error conditions closely match those of the interactive NX option. Refer to the Modeling Help for more detailed

descriptions.

IFERR,label: Specifies a label to which program execution jumps if an error occurs.

Extract

Synopsis obj = BSURF/SURFC,obj[,APPROX][,TOLER,dtol,atol][,IFERR,label:]

Description Creates a new sheet body with an underlying B-surface face type by extracting a face from an existing body. You can either

extract the face into a cubic polynomial B-surface type sheet, or a more general B-surface type sheet.

Parameters

Parameter Description

SURFC Minor word denoting a sheet extraction.

obj The existing face to be extracted.

APPROX Optional minor word indicating that the resulting sheet is to be a polynomial cubic. The system

almost always approximates the sheet, so the original surface type may not be replicated exactly.

If APPROX is not specified, the system attempts to convert the surface type exactly. But, if the

surface is of a type that cannot be converted exactly, then the system approximates it. See the

table on page for a breakdown of each instance and whether the system performs an

approximation or exact replication.

TOLER Optional minor word indicating that two tolerance values are being specified for the extraction.

The tighter (smaller) the tolerances, the more patches the system creates in the resulting B-surface

type sheet. If none is specified, the default is the value set in the NX option Preferences-

>Modeling. You can also read and set these tolerances using the GPAs &DISTOL and

&ANGTOL.

dtol The distance tolerance to be used during the approximation. The maximum allowable distance

between corresponding points on the original body and the new sheet.

atol The angle tolerance to be used during the approximation. The maximum allowable angle between

the face normals at corresponding points.

IFERR,label: Specifies a label to which program execution jumps if an error occurs; for example, if the body

cannot be approximated within the input tolerances, or when the extraction is to be done exactly

and the resulting sheet exceeds the maximum size allowed. In these cases, the following error

message is returned:

Unable To Define Surface, No Surface Created

As mentioned previously, the system may sometimes replicate the original surface type exactly, but other times may have to

approximate them, depending on the original surface type and the method of conversion that you specify. The following table

illustrates each instance. The bracketed numbers refer to the notes listed below.

Page 140: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

134

Original Surface Type Approximation Specified Approximation Not Specified

Cylinder, cone, sphere Approximate Exact

Tabulated cylinder Approximate Exact

Surface of revolution Approximate Exact

Ruled surface Approximate Exact [1]

Fillet surface Approximate Approximate [2]

Sculptured surface Approximate Approximate [2]

B-surface Approximate [3] Exact

Offset surface Approximate Approximate [2]

Bounded planes Exact Exact

Notes: This conversion of a ruled surface type sheet is an approximation if either or both generating curves are an arc or conic.

In these cases, the general B-surface option produces the same result as the polynomial cubic option.

If the selected sheet is already a polynomial cubic, no conversion is necessary.

Create Sheets from Curves

Synopsis obj = AUTOSF/obj list[,BYLAYR][,CNT,count][,IFERR,label:]

Description Creates sheet bodies from a list of specified curves. The system processes these curves to generate sheet bodies whose underlying

surface type can be one of the following: bounded planes, cylinders, tabulated cylinders, and truncated cones. AUTOSF does not

create ruled surfaces.

The object identifier of each sheet body created is returned in another object list. The system does not return any more sheets than

allowed for in the return list. For example, if you create 20 sheets but have only allocated space in the return list for 10 elements,

the system only returns 10 sheets.

For a more detailed discussion of important design considerations which you should be aware of before attempting to create

sheets from curves, refer to the Modeling Help.

Parameters

Parameter Description

obj list A list of objects to be processed into sheets. The system only processes lines, arcs, circles,

ellipses, planar splines, and planar B-curves.

BYLAYR Optional minor word which indicates the system is to process the specified curves by layer in

order to reduce virtual memory usage.

CNT Minor word indicating that a count of objects returned is desired.

count The number of objects returned in the list.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include

virtual memory exhausted, etc.

Page 141: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

135

Features

Introduction This topic covers the GRIP statements used to perform solid body functions. The statements have been grouped into two separate

sections, to help you find the specific statement you want as quickly as possible.

Feature Creation operations fall into the following categories:

Feature Creation Methods

Feature Operation Statements

Parametric vs. Non-Parametric Solid Bodies Many of the creation statements in this section create parametric solid bodies. Any creation parameters (e.g., dimensions of a

block) are stored with the solid body and may be edited. Usually the resulting body is associative with any geometry used to

construct the body.

Many of the operation statements result in a non-parametric body. Association between the original bodies and the construction

curves (or sheets) may also be lost.

The description for each statement explains whether or not the resulting solid body is parametric.

Specifying Modeling Tolerances If a Modeling Application statement allows you to specify a distance or angle tolerance value and you do not provide one, the

default is the value set in the NX option for Preferences->Modeling. You can read and set these tolerance values using the GPAs

&DISTOL and &ANGTOL.

If a Modeling Application statement performs an approximation and that statement does not allow the minor word TOLER, the

system uses the tolerance value set in NX.

Shading Solid Bodies If you wish to create the image file used to display shaded images of solid bodies, refer to the SOLPIX statement description.

Feature Statements on Assemblies When using feature statements on assemblies, you need to make sure that the operation (or creation statement) is performed on

objects in the work part. If the objects are not in the work part, the statement is not executed and an error is reported.

Features Statements List

Function Statement Format

CREATE SOLID BLOCK obj = SOLBLK/ORIGIN,xc,yc,zc

,SIZE,dx,dy,dz

[,IFERR,label:]

CREATE EXTRUDED SOLID obj = SOLEXT/obj list,HEIGHT,h[,AXIS,i,j,k]

[,IFERR,label:]

CREATE SOLID PRISM obj = SOLPRI/ORIGIN,xc,yc,zc,

HEIGHT,j

.DIAMTR,d

,SIDE,s

[,AXIS,i,j,k]

[,IFERR,label:]

SEW SHEETS TO CREATE BODY obj = SEW/obj list[,IFERR,label:]

CREATE SOLID CONE obj = SOLCON/ORIGIN,xc,yc,zc

,HEIGHT,h

,DIAMTR,d1,d2

[,AXIS,i,j,k]

[,IFERR,label:]

Page 142: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

136

CREATE SOLID CYLINDER obj = SOLCYL/ORIGIN,xc,yc,zc

,HEIGHT,h

,DIAMTR,d

[,AXIS,i,j,k]

[,IFERR,label:]

CREATE SOLID OF REVOLUTION obj = SOLREV/obj list,ORIGIN,xc,yc,zc

,ATANGL,a

[,AXIS,i,j,k]

[,IFERR,label:]

CREATE SOLID SPHERE obj = SOLSPH/ORIGIN,xc,yc,zc

,DIAMTR,d

[,IFERR,label:]

CREATE SOLID TORUS obj = SOLTOR/ORIGIN,xc,yc,zc

,RADIUS,r1,r2

[,AXIS,i,j,k]

[,IFERR,label:]

CREATE SOLID TUBE OR CABLE obj = SOLTUB/obj list

,DIAMTR,d1[,d2]

[,TOLER,t]

[,IFERR,label:]

BLEND/CHAMFER SOLID EDGES BLEND/obj,{RADIUS|CHAMFR},num

[,obj list1] [,VERT,obj list2

[,IFERR,label:]

CUT SOLID obj list = SOLCUT/obj list1,WITH,obj[,CNT,c1[,c2]]

[,IFERR,label:]

FIX BLEND/CHAMFER BLENFX/obj list[,IFERR,label:]

INTERSECT SOLIDS obj list = INTERS/obj,WITH,obj list1

[,CNT,c][,IFERR,label:]

CREATE SOLID SECTION obj list = SECT/obj list1,WITH,obj[,CNT,c]

[,IFERR,label:]

SPLIT SOLIDS obj list = SPLIT/obj list1,WITH,obj[,CNT,c]

[,IFERR,label:]

SUBTRACT SOLIDS obj list = SUBTRA/obj,WITH,obj list[,CNT,C]

[,IFERR,label:]

UNITE SOLIDS obj list = UNITE/obj,WITH,obj list,[,CNT,c]

[,IFERR,label:]

SOLID CONTAINMENT num = ENCONT/obj1,obj2,[,IFERR,label:]

SUBDIVIDE FACE obj list = FACDIV/obj1,WITH,obj2[,CNT,c]

[,IFERR,label:]

MOVE FACE FACMOV/obj,TRIM,HEIGHT,h[,AXIS,i,j,k]

[,IFERR,label:]

SOLID BOX COORDINATES obj list = SOLBOX/obj,[,IFERR,label:]

RETURN EDGE OR FACE IDENTIFIERS obj list = SOLENT/obj{,FACE|,EDGE}

{,ALL|,seqno}[,IFERR,label:]

Page 143: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

137

Feature Creation Statements

Introduction This topic contains the GRIP statements necessary to create solid bodies, including: block, cone, cylinder, sphere, prism, torus,

solid of revolution, extruded solid, sew sheets, and solid tubes and cables.

Feature Creation Statement List

Function Major Word

Block SOLBLK

Extruded Solid SOLEXT

Prism SOLPRI

Sew Sew

Solid Cone SOLCON

Solid Cylinder SOLCYL

Solid of Revolution SOLREV

Solid Sphere SOLSPH

Torus SOLTOR

Tube or Cable SOLTUB

Block

Synopsis obj = SOLBLK/ORIGIN,xc,yc,zc,SIZE,dx,dy,dz[,IFERR,label:]

Description Allows you to create a parametric solid block of any size within NX Modeling limitations. (NX has a part size limit of 1000 x

1000 x 1000 meters. The command will fail if outside the limit). The origin is on a corner of the block. The edges of the block are

aligned with the axes of the WCS.

Parameters

Parameter Description

ORIGIN Minor word indicating that the following values specify the block's origin.

xc,yc,zc Work coordinates which specify the origin of the block.

SIZE Minor word indicating that the following values specify the size of the block.

dx,dy,dz Three length values for the block's edges. These values can be positive or negative, and determine

the placement of the block relative to its origin. A positive value causes the system to create that

particular edge in the positive direction of the corresponding axis. A negative value causes the

system to create that edge in the negative direction of the corresponding axis.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include an

invalid origin specification, invalid parameter value, etc.

Page 144: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

138

Extruded Solid

Synopsis obj = SOLEXT/obj list,HEIGHT,h[,AXIS,i,j,k][,IFERR,label:]

Description Allows you create a parametric solid body by sweeping a series of curves a specified distance in a specified direction. The

specified curves may form an open or closed boundary.

Parameters

Parameter Description

obj list A list of curves to be extruded along the specified axis. If the specified curves are not closed, the

system creates a solid sheet. A closed loop of curves creates a solid. The curves do not have to be

coplanar. The maximum number of objects allowed is 514.

When attempting to create a hole, we recommend that you first specify the objects that make up

the hole, then specify the remaining peripheral objects.

In the case of a closed loop of curves, if the curves are not coplanar, then the system attempts to

attach a sheet body to the loop. If no sheet can be attached, then the extrusion fails. Planar,

spherical, conical, cylindrical, and toroidal bodies can be attached.

HEIGHT Minor word indicating that the next value specifies the height of the extruded solid.

h The distance that the specified curves sweep in the specified direction. Values can be positive or

negative. Positive values sweep in the direction of the axis vector, negative values sweep in the

opposite direction of the axis vector.

AXIS Optional minor word indicating that the next values specify the axis for the extruded solid.

i,j,k Specifies a vector which defines the direction for the sweep.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include an

invalidly specified axis, parameter values not within correct ranges, number of objects exceeds

maximum, invalid objects listed, the system was unable to find a body while attaching a sheet to a

face, the geometry fails to pass checks while subdividing a face, etc.

Prism

Synopsis obj = SOLPRI/ORIGIN,xc,yc,zc,HEIGHT,h,DIAMTR,d,SIDE,s,[,AXIS,i,j,k][,IFERR,label:]

Description Allows you to create a non-parametric solid prism.

Parameters

Parameter Description

ORIGIN Minor word indicating that the following values specify the prism origin.

xc,yc,zc Work coordinate values specifying the origin of the prism. The origin is the center of one of the

end faces.

HEIGHT Minor word indicating that the following value specifies the prism height.

h The height of the prism. The height is the distance between the two end faces. A positive height

value causes the system to create the prism in the same direction as the prism axis vector. A

negative height value causes the system to create the prism in the opposite direction of the axis

vector.

DIAMTR Minor word indicating that the following value specifies the inscribed diameter.

d The inscribed diameter value, representing a cylinder which is tangent to all sides of the prism.

Page 145: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

139

SIDE Minor word indicating that the following value specifies the number of sides for the prism.

s The number of sides for the prism. Must be a non-negative number. A value of zero, 1, or 2

causes the system to create a 3-sided prism.

AXIS Optional minor word indicating that the following values specify the axis of the prism.

i,j,k Specifies a vector which defines the axis of the prism. The system defines the prism axis parallel

to the specified vector. If none is specified, the system defines the axis parallel to the ZC axis of

the WCS.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include an

invalidly specified axis or origin, parameter values not within the correct range, etc.

Inscribed Diameter Measurement; Six Sided Prism

Sew

Synopsis obj = SEW/obj list[,IFERR,label:]

Description Creates a parametric solid by sewing a series of sheets together. The edges of the sheets must be coincident to within the

Modeling distance tolerance, and generally form a closed volume. To read or set the current distance tolerance, use the GPA

&DISTOL.

Parameters

Parameter Description

obj list A list of of valid NX sheets to be sewn together to form a solid. A maximum of 514 objects can

be listed.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include the

operation forms a self-intersecting object, exceeding the maximum allowable number of objects,

invalid objects in list, sheets do not form a single solid, etc.

Solid Cone

Synopsis obj = SOLCON/ORIGIN,xc,yc,zc,HEIGHT,h,DIAMTR,d1,d2[,AXIS,i,j,k][,IFERR,label:]

Description Allows you to create a parametric solid cone.

Parameters

Parameter Description

Page 146: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

140

ORIGIN Minor word indicating that the next values specify the origin of the cone.

xc,yc,zc Work coordinate values specifying the cone's origin. The origin is either the center of one of its

circular faces or at it's apex, depending on whether the height value specified is positive or

negative.

HEIGHT Minor word indicating that the next value specifies the height of the cone.

h The height of the cone. The height is the distance between the two circular faces of the cone.

Height can be positive or negative and determines one of two possible cones.

DIAMTR Minor word indicating that the next values specify the cone's diameter.

d1 The diameter of the cone at its origin.

d2 The diameter of the cone at its apex.

AXIS Optional minor word indicating that the next values specify define the cone's axis.

i,j,k Specifies a vector which defines the axis of the cone. The system defines the cone axis parallel to

the specified vector. If none is specified, the system defines the axis parallel to the ZC axis of the

WCS.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include an

invalidly specified axis or origin, parameter values not within the correct range, etc.

Solid Cylinder

Synopsis obj = SOLCYL/ORIGIN,xc,yc,zc,HEIGHT,h,DIAMTR,d[,AXIS,i,j,k][,IFERR,label:]

Description Allows you to create a parametric solid cylinder by specifying its origin, height, and diameter.

Parameters

Parameter Description

ORIGIN Minor word indicating that the following coordinate values specify the cylinder origin.

xc,yc,zc Work coordinate values which specify the origin of the cylinder. The origin is located on one of

the circular faces of the cylinder.

HEIGHT Minor word indicating that the following value specifies the cylinder height.

h The distance between the two circular faces of the cylinder. The height can be positive or negative

and determines one of two possible cylinders.

DIAMTR Minor word indicating that the following value represents the cylinder diameter.

d The diameter of the cylinder.

AXIS Optional minor word indicating that the following values specify the cylinder axis.

i,j,k Specifies a vector which defines the axis of the cylinder. The system defines the axis parallel to

this vector. If none is specified, the system defines the cylinder axis parallel to the ZC axis of the

WCS.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include an

invalidly specified axis or origin, parameter values not within the correct range, etc.

Page 147: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

141

Solid of Revolution

Synopsis obj = SOLREV/obj list,ORIGIN,xc,yc,zc,ATANGL,a[,AXIS,i,j,k][,IFERR,label:]

Description Allows you to create a solid of revolution by revolving a series of curves around a specified axis. The resulting solid is

parametric. The specified curves may form an open or closed boundary. Self intersecting solids are not allowed.

Parameters

Parameter Description

obj list A series of curves to be revolved around the specified axis. If the specified curves are not closed,

the system creates a solid sheet. A closed loop of curves creates a solid. The curves do not have to

be coplanar. The maximum number of objects allowed is 514.

When attempting to create a hole, first specify the objects that make up the hole, then specify the

remaining peripheral objects.

In the case of a closed loop of curves, if the curves are not coplanar, then the system attempts to

attach a sheet body to the loop. If no body can be attached, then the extrusion fails. Planar,

spherical, conical, cylindrical, and toroidal bodies can be attached.

ORIGIN Minor word indicating that the following values specify the origin for the axis of rotation.

xc,yc,zc Work coordinates specifying the origin of the solid.

ATANGL Minor word indicating that the following value specifies the angle of rotation.

a The angle of rotation for the solid. The positive direction is determined by the right hand rule for

rotation. Align the thumb of your right hand with the displayed vector. The direction in which your

fingers curl is the direction of positive rotation.

AXIS Minor word indicating that the following values specify the axis of rotation.

i,j,k Specifies a vector which defines the axis of rotation. The system defines the axis as parallel to the

specified vector, passing through the origin. If no axis is specified, the YC axis is used.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include: an

invalidly specified axis or origin; parameter values not within correct ranges; number of objects

exceeds maximum allowed; invalid object types listed; the geometry fails to pass checks while

subdividing a face; the system is unable to find a body while attaching a sheet to a face; etc.

Solid Sphere

Synopsis obj = SOLSPH/ORIGIN,xc,yc,zc,DIAMTR,d[,IFERR,label:]

Description Allows you to create a parametric solid sphere by specifying its center and diameter.

Parameters

Parameter Description

ORIGIN Minor word indicating that the following coordinate values specify the center of the sphere.

xc,yc,zc Work coordinate values specifying the sphere's center.

DIAMTR Minor word indicating that the following value specifies the sphere's diameter.

d The diameter of the sphere. Value must be positive.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include an

invalidly specified origin, parameter values not within correct ranges, etc.

Page 148: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

142

Torus

Synopsis obj = SOLTOR/ORIGIN,xc,yc,zc,RADIUS,r1,r2,[,AXIS,i,j,k][,IFERR,label:]

Description Allows you to create a non-parametric solid torus by specifying its origin, major radius, and minor radius.

Parameters

Parameter Description

ORIGIN Minor word indicating that the following values specify the origin of the torus.

xc,yc,zc Work coordinate values specifying the origin.

RADIUS Minor word indicating that the following values specify major and minor torus values.

r1 Major radius of the torus. If you enter a negative major radius, then the minor radius must be

greater than the absolute value of the major radius. Refer to Figure 1-9, Figure 1-10, and Figure 1-

11.

r2 Minor radius of the torus. The minor radius cannot be negative.

AXIS Optional minor word indicating that the following values specify the axis of the torus.

i,j,k Specifies a vector to define the torus axis. The system defines the axis parallel to this vector. If

none is specified, the system defines the axis parallel to the ZC axis of the WCS.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include an

invalidly specified axis or origin, parameter values not within the correct range, etc.

Torus: Positive Radii

Page 149: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

143

Torus: Major Radius Less than Minor Radius, Both Positive

Tube or Cable

Synopsis obj = SOLTUB/obj list,DIAMTR,d1[,d2][,TOLER,t][,IFERR,label:]

Description Allows you to create a parametric solid tube or cable along a path of curves. The path of curves must form an open boundary.

Parameters

Parameter Description

obj list A list of curves which form the path for defining the tube or cable. Be careful when you define the

path because you are not allowed to create a self intersecting solid. All NX curves are valid. The

curves must form a continuous chain, and may not be a closed boundary.

Best behavior is achieved when adjoining curves have tangent slopes at their point of intersection.

DIAMTR Minor word indicating that the following value specifies the outer diameter of the tube or cable.

d1 The outer diameter of the tube or cable.

d2 Optional value for the inner diameter of the tube or cable. If this is not specified, the inner

diameter defaults to zero.

TOLER Optional minor word indicating that the following value specifies the curve approximation

tolerance. If none is specified, the default is the value set in the NX option Preferences->Modeling.

You can also read and set this tolerance using the GPA &DISTOL.

t The curve approximation tolerance. If the path of curves contains curves other than lines and arcs,

they are approximated by a series of lines and arcs. This tolerance controls how accurately the

curves are approximated. The smaller the value, the more approximating segments are used.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include self

intersecting solid, negative tolerance, non-continuous curve path.

Feature Operations

Introduction This topic contains the GRIP statements necessary to perform various solid body operations functions, including: unite, intersect,

subtract, split, section, cut, blend/chamfer, and fix.

Page 150: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

144

Feature Operation Statement List

Function Major Word

Blend/Chamfer BLEND

Cut Solid SOLCUT

Fix Blend/Chamfer BLENFX

Intersect INTERS

Section SECT

Split SPLIT

Subtract SUBTRA

Unite INITE

Solid Containment ENCONT

Subdivide a Face with a Curve FACDIV

Move Face FACMOV

Solid Box Coordinates SOLBOX

Return Edge or Face Identifiers SOLENT

Blend/Chamfer

Synopsis BLEND/obj,{RADIUS|CHAMFR},num[,obj list1][,VERT,obj list2][IFERR,label:]

Description Allows you to modify a solid by either rounding (blend) or beveling (chamfer) specified edges of the solid.

The BLEND statement works in much the same way as the Blend option in the Modeling application except that you may only

do fixed radius blends. See the Modeling Help.

Parameters

Parameter Description

obj The solid to be modified.

RADIUS Minor word indicating that a blend operation is to be performed on the solid.

CHAMFR Minor word indicating that a chamfer operation is to be performed on the solid.

num When used with the RADIUS minor word, num is the positive radius of the blend.

When used with the CHAMFR minor word, num is the offset distance between the intersection of

the specified edges. When one edge is curved, the offset is measured along the path of the curved

edge.

obj list1 First list of point objects which identify the edges of the solid to blend/chamfer. The points

identify the edges by distance. If neither list of points is specified, then the system

blends/chamfers every edge in the solid.

VERT Optional minor word specifies that the following list of points identifies vertices on the solid.

obj list2 Second list of point objects which identify vertices on the solid. The points identify the vertices by

distance. The edges involved in these vertices are blended/chamfered. If you do not specify either

list of points, then the system blends/chamfers every edge in the solid.

Page 151: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

145

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include:

illegal object specified; radius values must be positive, etc.

Cut Solid

Synopsis obj list = SOLCUT/obj list1,WITH,obj[,CNT,c1[,c2]][,IFERR,label:]

Description Allows you to cut a series of solids with a cutting sheet body. The solids are divided into two or more portions by the cutting

sheet. The resulting solid bodies are non-parametric.

Parameters

Parameter Description

obj list1 A list of solids to be cut. Maximum number allowed is 1000.

WITH Minor word indicates that the solids listed are to be cut by the following sheet body.

obj The cutting sheet body. Must have an underlying surface type of either a planar or cylindrical

surface.

CNT Optional minor word indicating that a number is to be returned.

c1 Variable which returns the total number of resulting solids.

c2 Variable which returns the number of solids on the primary side of the cutting sheet. You must

first specify variable c1 for c2 to be allowed. For a planar surface type, the primary side is on the

face normal side of the sheet. For a cylindrical surface type, the primary side of the sheet is

outside of the cylinder. All objects not returned by this variable lie on the other side of the cutting

sheet. See the example below.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include:

invalid cutting sheet type; maximum number of objects exceeded, etc.

Fix Blend/Chamfer

Synopsis BLENFX/obj list[,IFERR,label:]

Description Fixes the blends and chamfers of solids. Blends and chamfers must be fixed before the solid is actually modified.

Fixing the blend or chamfer attribute changes it into a face with the appropriate blending sheet body geometry. The original edge

is deleted.

The BLENFX statement is no longer necessary. The BLEND statement makes BLENFX obsolete.

Parameters

Parameter Description

obj list A list of solids to be fixed. Maximum number allowed is 1000.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include:

invalid object type in list; could not fix blends in body; maximum number of objects exceeded, etc.

Intersect

Synopsis obj list = INTERS/obj,WITH,obj list1[,CNT,c][,IFERR,label:]

Page 152: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

146

Description Allows you to create a separate solid from those portions shared by multiple solids. You can intersect solids with solids, sheet

bodies with sheet bodies, and a solid with a sheet body; however, you cannot mix solids and sheets in the the object list of tool

solids. The resulting body is parametric only if a single body results. When multiple bodies result, they are not parametric.

Parameters

Parameter Description

obj The target solid.

WITH Minor word indicates that the target solid is to be intersected with the following list of solids.

obj list1 A list of tool solids you wish to add to the target solid. Objects must be similar (all solids or all

sheets). Maximum allowable number is 1000.

CNT Optional minor word indicates that a count of solid objects is to be returned

c Variable which returns the number of solid objects.

IFERR, label: specifies a label to which program execution jumps if an error occurs. Possible errors include:

mixture of sheet and solid tool bodies; maximum number of tool solids exceeded; illegal object

type in list, etc.

Section

Synopsis obj list = SECT/obj list1,WITH,obj[,CNT,c][,IFERR,label:]

Description Allows you to create cross-sections of one or more solids by specifying a series of solids and a cutting sheet body. This creates a

set of curves marking the section outline where the cutting sheet body intersects the solids. SECT is similar to the SPLIT

statement, but in this case the solid remains intact. The curves produced are nonparametric (i.e., they are not associated with the

solids of the cutting sheet body).

See Also To cross-section a sheet body using a plane or another sheet body, use the INTSEC command.

Parameters

Parameter Description

obj list1 A list of solids to be cross-sectioned. Maximum number allowed is 1000.

WITH Minor word indicates that the solids listed are to be cross-sectioned by the following sheet body.

obj The cutting sheet body. Must be either an analytic plane (type 46) or a cylindrical sheet body.

CNT Optional minor word indicates that a count of curves is to be returned.

c Variable which returns the number of curves created for the cross-section.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include:

invalid cutting sheet type; maximum number of objects exceeded, etc.

Split

Synopsis obj list = SPLIT/obj list1,WITH,obj[,CNT,c][,IFERR,label:]

Page 153: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

147

Description Allows you to divide solid or sheet bodies into two or more portions using a sheet or plane. The resultant solids are distinct, and

each can be selected and edited, and they are nonparametric.

Parameters

Parameter Description

obj list1 A list of solids you wish to be split. Maximum number allowed is 1000.

WITH Minor word indicates that the solids specified in the list are to be split by the following sheet.

obj The sheet which splits the solids. Must have either an underlying surface of revolution, tabulated

cylinder, B-surface, or plane.

CNT Optional minor word indicates that a count of solid objects is to be returned.

c Variable which returns the number of solid objects.

IFERR, label: Specifies a label to which program execution jumps if an error occurs. Possible errors include:

invalid type of splitting sheet; invalid bodies during subtraction; Boolean failure, maximum

number of objects exceeded, etc.

Subtract

Synopsis obj list = SUBTRA/obj,WITH,obj list[,CNT,c][,IFERR,label:]

Description Allows you to subtract solids from solids, sheet bodies from sheet bodies, and sheet bodies from solids, as long as the sheet body

cuts the solid completely. The resulting body is parametric only if a single body results. When multiple bodies result, they are not

parametric.

Parameters

Parameter Description

obj The target solid.

WITH Minor word indicates that the following list of objects is to be subtracted from the target solid.

obj list1 A list of tool solids you wish to subtract from the target solid. Maximum number allowed in list is

1000.

CNT Optional minor word indicating that a count of solid objects is to be returned.

c Variable which returns the number of solid objects.

IFERR, label: Specifies a label to which program execution jumps if an error occurs. Possible errors include:

non-manifold body or boundary; maximum number of tool objects exceeded; illegal object type in

list, etc.

Unite

Synopsis obj list = UNITE/obj,WITH,obj list1[,CNT,c][,IFERR,label:]

Description Allows you to combine several solids into one by specifying a target solid and a list of solids to be united to the target. The

resulting solid body is parametric. In order for the unite operation to be useful, the specified solids must intersect.

In order to unite sheet bodies, they must meet at their edges unless they have overlapping faces.

Page 154: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

148

Parameters

Parameter Description

obj The target solid.

WITH Minor word specifying that the target solid is united with the following object list.

obj list1 List of solid objects to be united with the target solid. Maximum allowed in list is 1000.

CNT Optional minor word indicating that a count of solid objects is to be returned.

c Variable which returns the number of solid objects.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. Possible errors include:

maximum amount of objects exceeded; illegal object specified; cannot unite opposed sheets; can't

unite solid with sheet, etc.

Solid Containment

Synopsis num = ENCONT/obj1,obj2,[,IFERR,label:]

Description Determines if a point is inside, outside, or on a body, face or edge.

The system returns a value indicating where the point lies in regard to the object. Values are as follows:

1 = IN

2 = OUT

3 = ON

The return values depend upon the object type that you select for obj2 (body, face, or edge) and the location of the point you

specify for obj1 with respect to obj2's object type. Three separate cases occur since there are three object types that you can

specify.

To illustrate these separate cases, consider a cube. A cube is a body with six faces and 12 edges. The point you specify is always

with respect to the object you select (body, face, or edge). The following cases can occur:

obj2 = body

If the point you specify is inside the cube, the system returns 1= IN. If you specify a point that is not inside the cube and not lying

on a face or edge, then the system returns 2= OUT. If you specify a point that is not inside the cube but lies on any face or edge,

then the system returns 3= ON.

obj2 = face

If the point you specify lies on the face but not on an edge, then the system returns 1 =IN. If the point you specify does not lie on

a face and does not lie on an edge, then the system returns 2 = OUT. If the point you specify lies anywhere on an edge, then the

system returns 3= ON.

obj2 = edge

If the point you specify lies on an edge but does not lie on an end point, then the system returns 1 = IN. If the point you specify

does not lie on the selected edge, then the system returns 2 = OUT. If the point you specify is the end point of a selected edge,

then the system returns 3 = ON.

Parameters

Parameter Description

obj1 The object identifier of the point.

obj2 The object identifier of a body, face, or edge.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. For example, an error

results if obj1 and obj2 are not properly defined.

Page 155: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

149

Subdivide a Face with a Curve

Synopsis obj list = FACDIV/obj1,WITH,obj2[,CNT,c][,IFERR,label:]

Description Subdivides a specified face with an existing curve. The system returns an object list of new faces created. This statement does not

affect the parametric data of a body.

Parameters

Parameter Description

obj1 The object identifier the solid face to be subdivided.

WITH Minor word indicates the subdivision of the face with the following curve.

obj2 The object identifier of the curve to be used in subdividing the face.

CNT Optional minor word indicating that a number is to be returned.

c A variable which returns the number of new faces created.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. For example, an error

occurs if obj1 or obj2 is not properly defined, or if the face could not be subdivided given the

input data.

Move Face

Synopsis FACMOV/obj,TRIM,HEIGHT,h[,AXIS,i,j,k][,IFERR,label:]

Description Moves a specified face in a given direction. The resulting solid body is non-parametric.

Parameters

Parameter Description

obj The object identifier of the solid face to be moved.

TRIM Minor word indicating that existing faces are trimmed as a result of the move.

HEIGHT Minor word indicating that the next value specifies the distance of the move.

h Value specifying the distance of the move.

AXIS Optional minor word indicating that the next values specify the axis for the move.

i,j,k Specifies a vector which defines the direction for the sweep. The default axis is 0,0,1.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. For example, an error

occurs if obj or the axis are not defined properly, or if an invalid move operation is attempted.

Solid Box Coordinates

Synopsis obj list = SOLBOX/obj,[,IFERR,label:]

Page 156: GRIP Reference Guide - Home - Siemens PLM …community.plm.automation.siemens.com/.../1/6510_GRIP-Reference-… · GRIP Reference Guide . ... Three Dimensional Vector Offset ... Parallel/Perp

150

Description Determines the coordinates of the diagonal corners of a box containing a specified solid body, face, or edge. The box is aligned

with the absolute coordinate system. This box contains the specified solid body, face, or edge. The box is usually close to the

minimum possible size, but this is not guaranteed.

The system returns a six word array indicating the coordinates of the diagonal corners of the box as follows:

minimum XC coordinates of the box

minimum YC coordinates of the box

minimum ZC coordinates of the box

maximum XC coordinates of the box

maximum YC coordinates of the box

maximum ZC coordinates of the box

Parameters

Parameter Description

obj The object identifier of the solid body, face, or edge.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. For example, an error

occurs if obj is not properly defined.

Return Edge or Face Identifiers

Synopsis obj list = SOLENT/obj{,FACE|,EDGE}{,ALL|,seqno}[,IFERR,label:]

Description Returns the object identifiers of faces or edges of a specified body or face. The system returns an object list of face or edge

identifiers.

A face or edge identifier is an object that may be used to identify the face or edge of a body in another statement (e.g.,

FACMOV).

The objects returned in the object list are not order dependent. This command makes no claims as to which object appears first in

the object list. Use the SOLBOX and ENCONT commands to assist in identifying edges.

Parameters

Parameter Description

obj The object identifier of the body whose edge or face you wish to identify.

FACE Minor word indicating that you want to return the identifiers of faces.

EDGE Minor word indicating that you want to return the identifiers of edges.

ALL Minor word indicating that you want to return all face or edge identifiers.

seqno Specifies which face or edge to return.

IFERR,label: Specifies a label to which program execution jumps if an error occurs. For example, an error

occurs if obj is not properly defined, or if the sequence number is poorly defined.