Jlinkug
Jlinkug
                                                March 2010
Copyright © 2009 Parametric Technology Corporation and/or Its Subsidiary Companies. All Rights
Reserved.
User and training guides and related documentation from Parametric Technology Corporation and its
subsidiary companies (collectively "PTC") are subject to the copyright laws of the United States and other
countries and are provided under a license agreement that restricts copying, disclosure, and use of such
documentation. PTC hereby grants to the licensed software user the right to make copies in printed form of
this documentation if provided on software media, but only for internal/personal use and in accordance with
the license agreement under which the applicable software is licensed. Any copy made shall include the PTC
copyright notice and any other proprietary notice provided by PTC. Training materials may not be copied
without the express written consent of PTC. This documentation may not be disclosed, transferred, modified,
or reduced to any form, including electronic media, or transmitted or made publicly available by any means
without the prior written consent of PTC and no authorization is granted to make copies for such purposes.
Information described herein is furnished for general information only, is subject to change without notice,
and should not be construed as a warranty or commitment by PTC. PTC assumes no responsibility or
liability for any errors or inaccuracies that may appear in this document.
The software described in this document is provided under written license agreement, contains valuable
trade secrets and proprietary information, and is protected by the copyright laws of the United States and
other countries. It may not be copied or distributed in any form or medium, disclosed to third parties, or used
in any manner not provided for in the software licenses agreement except with written prior approval from
PTC.
For Important Copyright, Trademark, Patent, Licensing and Data Collection Information: For
Windchill products, select About Windchill at the bottom of the product page. For InterComm products, on
the Help main page, click the link for Copyright 20xx. For other products, click Help > About on the main
menu of the product.
                                                                                                                   Contents - i
       Compact Data Classes...................................................................................... 3-4
       Unions ............................................................................................................... 3-5
       Sequences ........................................................................................................ 3-6
       Arrays ................................................................................................................ 3-7
       Enumeration Classes ........................................................................................ 3-9
       Action Listeners............................................................................................... 3-10
       Utilities............................................................................................................. 3-12
    Creating Applications............................................................................................. 3-14
       Importing Packages......................................................................................... 3-14
       Exception Handling ......................................................................................... 3-15
Chapter 4: J-Link Programming Considerations                                                                                 4-1
    J-Link Thread Restrictions ....................................................................................... 4-2
    Optional Arguments to J-Link Methods.................................................................... 4-2
        Optional Returns for J-Link Methods................................................................. 4-3
    Parent-Child Relationships Between J-Link Objects ............................................... 4-3
     Run-Time Type Identification in J-Link ................................................................... 4-4
Chapter 5: The J-Link Online Browser                                                                                         5-1
    Online Documentation — J-Link APIWizard ............................................................ 5-2
        Installing the APIWizard .................................................................................... 5-2
        Starting the APIWizard ...................................................................................... 5-2
        Web Browser Environments.............................................................................. 5-3
        Loading the Swing Class Library....................................................................... 5-3
        Automatic Index Tree Updating......................................................................... 5-6
        APIWizard Interface .......................................................................................... 5-6
Chapter 6: Session Objects                                                                                                   6-1
    Overview of Session Objects................................................................................... 6-2
    Getting the Session Object ..................................................................................... 6-2
        Getting Session Information .............................................................................. 6-2
    Directories................................................................................................................ 6-5
        Configuration Options........................................................................................ 6-5
        Macros............................................................................................................... 6-6
        Colors and Line Styles ...................................................................................... 6-7
    Accessing the Pro/ENGINEER Interface ................................................................. 6-7
        The Text Message File...................................................................................... 6-8
        Writing a Message Using a Message Pop-up Dialog Box................................. 6-9
        Accessing the Message Window..................................................................... 6-10
        Message Classification.................................................................................... 6-11
        Displaying Feature Parameters....................................................................... 6-13
        File Dialogs...................................................................................................... 6-14
                                                                                                               Contents - iii
    Creating Drawings from Templates ....................................................................... 10-2
       Drawing Creation Errors.................................................................................. 10-3
    Obtaining Drawing Models..................................................................................... 10-6
    Drawing Information............................................................................................... 10-6
    Drawing Operations ............................................................................................... 10-7
    Drawing Sheets ................................................................................................... 10-10
       Drawing Sheet Information............................................................................ 10-10
       Drawing Sheet Operations ............................................................................ 10-11
    Drawing Views ..................................................................................................... 10-15
       Creating Drawing Views ................................................................................ 10-15
       Obtaining Drawing Views .............................................................................. 10-20
       Drawing View Information ............................................................................. 10-21
       Drawing Views Operations ............................................................................ 10-25
    Drawing Dimensions............................................................................................ 10-26
       Obtaining Drawing Dimensions ..................................................................... 10-26
       Creating Drawing Dimensions....................................................................... 10-27
       Drawing Dimensions Information .................................................................. 10-30
       Drawing Dimensions Operations................................................................... 10-32
    Drawing Tables.................................................................................................... 10-37
       Creating Drawing Cells.................................................................................. 10-38
       Selecting Drawing Tables and Cells.............................................................. 10-38
       Creating Drawing Tables............................................................................... 10-39
       Retrieving Drawing Tables ............................................................................ 10-39
       Drawing Tables Information .......................................................................... 10-40
       Drawing Tables Operations........................................................................... 10-41
       Drawing Table Segments .............................................................................. 10-47
       Repeat Regions............................................................................................. 10-48
    Detail Items.......................................................................................................... 10-49
       Listing Detail Items ........................................................................................ 10-49
       Creating a Detail Item.................................................................................... 10-50
    Detail Entities....................................................................................................... 10-51
       Instructions .................................................................................................... 10-51
       Detail Entities Information ............................................................................. 10-55
       Detail Entities Operations.............................................................................. 10-55
    OLE Objects ........................................................................................................ 10-56
    Detail Notes ......................................................................................................... 10-56
       Instructions .................................................................................................... 10-56
       Detail Notes Information................................................................................ 10-61
       Details Notes Operations .............................................................................. 10-62
    Detail Groups....................................................................................................... 10-63
                                                                                                                    Contents - v
       View Operations .............................................................................................. 12-5
    Coordinate Systems and Transformations ............................................................ 12-6
       Coordinate Systems ........................................................................................ 12-6
       Transformations .............................................................................................. 12-8
Chapter 13: ModelItem                                                                                                     13-1
    Solid Geometry Traversal ...................................................................................... 13-2
    Getting ModelItem Objects .................................................................................... 13-2
    ModelItem Information ........................................................................................... 13-3
    Layer Objects......................................................................................................... 13-4
        Getting Layer Objects...................................................................................... 13-4
        Layer Operations............................................................................................. 13-4
Chapter 14: Features                                                                                                      14-1
    Access to Features ................................................................................................ 14-2
    Feature Information ............................................................................................... 14-3
    Feature Operations................................................................................................ 14-4
    Feature Groups and Patterns ................................................................................ 14-6
       Changes To Feature Groups........................................................................... 14-7
    User Defined Features........................................................................................... 14-8
       Read Access to Groups and User Defined Features ...................................... 14-9
    Creating Features from UDFs................................................................................ 14-9
       Creating UDFs............................................................................................... 14-10
       Creating Interactively Defined UDFs ............................................................. 14-11
       Creating a Custom UDF ................................................................................ 14-11
Chapter 15: Datum Features                                                                                                15-1
    Datum Plane Features........................................................................................... 15-2
    Datum Axis Features ............................................................................................. 15-6
    General Datum Point Features .............................................................................. 15-7
    Datum Coordinate System Features ..................................................................... 15-9
Chapter 16: Geometry Evaluation                                                                                           16-1
    Geometry Traversal ............................................................................................... 16-2
       Geometry Terms ............................................................................................. 16-2
       Traversing the Geometry of a Solid Block....................................................... 16-3
    Curves and Edges ................................................................................................. 16-3
       The t Parameter .............................................................................................. 16-3
       Curve and Edge Types.................................................................................... 16-4
       Evaluation of Curves and Edges ..................................................................... 16-5
       Solid Edge Geometry ...................................................................................... 16-6
       Curve Descriptors............................................................................................ 16-6
    Contours ................................................................................................................ 16-7
                                                                                                              Contents - vii
    Redefining and Rerouting Assembly Components .............................................. 19-14
    Exploded Assemblies .......................................................................................... 19-20
    Skeleton Models .................................................................................................. 19-21
Chapter 20: Family Tables                                                                                              20-1
    Working with Family Tables................................................................................... 20-2
       Accessing Instances........................................................................................ 20-2
       Accessing Columns......................................................................................... 20-3
       Accessing Cell Information.............................................................................. 20-4
    Creating Family Table Instances ........................................................................... 20-5
    Creating Family Table Columns ............................................................................ 20-5
Chapter 21: Action Listeners                                                                                           21-1
    J-Link Action Listeners........................................................................................... 21-2
    Creating an ActionListener Implementation........................................................... 21-2
    Action Sources....................................................................................................... 21-3
    Types of Action Listeners ...................................................................................... 21-4
        Session Level Action Listeners ....................................................................... 21-4
        UI Command Action Listeners......................................................................... 21-5
        Model Level Action listeners............................................................................ 21-5
        Solid Level Action Listeners ............................................................................ 21-8
        Feature Level Action Listeners...................................................................... 21-10
    Cancelling an ActionListener Operation .............................................................. 21-11
Chapter 22: Interface                                                                                                  22-1
     Exporting Files and 2D Models............................................................................. 22-2
        Export Instructions........................................................................................... 22-3
        Exporting Drawing Sheets............................................................................... 22-5
    Exporting to PDF and U3D .................................................................................... 22-6
    Exporting 3D Geometry ....................................................................................... 22-13
        Export Instructions......................................................................................... 22-14
        Export Utilities ............................................................................................... 22-17
    Shrinkwrap Export ............................................................................................... 22-18
        Setting Shrinkwrap Options........................................................................... 22-19
        Surface Subset Options ................................................................................ 22-21
        Faceted Solid Options ................................................................................... 22-22
        Merged Solid Options.................................................................................... 22-24
        VRML Representation ................................................................................... 22-25
    Importing Files ..................................................................................................... 22-26
        Import Instructions......................................................................................... 22-26
        Importing 2D Models ..................................................................................... 22-28
    Importing 3D Geometry ....................................................................................... 22-29
                                                                                                                 Contents - ix
        Displaying Text in the Graphics Window......................................................... 26-7
        Controlling Text Fonts ..................................................................................... 26-8
    Display Lists and Graphics .................................................................................... 26-8
Chapter 27: External Data                                                                                                  27-1
    External Data ......................................................................................................... 27-2
        Introduction to External Data........................................................................... 27-2
        Compatibility with Pro/TOOLKIT ..................................................................... 27-3
        Accessing External Data ................................................................................. 27-3
        Storing External Data ...................................................................................... 27-4
        Initializing Data Objects................................................................................... 27-4
        Retrieving External Data ................................................................................. 27-5
    Exceptions ............................................................................................................. 27-9
Chapter 28: Windchill Connectivity APIs                                                                                    28-1
    Introduction ............................................................................................................ 28-2
          Non-Interactive Mode Operations ................................................................... 28-2
     Accessing a Windchill Server from a Pro/ENGINEER Session ............................ 28-2
          Accessing Information Before Registering a Server........................................ 28-3
          Registering and Activating a Server ................................................................ 28-4
          Accessing Information From a Registered Server........................................... 28-5
          Information on Servers in Session .................................................................. 28-6
    Accessing Workspaces.......................................................................................... 28-6
          Creating and Modifying the Workspace .......................................................... 28-7
    Workflow to Register a Server ............................................................................... 28-8
    Aliased URL........................................................................................................... 28-9
    Server Operations................................................................................................ 28-10
          Save .............................................................................................................. 28-11
          Upload ........................................................................................................... 28-12
          CheckIn ......................................................................................................... 28-13
          Retrieval ........................................................................................................ 28-15
          Checkout and Download ............................................................................... 28-15
          Undo Checkout.............................................................................................. 28-18
          Import and Export.......................................................................................... 28-18
          File Copy ....................................................................................................... 28-21
          Server Object Status ..................................................................................... 28-22
          Object Lock Status ........................................................................................ 28-22
          Delete Objects............................................................................................... 28-24
          Conflicts During Server Operations............................................................... 28-24
    Utility APIs ........................................................................................................... 28-37
    Sample Batch Workflow....................................................................................... 28-38
                                                                                                                 Contents - xi
Appendix D: Digital Rights Management                                                                                            D-1
    Introduction .............................................................................................................   D-2
    Implications of DRM on J-Link ................................................................................               D-2
         Exception Types...............................................................................................          D-2
         Copy Permission to Interactively Open Models................................................                            D-5
    Additional DRM Implications...................................................................................               D-6
Appendix E: Geometry Traversal                                                                                                   E-1
    Example 1...............................................................................................................     E-2
    Example 2...............................................................................................................     E-2
    Example 3...............................................................................................................     E-3
    Example 4...............................................................................................................     E-4
    Example 5...............................................................................................................     E-5
Appendix F: Geometry Representations                                                                                             F-1
    Surface Parameterization ....................................................................................... F-2
        Plane ................................................................................................................ F-3
        Cylinder ............................................................................................................ F-3
        Cone................................................................................................................. F-4
        Torus ................................................................................................................ F-5
        General Surface of Revolution ......................................................................... F-6
        Ruled Surface................................................................................................... F-6
        Tabulated Cylinder ........................................................................................... F-7
        Coons Patch..................................................................................................... F-8
        Fillet Surface .................................................................................................... F-8
        Spline Surface .................................................................................................. F-9
        NURBS Surface ............................................................................................. F-10
        Cylindrical Spline Surface .............................................................................. F-11
    Edge and Curve Parameterization........................................................................ F-13
        Line................................................................................................................. F-13
        Arc .................................................................................................................. F-14
        Spline ............................................................................................................. F-14
        NURBS........................................................................................................... F-15
Appendix G: J-Link Classes                                                                                                       G-1
    List of J-Link Classes.............................................................................................. G-2
Topic Page
Purpose                                                           ii
Audience                                                          ii
Contents                                                          ii
Prerequisites                                                    iv
Documentation                                                    iv
Software Product Concerns and Documentation Comments              v
Audience
                    This manual is intended for experienced Pro/ENGINEER users who
                    are already familiar with Java or another object-oriented language.
Contents
                    This manual contains the following chapters and appendixes:
Prerequisites
                   This manual assumes you have the following knowledge:
                   •    Pro/ENGINEER
                   •    The syntax and language structure of Java.
Documentation
                   The documentation for J-Link includes the following:
Conventions
                   The following table lists conventions and terms used throughout
                   this book.
             Notes:
             •   Important information that should not be overlooked
                 appears in notes like this.
             •   All references to mouse clicks assume the use of a
                 right-handed mouse.
Topic Page
                                                             1-1
Setting Up Your Machine
                See Java Options and Debugging for more information about
                supported Java Virtual Machines and how to setup
                Pro/ENGINEER.
Standalone Applications
                You can start the J-Link application independently at any time,
                regardless of which models are in session. A registry file contains
                key information regarding the execution of the program.
Registry File
                A registry file contains Pro/ENGINEER-specific information about
                the standalone application you want to load.
                The registry file called protk.dat is a simple text file, where each
                line consists of one predefined keyword followed by a value. The
                standard form of the protk.dat file is as follows:
                name                java_demo
                startup             java
                java_app_class      MyJavaApp
                                                                                                   Setting Up J-Link
                    •     name—Assigns a unique name to this J-Link application. The
                          name identifies the application when there is more than one in
                          the protk.dat file. The maximum size of the name is 31
                          characters for the name, plus the end-of-string character.
                    •     startup—Specifies the method to be used by Pro/ENGINEER to
                          communicate with the application. For J-Link applications, set
                          startup to “java.”
                    •     java_app_class—Specifies the fully qualified package and name
                          of a Java class. This class contains the J-Link application’s
                          start and stop methods (described below).
                    •     java_app_classpath—An optional field to specify the full path to
                          the J-Link application classes and archives (including the
                          J-Link archive pfc.jar). Refer to the section "CLASSPATH
                          Variables" section for more information on the other available
                          mechanisms to set the CLASSPATH. This field has a character
                          limit of 2047 wide characters (wchar_t).
                    •     java_app_start—Specifies the start method of your program.
                          See the section Start and Stop Methods on page 1 - 7 for more
                          information.
                    •     java_app_stop—Specifies the stop method of your program. See
                          the section Start and Stop Methods on page 1 - 7 for more
                          information.
                    •     allow_stop—Stops the application during the session if it is set
                          to true. If this field is missing or set to false, you cannot stop the
                          application, regardless of how it was started.
                    •     delay_start—Enables you to choose when to start the J-Link
                          application if it is set to true. Pro/ENGINEER does not start the
                          J-Link application during startup. If this field is missing or is
                          set to false, the J-Link application starts automatically.
                                                                                                 Setting Up J-Link
                    application is seen only if you start Pro/ENGINEER from the
                    specific directory that contains protk.dat. or protk.dev.
                                                                                            Setting Up J-Link
                    package.
                    For example:
                    public static void startMyProgram() {
                        runMyUtilities();
                        configureMyModels();
                        addMyUI();
                    }
      J-Link start and stop methods must be public, static, return void
      and take no arguments. You can configure applications based on
      the Pro/ENGINEER version and build or custom command line
      arguments using methods described in the Session chapter.
Topic Page
                                                             2-1
Use of the JDK in J-Link Applications
         Sun Microsystems provides a large number of objects and methods
         with the Java Development Kit (JDK). These objects and methods
         include the following:
http://java.sun.com/reference/docs
         Examples in this guide usually do not use classes from the Java
         API beyond the ones found in the package java.lang. Most of the
         other packages can be used to improve a J-Link program, but they
         are not absolutely necessary to create the program.
                                                                                         Java Programming
                            information incorrect or obsolete.
                                                                                           Considerations
                  Java offers the following benefits:
                      class B extends A {
                          public B() {
                          //A is a superclass of B, B is a subclass of A.
                          }
                      }
                      // Constructor of B
                      class B implements A {
                          // Implementation of this method
                          public void doNothing() {
                          }
                      }
Java Keywords
        This section describes the Java keywords most commonly used
        when using J-Link.
                                                                                           Java Programming
                  The following keywords describe variables or methods:
                                                                                             Considerations
                  •   static—The method or variable is not attached to a particular
                      object, but to an entire class.
                      The advantage of a static method is that you do not need to
                      define an instance of the class in order to use the method.
                  •   final—Specifies that the class, method, or field will not be
                      modified by another object.
                      A static final declaration identifies a constant.
                  •   new—Creates instances of various classes. The following
                      statement shows an example of instantiation:
                      String mystring = new String ("This is my string.");
                      Except for single objects, you cannot use the new keyword to
                      initialize J-Link objects. You can use new to construct objects
                      that do not explicitly belong to J-Link (that is, Java API
                      objects).
                  •   instanceof—The Java instanceof operator is a way to
                      determine whether a particular object can be correctly cast to a
                      specified class. The instanceof operator produces a Boolean
                      value that identifies whether the object is a member of that
                      class. The typical use is as follows:
                      if (<objectname> instanceof <classname>)
Event Handling
        Java implements listeners and adapters to notify you of certain
        events. There are three kinds of listeners:
                                                                                          Java Programming
                      try—Execute a control block using predeclared exception
                                                                                            Considerations
                      handlers.
                  •   catch—Specify the exceptions to “catch” in a try block.
                  •   finally—Specify a control block to be applied after a try block,
                      regardless of whether an exception is handled by a catch clause
                      within the try block.
                  •   throw—Immediately send control to a handler for that specific
                      exception.
Comments
                  Java provides three different types of comment characters:
                  C++-style, C-style, and javadoc-style.
                  As in the C++ language, two double slashes (//) are used to specify a
                  one-line comment. For example:
                  .
                  .
                  .
                  // This method retrieves the value of the dimension.
                  .
                  .
                  .
                  Java also supports C-style comment characters (/* */). All the text
                  within these characters is considered a comment. For example:
                  .
                  .
                  .
                  {
                  /* Open the file input.txt with read-only
                     access. */
Topic Page
                                                    3-1
Class Types
                 J-Link is made up of a number classes in many packages. The
                 following are the eight main classes.
Pro/ENGINEER-Related Interfaces
                 The Pro/ENGINEER-related interfaces contain methods that
                 directly manipulate objects in Pro/ENGINEER. Examples of these
                 objects include models, features, and parameters.
Initialization
                 You cannot construct one of these objects using the Java keyword
                 new. Some objects that represent Pro/ENGINEER objects cannot
                 be created directly but are returned by a Get or Create method.
Attributes
                     Attributes within Pro/ENGINEER-related objects are not directly
                                                                                           Overview of J-Link
                     accessible, but can be accessed through Get and Set methods.
                     These methods are of the following types:
                     Attribute name: int XYZ
                     Methods:    int GetXYZ();
                                 void SetXYZ (int i);
Methods
                     You must start Methods from the object in question and you must
                     first initialize that object. For example, the following calls are
                     illegal:
                     Window window;
Inheritance
                     All Pro/ENGINEER related objects are defined as interfaces so that
                     they can inherit methods from other interfaces. To use these
                     methods, call them directly (no casting is needed). For example:
                     public interface Feature
                          extends jxobject,
                          pfcModelItem.ParameterOwner,
                          pfcObject.Parent,
                          pfcObject.Object,
Exceptions
                 Almost every J-Link method can throw an exception of type
                 com.ptc.cipjava.jxthrowable. Surround each method you use
                 with a try-catch-finally block to handle any exceptions that are
                 generated. See the Exceptions section for more information.
Initialization
                 You can create instances of these classes using a static create
                 method.
                 Example: pfcModel.BOMExportIntructions_Create()
                 This static method usually belongs to the utility class in the specific
                 package that the compact data class belong to.
Attributes
                 Attributes within compact data related classes are not directly
                 accessible, but can be accessed through Get and Set methods.
                 These methods are of the following types:
                 Attribute name: int XYZ
                 Methods:    int GetXYZ();
                             void SetXYZ (int i);
                                                                                              Overview of J-Link
                                           initialized.
                     SetOptionsKeywords(); // There is no invoking object
Inheritance
                     Compact objects can inherit methods from other compact interfaces.
                     To use these methods, call them directly (no casting needed).
Exceptions
                     Almost every J-Link method can throw an exception of type
                     com.ptc.cipjava.jxthrowable. Surround each method you use
                     with a try-catch-finally block to handle any exceptions that are
                     generated.
Unions
                     Unions are interface-like objects. Every union has a discriminator
                     method with the pre-defined name Getdiscr( ). This method returns
                     a value identifying the type of data that the union objects holds. For
                     each union member, a pair of (Get/Set) methods is used to access
                     the different data types. It is illegal to call any Get method except
                     the one that matches the value returned from Getdiscr( ). However,
                     any Set method can be called. This switches the discriminator to
                     the new value.
class ParamValue
{
public:
    ParamValueType                        Getdiscr ();
    String                                GetStringValue ();
    void                                  SetStringValue (String value);
    int                                   GetIntValue ();
    void                                  SetIntValue (int value);
    boolean                               GetBoolValue ();
    void                                  SetBoolValue (boolean value);
    double                                GetDoubleValue ();
    void                                  SetDoubleValue (double value);
Sequences
                 Sequences are expandable arrays of primitive data types or objects
                 in J-Link. All sequence classes have the same methods for adding to
                 and accessing the array. Sequence classes are identified by a plural
                 name, or the suffix “seq”.
Initialization
                 You cannot construct one of these objects using the Java keyword
                 new. Static create methods for each list type are available. For
                 example, pfcModel.Models.create() returns an empty Models
                 sequence object for you to fill in.
Attributes
                 The attributes within sequence objects must be accessed using
                 methods.
Methods
                 Sequence objects always contain the same methods: get, set,
                 getarraysize, insert, insertseq, removerange, and create.
                 Methods must be invoked from an initialized object of the correct
                 type, except for the static create method, which is invoked from the
                 sequence class.
Inheritance
                 Sequence classes do not inherit from any other J-Link classes.
                 Therefore, you cannot cast sequence objects to any other type of
                 J-Link object, including other sequences. For example, if you have a
                 list of model items that happen to be features, you cannot make the
                 following call:
                 Features features = (Features) modelitems;
                                                                                             Overview of J-Link
                     com.ptc.pfc.pfcModel.Models.
package com.ptc.pfc.pfcModel;
Arrays
                     Arrays are groups of primitive types or objects of a specified size.
                     An array can be one or two dimensional. The following array classes
                     are in the pfcBase package: Matrix3D, Point2D, Point3D,
                     Outline2D, Outline3D, UVVector, UVParams, Vector2D, and
                     Vector3D. See the online reference documentation to determine
                     the exact size of these arrays.
Attributes
                  The attributes within array objects must be accessed using
                  methods.
Methods
                  Array objects always contain the same methods: get, set, and
                  create. Methods must be invoked from an initialized object of the
                  correct type, except for the create method, which is invoked from
                  the name of the array class.
Inheritance
                  Array classes do not inherit from any other J-Link classes.
Exceptions
                  If you try to access an object that is not within the size of the array,
                  the exception cipjava.XNoAttribute is thrown.
                                                                                             Overview of J-Link
                     equivalent _FEATTYPE_HOLE . Enumeration classes in J-Link
                     generally have names of the form XYZType or XYZStatus.
Initialization
                     You cannot construct one of these objects. You simply use the name
                     of the static instance or static integer constant.
Attributes
                     An enumeration class is made up of constant integer attributes and
                     static instances of the enumerated class type. Related integers and
                     instances have the same name, except the integer attribute begins
                     with an underscore (_). The names of these attributes are all
                     uppercase and describe what the attribute represents. For example:
Methods
                     Enumeration classes have one method that you are likely to use:
Exceptions
              Enumeration classes do not throw exceptions.
Action Listeners
              Use ActionListeners in J-Link to assign programmed reactions
              to events that occur within Pro/ENGINEER. J-Link defines a set of
              action listener interfaces that can be implement enabling
              Pro/ENGINEER to call your J-Link application when specific
              events occur. These interfaces are designed to respond to events
              from action sources in Pro/ENGINEER. Examples of action sources
              include the session, user-interface commands, models, solids,
              parameters, and features.
3 - 10                                                               User’s Guide
Initialization
                     For each of its defined ActionListener interfaces, J-Link
                     provides a corresponding default implementation class. For
                     example, the SolidActionListener interface has a
                     corresponding DefaultSolidActionListener implementation.
                     All of the default action listener classes override every listener
                     method with an empty method.
                                                                                             Overview of J-Link
                     You must use the default implementation to construct applications.
                     You cannot directly implement the SolidActionListener
                     interface, as this interface will be missing the routing used
                     internally by J-Link
Attributes
                     Action listeners do not have any accessible attributes.
Methods
                     You must override the methods you need in the default class to
                     create an ActionListener object correctly. The methods you
                     create can call other methods in the ActionListener class or in
                     other classes.
Inheritance
                     All J-Link ActionListener objects inherit from the interface
                     pfcBase.ActionListener.
Exceptions
                     Action listeners cause methods to be called outside of your
                     application start and stop methods. Therefore, you must include
                     exception-handling code inside the ActionListener
                     implementation if you want to respond to exceptions. In some
                     methods called before an event, propagating an exception out of
                     your method will cancel the impending event.
Overview of J-Link                                                                  3 - 11
Example Code: Listener Class
                 The following example code shows part of the
                 SolidActionListener interface.
package com.ptc.pfc.pfcSolid;
{
     void                            OnBeforeRegen (
         com.ptc.pfc.pfcSolid.Solid      Sld,
         com.ptc.pfc.pfcFeature.Feature /* optional */ StartFeature
     ) throws jxthrowable;
     void                            OnAfterRegen (
         com.ptc.pfc.pfcSolid.Solid      Sld,
         com.ptc.pfc.pfcFeature.Feature /* optional */ StartFeature,
         boolean                         WasSuccessful
     ) throws jxthrowable;
     void                               OnBeforeUnitConvert (
         com.ptc.pfc.pfcSolid.Solid         Sld,
         boolean                            ConvertNumbers
     ) throws jxthrowable;
     void                               OnAfterUnitConvert (
         com.ptc.pfc.pfcSolid.Solid         Sld,
         boolean                            ConvertNumbers
     ) throws jxthrowable;
};
Utilities
                 Each package in J-Link has one class that contains special static
                 methods used to create and access some of the other classes in the
                 package. These utility classes have the same name as the package,
                 such as pfcModel.pfcModel.
Initialization
                 Because the utility packages have only static methods, you do not
                 need to initialize them. Simply access the methods through the
                 name of the class, as follows:
                 ParamValue pv = pfcModelItem.CreateStringParamValue
                 ("my_param");
3 - 12                                                                  User’s Guide
Attributes
                     Utilities do not have any accessible attributes.
Methods
                     Utilities contain only static methods used for initializing certain
                                                                                               Overview of J-Link
                     J-Link objects.
Inheritance
                     Utilities do not inherit from any other J-Link classes.
Exceptions
                     Methods in utilities can throw jxthrowable type exceptions.
Overview of J-Link                                                                    3 - 13
Creating Applications
              The following sections describe how to create applications. The
              topics are as follows:
              •    Importing Packages
              •    Application Hierarchy
              •    Exception Handling
Importing Packages
              To use pfc code in your application you must import the necessary
              packages. Import each class or package with a statement similar to
              the following:
              For the Parameter class only:
import com.ptc.pfc.pfcModelItem.Parameter;
import com.ptc.pfc.pfcBase.*;
Application Hierarchy
              The rules of object orientation require a certain hierarchy of object
              creation when you start a J-Link application. The pfc method
              invoked must be pfcGlobal.GetProESession, which returns a
              handle to the current session of Pro/ENGINEER.
              The application must iterate down to the level of object you want to
              access. For example, to list all the datum axes contained in the hole
              features in all models in session, do the following:
3 - 14                                                                  User’s Guide
                              model.ListModelItems
                              (ModelItemType.ITEM_FEATURE);
                     4.   Filter out the features of type hole:
                               feature.GetFeatureType();
                     5.   Get the subitems in each feature that are axes:
                               feature.ListSubItems
                                                                                            Overview of J-Link
                               (ModelItemType.ITEM_AXIS);
Exception Handling
                     Nearly all J-Link methods are declared as throwing the
                     jxthrowable exception, as shown here in the declaration of
                     Model.CreateLayer().
                     com.ptc.pfc.pfcLayer.Layer              CreateLayer (
                         String                                  Name
                     ) throws jxthrowable;
Overview of J-Link                                                                 3 - 15
                              Figure 3-1: J-Link Exception Classes
java.lang.Exception
com.ptc.cipjava.jxthrowable
XInvalidArrayDimIndex XPFC
XInvalidArrayIndex XInAMethod
XInvalidDictIndex XBadGetParamValue
XNegativeIndex XInvalidEnumValue
XLicense XUnimplemented
XCannotConnect XUnknownModelExtension
XConnectionClosed XToolkitError
                                                            XBadArgument
         XMsgStringTooLong
XNativeException XBadOutlineExcludeType
XNumberTooLarge
XSequenceTooLong
XStringTooLong
PFC exceptions
3 - 16                                                                              User’s Guide
cipjava Exceptions
                     The cipjava exceptions are thrown by classes in the
                     com.ptc.cipjava package. With the exception of the intseq,
                     realseq, boolseq, and stringseq classes, these classes are only
                     used internally.
                                                                                                Overview of J-Link
                             Exception                           Purpose
                      XInvalidArrayDimIndex,       Illegal index value used when
                      XInvalidArrayIndex,          accessing a cipjava array,
                      XInvalidDictIndex,           sequence, or dictionary. (The J-Link
                      XNegativeIndex               interface does not currently include
                                                   any dictionary classes.)
                      XLicense                     Licensing error (license does not
                                                   exist, lost, server down, etc.)
                      XMsgStringTooLong            Communication synchronization
                                                   problem between Pro/ENGINEER
                                                   and J-Link application. Restart the
                                                   J-Link application.
                      XNativeException             Unknown exception occurred in
                                                   another language. This usually
                                                   signals a serious error (such as
                                                   division by zero or class not found)
                                                   that is related to the J-Link
                                                   application.
                      XCannotConnect,              Communication problems between
                      XConnectionClosed,           Pro/ENGINEER and the J-Link
                      XFlushFailed                 application.
                      Other, internal errors       Internal assertions that should not
                                                   append and which need not be
                                                   caught individually.
PFC Exceptions
                     The PFC exceptions are thrown by the classes that make up
                     J-Link’s public interface. The following table describes these
                     exceptions.
                Exception                                      Purpose
 XBadExternalData                              An attempt to read contents of an
                                               external data object which has been
                                               terminated.
Overview of J-Link                                                                     3 - 17
              Exception                       Purpose
 XBadGetArgValue              Indicates attempt to read the wrong
                              type of data from the ArgValue union.
 XBadGetExternalData          Indicates attempt to read the wrong
                              type of data from the ExternalData
                              union.
 XBadGetParamValue            Indicates attempt to read the wrong
                              type of data from the ParamValue
                              union.
 XBadOutlineExcludeType       Indicates an invalid type of item was
                              passed to the outline calculation
                              method.
 XCancelProEAction            This exception type will not be thrown
                              by J-Link methods, but you may
                              instantiate and throw this from certain
                              ActionListener methods to cancel the
                              corresponding action in
                              Pro/ENGINEER.
 XCannotAccess                The contents of a J-Link object cannot
                              be accessed in this situation.
 XEmptyString                 An empty string was passed to a method
                              that does not accept this type of input.
 XInvalidEnumValue            Indicates an invalid value for a specified
                              enumeration class.
 XInvalidFileName             Indicates a file name passed to a method
                              was incorrectly structured.
 XInvalidFileType             Indicates a model descriptor contained
                              an invalid file type for a requested
                              operation.
 XInvalidModelItem            Indicates that the item requested to be
                              used is no longer usable (for example, it
                              may have been deleted).
 XInvalidSelection            Indicates that the Selection passed is
                              invalid or is missing a needed piece of
                              information. For example, its
                              component path, drawing view, or
                              parameters.
 XJLinkApplicationException   Contains the details when an attempt to
                              call code in an external J-Link
                              application failed due to an exception.
3 - 18                                                       User’s Guide
                Exception                                     Purpose
 XJLinkApplicationInactive                     Unable to operate on the requested
                                               JLinkApplication object because it has
                                               been shut down.
 XJLinkTaskExists                              Indicates that a J-Link task with the
                                               given name already exists in session.
 XJLinkTaskNotFound                            Indicates that the J-Link task with the
                                                                                             Overview of J-Link
                                               given name could not be found and run.
 XModelNotInSession                            Indicates that the model is no longer in
                                               session; it may have been erased or
                                               deleted.
 XNegativeNumber                               Numeric argument was negative.
 XNumberTooLarge                               Numeric argument was too large.
 XProEWasNotConnected                          The Pro/ENGINEER session is not
                                               available so the operation failed.
 XSequenceTooLong                              Sequence argument was too long.
 XStringTooLong                                String argument was too long.
 XUnimplemented                                Indicates unimplemented method.
 XUnknownModelExtension                        Indicates that a file extension does not
                                               match a known Pro/ENGINEER model
                                               type.
Pro/TOOLKIT Errors
                     The XToolkitError exception provides access to error codes from
                     Pro/TOOLKIT functions that J-Link uses internally and to the
                     names of the functions returning such errors. XToolkitError is
                     the exception you are most likely to encounter because J-Link is
                     built on top of Pro/TOOLKIT. The following table lists the integer
                     values that can be returned by the
                     XToolkitError.GetErrorCode() method and shows the
                     corresponding Pro/TOOLKIT constant that indicates the cause of
                     the error. Each specific XToolkitError exception is represented by
                     an appropriately named child class, allowing you to catch specific
                     exceptions you need to handle separately.
Overview of J-Link                                                                  3 - 19
     XToolkitError Child Class        Pro/TOOLKIT Error          #
 XToolkitNotFound                PRO_TK_E_NOT_FOUND             -4
 XToolkitFound                   PRO_TK_E_FOUND                 -5
 XToolkitLineTooLong             PRO_TK_LINE_TOO_LONG           -6
 XToolkitContinue                PRO_TK_CONTINUE                -7
 XToolkitBadContext              PRO_TK_BAD_CONTEXT             -8
 XToolkitNotImplemented          PRO_TK_NOT_IMPLEMENTED         -9
 XToolkitOutOfMemory             PRO_TK_OUT_OF_MEMORY           -10
 XToolkitCommError               PRO_TK_COMM_ERROR              -11
 XToolkitNoChange                PRO_TK_NO_CHANGE               -12
 XToolkitSuppressedParents       PRO_TK_SUPP_PARENTS            -13
 XToolkitPickAbove               PRO_TK_PICK_ABOVE              -14
 XToolkitInvalidDir              PRO_TK_INVALID_DIR             -15
 XToolkitInvalidFile             PRO_TK_INVALID_FILE            -16
 XToolkitCantWrite               PRO_TK_CANT_WRITE              -17
 XToolkitInvalidType             PRO_TK_INVALID_TYPE            -18
 XToolkitInvalidPtr              PRO_TK_INVALID_PTR             -19
 XToolkitUnavailableSection      PRO_TK_UNAV_SEC                -20
 XToolkitInvalidMatrix           PRO_TK_INVALID_MATRIX          -21
 XToolkitInvalidName             PRO_TK_INVALID_NAME            -22
 XToolkitNotExist                PRO_TK_NOT_EXIST               -23
 XToolkitCantOpen                PRO_TK_CANT_OPEN               -24
 XToolkitAbort                   PRO_TK_ABORT                   -25
 XToolkitNotValid                PRO_TK_NOT_VALID               -26
 XToolkitInvalidItem             PRO_TK_INVALID_ITEM            -27
 XToolkitMsgNotFound             PRO_TK_MSG_NOT_FOUND           -28
 XToolkitMsgNoTrans              PRO_TK_MSG_NO_TRANS            -29
 XToolkitMsgFmtError             PRO_TK_MSG_FMT_ERROR           -30
 XToolkitMsgUserQuit             PRO_TK_MSG_USER_QUIT           -31
 XToolkitMsgTooLong              PRO_TK_MSG_TOO_LONG            -32
 XToolkitCantAccess              PRO_TK_CANT_ACCESS             -33
 XToolkitObsoleteFunc            PRO_TK_OBSOLETE_FUNC           -34
 XToolkitNoCoordSystem           PRO_TK_NO_COORD_SYSTEM         -35
3 - 20                                                    User’s Guide
    XToolkitError Child Class         Pro/TOOLKIT Error        #
 XToolkitAmbiguous               PRO_TK_E_AMBIGUOUS           -36
 XToolkitDeadLock                PRO_TK_E_DEADLOCK            -37
 XToolkitBusy                    PRO_TK_E_BUSY                -38
 XToolkitInUse                   PRO_TK_E_IN_USE              -39
 XToolkitNoLicense               PRO_TK_NO_LICENSE            -40
                                                                       Overview of J-Link
 XToolkitBsplUnsuitableDegree    PRO_TK_BSPL_UNSUITABLE_      -41
                                 DEGREE
 XToolkitBsplNonStdEndKnots      PRO_TK_BSPL_NON_STD_END_     -42
                                 KNOTS
 XToolkitBsplMultiInnerKnots     PRO_TK_BSPL_MULTI_INNER_     -43
                                 KNOTS
 XToolkitBadSrfCrv               PRO_TK_BAD_SRF_CRV           -44
 XToolkitEmpty                   PRO_TK_EMPTY                 -45
 XToolkitBadDimAttach            PRO_TK_BAD_DIM_ATTACH        -46
 XToolkitNotDisplayed            PRO_TK_NOT_DISPLAYED         -47
 XToolkitCantModify              PRO_TK_CANT_MODIFY           -48
 XToolkitCheckoutConflict        PRO_TK_CHECKOUT_CONFLICT     -49
 XToolkitCreateViewBadSheet      PRO_TK_CRE_VIEW_BAD_SHEET    -50
 XToolkitCreateViewBadModel      PRO_TK_CRE_VIEW_BAD_MODEL    -51
 XToolkitCreateViewBadParent     PRO_TK_CRE_VIEW_BAD_         -52
                                 PARENT
 XToolkitCreateViewBadType       PRO_TK_CRE_VIEW_BAD_TYPE     -53
 XToolkitCreateViewBadExplode    PRO_TK_CRE_VIEW_BAD_         -54
                                 EXPLODE
 XToolkitUnattachedFeats         PRO_TK_UNATTACHED_FEATS      -55
 XToolkitRegenerateAgain         PRO_TK_REGEN_AGAIN           -56
 XToolkitDrawingCreateErrors     PRO_TK_DWGCREATE_ERRORS      -57
 XToolkitUnsupported             PRO_TK_UNSUPPORTED           -58
 XToolkitNoPermission            PRO_TK_NO_PERMISSION         -59
 XToolkitAuthenticationFailure   PRO_TK_AUTHENTICATION_FAIL   -60
                                 URE
 XToolkitAppNoLicense            PRO_TK_APP_NO_LICENSE        -92
 XToolkitAppExcessCallbacks      PRO_TK_APP_XS_CALLBACKS      -93
 XToolkitAppStartupFailed        PRO_TK_APP_STARTUP_FAIL      -94
Overview of J-Link                                            3 - 21
     XToolkitError Child Class                Pro/TOOLKIT Error                  #
 XToolkitAppInitialization            PRO_TK_APP_INIT_FAIL                     -95
 Failed
 XToolkitAppVersionMismatch           PRO_TK_APP_VERSION_                      -96
                                      MISMATCH
 XToolkitAppCommunication             PRO_TK_APP_COMM_FAILURE                  -97
 Failure
 XToolkitAppNewVersion                PRO_TK_APP_NEW_VERSION                   -98
                 Rather than catching the generic exception, you can set up your
                 code to respond to specific exception types, using multiple catch
                 blocks to respond to different situations, as follows:
                 try
                 {
                       Object.DoSomething()
                 }
                       catch (XToolkitError x)
                       {
                           // Respond based on the error code.
                           x.GetErrorCode();
                       }
                       catch (XStringTooLong x)
                       {
                           // Respond to the exception.
                       }
                       catch (jxthrowable x) // Do not forget to check for
                                               // an unexpected error!
3 - 22                                                                   User’s Guide
                         {
                              // Respond to the exception.
                         }
                                                                                              Overview of J-Link
                         public void MyMethod() throws jxthrowable
                         {
                              // Includes Pro/J.Link function calls
                         }
                     }
Overview of J-Link                                                                   3 - 23
                                                    4
        J-Link Programming
             Considerations
Topic Page
                                                              4-1
J-Link Thread Restrictions
         When you run a synchronous J-Link program, you should configure
         your program so it does not interfere with the main thread of the
         Pro/ENGINEER program. Because the Java API allows you to run
         with multiple threads, you should be cautious of using certain Java
         routines in your program.
         The most obvious restriction involves the use of Java language user
         interfaces. Any Java window that you create must be a dialog box
         that is blocking (or modal).
         {
             com.ptc.pfc.pfcModelItem.ModelItems ListItems (
                  com.ptc.pfc.pfcModelItem.ModelItemType
                      /* optional */ Type
             ) throws jxthrowable;
         }
         You can pass the Java keyword null in place of any such optional
         argument. In addition, a return value of null is possible for returns
         that are declared optional. The J-Link methods that take optional
         arguments provide default handling for null parameters as is
         described in the online documentation.
                                                                                         J-Link Programming
Optional Returns for J-Link Methods
                                                                                            Considerations
                  Some methods in J-Link may have an optional return. Usually
                  these correspond to lookup methods that may or may not find an
                  object to return. For example, the
                  pfcSession.BaseSession.GetModel method returns an optional
                  model:
                  public interface Session
                  {
                  /*optional*/ com.ptc.pfc.pfcModel.ModelGetModel
                  (java.lang.String Name,
                    com.ptc.pfc.pfcModel.ModelType Type);
                  }
                  J-Link might return null in certain cases where these methods are
                  called. You must use appropriate error checking in your application
                  code.
•     pfcObject.Child.GetDBParent
                  The method GetDBParent returns the owner of the child object.
                  Because the object is returned as a
                  com.ptc.pfc.pfcObject.Parent object, the application
                  developer must down cast the return to the appropriate class. The
                  following table lists parent/child relationships in J-Link.
                      Parent                    Child
                    Session         Model
                    Session         Window
                    Model           ModelItem
                    Solid           Feature
                    Model           Parameter
                    Model           ExternalDataAccess
                    Display         DisplayList2D/3D
                    Part            Material
                    Model           View
                    Model2D         View2D
                    Solid           XSection
                    Session         Dll (Pro/TOOLKIT)
                    Session         Application (J-Link)
   This chapter describes how to use the online browser provided with
   J-Link.
Topic Page
                                                                 5-1
Online Documentation — J-Link APIWizard
            J-Link provides an online browser called the J-Link APIWizard
            that displays detailed documentation. This browser displays
            information from the J-Link User’s Guide and API specifications
            derived from J-Link header file data.
            Your web browser will display the J-Link APIWizard data in a new
            window.
                                                                                              Browser
                  you. This takes several minutes, and is not persistant between
                  sessions. See Loading the Swing Class Library for the procedure on
                  loading Swing permanently.
source ~/.cshrc
                        ...;[path_to_swingall_archive];.
                  Use the semicolon as the path delimiter before and after the path to
                  the archive, and the period (.) at the end of the variable definition.
                  There must be only one semicolon-period “;.” entry in the ClassPath
                  variable, and it should appear at the end of the class path.
[path_to_swingall_archive];.
APIWizard Interface
              The APIWizard interface consists of two frames. The next sections
              describe how to display and use these frames in your Web browser.
                                                                                             Browser
                  In Interfaces mode, this frame displays an alphabetical list of the
                  J-Link interfaces. It can also display J-Link methods as subnodes of
                  the interfaces.
Display Frame
                  This frame, located on the right of the screen, displays:
                                                                                              Browser
                  Interfaces, Exceptions, or the J-Link Wildfire 4.0 User’s
                  Guide at the top of the frame. The APIWizard displays the tree
                  structure in a collapsed form. The switch icon to the far left of a
                  node (i.e. a package, a class, a interface or chapter name) signifies
                  that this node contains subnodes. If a node has no switch icon, it
                  has no subnodes. Clicking the switch icon (or double-clicking on the
                  node text) moves the switch to the down position. The APIWizard
                  then expands the tree to display the subnodes. Select a node or
                  subnode, and the APIWizard displays the online data in the Display
                  frame.
                  The following figure shows the collapased tree layout for the J-Link
                  packages.
View a section by clicking the switch icon next to the desired section
                                                                                                Browser
                  for the selected section and its subsections appear in the Display
                  frame. Click the switch icon again (or double-click the node text) to
                  collapse the subnodes listed and display only the main nodes.
                  The following figure shows the collapsed tree layout for the table of
                  contents of the J-Link User’s Guide.
                                                                                            Browser
                            APIWizard Search Dialog Box
                                                                                              Browser
                      TOC and section titles, or on the User’s Guide contents (the
                      entire text).
                  •   Wildcard searches—valid characters are:
                      –     * (asterisk) matches zero or more non-whitespace
                            characters
                      –     ? (question mark) matches one and only one non-whitespace
                            character
Browser
Topic Page
                                                              6-1
Overview of Session Objects
                  The Pro/ENGINEER Session object (contained in the class
                  com.ptc.pfc.pfcSession.Session) is the highest level object in
                  J-Link. Any program that accesses data from Pro/ENGINEER must
                  first get a handle to the Session object before accessing more
                  specific data.
•     pfcGlobal.pfcGlobal.GetProESession
                  The method pfcGlobal.pfcGlobal.GetProESession gets a
                  Session object in sychronous mode.
                      Note: You can make multiple calls to this method but each
                            call will give you a handle to the same object.
•     pfcGlobal.pfcGlobal.GetProEArguments
•     pfcGlobal.pfcGlobal.GetProEVersion
•     pfcGlobal.pfcGlobal.GetProEBuildCode
                  The method pfcGlobal.pfcGlobal.GetProEArguments returns
                  an array containing the command line arguments passed to
                  Pro/ENGINEER if these arguments follow one of two formats:
                                                                                         Session Objects
                  The method pfcGlobal.pfcGlobal.GetProEBuildCode returns a
                  string that represents the build code of the Pro/ENGINEER
                  session.
/*------------------------------------------------------------------*\
 Pass the boolean values to the method where they are used for some
 application.
/*------------------------------------------------------------------*\
              runApplication(runtime,unix);
          }
          else
       {
              printMsg("Invalid number of arguments");
          }
      }
      catch(jxthrowable x)
      {
          printMsg("Exception in getting session:"+x);
                                                                                        Session Objects
  {
  }
  public static void printMsg(String str)
  {
          System.out.println(str);
  }
}
Directories
Methods Introduced:
•   pfcSession.BaseSession.GetCurrentDirectory
•   pfcSession.BaseSession.ChangeDirectory
                  The method pfcSession.BaseSession.GetCurrentDirectory
                  returns the absolute path name for the current working directory of
                  Pro/ENGINEER.
Configuration Options
Methods Introduced:
•   pfcSession.BaseSession.GetConfigOptionValues
•   pfcSession.BaseSession.SetConfigOption
•   pfcSession.BaseSession.LoadConfigFile
                  You can access configuration options programmatically using the
                  methods described in this section.
Macros
Method Introduced:
•     pfcSession.BaseSession.RunMacro
                  The method pfcSession.BaseSession.RunMacro runs a macro
                  string. A J-Link macro string is equivalent to a Pro/ENGINEER
                  mapkey minus the key sequence and the mapkey name. To
                  generate a macro string, create a mapkey in Pro/ENGINEER. Refer
                  to the Pro/ENGINEER online help for more information about
                  creating a mapkey.
                                                                                         Session Objects
                  Macros are executed in asynchronous mode as soon as they are
                  registered. Macros in asynchronous mode are run in the same order
                  that they are saved.
•   pfcSession.BaseSession.SetStdColorFromRGB
•   pfcSession.BaseSession.GetRGBFromStdColor
•   pfcSession.BaseSession.SetTextColor
•   pfcSession.BaseSession.SetLineStyle
                  These methods control the general display of a Pro/ENGINEER
                  session.
                  To change the color of any text in the window, use the method
                  pfcSession.BaseSession.SetTextColor.
                                                                                           Session Objects
Method Introduced:
•   pfcSession.Session.UIShowMessageDialog
                  The method pfcSession.Session.UIShowMessageDialog
                  displays the UI message dialog. The input arguments to the method
                  are:
•   pfcSession.Session.UIDisplayMessage
•   pfcSession.Session.UIDisplayLocalizedMessage
•   pfcSession.Session.UIClearMessage
                 These methods enable you to display program information on the
                 screen.
•   pfcSession.BaseSession.GetMessageContents
•   pfcSession.BaseSession.GetLocalizedMessageContents
                  These methods take the same input arguments and perform exactly
                  the same argument substitution and translation as the
                  pfcSession.Session.UIDisplayMessage and
                  pfcSession.Session.UIDisplayLocalizedMessage methods
                                                                                             Session Objects
                  described in the previous section.
Message Classification
                  Messages displayed in J-Link include a symbol that identifies the
                  message type. Every message type is identified by a classification
                  that begins with the characters %C. A message classification
                  requires that the message key line (line one in the message file)
                  must be preceded by the classification code.
                      Note: Any message key string used in the code should not
                            contain the classification.
                  J-Link applications can now display any or all of the following
                  message symbols:
Session Objects                                                                     6 - 11
                      interrupt a process. Also, a Warning should not be used to
                      indicate a failed operation. Warnings must only caution a user
                      that the completed operation may not have been performed in a
                      completely desirable way. The classification for Warning
                      messages is %CW.
                  •   Error—This J-Link message is preceded by a a broken square.
                      An Error message informs the user that a required task was not
                      completed successfully. Depending on the application, a failed
                      task may or may not require intervention or correction before
                      work can continue. Whenever possible redress this situation by
                      providing a path. The classification for Error messages is %CE.
                  •   Critical—This J-Link message is preceded by a red X. A
                      Critical message type informs the user of an extremely serious
                      situation that is usually preceeded by loss of user data. Options
                      redressing this situation, if available, should be provided within
                      the message. The classification for a Critical messages is %CC.
                  ______________________________________
                  USER Error: %0s of code %1s at %2s
                  Error: %0s of code %1s at %2s
                  #
                  #
                  ______________________________________
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
         try {
             texts = stringseq.create();
         }
         catch (jxthrowable x) {
             System.out.println ("Exception in creating string sequence:"+x);
             return;
         }
                                                                                           Session Objects
        try {
            session.UIDisplayMessage ("mymessages.txt",
                         "USER Error: %0s of code %1s at %2s", texts);
        }
        catch (jxthrowable x) {
            System.out.println ("Exception in UIDisplayMessage():"+x);
        }
    }
}
•   pfcSession.Session.UIReadIntMessage
•   pfcSession.Session.UIReadRealMessage
•   pfcSession.Session.UIReadStringMessage
                  These methods enable a program to get data from the user.
•   pfcSession.Session.UIDisplayFeatureParams
                  The method pfcSession.Session.UIDisplayFeatureParams
                  forces Pro/ENGINEER to show dimensions or other parameters
                  stored on a specific feature. The displayed dimensions may then be
                  interactively selected by the user.
Session Objects                                                                   6 - 13
File Dialogs
Methods Introduced:
•   pfcSession.Session.UIOpenFile
•   pfcUI.pfcUI.FileOpenOptions_Create
•   pfcUI.FileOpenOptions.SetFilterString
•   pfcUI.FileOpenOptions.SetPreselectedItem
•   pfcUI.FileUIOptions.SetDefaultPath
•   pfcUI.FileUIOptions.SetDialogLabel
•   pfcUI.FileUIOptions.SetShortcuts
•   pfcUI.pfcUI.FileOpenShortcut_Create
•   pfcUI.FileOpenShortcut.SetShortcutName
•   pfcUI.FileOpenShortcut.SetShortcutPath
•   pfcSession.Session.UISaveFile
•   pfcUI.pfcUI.FileSaveOptions_Create
•   pfcSession.Session.UISelectDirectory
•   pfcUI.pfcUI.DirectorySelectionOptions_Create
•   pfcSession.BaseSession.UIRegisterFileOpen
•   pfcUI.pfcUI.FileOpenRegisterOptions_Create
•   pfcUI.FileOpenRegisterOptions.SetFileDescription
•   pfcUI.FileOpenRegisterOptions.SetFileType
•   pfcUI.FileOpenRegisterListener.FileOpenAccess
•   pfcUI.FileOpenRegisterListener.OnFileOpenRegister
•   pfcSession.BaseSession.UIRegisterFileSave
•   pfcUI.pfcUI.FileSaveRegisterOptions_Create
•   pfcUI.FileSaveRegisterOptions.SetFileDescription
•   pfcUI.FileSaveRegisterOptions.SetFileType
•   pfcUI.FileSaveRegisterListener.FileSaveAccess
•   pfcUI.FileSaveRegisterListener.OnFileSaveRegister
                                                                                            Session Objects
                  •   FilterString—Specifies the filter string for the type of file
                      accepted by the dialog box. Multiple file types should be listed
                      with wildcards and separated by commas, for example, "*.prt,
                      *.asm". Use the method
                      pfcUI.FileOpenOptions.SetFilterString to set this option.
                  •   PreselectedItem—Specifies the name of an item to preselect in
                      the dialog box. Use the method
                      pfcUI.FileOpenOptions.SetPreselectedItem to set this
                      option.
                  The pfcUI.FileUIOptions object contains the the following
                  options:
Session Objects                                                                    6 - 15
         The method pfcSession.Session.UISaveFile opens the
         Pro/ENGINEER dialog box for saving a file. The method accepts
         options similar to pfcSession.Session.UIOpenFile through the
         pfcUI.FileSaveOptions and pfcUI.FileUIOptions objects.
         Use the method pfcUI.pfcUI.FileSaveOptions_Create to create
         a new instance of the pfcUI.FileSaveOptions object. When
         using the Save dialog box, you can set the name to a non-existent
         file. The method pfcSession.Session.UISaveFile returns the
         name of the file selected by you; the application must use other
         methods or techniques to perform the desired action on the file.
                                                                                          Session Objects
                  The method pfcSession.BaseSession.UIRegisterFileSave registers a
                  new file type in the File > Save a Copy dialog box in
                  Pro/ENGINEER. This method takes the
                  pfcUI.FileSaveRegisterOptions and
                  pfcUI.FileSaveRegisterListener objects as its input
                  arguments. These objects are described as follows:
Session Objects                                                                  6 - 17
Adding Custom Web Pages
                 To add custom Web pages to the navigation area, the J-Link
                 application must:
Methods Introduced:
•   pfcSession.Session.NavigatorPaneBrowserAdd
•   pfcSession.Session.NavigatorPaneBrowserIconSet
•   pfcSession.Session.NavigatorPaneBrowserURLSet
                 The method pfcSession.Session.NavigatorPaneBrowserAdd
                 adds a new pane that can display a Web page to the navigation
                 area. The input parameters are:
                                                                                      Session Objects
package com.ptc.jlinkexamples;
import com.ptc.pfc.pfcGlobal.pfcGlobal;
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import java.lang.Object.*;
import java.io.*;
/*=====================================================================*\
FUNCTION: AddPane
PURPOSE: Adds a new navigator pane.
\*=====================================================================*/
  public static void AddPane() throws jxthrowable
  {
    Session session = pfcGlobal.GetProESession ();
/*---------------------------------------------------------------------*\
         Get the pane name and url from the user and set the values
\*---------------------------------------------------------------------*/
Session Objects                                                              6 - 19
/*=====================================================================*\
FUNCTION: ChangePaneURL
PURPOSE: Change navigator pane url.
\*=====================================================================*/
  public static void ChangePaneURL() throws jxthrowable
  {
    Session session = pfcGlobal.GetProESession ();
/*---------------------------------------------------------------------*\
         Get the pane name and new url from the user
\*---------------------------------------------------------------------*/
      session.NavigatorPaneBrowserURLSet(name, url);
  }
/*=====================================================================*\
FUNCTION: ChangePaneIcon
PURPOSE: Change navigator pane icon.
\*=====================================================================*/
  public static void ChangePaneIcon() throws jxthrowable
  {
    Session session = pfcGlobal.GetProESession ();
/*---------------------------------------------------------------------*\
         Get the pane name and new url from the user
\*---------------------------------------------------------------------*/
Session Objects
Session Objects                                            6 - 21
                                                    7
                                  Selection
Topic Page
                                                                7-1
Interactive Selection
Methods Introduced:
•     pfcSession.BaseSession.Select
•     pfcSelect.pfcSelect.SelectionOptions_Create
•     pfcSelect.SelectionOptions.SetMaxNumSels
•     pfcSelect.SelectionOptions.SetOptionKeywords
                        The method pfcSession.BaseSession.Select activates the
                        standard Pro/ENGINEER menu structure for selecting objects and
                        returns a pfcSelect.Selections sequence that contains the
                        objects the user selected. Using the Options argument, you can
                        control the type of object that can be selected and the maximum
                        number of selections.
                                                                                       Selection
 Integer parameter             ipar           ITEM_DIMENSION
 Part                          part           N/A
 Part or subassembly          prt_or_asm      N/A
 Assembly component            component      N/A
 model
 Component or feature          membfeat       ITEM_FEATURE
 Detail symbol                 dtl_symbol     ITEM_DTL_SYM_INSTANCE
 Note                          any_note       ITEM_NOTE,ITEM_DTL_NOTE
 Draft entity                  draft_ent      ITEM_DTL_ENTITY
 Table                         dwg_table      ITEM_TABLE
 Table cell                   table_cell      ITEM_TABLE
 Drawing view                 dwg_view        N/A
Selection                                                                        7-3
Accessing Selection Data
Methods Introduced:
•     pfcSelect.Selection.GetSelModel
•     pfcSelect.Selection.GetSelItem
•     pfcSelect.Selection.GetPath
•     pfcSelect.Selection.GetParams
•     pfcSelect.Selection.GetTParam
•     pfcSelect.Selection.GetPoint
•     pfcSelect.Selection.GetDepth
•     pfcSelect.Selection.GetSelView2D
•     pfcSelect.Selection.GetSelTableCell
•     pfcSelect.Selection.GetSelTableSegment
                   These methods return objects and data that make up the selection
                   object. Using the appropriate methods, you can access the following
                   data:
•    pfcSelect.Selection.Highlight
•    pfcSelect.Selection.UnHighlight
•    pfcSelect.Selection.Display
                  These methods cause a specific selection to be highlighted or
                  dimmed on the screen using the color specified as an argument.
                                                                                         Selection
                  The method pfcSelect.Selection.Highlight highlights the
                  selection in the current window. This highlight is the same as the
                  one used by Pro/ENGINEER when selecting an item—it just
                  repaints the wire-frame display in the new color. The highlight is
                  removed if you use the View, Repaint command or
                  pfcWindow.Window.Repaint; it is not removed if you use
                  pfcWindow.Window.Refresh.
                      Note: This is a one-time action and the next repaint will erase
                            this display.
/**
  * This example allows the user to interactively select objects.
  * This method initializes a SelectionOptions object that restricts
  * selection to features, with a specified maximum number of selections.
  */
Selection                                                                          7-5
        try {
            sel_options = pfcSelect.SelectionOptions_Create ("feature");
            sel_options.SetMaxNumSels (new Integer (max));
        }
        catch (jxthrowable x) {
            System.out.println ("Exception caught in initializing options"+x);
            return (null);
        }
        try {
            selections = session.Select (sel_options, null);
        }
        catch (jxthrowable x) {
            System.out.println ("Exception caught in selection");
            return (null);
        }
        return (selections);
    }
}
Programmatic Selection
                     J-Link provides methods whereby you can make your own Selection
                     objects, without prompting the user. These Selections are required
                     as inputs to some methods and can also be used to highlight certain
                     objects on the screen.
•       pfcSelect.pfcSelect.CreateModelItemSelection
•       pfcSelect.pfcSelect.CreateComponentSelection
•       pfcSelect.Selection.SetSelItem
•       pfcSelect.Selection.SetPath
•       pfcSelect.Selection.SetParams
•       pfcSelect.Selection.SetTParam
•       pfcSelect.Selection.SetPoint
•       pfcSelect.Selection.SetSelTableCell
•       pfcSelect.Selection.SetSelView2D
                     The method pfcSelect.pfcSelect.CreateModelItemSelection
                     creates a selection out of any model item object. It takes a
                     pfcModelItem.ModelItem and optionally a
                     pfcAssembly.ComponentPath object to identify which component
                     in an assembly the Selection Object belongs to.
                                                                                     Selection
            The selected component path using the method
            pfcSelect.Selection.SetPath.
Selection Buffer
Introduction to Selection Buffers
            Selection is the process of choosing items on which you want to
            perform an operation. In Pro/ENGINEER, before a feature tool is
            invoked, the user can select items to be used in a given tool's
            collectors. Collectors are like storage bins of the references of
            selected items. The location where preselected items are stored is
            called the selection buffer.
Selection                                                                      7-7
                   In the default Part and Assembly buffer there are two levels at
                   which selection is done:
•     pfcSession.Session.GetCurrentSelectionBuffer()
•     pfcSelect.SelectionBuffer.GetContents()
                   The method pfcSession.Session.GetCurrentSelectionBuffer
                   returns the selection buffer object for the current active model in
                   session. The selection buffer contains the items preselected by the
                   user to be used by the selection tool and popup menus.
•   pfcSelect.SelectionBuffer.RemoveSelection
•   pfcSelect.SelectionBuffer.Clear
                 Use the method pfcSelect.SelectionBuffer.RemoveSelection to
                 remove a specific selection from the selection buffer. The input
                 argument is the IndexToRemove specifies the index where the item
                                                                                           Selection
                 was found in the call to the method
                 pfcSelect.SelectionBuffer.GetContents.
•   pfcSelect.SelectionBuffer.AddSelection
                 Use the method pfcSelect.SelectionBuffer.AddSelection to add
                 an item to the currently active selection buffer.
Selection                                                                            7-9
                                                8
Menus, Commands, and
        Pop-up Menus
Topic Page
Introduction                                               8-2
Menu Bar Definitions                                       8-2
Creating New Menus and Buttons                             8-2
Designating Commands                                      8 - 12
Pop-up Menus                                              8 - 15
                                                           8-1
Introduction
                  The J-Link menu bar classes enable you to modify existing
                  Pro/ENGINEER menu bar menus and to create new menu bar
                  menus.
Methods Introduced:
•     pfcSession.Session.UICreateCommand
•     pfcSession.Session.UICreateMaxPriorityCommand
•     pfcSession.Session.UIAddButton
•     pfcSession.Session.UIAddMenu
•     pfcCommand.UICommandActionListener.OnCommand
The method
                                                                                          Menus, Commands,
                                                                                          and Pop-up Menus
                 pfcSession.Session.UICreateMaxPriorityCommand creates a
                 pfcCommand.UICommand object having maximum command
                 priority. The priority of the action refers to the level of precedence
                 the added action takes over other Pro/ENGINEER actions.
                 Maximum priority actions dismiss all other actions except
                 asynchronous actions.
import com.ptc.pfc.pfcGlobal.pfcGlobal;
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
/*====================================================================*\
  FUNCTION : addInputButton()
  PURPOSE : An example of the creation of a new button on the Pro/E
      menu bar. This method will create a button called "Input
      info" on the utilities menu and assigns the method
      gatherInputs() to activate when the button is pressed.
      Command access check is added by CheckCommandAccess
\*====================================================================*/
public static void addInputButton(Session session)
{
UICommand inputCommand = null;
/*====================================================================*\
  Add new input command
\*====================================================================*/
try {
  inputCommand=session.UICreateCommand("INPUT",
    new GatherInputListener (session));
  }
catch(jxthrowable x) {
  System.out.println("Exception in UICreateCommand():"+x);
  return;
}
/*====================================================================*\
  Add action listener to check access to the command
\*====================================================================*/
try {
 inputCommand.AddActionListener(new CheckButtonCommandAccess (session));
  }
catch(jxthrowable x) {
  System.out.println("Exception in AddActionListener():"+x);
  return;
}
/*====================================================================*\
  Add new button to "windows" menu
\*====================================================================*/
try {
  session.UIAddButton(inputCommand, "Windows", null,
   "USER Input info", "USER Gather inputs",
                      "jlexamples.txt");
      }
catch(jxthrowable x){
/*====================================================================*\
 CLASS    : GatherInputListener()
 PURPOSE : Listener class which implements the added command.
\*====================================================================*/
                                                                                          Menus, Commands,
                                                                                          and Pop-up Menus
 class GatherInputListener extends DefaultUICommandActionListener
  {
    public Session session;
Method Introduced:
•     pfcSession.Session.UIGetCommand
                  The method pfcSession.Session.UIGetCommand returns a
                  pfcCommand.UICommand object representing an existing
                  Pro/ENGINEER command. The method allows you to find the
                  command ID for an existing command so that you can add an access
                  function or bracket function to the command. You must know the
                  name of the command in order to find its ID.
                  Use the trail file to find the name of an action command (not a
                  menu button). Click the corresponding icon on the toolbar (not the
                  button in the menu bar) and check the last entry in the trail file.
                  For example, for the Save icon, the trail file will have the
                  corresponding entry:
Methods Introduced:
•     pfcBase.ActionSource.AddActionListener
•     pfcCommand.UICommandAccessListener.OnCommandAccess
                  Use the method pfcBase.ActionSource.AddActionListener to
                  register a new pfcCommand.UICommandAccessListener on
                  any command (created either by an application or
                  Pro/ENGINEER). This listener will be called when buttons based
                  on the command might be shown.
                                                                                          Menus, Commands,
                                                                                          and Pop-up Menus
                 •   ACCESS_REMOVE—The button is not visible and if all of the
                     menu buttons in the containing menu possess an access
                     function returning ACCESS_REMOVE, the containing menu
                     will also be removed from the Pro/ENGINEER user interface..
                 •   ACCESS_INVISIBLE—The button is not visible.
                 •   ACCESS_UNAVAILABLE—The button is visible, but gray
                     and cannot be selected.
                 •   ACCESS_DISALLOW—The button shows as available, but
                     the command will not be executed when it is chosen.
                 •   ACCESS_AVAILABLE—The button is not gray and can be
                     selected by the user. This is the default value.
/*=============================================================*\
Get the current model
\*=============================================================*/
                   model = session.GetCurrentModel ();
/*===================================================================*\
If model is not present or it is not of type part, return
"ACCESS_UNAVAILABLE" which disables button associated with the command
\*====================================================================*/
                  if (model == null)
                  {
                        return CommandAccess.ACCESS_UNAVAILABLE;
                  }
                  else if (model.GetType() != ModelType.MDL_PART)
                  {
                        return CommandAccess.ACCESS_UNAVAILABLE;
                  }
/*===================================================================*\
Else, return "ACCESS_AVAILABLE" which enables button associated with
the command
\*===================================================================*/
                  else
                  {
                        return CommandAccess.ACCESS_AVAILABLE;
                  }
            }
            catch(jxthrowable x)
            {
              System.out.println("Exception in OnCommandAccess():"+x);
              return CommandAccess.ACCESS_UNAVAILABLE;
            }
        }
  }
•   pfcBase.ActionSource.AddActionListener
•   pfcCommand.UICommandBracketListener.OnBeforeCommand
•   pfcCommand.UICommandBracketListener.OnAfterCommand
                 Use the method pfcBase.ActionSource.AddActionListener to
                 register a new pfcCommand.UICommandBracketListener on
                                                                                      Menus, Commands,
                                                                                      and Pop-up Menus
                 any command (created either by an application or
                 Pro/ENGINEER). This listener will be called when the command is
                 selected by the user.
                 The method
                 pfcCommand.UICommandBracketListener.OnBeforeComm
                 and could also be used to cancel an upcoming command. To do this,
                 throw a pfcExceptions.XCancelProEAction exception from the
                 body of the listener method using
                 pfcExceptions.XCancelProEAction.Throw.
try
{
/*====================================================================*\
 Get the command which is invoked by pressing "Rename" button
\*====================================================================*/
/*====================================================================*\
 If the command is not null, add action listener to check access to the
 command
\*====================================================================*/
if (command != null)
{
command.AddActionListener(new RenameBracketListener(session ,
paramName));
}
}
catch(jxthrowable x)
{
System.out.println("Exception in addRenameCheck():"+x);
return;
}
   }
 }
/*====================================================================*\
 CLASS    : RenameBracketListener()
 PURPOSE : This listener class will be used to check if model rename
 should be allowed depending if parameter is present.
\*====================================================================*/
   class RenameBracketListener extends DefaultUICommandBracketListener
   {
  public Session session;
  String name;
/*====================================================================*\
     FUNCTION : OnAfterCommand()
            PURPOSE : Function called after rename execution is complete.
\*====================================================================*/
  public void OnAfterCommand()
  {
  }
/*====================================================================*\
     FUNCTION : OnBeforeCommand()
            PURPOSE : Function called when rename button is pressed.
try
                                                                              Menus, Commands,
                                                                              and Pop-up Menus
{
/*==============================================================*\
    Get the current model
\*==============================================================*/
 model = session.GetCurrentModel ();
if (model == null)
{
return;
}
/*==============================================================*\
    Get the specified parameter
\*==============================================================*/
param = model.GetParam(name);
/*==============================================================*\
    If parameter is present, rename should not be allowed
\*==============================================================*/
if (param != null)
{
cancelRename = true;
}
else
{
cancelRename = false;
}
}
catch(jxthrowable x)
{
  System.out.println("Exception in OnBeforeCommand():"+x);
  return;
}
if (cancelRename == true)
{
XCancelProEAction.Throw();
}
  }
Command Icons
Method Introduced:
•   pfcCommand.UICommand.SetIcon
                 The method pfcCommand.UICommand.SetIcon allows you to
                 designate an icon to be used with the command you created. The
                 method adds the icon to the Pro/ENGINEER command. Specify the
                 name of the icon file, including the extension as the input argument
                 for this method. A valid format for the icon file is the
                 PTC-proprietary format used by Pro/ENGINEER.BIF or a standard
                 .GIF. The Pro/ENGINEER toolbar button is replaced with the
                 image of the image.
                      Note: While specifying the name of the icon file, do not specify
                            the full path to the icon names.
                 The default search paths for finding the icons are:
                 •    <ProENGINEER loadpoint>/text/resource
                 •    <Application text dir>/resource
                 •    <Apppplication text dir>/(language)/resource
                 The location of the application text directory is specified in the
                 registry file.
                                                                                         Menus, Commands,
                                                                                         and Pop-up Menus
Designating the Command
Method Introduced:
•   pfcCommand.UICommand.Designate
                 This method allows you designate the command as available in the
                 Screen Customization dialog box of Pro/ENGINEER. After a J-Link
                 application has used the method
                 pfcCommand.UICommand.Designate on a command, you can
                 interactively drag the toolbar button that you associate with the
                 command, on to the Pro/ENGINEER toolbar. If this method is not
                 called, the toolbar button will not be visible in the Screen
                 Customization dialog box of Pro/ENGINEER.
                                                                                          Menus, Commands,
                                                                                          and Pop-up Menus
Pop-up Menus
                 Pro/ENGINEER provides shortcut menus that contain frequently
                 used commands appropriate to the currently selected items. You
                 can access a shortcut menu by right-clicking a selected item.
                 Shortcut menus are accessible in:
                 •   Graphics window
                 •   Model Tree
                 •   Some dialog boxes
                 •   Any area where you can perform an object-action operation by
                     selecting an item and choosing a command to perform on the
                     selected item.
                 The methods described in this section allow you to add menus to a
                 graphics window pop-up menu.
                 For example, the pop-up menu, Edit Properties, has the following
                 comment in the trail file:
                 ~ Close `rmb_popup` `PopupMenu`
                 ~ Activate `rmb_popup` `EditProperties`
                 !Command ProCmdEditPropertiesDtm was pushed from the
                 software.
                 !Item was selected from popup menu 'popup_mnu_edit'
•   pfcBase.ActionSource.AddActionListener
•   pfcUI.PopupmenuListener.OnPopupmenuCreate
                 Use the method pfcBase.ActionSource.AddActionListener to
                 register a new pfcUI.PopupmenuListener to the session. This
                 listener will be called when pop-up menus are initialized.
                                                                                          Menus, Commands,
                                                                                          and Pop-up Menus
                 pop-up menus used to access these menus while using other
                 methods.
Method Introduced:
•   pfcUI.Popupmenu.GetName
                 The method pfcUI.Popupmenu.GetName() returns the name of
                 the pop-up menu.
•   pfcUI.Popupmenu.AddButton
•   pfcUI.Popupmenu.AddMenu
                 Use pfcUI.Popupmenu.AddButton to add a new item to a pop-up
                 menu. The input arguments are:
import   com.ptc.pfc.pfcGlobal.pfcGlobal;
import   com.ptc.cipjava.*;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcSelect.*;
import   com.ptc.pfc.pfcCommand.*;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcExceptions.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcUI.*;
import   com.ptc.pfc.pfcAssembly.*;
import   com.ptc.pfc.pfcFeature.*;
import   com.ptc.pfc.pfcComponentFeat.*;
import   com.ptc.pfc.pfcBase.*;
import   com.ptc.pfc.pfcSolid.*;
/*=====================================================================*\
FUNCTION: addMenus
PURPOSE: This function demonstrates the usage of UI functions to add a
  new button to ProE Graphics Window and model tree popup menu.
\*=====================================================================*/
public static void addMenus(Session session)
{
UICommand inputCommand = null;
try
{
    /*-----------------------------------------------------------*\
          Add action listener to check access to the command
    \*-----------------------------------------------------------*/
                                                                                 Menus, Commands,
                                                                                 and Pop-up Menus
    inputCommand.AddActionListener(new CheckCommandAccess (session));
    /*-----------------------------------------------------------*\
          Add new button to action menu
    \*-----------------------------------------------------------*/
    session.UIAddButton(inputCommand, "ActionMenu", null,
     "USER Highlight Constraint", "USER Highlight Constraint Help",
                        "jlexamples.txt");
    /*-----------------------------------------------------------*\
          Add action listener which will execute when new popup menus
          are created
    \*-----------------------------------------------------------*/
    session.AddActionListener(new CreatePopupButton(session) );
catch(jxthrowable x)
{
  System.out.println("Exception in addMenus():"+x);
  return;
}
}
 }
/*=====================================================================*\
CLASS: AssemblyFunction
PURPOSE: This is the Listener class to implement Highlight command.
\*=====================================================================*/
 class AssemblyFunction extends DefaultUICommandActionListener
  {
   private Session session;
    Selections selections;
SelectionBuffer selectionBuffer;
SelectionOptions options ;
ModelItem item ;
Feature feature ;
ComponentPath modelPath;
ComponentPath parentPath;
intseq parentIds;
        Solid modelParent;
        int modelId;
/*---------------------------------------------------------------------*\
  Get selected components
\*---------------------------------------------------------------------*/
selectionBuffer = session.GetCurrentSelectionBuffer();
selections = selectionBuffer.GetContents();
if (selections == null)
{
options = pfcSelect.SelectionOptions_Create ("membfeat");
options.SetMaxNumSels (new Integer (1));
selections = session.Select (options, null);
/*---------------------------------------------------------------------*\
  Get the model item from the selection
\*---------------------------------------------------------------------*/
item = selections.get(0).GetSelItem();
/*---------------------------------------------------------------------*\
  If item is null, get the model item from the selection model
\*---------------------------------------------------------------------*/
if (item == null)
{
/*-----------------------------------------------------------------*\
   Get the component path from the selection model
\*-----------------------------------------------------------------*/
modelPath = selections.get(0).GetPath();
/*-----------------------------------------------------------------*\
   Get the parent model of the selection model
\*-----------------------------------------------------------------*/
parentIds = modelPath.GetComponentIds();
                                                                                 Menus, Commands,
                                                                                 and Pop-up Menus
parentIds.removerange(parentIds.getarraysize() - 1 ,
parentIds.getarraysize());
if (parentIds.getarraysize() == 0)
{
modelParent = modelPath.GetRoot();
}
else
{
parentPath = pfcAssembly.CreateComponentPath(modelPath.GetRoot(),
parentIds);
modelParent = parentPath.GetLeaf();
}
/*-----------------------------------------------------------------*\
   Get the selection model as model item from the parent model
\*-----------------------------------------------------------------*/
item = ((ModelItemOwner)modelParent).GetItemById
(ModelItemType.ITEM_FEATURE , modelId);
if (item == null)
return;
feature = (Feature)item;
if (feature.GetFeatType () != FeatureType.FEATTYPE_COMPONENT)
    return;
if (asmRef != null)
    asmRef.Highlight (StdColor.COLOR_ERROR);
/*---------------------------------------------------------------------*\
  Highlight the component reference geometry
\*---------------------------------------------------------------------*/
Selection compRef = c.GetComponentReference ();
if (compRef != null)
    compRef.Highlight (StdColor.COLOR_WARNING);
/*---------------------------------------------------------------------*\
  Prepare and display the message text.
\*---------------------------------------------------------------------*/
Double offset = c.GetOffset ();
String offsetString = "";
if (offset != null)
    offsetString = ", offset of "+offset;
session.UIDisplayMessage ("jlexamples.txt",
  "JLEX Showing constraint %0s of %1s %2s%3s. Hit <CR> to continue.",
  texts);
session.UIReadStringMessage (null);
/*---------------------------------------------------------------------*\
  Clean up the UI for the next constraint
\*---------------------------------------------------------------------*/
if (asmRef != null)
{
asmRef.UnHighlight ();
}
if (compRef != null)
{
compRef.UnHighlight ();
}
}
/*=====================================================================*\
FUNCTION: constraintTypeToString
PURPOSE: Utility to convert the constraint type to a string for printing
\*=====================================================================*/
    private static String constraintTypeToString (ComponentConstraintType
type)
    {
                                                                              Menus, Commands,
                                                                              and Pop-up Menus
switch (type.getValue())
    {
    case ComponentConstraintType._ASM_CONSTRAINT_MATE:
return ("(Mate)");
    case ComponentConstraintType._ASM_CONSTRAINT_MATE_OFF:
return ("(Mate Offset)");
    case ComponentConstraintType._ASM_CONSTRAINT_ALIGN:
return ("(Align)");
    case ComponentConstraintType._ASM_CONSTRAINT_ALIGN_OFF:
return ("(Align Offset)");
    case ComponentConstraintType._ASM_CONSTRAINT_INSERT:
return ("(Insert)");
    case ComponentConstraintType._ASM_CONSTRAINT_ORIENT:
return ("(Orient)");
    case ComponentConstraintType._ASM_CONSTRAINT_CSYS:
return ("(Csys)");
    case ComponentConstraintType._ASM_CONSTRAINT_TANGENT:
return ("(Tangent)");
    case ComponentConstraintType._ASM_CONSTRAINT_PNT_ON_SRF:
return ("(Point on Surf)");
    case ComponentConstraintType._ASM_CONSTRAINT_EDGE_ON_SRF:
return ("(Edge on Surf)");
    case ComponentConstraintType._ASM_CONSTRAINT_DEF_PLACEMENT:
return ("(Default)");
    case ComponentConstraintType._ASM_CONSTRAINT_SUBSTITUTE:
return ("(Substitute)");
    case ComponentConstraintType._ASM_CONSTRAINT_PNT_ON_LINE:
return ("(Point on Line)");
    case ComponentConstraintType._ASM_CONSTRAINT_FIX:
return ("(Fix)");
    case ComponentConstraintType._ASM_CONSTRAINT_AUTO:
return ("(Auto)");
    default:
return ("(Unrecognized Type)");
    }
    }
  }
/*=====================================================================*\
CLASS: CreatePopupButton
PURPOSE: Listener class to create Popup menu button when the menu is
  created.
/*---------------------------------------------------------------------*\
  If the created popup menu is "Sel Obj Menu", then get the command for
  highlight constraint added previously and add button
\*---------------------------------------------------------------------*/
  if (menu.GetName().equals("Sel Obj Menu"))
  {
  command = session.UIGetCommand("HIGHLIGHT");
  if (command != null)
  {
  options = pfcUI.PopupmenuOptions_Create(new String
("HIGHLIGHT_CONSTRAINTS"));
  options.SetHelptext("Highlight Assembly Constraints");
  options.SetLabel("Highlight Constraint");
  menu.AddButton(command, options);
  }
  }
  }
  }
/*=====================================================================*\
CLASS: CreatePopupButton
PURPOSE: This listener class checks if command is accessible to the user.
\*=====================================================================*/
  class CheckCommandAccess extends DefaultUICommandAccessListener
  {
  private Session session;
try
{
/*---------------------------------------------------------------------*\
    Get the current model
\*---------------------------------------------------------------------*/
                                                                              Menus, Commands,
                                                                              and Pop-up Menus
 model = session.GetCurrentModel ();
/*---------------------------------------------------------------------*\
    If model is not present or it is not of type assembly, return
    "ACCESS_UNAVAILABLE" which disables button associated with the command
\*---------------------------------------------------------------------*/
if (model == null)
{
return CommandAccess.ACCESS_UNAVAILABLE;
}
else if (model.GetType() != ModelType.MDL_ASSEMBLY)
{
return CommandAccess.ACCESS_UNAVAILABLE;
}
/*---------------------------------------------------------------------*\
    Get the current selection
\*---------------------------------------------------------------------*/
selectionBuffer = session.GetCurrentSelectionBuffer();
selections = selectionBuffer.GetContents();
/*---------------------------------------------------------------------*\
    If nothing has been selected or more than one item has been sleected,
    return "ACCESS_UNAVAILABLE" which disables button associated with the
    command
\*---------------------------------------------------------------------*/
if ((selections == null) || (selections.getarraysize() > 1))
{
return CommandAccess.ACCESS_UNAVAILABLE;
}
/*---------------------------------------------------------------------*\
    Else return "ACCESS_AVAILABLE" which enables button associated with
the
    command
\*---------------------------------------------------------------------*/
return CommandAccess.ACCESS_AVAILABLE;
}
catch(jxthrowable x)
{
  System.out.println("Exception in OnCommandAccess():"+x);
    }
     }
Topic Page
                                                                 9-1
Overview of Model Objects
                   Models can be any Pro/ENGINEER file type, including parts,
                   assemblies, drawings, sections, and layouts. The classes and
                   methods in the package com.ptc.pfc.pfcModel provide generic access
                   to models, regardless of their type. The available methods enable
                   you to do the following:
•     pfcFamily.FamilyTableRow.CreateInstance
•     pfcSelect.Selection.GetSelModel
•     pfcSession.BaseSession.GetModel
•     pfcSession.BaseSession.GetCurrentModel
•     pfcSession.BaseSession.ListModels
•     pfcSession.BaseSession.GetByRelationId
•     pfcWindow.Window.GetModel
                   These methods get a model object that is already in session.
                   For more methods that return solid models, refer to the chapter
                   Solid.
•   pfcModel.pfcModel.ModelDescriptor_Create
•   pfcModel.pfcModel.ModelDescriptor_CreateFromFileName
•   pfcModel.ModelDescriptor.SetGenericName
•   pfcModel.ModelDescriptor.SetInstanceName
                                                                                         Models
•   pfcModel.ModelDescriptor.SetType
•   pfcModel.ModelDescriptor.SetHost
•   pfcModel.ModelDescriptor.SetDevice
•   pfcModel.ModelDescriptor.SetPath
•   pfcModel.ModelDescriptor.SetFileVersion
•   pfcModel.ModelDescriptor.GetFullName
•   pfcModel.Model.GetFullName
                 Model descriptors are data objects used to describe a model file and
                 its location in the system. The methods in the model descriptor
                 enable you to set specific information that enables Pro/ENGINEER
                 to find the specific model you want.
                 If you want to load a model that is not a family table instance, pass
                 an empty string as the generic name argument so that the full
                 name of the model is constructed correctly. If the model is a family
                 table interface, you should specify both the instance and generic
                 names.
Models                                                                            9-3
                   The static utility method
                   pfcModel.pfcModel.ModelDescriptor_CreateFromFileName
                   allows you to create a new model descriptor from a given a file
                   name. The file name is a string in the form
                   "<name>.<extension>".
Retrieving Models
Methods Introduced:
•     pfcSession.BaseSession.RetrieveModel
•     pfcSession.BaseSession.RetrieveModelWithOpts
•     pfcSession.BaseSession.OpenFile
•     pfcSolid.Solid.HasRetrievalErrors
                   These methods cause Pro/ENGINEER to retrieve the model that
                   corresponds to the ModelDescriptor argument.
/**
  * An example of retrieving a model using a model descriptor object.
                                                                                     Models
  * This method loads the model identified by modelname and type from a
  * standard directory location.
  */
         try {
           descr = pfcModel.ModelDescriptor_Create (type, modelname, null);
           descr.SetPath (stdpath);
         }
         catch (jxthrowable x) {
           System.out.println ("Error in initializing model descriptor"+x);
           return (null);
         }
         try {
           model = session.RetrieveModel (descr);
         }
         catch (jxthrowable x) {
           printMsg ("Exception in retrieving model:"+x);
           return (null);
         }
         return (model);
    }
    public static void printMsg (String str)
    {
     System.out.println (str);
    }
}
Models                                                                         9-5
Model Information
Methods Introduced:
•     pfcModel.Model.GetFileName
•     pfcModel.Model.GetCommonName
•     pfcModel.Model.IsCommonNameModifiable
•     pfcModel.Model.GetFullName
•     pfcModel.Model.GetGenericName
•     pfcModel.Model.GetInstanceName
•     pfcModel.Model.GetOrigin
•     pfcModel.Model.GetRelationId
•     pfcModel.Model.GetDescr
•     pfcModel.Model.GetType
•     pfcModel.Model.GetIsModified
•     pfcModel.Model.GetVersion
•     pfcModel.Model.GetRevision
•     pfcModel.Model.GetBranch
•     pfcModel.Model.GetReleaseLevel
•     pfcModel.Model.GetVersionStamp
•     pfcModel.Model.ListDependencies
•     pfcModel.Model.ListDeclaredModels
•     pfcModel.Model.CheckIsModifiable
•     pfcModel.Model.CheckIsSaveAllowed
                  The method pfcModel.Model.GetFileName retrieves the model
                  file name in the "name"."type" format.
                                                                                  Models
         The method pfcModel.Model.GetOrigin returns the complete
         path to the file from which the model was opened. This path can be
         a location on disk from a Windchill workspace, or from a
         downloaded URL.
         •   MDL_ASSEMBLY—Specifies an assembly.
         •   MDL_PART—Specifies a part.
         •   MDL_DRAWING—Specifies a drawing.
Models                                                                      9-7
      •   MDL_2D_SECTION—Specifies a 2D section.
      •   MDL_LAYOUT—Specifies a layout.
      •   MDL_DWG_FORMAT—Specifies a drawing format.
      •   MDL_MFG—Specifies a manufacturing model.
      •   MDL_REPORT—Specifies a report.
      •   MDL_MARKUP—Specifies a drawing markup.
      •   MDL_DIAGRAM—Specifies a diagram
      The method pfcModel.Model.GetIsModified identifies whether
      the model has been modified since it was last saved.
                                                                                          Models
                 identify if it is currently safe to save the model. Thus, calling this
                 method at different times might return different results. This
                 method takes a boolean argument ShowUI. Refer to the previous
                 method for more information on this argument.
Model Operations
Methods Introduced:
•   pfcModel.Model.Backup
•   pfcModel.Model.Copy
•   pfcModel.Model.CopyAndRetrieve
•   pfcModel.Model.Rename
•   pfcModel.Model.Save
•   pfcModel.Model.Erase
•   pfcModel.Model.EraseWithDependencies
•   pfcModel.Model.Delete
•   pfcModel.Model.Display
•   pfcModel.Model.SetCommonName
                 These model operations duplicate most of the commands available
                 in the Pro/ENGINEER File menu.
Models                                                                             9-9
                 The method pfcModel.Model.Rename renames a specified model.
Running ModelCHECK
                 ModelCHECK is an integrated application that runs transparently
                 within Pro/ENGINEER. ModelCHECK uses a configurable list of
                 company design standards and best modeling practices. You can
                 configure ModelCHECK to run interactively or automatically when
                 you regenerate or save a model.
Methods Introduced:
•   pfcSession.BaseSession.ExecuteModelCheck
•   pfcModelCheck.pfcModelCheck.ModelCheckInstructions_Create
•   pfcModelCheck.ModelCheckInstructions.SetConfigDir
•   pfcModelCheck.ModelCheckInstructions.SetMode
•   pfcModelCheck.ModelCheckInstructions.SetOutputDir
•   pfcModelCheck.ModelCheckInstructions.SetShowInBrowser
                                                                                        Models
               •   ConfigDir—Specifies the location of the configuration files. If
                   this parameter is set to NULL, the default ModelCHECK
                   configuration files are used.
               •   Mode—Specifies the mode in which you want to run
                   ModelCHECK. The modes are:
                   –   MODELCHECK_GRAPHICS—Interactive mode
                   –   MODELCHECK_NO_GRAPHICS—Batch mode
               •   OutputDir—Specifies the location for the reports. If you set this
                   parameter to NULL, the default ModelCHECK directory, as per
                   config_init.mc, will be used.
               •   ShowInBrowser—Specifies if the results report should be
                   displayed in the Web browser.
               The method
               pfcModelCheck.pfcModelCheck.ModelCheckInstructions_C
               reate creates the ModelCheckInstructions object containing the
               ModelCHECK instructions described above.
Models                                                                         9 - 11
          Use the
          methodspfcModelCheck.ModelCheckResults.GetNumberOfE
          rrors,
          pfcModelCheck.ModelCheckResults.GetNumberOfWarning,
          and pfcModelCheck.ModelCheckResults.GetWasModelSaved
          to access the results obtained.
Custom Checks
          This section describes how to define custom checks in
          ModelCHECK that users can run using the standard ModelCHECK
          interface in Pro/ENGINEER.
                                                                                         Models
                 3.   Add the check and its values to the ModelCHECK configuration
                      file.
                 4.   Register the ModelCHECK check from the J-Link application.
                      Note: Other than the requirements listed above, J-Link
                            custom checks do not have access to the rest of the
                            values in the ModelCHECK configuration files. All the
                            custom settings specific to the check, such as start
                            parameters, constants, and so on, must be supported by
                            the user application and not ModelCHECK.
•   pfcSession.BaseSession.RegisterCustomModelCheck
•   pfcModelCheck.pfcModelCheck.CustomCheckInstructions_Create
•   pfcModelCheck.CustomCheckInstructions.SetCheckName
•   pfcModelCheck.CustomCheckInstructions.SetCheckLabel
•   pfcModelCheck.CustomCheckInstructions.SetListener
•   pfcModelCheck.CustomCheckInstructions.SetActionButtonLabel
•   pfcModelCheck.CustomCheckInstructions.SetUpdateButtonLabel
                 The method
                 pfcSession.BaseSession.RegisterCustomModelCheck
                 registers a custom check that can be included in any ModelCHECK
                 run. This method takes the instructions in the form of the
                 CustomCheckInstructions object as its input argument. This
                 object contains the following parameters:
Models                                                                          9 - 13
         •   Listener—Specifies the listener object containing the custom
             check methods. Refer to the section Custom Check Listeners for
             more information.
         •   ActionButtonLabel—Specifies the label for the action button. If
             you specify NULL for this parameter, this button is not shown.
         •   UpdateButtonLabel—Specifies the label for the update button.
             If you specify NULL for this parameter, this button is not
             shown.
         The method
         pfcModelCheck.pfcModelCheck.CustomCheckInstructions_
         Create creates the CustomCheckInstructions object containing
         the custom check instructions described above.
•   pfcModelCheck.ModelCheckCustomCheckListener.OnCustomCheck
•   pfcModelCheck.pfcModelCheck.CustomCheckResults_Create
•   pfcModelCheck.CustomCheckResults.SetResultsCount
•   pfcModelCheck.CustomCheckResults.SetResultsTable
•   pfcModelCheck.CustomCheckResults.SetResultsUrl
•   pfcModelCheck.ModelCheckCustomCheckListener.OnCustomCheckAction
•   pfcModelCheck.ModelCheckCustomCheckListener.OnCustomCheckUpdate
                 The interface
                 pfcModelCheck.ModelCheckCustomCheckListener provides
                 the method signatures to implement a custom ModelCheck check.
Models                                                                       9 - 15
         •   Mdl—The model being checked.
         The application method that overrides
         pfcModelCheck.ModelCheckCustomCheckListener.OnCusto
         mCheck is used to evaluate a custom defined check. The user
         application runs the check on the specified model and returns the
         results in the form of the CustomCheckResults object. This object
         contains the following parameters:
# DWGVIEWGENERIC
Models                                                                   9 - 17
DEF_UG_DWGVIEW_GENERIC   CHKTK_UG_DWGVIEW_GENERIC_DRW
TAB_UG_DWGVIEW_GENERIC   VIEWS
MSG_UG_DWGVIEW_GENERIC   CUSTOM: J-Link - Report Generic Status
ERM_UG_DWGVIEW_GENERIC   CUSTOM: J-Link - Report Generic Status
DSC_UG_DWGVIEW_GENERIC   CUSTOM: J-Link - Report Generic Status
# MODEL_PARAM_NAME
DEF_UG_MDLPARAM_NAME   CHKTK_UG_MDLPARAM_NAME_PRT
TAB_UG_MDLPARAM_NAME   DATUM
MSG_UG_MDLPARAM_NAME   CUSTOM: J-Link - Parameter has invalid value
ERM_UG_MDLPARAM_NAME   CUSTOM: J-Link - Invalid Parameter value.
DSC_UG_MDLPARAM_NAME   CUSTOM: J-Link - Parameter has invalid value
# MODEL_ACCURACY
DEF_UG_MDL_ACC_TYPE   CHKTK_UG_MDL_ACC_TYPE_PRT
TAB_UG_MDL_ACC_TYPE   INFO
MSG_UG_MDL_ACC_TYPE   CUSTOM: J-Link - Report Model accuracy type
ERM_UG_MDL_ACC_TYPE   CUSTOM: J-Link - Report Model accuracy type.
DSC_UG_MDL_ACC_TYPE   CUSTOM: J-Link - Report Model accuracy type
import   com.ptc.pfc.pfcGlobal.pfcGlobal;
import   com.ptc.pfc.pfcSession.Session;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcModel2D.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcFeature.*;
import   com.ptc.pfc.pfcComponentFeat.*;
import   com.ptc.pfc.pfcFamily.FamilyTableRow;
import   com.ptc.pfc.pfcBase.*;
import   com.ptc.pfc.pfcSelect.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcAssembly.*;
import   com.ptc.pfc.pfcWindow.*;
import   com.ptc.pfc.pfcView2D.*;
import   com.ptc.pfc.pfcDrawing.*;
import java.util.logging.*;
import java.io.IOException;
import javax.swing.*;
/******************************************************\
CLASS:   pfcModelCheckExamples
                                                                                 Models
PURPOSE: Define all the ModelCHECKs of this example code
\******************************************************/
         try
         {
           /*-----------------------------------------------*\
            Define the ModelCHECK Instructions object
           \*-----------------------------------------------*/
           CustomCheckInstructions NameCheckInst =
           pfcModelCheck.CustomCheckInstructions_Create (Name, Label,
                                                 new MCheckNameListen ()   );
           /*-----------------------------------------------*\
            Define the label for the Update button
           \*-----------------------------------------------*/
           /*-----------------------------------------------*\
            Register the ModelCHECK
           \*-----------------------------------------------*/
Models                                                                  9 - 19
            session.RegisterCustomModelCheck ( NameCheckInst );
         }
         catch (jxthrowable x)
         {
         }
     }
     /******************************************************\
     FUNCTION: SetupDwgGenericCheck()
     PURPOSE: Register the ModelCHECK for checking Generic
              objects in a drawing.
     \******************************************************/
     public static void SetupDwgGenericCheck ()
     {
       String Name = "CHKTK_UG_DWGVIEW_GENERIC";
       String Label = "UG CustomCheck: DWGVIEW GENERIC";
          try
          {
            /*-----------------------------------------------*\
             Define the ModelCHECK Instructions object
            \*-----------------------------------------------*/
            CustomCheckInstructions DwgGenericCheckInst =
            pfcModelCheck.CustomCheckInstructions_Create (Name, Label,
                                             new MCheckDwgGenericListen ()    );
            /*-----------------------------------------------*\
             Define the label for the Action button
            \*-----------------------------------------------*/
            DwgGenericCheckInst.SetActionButtonLabel ("UG CustomCheckAction:
                                                      DWGVIEW GENERIC");
            session = pfcGlobal.GetProESession();
            /*-----------------------------------------------*\
             Register the ModelCHECK
            \*-----------------------------------------------*/
            session.RegisterCustomModelCheck ( DwgGenericCheckInst );
          }
          catch (jxthrowable x)
          {
          }
     }
     /******************************************************\
     FUNCTION: SetupAccuracyCheck()
     PURPOSE: Register the ModelCHECK for checking the type of
              accuracy defined for the model.
     \******************************************************/
     public static void SetupAccuracyCheck ()
         try
         {
           /*-----------------------------------------------*\
            Define the ModelCHECK Instructions object
           \*-----------------------------------------------*/
           CustomCheckInstructions AccuracyCheckInst =
                                                                                        Models
           pfcModelCheck.CustomCheckInstructions_Create (
           Name, Label, new MCheckAccuracyListen () );
session = pfcGlobal.GetProESession();
           /*-----------------------------------------------*\
            Register the ModelCHECK
           \*-----------------------------------------------*/
           session.RegisterCustomModelCheck ( AccuracyCheckInst );
         }
         catch (jxthrowable x)
         {
         }
    }
Models                                                                         9 - 21
/******************************************************\
CLASS:   MCheckNameListen
PURPOSE: Define the ModelCHECK for checking the parameter value on the
         model & Update for changing it to the required value if required.
\******************************************************/
class MCheckNameListen extends
com.ptc.pfc.pfcModelCheck.DefaultModelCheckCustomCheckListener
{
     /******************************************************\
     FUNCTION: OnCustomCheck()
     PURPOSE: Check name of the parameter
     RETURNS: CustomCheckResults object
     \******************************************************/
     public CustomCheckResults OnCustomCheck (String CheckName, Model Mdl)
                                        throws com.ptc.cipjava.jxthrowable
     {
       CustomCheckResults result = null;
         if (param == null)
         {
           results_table.append("UG CustomCheck: MDL PARAM NOT FOUND");
           result_count = 1;
         }
         else
         {
           param_value = param.GetScaledValue ();
pvalue_type = param_value.Getdiscr();
           if (pvalue_type == ParamValueType.PARAM_STRING)
           {
            if( param_value.GetStringValue().equals(Mdl.GetInstanceName()) )
            {
             result_count = 0;
            }
            else
            {
             results_table.append("UG CustomCheck: MDL PARAM INCORRECT");
             result_count = 1;
            }
           }
           else
result.SetResultsTable (results_table);
return (result);
                                                                                     Models
    }
    /******************************************************\
    FUNCTION: OnCustomCheckUpdate()
    PURPOSE: Update the parameter name in case it is wrong or create the
              parameter with requried name in case it does not exist.
    \******************************************************/
    public void OnCustomCheckUpdate (String CheckName , Model Mdl, String
                         SelectedItem) throws com.ptc.cipjava.jxthrowable
    {
      Parameter param;
      ParamValue param_value;
      ParamValueType pvalue_type;
      String message_file = "jlexamples.txt";
Models                                                                      9 - 23
     }
     if (Sld.GetAbsoluteAccuracy() != null)
     {
       accuracy = Sld.GetAbsoluteAccuracy();
       results_table.append("UG CustomCheck: MDL ACC ABS");
       result_count = 1;
       sess.UIDisplayMessage (message_file, "jlMCABSAcc", null);
     }
     else
     {
       accuracy = Sld.GetRelativeAccuracy();
result.SetResultsTable (results_table);
return (result);
                                                                                          Models
    }
    /******************************************************\
    FUNCTION: OnCustomCheck()
    PURPOSE: Check existence of Generics in the drawing
    RETURNS: CustomCheckResults object
    \******************************************************/
    public CustomCheckResults OnCustomCheck (String CheckName, Model Mdl)
                                         throws com.ptc.cipjava.jxthrowable
    {
      CustomCheckResults result = null;
        View2D dwgview;
        Model viewmodel;
Models                                                                           9 - 25
      Solid viewsolid;
      FamilyMember parent;
      String viewname;
/*-----------------------------------------------*\
      Generics will have no parent.
\*-----------------------------------------------*/
          if (parent == null)
          {
            viewname = dwgview.GetName();
            results_table.append(viewname);
            result_count++;
          }
      }
result.SetResultsTable (results_table);
      return (result);
  }
  /******************************************************\
  FUNCTION: OnCustomCheckAction()
  PURPOSE: Highlight Generics present in the drawing.
  \******************************************************/
  public void OnCustomCheckAction (String CheckName , Model Mdl, String
                         SelectedItem) throws com.ptc.cipjava.jxthrowable
  {
    Session sess = pfcGlobal.GetProESession ();
      Point3D p1 = Point3D.create();
      p1.set(0,(outline.get(0).get(0) - 10));
      p1.set(1,(outline.get(0).get(1) - 10));
      p1.set(2,0);
Point3D p2 = Point3D.create();
        Point3D p3 = Point3D.create();
        p3.set(0,(outline.get(1).get(0) + 10));
        p3.set(1,(outline.get(1).get(1) + 10));
        p3.set(2,0);
        Point3D p4 = Point3D.create();
        p4.set(0,(outline.get(1).get(0) + 10));
                                                                                   Models
        p4.set(1,(outline.get(0).get(1) - 10));
        p4.set(2,0);
        Point3D p5 = Point3D.create();
        p5.set(0,(outline.get(0).get(0) - 10));
        p5.set(1,(outline.get(0).get(1) - 10));
        p5.set(2,0);
        boundary.insert(0,p1);
        boundary.insert(1,p2);
        boundary.insert(2,p3);
        boundary.insert(3,p4);
        boundary.insert(4,p5);
sess.DrawPolyline (boundary);
        dwgview.Regenerate();
    }
}
Models                                                                    9 - 27
CHKTK_UG_DWGVIEW_GENERIC_DRW    YNEW    E       E       E           E        Y
CHKTK_UG_MDLPARAM_NAME_PRT      YNEW    E       E       E           E        Y
CHKTK_UG_MDL_ACC_TYPE_PRT       YNEW    Y       Y       Y           Y        Y
Topic Page
                                                            10 - 1
Overview of Drawings in J-Link
                 This section describes the functions that deal with drawings. You
                 can create drawings of all Pro/ENGINEER models using the
                 functions in J-Link. You can annotate the drawing, manipulate
                 dimensions, and use layers to manage the display of different items.
Method Introduced:
•   pfcSession.BaseSession.CreateDrawingFromTemplate
                 Use the method
                 pfcSession.BaseSession.CreateDrawingFromTemplate to
                 create a drawing from the drawing template and to return the
                 created drawing. The attributes are:
                                                                                        Drawings
Methods Introduced:
•   pfcExceptions.XToolkitDrawingCreateErrors.GetErrors
•   pfcExceptions.DrawingCreateError.GetType
•   pfcExceptions.DrawingCreateError.GetViewName
•   pfcExceptions.DrawingCreateError.GetObjectName
•   pfcExceptions.DrawingCreateError.GetSheetNumber
•   pfcExceptions.DrawingCreateError.GetView
                 The exception XToolkitDrawingCreateErrors is thrown if an
                 error is encountered when creating a drawing from a template. This
                 exception contains a list of errors which occurred during drawing
                 creation.
Drawings                                                                       10 - 3
                     –   DWGCREATE_ERR_NO_RPT_REGIONS—Repeat regions
                         not available.
                     –   DWGCREATE_ERR_FIRST_REGION_USED—Repeat
                         region was unable to use the region specified.
                     –   DWGCREATE_ERR_NOT_PROCESS_ASSEM— Model is
                         not a process assembly view.
                     –   DWGCREATE_ERR_NO_STEP_NUM—The process step
                         number does not exist.
                     –   DWGCREATE_ERR_TEMPLATE_USED—The template
                         does not exist.
                     –   DWGCREATE_ERR_NO_PARENT_VIEW_FOR_PROJ—Ther
                         e is no possible parent view for this projected view.
                     –   DWGCREATE_ERR_CANT_GET_PROJ_PARENT—Could
                         not get the projected parent for a drawing view.
                     –   DWGCREATE_ERR_SEC_NOT_PARALLEL—The
                         designated cross section was not parallel to the created
                         view.
                     –   DWGCREATE_ERR_SIMP_REP_DOESNT_EXIST—The
                         designated simplified representation does not exist.
                 •   ViewName—Name of the view where the error occurred.
                 •   SheetNumber—Sheet number where the error occurred.
                 •   ObjectName—Name of the invalid or missing object.
                 •   View—2D view in which the error occurred.
                 Use the method
                 pfcExceptions.XToolkitDrawingCreateErrors.GetErrors to
                 obtain the preceding array elements from the error object.
                                                                              Drawings
import   java.io.*;
public   class pfcDrawingExamples {
/*====================================================================*\
FUNCTION: createDrawingFromTemplate
PURPOSE: Create a new drawing using a predefined template.
\*====================================================================*/
    public static void createDrawingFromTemplate (String newDrawingName)
    throws com.ptc.cipjava.jxthrowable
    {
     String predefinedTemplate = "c_drawing";
     if (newDrawingName == "")
         {
          throw new RuntimeException("Please supply a drawing name.
                                      Aborting...");
         }
/*------------------------------------------------------------------*\
  Use the current model to create the drawing.
\*------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession();
     Model solid = session.GetCurrentModel();
     if (solid == null || (solid.GetType() != ModelType.MDL_PART &&
                       solid.GetType() != ModelType.MDL_ASSEMBLY))
         {
          throw new RuntimeException ("Current model is not usable for new
                                       drawing. Aborting...");
         }
Drawings                                                             10 - 5
     }
}
Methods Introduced:
•   pfcSession.BaseSession.RetrieveModel
•   pfcSession.BaseSession.GetModel
•   pfcSession.BaseSession.GetModelFromDescr
•   pfcSession.BaseSession.ListModels
•   pfcSession.BaseSession.ListModelsByType
                 The method pfcSession.BaseSession.RetrieveModel retrieves
                 the drawing specified by the model descriptor. Model descriptors
                 are data objects used to describe a model file and its location in the
                 system. The method returns the retrieved drawing.
Drawing Information
Methods Introduced:
•   pfcModel2D.Model2D.ListModels
•   pfcModel2D.Model2D.GetCurrentSolid
•   pfcModel2D.Model2D.ListSimplifiedReps
•   pfcModel2D.Model2D.GetTextHeight
                 The method pfcModel2D.Model2D.ListModels returns a list of
                 all the solid models used in the drawing.
Drawing Operations
                                                                                          Drawings
Methods Introduced:
•   pfcModel2D.Model2D.AddModel
•   pfcModel2D.Model2D.DeleteModel
•   pfcModel2D.Model2D.ReplaceModel
•   pfcModel2D.Model2D.SetCurrentSolid
•   pfcModel2D.Model2D.AddSimplifiedRep
•   pfcModel2D.Model2D.DeleteSimplifiedRep
•   pfcModel2D.Model2D.Regenerate
•   pfcModel2D.Model2D.SetTextHeight
•   pfcModel2D.Model2D.CreateDrawingDimension
•   pfcModel2D.Model2D.CreateView
                 The method pfcModel2D.Model2D.AddModel adds a new solid
                 model to the drawing.
Drawings                                                                         10 - 7
                 The method pfcModel2D.Model2D.AddSimplifiedRep
                 associates the drawing with the simplified representation of an
                 assembly .
import   com.ptc.pfc.pfcGlobal.pfcGlobal;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcDetail.*;
import   com.ptc.pfc.pfcDrawing.*;
import   com.ptc.pfc.pfcBase.*;
import   com.ptc.pfc.pfcGeometry.*;
import   com.ptc.pfc.pfcSelect.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcTable.*;
import   com.ptc.pfc.pfcView2D.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcAssembly.*;
import   com.ptc.pfc.pfcModel2D.*;
import   com.ptc.pfc.pfcSheet.*;
import   com.ptc.pfc.pfcExceptions.*;
import   com.ptc.pfc.pfcDrawingFormat.*;
import   com.ptc.pfc.pfcDimension2D.*;
/*==================================================================*\
FUNCTION: drawingSolidReplace()
PURPOSE: Replaces all instance solid models in a drawing with their
                                                                              Drawings
          generic. Similar to the Pro/ENGINEER behavior, the function
          will not replace models if the target generic
          model is already present in the drawing.
\*==================================================================*/
    public static void replaceModels() throws com.ptc.cipjava.jxthrowable
    {
/*--------------------------------------------------------------------*\
  Get the current drawing
\*--------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession ();
     Model model = session.GetCurrentModel();
     if (model.GetType() != ModelType.MDL_DRAWING)
         throw new RuntimeException ("Current model is not a drawing");
/*------------------------------------------------------------------*\
  Loop on all of the drawing models.
\*------------------------------------------------------------------*/
     for (int i = 0; i < solids.getarraysize(); i++)
         {
          Solid solid = (Solid)solids.get (i);
/*------------------------------------------------------------------*\
  If the generic is not an instance, continue (GetParent() method
  from class FamilyMember)
\*------------------------------------------------------------------*/
          Solid generic = (Solid)solid.GetParent();
           if (generic == null)
               continue;
/*------------------------------------------------------------------*\
  Replace all instances with their (top-level) generic.
\*------------------------------------------------------------------*/
Drawings                                                             10 - 9
           try
               {
                drawing.ReplaceModel (solid, generic, true);
               }
           catch (XToolkitFound xtef)
               {
                // Target generic is already in drawing; do nothing
               }
          }
     }
}
Drawing Sheets
                 A drawing sheet is represented by its number. Drawing sheets in
                 J-Link are identified by the same sheet numbers seen by a
                 Pro/Engineer user.
•   pfcSheet.SheetOwner.GetSheetData
•   pfcSheet.SheetOwner.GetSheetTransform
•   pfcSheet.SheetOwner.GetSheetScale
•   pfcSheet.SheetOwner.GetSheetFormat
•   pfcSheet.SheetOwner.GetSheetBackgroundView
•   pfcSheet.SheetOwner.GetNumberOfSheets
•   pfcSheet.SheetOwner.GetCurrentSheetNumber
•   pfcSheet.SheetOwner.GetSheetUnits
                 The method pfcSheet.SheetOwner.GetSheetData returns sheet
                 data including the size, orientation, and units of the sheet specified
                 by the sheet number.
                 The method
                 pfcSheet.SheetOwner.GetSheetBackgroundView returns the
                                                                                          Drawings
                 view object representing the background view of the sheet specified
                 by the sheet number.
•   pfcSheet.SheetOwner.AddSheet
•   pfcSheet.SheetOwner.DeleteSheet
•   pfcSheet.SheetOwner.ReorderSheet
•   pfcSheet.SheetOwner.RegenerateSheet
•   pfcSheet.SheetOwner.SetSheetScale
•   pfcSheet.SheetOwner.SetSheetFormat
•   pfcSheet.SheetOwner.SetCurrentSheetNumber
                 The method pfcSheet.SheetOwner.AddSheet adds a new sheet
                 to the model and returns the number of the new sheet.
Drawings                                                                        10 - 11
                     Note: The sheet number of other affected sheets also changes
                           due to reordering or deletion.
                  The method pfcSheet.SheetOwner.RegenerateSheet
                  regenerates the sheet specified by the sheet number.
                  The following example shows how to list the sheets in the current
                  drawing. The information is placed in an external browser window.
import com.ptc.cipjava.*;
import    com.ptc.pfc.pfcGlobal.pfcGlobal;
import    com.ptc.pfc.pfcSession.*;
import    com.ptc.pfc.pfcModel.*;
import    com.ptc.pfc.pfcDetail.*;
import    com.ptc.pfc.pfcDrawing.*;
import    com.ptc.pfc.pfcBase.*;
import    com.ptc.pfc.pfcGeometry.*;
import    com.ptc.pfc.pfcSelect.*;
import    com.ptc.pfc.pfcSolid.*;
import    com.ptc.pfc.pfcTable.*;
import    com.ptc.pfc.pfcView2D.*;
import    com.ptc.pfc.pfcModelItem.*;
import    com.ptc.pfc.pfcAssembly.*;
import    com.ptc.pfc.pfcModel2D.*;
import    com.ptc.pfc.pfcSheet.*;
import    com.ptc.pfc.pfcExceptions.*;
import java.lang.reflect.Array;
import java.text.*;
import java.io.*;
/*====================================================================*\
FUNCTION : listSheets()
                                                                              Drawings
PURPOSE : Command to list drawing sheet info in an information window
\*====================================================================*/
    public static void listSheets() throws com.ptc.cipjava.jxthrowable,
java.io.IOException
    {
/*--------------------------------------------------------------------*\
          Save an HTML file to contain the information to be displayed
\*--------------------------------------------------------------------*/
     String URL = "sheet_info.html";
writer.println ("<html><head></head><body>");
/*--------------------------------------------------------------------*\
   Get the current drawing
\*--------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession ();
     Model model = session.GetCurrentModel();
     if (model.GetType() != ModelType.MDL_DRAWING)
         throw new RuntimeException ("Current model is not a drawing");
/*--------------------------------------------------------------------*\
 Print the information to the window
Drawings                                                            10 - 13
\*--------------------------------------------------------------------*/
           switch (info.GetUnits().GetType().getValue())
               {
               case LengthUnitType._LENGTHUNIT_INCH:
                unit = "inches";
                break;
               case LengthUnitType._LENGTHUNIT_FOOT:
                unit = "feet";
                break;
               case LengthUnitType._LENGTHUNIT_MM:
                unit = "mm";
                break;
               case LengthUnitType._LENGTHUNIT_CM:
                unit = "cm";
                break;
               case LengthUnitType._LENGTHUNIT_M:
                unit = "m";
                break;
               case LengthUnitType._LENGTHUNIT_MCM:
                unit = "mcm";
                break;
               }
          }
      writer.println ("</body></html>");
writer.close ();
      session.GetCurrentWindow().SetURL (session.GetCurrentDirectory()+
                                         URL);
Drawing Views
                 A drawing view is represented by the interface
                 pfcView2D.View2D. All model views in the drawing are
                 associative, that is, if you change a dimensional value in one view,
                                                                                         Drawings
                 the system updates other drawing views accordingly. The model
                 automatically reflects any dimensional changes that you make to a
                 drawing. In addition, corresponding drawings also reflect any
                 changes that you make to a model such as the addition or deletion
                 of features and dimensional changes.
•   pfcModel2D.Model2D.CreateView
                 The method pfcModel2D.Model2D.CreateView creates a new
                 view in the drawing. Before calling this method, the drawing must
                 be displayed in a window.
Methods Introduced:
•   pfcView2D.pfcView2D.GeneralViewCreateInstructions_Create
•   pfcView2D.GeneralViewCreateInstructions.SetViewModel
•   pfcView2D.GeneralViewCreateInstructions.SetLocation
•   pfcView2D.GeneralViewCreateInstructions.SetSheetNumber
Drawings                                                                       10 - 15
•   pfcView2D.GeneralViewCreateInstructions.SetOrientation
•   pfcView2D.GeneralViewCreateInstructions.SetExploded
•   pfcView2D.GeneralViewCreateInstructions.SetScale
                 The method
                 pfcView2D.pfcView2D.GeneralViewCreateInstructions_Cre
                 ate creates the pfcView2D.GeneralViewCreateInstructions
                 data object used for creating general drawing views.
                 The method
                 pfcView2D.GeneralViewCreateInstructions.SetOrientation
                 assigns the orientation of the model in the general drawing view in
                 the form of the pfcBase.Transform3D data object. The
                 transformation matrix must only consist of the rotation to be
                 applied to the model. It must not consist of any displacement or
                 scale components. If necessary, set the displacement to {0, 0, 0}
                 using the method pfcBase.Transform3D.SetOrigin, and remove
                 any scaling factor by normalizing the matrix.
•   pfcView2D.pfcView2D.ProjectionViewCreateInstructions_Create
•   pfcView2D.ProjectionViewCreateInstructions.SetParentView
•   pfcView2D.ProjectionViewCreateInstructions.SetLocation
•   pfcView2D.ProjectionViewCreateInstructions.SetExploded
                 The method
                 pfcView2D.pfcView2D.ProjectionViewCreateInstructions_C
                                                                                         Drawings
                 reate creates the
                 pfcView2D.ProjectionViewCreateInstructions data object
                 used for creating projected drawing views.
Drawings                                                                       10 - 17
import    com.ptc.pfc.pfcDimension2D.*;
import    java.lang.reflect.Array;
import    java.text.*;
import    java.io.*;
      if (model.GetType() != ModelType.MDL_DRAWING)
          throw new RuntimeException ("Current model is not a drawing");
/*--------------------------------------------------------------------*\
  Find the solid model, if its in session
\*--------------------------------------------------------------------*/
     ModelDescriptor mdlDescr =
         pfcModel.ModelDescriptor_CreateFromFileName (solidName);
     Model solidMdl = session.GetModelFromDescr (mdlDescr);
     if (solidMdl == null)
         {
/*--------------------------------------------------------------------*\
     If its not found, try to retieve the solid model
\*--------------------------------------------------------------------*/
          solidMdl = session.RetrieveModel (mdlDescr);
             if (solidMdl == null)
                 throw new RuntimeException ("Model "+solidName+"
                                             cannot be found or retrieved.");
            }
/*--------------------------------------------------------------------*\
     Try to add it to the drawing
\*--------------------------------------------------------------------*/
/*---------------------------------------------------------------------*\
 Create a general view from the Z axis direction at a predefined location
                                                                                 Drawings
\*---------------------------------------------------------------------*/
     Matrix3D matrix = Matrix3D.create();
     for (int i = 0; i < 4; i++)
          for (int j = 0; j < 4; j++)
              {
               if (i == j)
                   matrix.set (i, j, 1.0);
               else
                   matrix.set (i, j, 0.0);
              }
     GeneralViewCreateInstructions instrs =
         pfcView2D.GeneralViewCreateInstructions_Create (solidMdl,
                                                         sheetNo,
                                                         pos, transf);
/*--------------------------------------------------------------------*\
  Get the position and size of the new view
\*--------------------------------------------------------------------*/
     Outline3D outline = genView.GetOutline();
/*--------------------------------------------------------------------*\
  Create a projected view to the right of the general view
\*--------------------------------------------------------------------*/
     pos.set (0, outline.get (1).get (0) + (outline.get(1).get(0) -
                                outline.get (0).get (0)));
     pos.set (1, (outline.get (0).get(1) + outline.get (1).get(1))/2);
     ProjectionViewCreateInstructions pInstrs =
         pfcView2D.ProjectionViewCreateInstructions_Create (genView,
                                                            pos);
Drawings                                                               10 - 19
      drawing.CreateView (pInstrs);
/*--------------------------------------------------------------------*\
  Create a projected view below the general view
\*--------------------------------------------------------------------*/
     pos.set (0, (outline.get (0).get(0) + outline.get (1).get(0))/2);
     pos.set (1, outline.get (0).get (1) - (outline.get(1).get(1) -
                                outline.get (0).get (1)));
      pInstrs =
          pfcView2D.ProjectionViewCreateInstructions_Create (genView,
                                                             pos);
      drawing.CreateView (pInstrs);
     }
}
•   pfcSelect.Selection.GetSelView2D
•   pfcModel2D.Model2D.List2DViews
•   pfcModel2D.Model2D.GetViewByName
•   pfcModel2D.Model2D.GetViewDisplaying
•   pfcSheet.SheetOwner.GetSheetBackgroundView
                 The method pfcSelection.Selection.GetSelView2D returns the
                 selected drawing view (if the user selected an item from a drawing
                 view). It returns a null value if the selection does not contain a
                 drawing view.
•   pfcObject.Child.GetDBParent
•   pfcView2D.View2D.GetSheetNumber
                                                                                       Drawings
•   pfcView2D.View2D.GetIsBackground
•   pfcView2D.View2D.GetModel
•   pfcView2D.View2D.GetScale
•   pfcView2D.View2D.GetIsScaleUserdefined
•   pfcView2D.View2D.GetOutline
•   pfcView2D.View2D.GetLayerDisplayStatus
•   pfcView2D.View2D.GetIsViewdisplayLayerDependent
•   pfcView2D.View2D.GetDisplay
•   pfcView2D.View2D.GetTransform
•   pfcView2D.View2D.GetName
                 The inherited method pfcObject.Child.GetDBParent, when
                 called on a View2D object, provides the drawing model which owns
                 the specified drawing view. The return value of the method can be
                 downcast to a Model2D object.
Drawings                                                                     10 - 21
                  The method pfcView2D.View2D.GetLayerDisplayStatus
                  returns the display status of the specified layer in the drawing
                  view.
                                                                              Drawings
import java.lang.reflect.Array;
import java.text.*;
import java.io.*;
/*====================================================================*\
FUNCTION : listViews()
PURPOSE : Command to list view info in an information window
\*====================================================================*/
    public static void listViews() throws com.ptc.cipjava.jxthrowable,
    java.io.IOException
    {
/*--------------------------------------------------------------------*\
  Open a browser window to contain the information to be displayed
\*--------------------------------------------------------------------*/
     String URL = "view_info.html";
     PrintWriter writer = new PrintWriter (new FileOutputStream (URL));
writer.println ("<html><head></head><body>");
/*--------------------------------------------------------------------*\
  Get the current drawing
\*--------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession ();
     Model model = session.GetCurrentModel();
     if (model.GetType() != ModelType.MDL_DRAWING)
         throw new RuntimeException ("Current model is not a drawing");
Drawings                                                            10 - 23
/*--------------------------------------------------------------------*\
  Get the name & sheet number for this view
\*--------------------------------------------------------------------*/
          String viewName = view.GetName();
          int sheetNo = view.GetSheetNumber ();
/*--------------------------------------------------------------------*\
  Get the name of the solid that the view contains
\*--------------------------------------------------------------------*/
          Model solid = view.GetModel ();
          ModelDescriptor descr = solid.GetDescr();
/*--------------------------------------------------------------------*\
  Get the outline, scale, and display state
\*--------------------------------------------------------------------*/
          Outline3D outline = view.GetOutline();
          double scale = view.GetScale();
          ViewDisplay display = view.GetDisplay();
/*--------------------------------------------------------------------*\
  Write the information to the browser window file
\*--------------------------------------------------------------------*/
                                                                                        Drawings
                             dispStyle + " </td></tr>");
           writer.println   ("</table>");
           writer.println   ("<br>");
          }
      writer.println ("</body></html>");
writer.close ();
    session.GetCurrentWindow().SetURL (session.GetCurrentDirectory()+URL);
     }
}
•   pfcView2D.View2D.SetScale
•   pfcView2D.View2D.Translate
•   pfcView2D.View2D.Delete
•   pfcView2D.View2D.Regenerate
•   pfcView2D.View2D.SetLayerDisplayStatus
•   pfcView2D.View2D.SetDisplay
                 The method pfcView2D.View2D.SetScale sets the scale of the
                 drawing view.
Drawings                                                                      10 - 25
                 The method pfcView2D.View2D.SetLayerDisplayStatus sets
                 the display status for the layer in the drawing view.
Drawing Dimensions
                 This section describes the J-Link methods that give access to the
                 types of dimensions that can be created in the drawing mode. They
                 do not apply to dimensions created in the solid mode, either those
                 created automatically as a result of feature creation, or reference
                 dimension created in a solid. A drawing dimension or a reference
                 dimension shown in a drawing is represented by the interface
                 com.ptc.pfc.pfcDimension2D.Dimension2D.
•   pfcModelItem.ModelItemOwner.ListItems
•   pfcModelItem.ModelItemOwner.GetItemById
•   pfcSelect.Selection.GetSelItem
                 The method pfcModelItem.ModelItemOwner.ListItems
                 returns a list of drawing dimensions specified by the parameter
                 Type or returns null if no drawing dimensions of the specified type
                 are found. This method lists only those dimensions created in the
                 drawing.
The values of the parameter Type for the drawing dimensions are:
                 •    ITEM_DIMENSION—Dimension
                 •    ITEM_REF_DIMENSION—Reference dimension
                 Set the parameter Type to the type of drawing dimension to
                 retrieve. If this parameter is set to null, then all the dimensions in
                 the drawing are listed.
•   pfcDimension2D.pfcDimension2D.DrawingDimCreateInstructions_Create
•   pfcModel2D.Model2D.CreateDrawingDimension
•   pfcDimension2D.pfcDimension2D.EmptyDimensionSense_Create
•   pfcDimension2D.pfcDimension2D.PointDimensionSense_Create
                                                                                             Drawings
•   pfcDimension2D.pfcDimension2D.SplinePointDimensionSense_Create
•   pfcDimension2D.pfcDimension2D.TangentIndexDimensionSense_Create
•   pfcDimension2D.pfcDimension2D.LinAOCTangentDimensionSense_Create
•   pfcDimension2D.pfcDimension2D.AngleDimensionSense_Create
•   pfcDimension2D.pfcDimension2D.PointToAngleDimensionSense_Create
                 The method
                 pfcDimension2D.pfcDimension2D.DrawingDimCreateInstru
                 ctions_Create creates an instructions object that describes how to
                 create a drawing dimension using the method
                 pfcModel2D.Model2D.CreateDrawingDimension.
Drawings                                                                           10 - 27
              –   DIMSENSE_POINT_TO_ANGLE
          •   TextLocation—The location of the dimension text, in world
              units.
          The method pfcModel2D.Model2D.CreateDrawingDimension
          creates a dimension in the drawing based on the instructions data
          object that contains information needed to place the dimension. It
          takes as input an array of pfcSelection objects and an array of
          pfcDimensionSense structures that describe the required
          attachments. The method returns the created drawing dimension.
          The method
          pfcDimension2D.pfcDimension2D.EmptyDimensionSense_C
          reate creates a new dimension sense associated with the type
          DIMSENSE NONE. The "sense" field is set to Type. In this case no
          information such as location or direction is needed to describe the
          attachment points. For example, if there is a single attachment
          which is a straight line, the dimension is the length of the straight
          line. If the attachments are two parallel lines, the dimension is the
          distance between them.
          The method
          pfcDimension2D.pfcDimension2D.PointDimensionSense_Cr
          eate creates a new dimension sense associated with the type
          DIMSENSE POINT which specifies the part of the entity to which
          the dimension is attached. The "sense" field is set to the value of the
          parameter PointType.
           The method
           pfcDimension2D.pfcDimension2D.LinAOCTangentDimensio
           nSense_Create creates a new dimension sense associated with the
                                                                                     Drawings
           type DIMSENSE_LINEAR_TO_ARC_OR_CIRCLE_TANGENT.
           The dimension is the perpendicular distance between the a line and
           a tangent to an arc or a circle that is parallel to the line. The sense
           field is set to the value of the parameter TangentType.
Drawings                                                                   10 - 29
                 •    ShouldFlip—If the value of ShouldFlip is FALSE, and the
                      direction of the specified entity is away from the vertex of the
                      angle, then the dimension attaches directly to the entity. If the
                      direction of the entity is away from the vertex of the angle, then
                      the dimension is attached to the a witness line. The witness line
                      is in line with the entity but in the direction opposite to the
                      vertex of the angle. If the value of ShouldFlip is TRUE then the
                      above cases are reversed.
                 The method
                 pfcDimension2D.pfcDimension2D.PointToAngleDimensionS
                 ense_Create creates a new dimension sense associated with the
                 type DIMSENSE_POINT_TO_ANGLE. The dimension is the angle
                 between a line entity and the tangent to a curved entity. The curve
                 attachment is of the type DIMSENSE_POINT_TO_ANGLE and the
                 line attachment is of the type DIMSENSE POINT. In this case both
                 the "angle" and the "angle_sense" fields must be set. The field
                 "sense" shows which end of the curve the dimension is attached to
                 and the field "angle_sense" shows the direction in which the
                 dimension rotates and to which side of the tangent it attaches.
•   pfcDimension2D.Dimension2D.GetIsAssociative
•   pfcDimension2D.Dimension2D.GetIsReference
•   pfcDimension2D.Dimension2D.GetIsDisplayed
•   pfcDimension2D.Dimension2D.GetAttachmentPoints
•   pfcDimension2D.Dimension2D.GetDimensionSenses
•   pfcDimension2D.Dimension2D.GetOrientationHint
•   pfcDimension2D.Dimension2D.GetBaselineDimension
•   pfcDimension2D.Dimension2D.GetLocation
•   pfcDimension2D.Dimension2D.GetView
•   pfcDimension2D.Dimension2D.GetTolerance
•   pfcDimension2D.Dimension2D.GetIsToleranceDisplayed
                 The method pfcDimension2D.Dimension2D.GetIsAssociative
                 returns whether the dimension or reference dimension in a drawing
                 is associative.
           The method
           pfcDimension2D.Dimension2D.GetAttachmentPoints returns
           a sequence of attachment points. The dimension senses array
                                                                                 Drawings
           returned by the method
           pfcDimension2D.Dimension2D.GetDimensionSenses gives
           more information on how these attachments are interpreted.
           The method
           pfcDimension2D.Dimension2D.GetDimensionSenses returns
           a sequence of dimension senses, describing how the dimension is
           attached to each attachment returned by the method
           pfcDimension2D.Dimension2D.GetAttachmentPoints.
           The method
           pfcDimension2D.Dimension2D.GetOrientationHint returns
           the orientation hint for placing the drawing dimensions. The
           orientation hint determines how Pro/ENGINEER will orient the
           dimension with respect to the attachment points.
Drawings                                                               10 - 31
                 The method pfcDimension2D.Dimension2D.GetTolerance
                 retrieves the upper and lower tolerance limits of the drawing
                 dimension in the form of the DimTolerance object. A null value
                 indicates a nominal tolerance.
•   pfcDimension2D.Dimension2D.ConvertToLinear
•   pfcDimension2D.Dimension2D.ConvertToOrdinate
•   pfcDimension2D.Dimension2D.ConvertToBaseline
•   pfcDimension2D.Dimension2D.SetLocation
•   pfcDimension2D.Dimension2D.SwitchView
•   pfcDimension2D.Dimension2D.SetTolerance
•   pfcDimension2D.Dimension2D.EraseFromModel2D
•   pfcModel2D.Model2D.SetViewDisplaying
                 The method pfcDimension2D.Dimension2D.ConvertToLinear
                 converts an ordinate drawing dimension to a linear drawing
                 dimension. The drawing containing the dimension must be
                 displayed.
                 The method
                 pfcDimension2D.Dimension2D.ConvertToOrdinate converts
                 a linear drawing dimension to an ordinate baseline dimension.
                 The method
                 pfcDimension2D.Dimension2D.ConvertToBaseline converts a
                 location on a linear drawing dimension to an ordinate baseline
                 dimension. The method returns the newly created baseline
                 dimension.
                 The method
                 pfcDimension2D.Dimension2D.EraseFromModel2D
                 permanently erases the dimension from the drawing.
                                                                                      Drawings
                 The method pfcModel2D.Model2D.SetViewDisplaying changes
                 the view where a dimension created in a solid model is displayed.
/*====================================================================*\
FUNCTION: createPointDims()
PURPOSE : Command to create dimensions to each of the models' datum
points
Drawings                                                                    10 - 33
\*====================================================================*/
    public static void createPointDims() throws
com.ptc.cipjava.jxthrowable
    {
/*--------------------------------------------------------------------*\
  Select a coordinate system. This defines the model (the top one
    in that view), and the common attachments for the dimensions
\*--------------------------------------------------------------------*/
Session session = pfcGlobal.GetProESession ();
SelectionOptions selOptions =
    pfcSelect.SelectionOptions_Create("csys");
selOptions.SetMaxNumSels (new Integer (1));
Selections selections = session.Select (selOptions, null);
/*--------------------------------------------------------------------*\
  Extract the csys handle, and assembly path, and view handle.
\*--------------------------------------------------------------------*/
Selection csysSel = selections.get (0);
ModelItem selItem = csysSel.GetSelItem();
ComponentPath selPath = csysSel.GetPath();
View2D selView = csysSel.GetSelView2D();
Point3D selPos = csysSel.GetPoint();
if (selView == null)
    throw new RuntimeException ("Must select coordinate system from a
                                 drawing view.");
/*--------------------------------------------------------------------*\
  Get the root solid, and the transform from the root to the
  component owning the csys
\*--------------------------------------------------------------------*/
ModelItems points =
    rootSolid.ListItems (ModelItemType.ITEM_POINT);
                                                                              Drawings
Point3D csysPos = selPos;
if (asmTransf != null)
    {
csysPos = asmTransf.TransformPoint (selPos);
    }
Transform3D viewTransf = selView.GetTransform();
csysPos = viewTransf.TransformPoint (csysPos);
/*--------------------------------------------------------------------*\
  Get the view outline
\*--------------------------------------------------------------------*/
Outline3D outline = selView.GetOutline();
/*--------------------------------------------------------------------*\
  Allocate the attachment arrays
\*--------------------------------------------------------------------*/
DimensionSenses senses = DimensionSenses.create();
Selections attachments = Selections.create();
/*--------------------------------------------------------------------*\
  For each datum point...
\*--------------------------------------------------------------------*/
for(int p=0; p<points.getarraysize(); p++)
    {
/*--------------------------------------------------------------------*\
  Calculate the position of the point on the drawing
\*--------------------------------------------------------------------*/
Point point = (Point)points.get (p);
Point3D pntPos = point.GetPoint ();
/*--------------------------------------------------------------------*\
  Set up the "sense" information
\*--------------------------------------------------------------------*/
Drawings                                                            10 - 35
PointDimensionSense sense1 =
    pfcDimension2D.PointDimensionSense_Create
(DimensionPointType.DIMPOINT_CENTER);
senses.set (0, sense1);
PointDimensionSense sense2 =
    pfcDimension2D.PointDimensionSense_Create
(DimensionPointType.DIMPOINT_CENTER);
senses.set (1, sense2);
/*--------------------------------------------------------------------*\
  Set the attachment information
\*--------------------------------------------------------------------*/
Selection pntSel = pfcSelect.CreateModelItemSelection (point, null);
pntSel.SetSelView2D(selView);
attachments.set (0, pntSel);
attachments.set (1, csysSel);
/*--------------------------------------------------------------------*\
  Calculate the dim position to be just to the left of the
  drawing view, midway between the point and csys
\*--------------------------------------------------------------------*/
Vector2D dimPos = Vector2D.create ();
dimPos.set (0, outline.get (0).get (0) - 20.0);
dimPos.set (1, (csysPos.get (1) + pntPos.get (1))/2.0);
/*--------------------------------------------------------------------*\
  Create and display the dimension
\*--------------------------------------------------------------------*/
DrawingDimCreateInstructions createInstrs =
    pfcDimension2D.DrawingDimCreateInstructions_Create (attachments,
senses,
dimPos,
OrientationHint.ORIENTHINT_VERTICAL);
Dimension2D dim = drawing.CreateDrawingDimension (createInstrs);
DrawingDimensionShowInstructions showInstrs =
    pfcView2D.DrawingDimensionShowInstructions_Create (selView, null);
dim.Show (showInstrs);
/*--------------------------------------------------------------------*\
  If this is the first vertical dim, create an ordinate base
  line from it, else just convert it to ordinate
\*--------------------------------------------------------------------*/
if(p==0)
    {
//dimPos.set (0, csysPos.get (0));
//dimPos.set (1, csysPos.get (1));
vBaseline = dim.ConvertToBaseline (csys3DPos);
    }
else
/*--------------------------------------------------------------------*\
  Set this dimension to be horizontal
\*--------------------------------------------------------------------*/
createInstrs.SetOrientationHint (OrientationHint.ORIENTHINT_HORIZONTAL);
/*--------------------------------------------------------------------*\
  Calculate the dim position to be just to the bottom of the
  drawing view, midway between the point and csys
\*--------------------------------------------------------------------*/
dimPos.set (0, (csysPos.get (0) + pntPos.get (0))/2.0);
                                                                                      Drawings
dimPos.set (1, outline.get (1).get (1) - 20.0);
createInstrs.SetTextLocation (dimPos);
/*--------------------------------------------------------------------*\
  Create and display the dimension
\*--------------------------------------------------------------------*/
dim = drawing.CreateDrawingDimension (createInstrs);
dim.Show (showInstrs);
/*--------------------------------------------------------------------*\
  If this is the first horizontal dim, create an ordinate base line
  from it, else just convert it to ordinate
\*--------------------------------------------------------------------*/
if(p==0)
    {
//dimPos.set (0, csysPos.get (0));
//dimPos.set (1, csysPos.get (1));
hBaseline = dim.ConvertToBaseline (csys3DPos);
    }
else
    dim.ConvertToOrdinate (hBaseline);
           }
    }
}
Drawing Tables
               A drawing table in J-Link is represented by the interface
               com.ptc.pfc.pfcTable.Table. It is a child of the ModelItem
               interface.
Drawings                                                                    10 - 37
                 Some drawing table methods operate on specific rows or columns.
                 The row and column numbers in J-Link begin with 1 and range up
                 to the total number of rows or columns in the table. Some drawing
                 table methods operate on specific table cells. The interface
                 com.ptc.pfc.pfcTable.TableCell is used to represent a drawing
                 table cell.
•   pfcTable.pfcTable.TableCell_Create
                 The method pfcTable.pfcTable.TableCell_Create creates the
                 TableCell object representing a cell in the drawing table.
•   pfcSession.BaseSession.Select
•   pfcSelect.Selection.GetSelItem
•   pfcSelect.Selection.GetSelTableCell
•   pfcSelect.Selection.GetSelTableSegment
                 Tables may be selected using the method
                 pfcSession.BaseSession.Select. Pass the filter dwg_table to
                 select an entire table and the filter table_cell to prompt the user
                 to select a particular table cell.
•   pfcTable.pfcTable.TableCreateInstructions_Create
•   pfcTable.TableOwner.CreateTable
                 The method
                 pfcTable.pfcTable.TableCreateInstructions_Create creates
                 the TableCreateInstructions data object that describes how to
                                                                                             Drawings
                 construct a new table using the method
                 pfcTable.TableOwner.CreateTable.
•   pfcTable.pfcTable.TableRetrieveInstructions_Create
•   pfcTable.TableOwner.RetrieveTable
                 The method
                 pfcTable.pfcTable.TableRetrieveInstructions_Create creates
                 the TableRetrieveInstructions data object that describes how to
                 retrieve a drawing table using the method
                 pfcTable.TableOwner.RetrieveTable. The method returns the
                 created instructions data object.
Drawings                                                                           10 - 39
                 The method pfcTable.TableOwner.RetrieveTable retrieves a
                 table specified by the TableRetrieveInstructions data object
                 from a file on the disk. It returns the retrieved table. The data
                 object contains information on the table to retrieve and is returned
                 by the method
                 pfcTable.pfcTable.TableRetrieveInstructions_Create.
•   pfcTable.TableOwner.ListTables
•   pfcTable.TableOwner.GetTable
•   pfcTable.Table.GetRowCount
•   pfcTable.Table.GetColumnCount
•   pfcTable.Table.CheckIfIsFromFormat
•   pfcTable.Table.GetRowSize
•   pfcTable.Table.GetColumnSize
•   pfcTable.Table.GetText
•   pfcTable.Table.GetCellNote
                 The method pfcTable.TableOwner.ListTables returns a
                 sequence of tables found in the model.
                                                                                        Drawings
Methods Introduced:
•   pfcTable.Table.Erase
•   pfcTable.Table.Display
•   pfcTable.Table.RotateClockwise
•   pfcTable.Table.InsertRow
•   pfcTable.Table.InsertColumn
•   pfcTable.Table.MergeRegion
•   pfcTable.Table.SubdivideRegion
•   pfcTable.Table.DeleteRow
•   pfcTable.Table.DeleteColumn
•   pfcTable.Table.SetText
•   pfcTable.TableOwner.DeleteTable
                 The method pfcTable.Table.Erase erases the specified table
                 temporarily from the display. It still exists in the drawing. The
                 erased table can be displayed again using the method
                 pfcTable.Table.Display. The table will also be redisplayed by a
                 window repaint or a regeneration of the drawing. Use these
                 methods to hide a table from the display while you are making
                 multiple changes to the table.
Drawings                                                                      10 - 41
                  The method pfcTable.Table.InsertColumn inserts a new column
                  in the drawing table. Set the value of the parameter ColumnWidth
                  to specify the width of the column. Set the value of the parameter
                  InsertAfterColumn to specify the column number after which the
                  new column has to be inserted. Specify 0 to insert a new first
                  column.
                  The following example creates a drawing table that lists the datum
                  points in a model shown in a drawing view.
import    com.ptc.cipjava.*;
import    com.ptc.pfc.pfcGlobal.pfcGlobal;
import    com.ptc.pfc.pfcSession.*;
import    com.ptc.pfc.pfcModel.*;
import    com.ptc.pfc.pfcDetail.*;
import    com.ptc.pfc.pfcDrawing.*;
import    com.ptc.pfc.pfcBase.*;
import    com.ptc.pfc.pfcGeometry.*;
import    com.ptc.pfc.pfcSelect.*;
import    com.ptc.pfc.pfcSolid.*;
                                                                              Drawings
import   java.io.*;
public   class pfcDrawingExamples {
/*====================================================================*\
FUNCTION : createTableOfPoints()
PURPOSE : Command to create a table of points
\*====================================================================*/
    public static void createTableOfPoints()
    throws com.ptc.cipjava.jxthrowable
    {
/*--------------------------------------------------------------------*\
  Select a coordinate system. This defines the model (the top one
  in that view), and the reference for the datum point positions.
\*--------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession ();
     SelectionOptions selOptions =
         pfcSelect.SelectionOptions_Create("csys");
     selOptions.SetMaxNumSels (new Integer (1));
     Selections selections = session.Select (selOptions, null);
/*--------------------------------------------------------------------*\
  Extract the csys handle, and assembly path, and view handle.
\*--------------------------------------------------------------------*/
     ModelItem selItem = selections.get (0).GetSelItem();
     ComponentPath selPath = selections.get (0).GetPath();
     View2D selView = selections.get (0).GetSelView2D();
     if (selView == null)
         throw new RuntimeException ("Must select coordinate system from a
Drawings                                                            10 - 43
                                       drawing view.");
/*--------------------------------------------------------------------*\
  Extract the csys location (property CoordSys from class CoordSystem)
\*--------------------------------------------------------------------*/
     CoordSystem csys = (CoordSystem) selItem;
     Transform3D csysTransf = csys.GetCoordSys();
     csysTransf.Invert ();
/*--------------------------------------------------------------------*\
  Extract the cys name
\*--------------------------------------------------------------------*/
     String csysName = selItem.GetName();
/*--------------------------------------------------------------------*\
  Get the root solid, and the transform from the root to the
  component owning the csys
\*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*\
  Get a list of datum points in the model
\*--------------------------------------------------------------------*/
      ModelItems points =
          rootSolid.ListItems (ModelItemType.ITEM_POINT);
/*--------------------------------------------------------------------*\
  Set the table position
\*--------------------------------------------------------------------*/
     Point3D location = Point3D.create();
     location.set (0, 500.0);
     location.set (1, 500.0);
     location.set (2, 0.0);
/*--------------------------------------------------------------------*\
  Setup the table creation instructions
\*--------------------------------------------------------------------*/
     TableCreateInstructions instrs =
instrs.SetSizeType (TableSizeType.TABLESIZE_BY_NUM_CHARS);
                                                                                Drawings
                         widths [i]);
          columnInfo.insert (columnInfo.getarraysize(), column);
         }
     instrs.SetColumnData (columnInfo);
/*--------------------------------------------------------------------*\
  Create the table
\*--------------------------------------------------------------------*/
     Table dwgTable = drawing.CreateTable (instrs);
/*--------------------------------------------------------------------*\
  Merge the top row cells to form the header
\*--------------------------------------------------------------------*/
      TableCell topLeft = pfcTable.TableCell_Create (1, 1);
      TableCell bottomRight = pfcTable.TableCell_Create (1, 4);
      dwgTable.MergeRegion (topLeft, bottomRight, null);
/*--------------------------------------------------------------------*\
  Write header text specifying model and csys
\*--------------------------------------------------------------------*/
     writeTextInCell (dwgTable, 1, 1,
                      "Datum points for " + rootSolid.GetFullName() +
                      " w.r.t. csys "+csysName);
/*--------------------------------------------------------------------*\
  Add subheadings to columns
\*--------------------------------------------------------------------*/
      writeTextInCell (dwgTable, 2, 1, "Point");
      writeTextInCell (dwgTable, 2, 2, "X");
      writeTextInCell (dwgTable, 2, 3, "Y");
      writeTextInCell (dwgTable, 2, 4, "Z");
Drawings                                                              10 - 45
/*--------------------------------------------------------------------*\
  For each datum point...
\*--------------------------------------------------------------------*/
      for (int p=0; p<points.getarraysize(); p++)
          {
           Point geomPoint = (Point) points.get(p);
/*--------------------------------------------------------------------*\
  Add the point name to column 1
\*--------------------------------------------------------------------*/
           writeTextInCell (dwgTable, p+3, 1, geomPoint.GetName());
/*--------------------------------------------------------------------*\
  Transform the location w.r.t to the csys
\*--------------------------------------------------------------------*/
           Point3D trfPoint = geomPoint.GetPoint();
           if (asmTransf != null)
               trfPoint =
                asmTransf.TransformPoint (geomPoint.GetPoint());
           trfPoint = csysTransf.TransformPoint (trfPoint);
/*--------------------------------------------------------------------*\
  Add the XYZ to column 3,4,5
\*--------------------------------------------------------------------*/
           DecimalFormat format = new DecimalFormat ("#,##0.000");
           StringBuffer buffer = new StringBuffer();
           FieldPosition position =
                new FieldPosition (NumberFormat.FRACTION_FIELD);
/*====================================================================*\
FUNCTION : writeTextInCell()
PURPOSE : Utility to add one text line to a table cell
\*====================================================================*/
    private static void writeTextInCell(Table table, int row,
                    int col, String text)
                    throws com.ptc.cipjava.jxthrowable
                                                                                          Drawings
                 Drawing tables can be constructed with one or more segments.
                 Each segment can be independently placed. The segments are
                 specified by an integer identifier starting with 0.
Methods Introduced:
•   pfcSelect.Selection.GetSelTableSegment
•   pfcTable.Table.GetSegmentCount
•   pfcTable.Table.GetSegmentSheet
•   pfcTable.Table.MoveSegment
•   pfcTable.Table.GetInfo
                 The method pfcSelect.Selection.GetSelTableSegment returns
                 the value of the segment identifier of the selected table segment. It
                 returns a null value if the selection does not contain a segment
                 identifier.
Drawings                                                                        10 - 47
Repeat Regions
Methods Introduced:
•   pfcTable.Table.IsCommentCell
•   pfcTable.Table.GetCellComponentModel
•   pfcTable.Table.GetCellReferenceModel
•   pfcTable.Table.GetCellTopModel
•   pfcTable.TableOwner.UpdateTables
                 The methods pfcTable.Table.IsCommentCell,
                 pfcTable.Table.GetCellComponentModel,
                 pfcTable.Table.GetCellReferenceModel,
                 pfcTable.Table.GetCellTopModel, and
                 pfcTable.TableOwner.UpdateTables apply to repeat regions in
                 drawing tables.
                 In J-Link you can create, delete and modify detail items, control
                 their display, and query what detail items are present in the
                 drawing. The types of detail items available are:
                                                                                          Drawings
                      –   Arc
                      –   Ellipse
                      –   Line
                      –   Point
                      –   Polygon
                      –   Spline
                 •    Notes—Textual annotations
                 •    Symbol Definitions—Contained in the drawing’s symbol
                      gallery.
                 •    Symbol Instances—Instances of a symbol placed in a drawing.
                 •    Draft Groups—Groups of detail items that contain notes,
                      symbol instances, and draft entities.
                 •    OLE objects—Object Linking and Embedding (OLE) objects
                      embedded in the Pro/ENGINEER drawing file.
•   pfcModelItem.ModelItemOwner.ListItems
•   pfcDetail.DetailItemOwner.ListDetailItems
•   pfcModelItem.ModelItemOwner.GetItemById
•   pfcDetail.DetailItemOwner.CreateDetailItem
                 The method pfcModelItem.ModelItemOwner.ListItems
                 returns a list of detail items specified by the parameter Type or
                 returns null if no detail items of the specified type are found.
• ITEM_DTL_ENTITY—Detail Entity
Drawings                                                                        10 - 49
                 •    ITEM_DTL_NOTE—Detail Note
                 •    ITEM_DTL_GROUP—Draft Group
                 •    ITEM_DTL_SYM_DEFINITION—Detail Symbol Definition
                 •    ITEM_DTL_SYM_INSTANCE—Detail Symbol Instance
                 •    ITEM_DTL_OLE_OBJECT—Drawing embedded OLE object
                 If this parameter is set to null, then all the model items in the
                 drawing are listed.
                 Set the input parameter Type to the type of detail item to be listed.
                 Set it to null to return all the detail items. The input parameter
                 SheetNumber determines the sheet that contains the specified
                 detail item. Pass null to search all the sheets. This argument is
                 ignored if the parameter Type is set to
                 DETAIL_SYM_DEFINITION.
•   pfcDetail.DetailItemOwner.CreateDetailItem
•   pfcDetail.pfcDetailGroupInstructions_Create
                 The method pfcDetail.DetailItemOwner.CreateDetailItem
                 creates a new detail item based on the instruction data object that
                 describes the type and content of the new detail item. The
                 instructions data object is returned by the method
                 pfcDetail.pfcDetailGroupInstructions_Create. The method
                 returns the newly created detail item.
Instructions
                                                                                           Drawings
Methods Introduced:
•   pfcDetail.pfcDetail.DetailEntityInstructions_Create
•   pfcDetail.DetailEntityInstructions.GetGeometry
•   pfcDetail.DetailEntityInstructions.SetGeometry
•   pfcDetail.DetailEntityInstructions.GetIsConstruction
•   pfcDetail.DetailEntityInstructions.SetIsConstruction
•   pfcDetail.DetailEntityInstructions.GetColor
•   pfcDetail.DetailEntityInstructions.SetColor
•   pfcDetail.DetailEntityInstructions.GetFontName
•   pfcDetail.DetailEntityInstructions.SetFontName
•   pfcDetail.DetailEntityInstructions.GetWidth
•   pfcDetail.DetailEntityInstructions.SetWidth
•   pfcDetail.DetailEntityInstructions.GetView
•   pfcDetail.DetailEntityInstructions.SetView
                  The method
                  pfcDetail.pfcDetail.DetailEntityInstructions_Create creates
                  an instructions object that describes how to construct a detail
                  entity, for use in the methods
                  pfcDetail.DetailItemOwner.CreateDetailItem,
                  pfcDetail.DetailSymbolDefItem.CreateDetailItem, and
                  pfcDetail.DetailEntityItem.Modify.
Drawings                                                                         10 - 51
          The instructions object is created based on the curve geometry and
          the drawing view associated with the entity. The curve geometry
          describes the trajectory of the detail entity in world units. The
          drawing view can be a model view returned by the method
          pfcModel2D.Model2D.List2DViews or a drawing sheet
          background view returned by the method
          pfcSheet.SheetOwner.GetSheetBackgroundView. The
          background view indicates that the entity is not associated with a
          particular model view.
          The method
          pfcDetail.DetailEntityInstructions.GetIsConstruction
          returns a value that specifies whether the entity is a construction
          entity.
          The method
          pfcDetail.DetailEntityInstructions.SetIsConstruction
          specifies if the detail entity is a construction entity.
                                                                                           Drawings
                 The method pfcDetail.DetailEntityInstructions.SetView sets
                 the drawing view associated with the entity. The view can either be
                 a model view or a drawing sheet background view.
import   com.ptc.pfc.pfcGlobal.pfcGlobal;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcDetail.*;
import   com.ptc.pfc.pfcDrawing.*;
import   com.ptc.pfc.pfcBase.*;
import   com.ptc.pfc.pfcGeometry.*;
import   com.ptc.pfc.pfcSelect.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcTable.*;
import   com.ptc.pfc.pfcView2D.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcAssembly.*;
import   com.ptc.pfc.pfcModel2D.*;
import   com.ptc.pfc.pfcSheet.*;
import   com.ptc.pfc.pfcExceptions.*;
import   com.ptc.pfc.pfcDrawingFormat.*;
import   com.ptc.pfc.pfcDimension2D.*;
import java.lang.reflect.Array;
import java.text.*;
import java.io.*;
/*====================================================================*\
FUNCTION : createLineEntity()
PURPOSE : Utility to create a line entity between specified points
Drawings                                                                         10 - 53
\*====================================================================*/
    public static void createLineEntity() throws
    com.ptc.cipjava.jxthrowable
    {
     StdColor color = StdColor.COLOR_QUILT;
     Session session = pfcGlobal.GetProESession ();
 /*--------------------------------------------------------------------*\
   Get the current drawing & its background view
\*--------------------------------------------------------------------*/
     Model model = session.GetCurrentModel();
      if (model.GetType() != ModelType.MDL_DRAWING)
          throw new RuntimeException ("Current model is not a drawing");
/*--------------------------------------------------------------------*\
  Select the endpoints of the line
\*--------------------------------------------------------------------*/
     MouseStatus mouse1 =
         session.UIGetNextMousePick (MouseButton.MOUSE_BTN_LEFT);
     Point3D start = mouse1.GetPosition();
     MouseStatus mouse2 =
         session.UIGetNextMousePick (MouseButton.MOUSE_BTN_LEFT);
     Point3D end = mouse2.GetPosition();
/*--------------------------------------------------------------------*\
  Allocate and initialize a curve descriptor
\*--------------------------------------------------------------------*/
     LineDescriptor geom = pfcGeometry.LineDescriptor_Create (start, end);
/*--------------------------------------------------------------------*\
  Allocate data for the draft entity
\*--------------------------------------------------------------------*/
     DetailEntityInstructions instrs =
         pfcDetail.DetailEntityInstructions_Create (geom,
                                                    view);
/*--------------------------------------------------------------------*\
  Set the color to the specified Pro/ENGINEER predefined color
\*--------------------------------------------------------------------*/
     ColorRGB rgb = session.GetRGBFromStdColor (color);
     instrs.SetColor(rgb);
/*--------------------------------------------------------------------*\
  Create the entity
\*--------------------------------------------------------------------*/
     drawing.CreateDetailItem (instrs);
                                                                                           Drawings
Methods Introduced:
•   pfcDetail.DetailEntityItem.GetInstructions
•   pfcDetail.DetailEntityItem.GetSymbolDef
                  The method pfcDetail.DetailEntityItem.GetInstructions
                  returns the instructions data object that is used to construct the
                  detail entity item.
•   pfcDetail.DetailEntityItem.Draw
•   pfcDetail.DetailEntityItem.Erase
•   pfcDetail.DetailEntityItem.Modify
                  The method pfcDetail.DetailEntityItem.Draw temporarily
                  draws a detail entity item, so that it is removed during the next
                  draft regeneration.
Drawings                                                                         10 - 55
OLE Objects
                 An object linking and embedding (OLE) object is an external file,
                 such as a document, graphics file, or video file that is created using
                 an external application and which can be inserted into another
                 application, such as Pro/ENGINEER. You can create and insert
                 supported OLE objects into a two-dimensional Pro/ENGINEER file,
                 such as a drawing, report, format file, layout, or diagram. The
                 functions described in this section enable you to identify and access
                 OLE objects embedded in drawings.
Methods Introduced:
•   pfcDetail.DetailOLEObject.GetApplicationType
•   pfcDetail.DetailOLEObject.GetOutline
•   pfcDetail.DetailOLEObject.GetPath
•   pfcDetail.DetailOLEObject.GetSheet
                 The method pfcDetail.DetailOLEObject.GetApplicationType
                 returns the type of the OLE object as a string, for example,
                 "Microsoft Word Document".
Detail Notes
                 A detail note in J-Link is represented by the interface
                 com.ptc.pfc.pfcDetail.DetailNoteItem. It is a child of the
                 DetailItem interface.
Instructions
Methods Introduced:
• pfcDetail.pfcDetail.DetailNoteInstructions_Create
                                                                                          Drawings
•   pfcDetail.DetailNoteInstructions.SetIsMirrored
•   pfcDetail.DetailNoteInstructions.GetHorizontal
•   pfcDetail.DetailNoteInstructions.SetHorizontal
•   pfcDetail.DetailNoteInstructions.GetVertical
•   pfcDetail.DetailNoteInstructions.SetVertical
•   pfcDetail.DetailNoteInstructions.GetColor
•   pfcDetail.DetailNoteInstructions.SetColor
•   pfcDetail.DetailNoteInstructions.GetLeader
•   pfcDetail.DetailNoteInstructions.SetLeader
•   pfcDetail.DetailNoteInstructions.GetTextAngle
•   pfcDetail.DetailNoteInstructions.SetTextAngle
                  The method
                  pfcDetail.pfcDetail.DetailNoteInstructions_Create creates a
                  data object that describes how a detail note item should be
                  constructed when passed to the methods
                  pfcDetail.DetailItemOwner.CreateDetailItem,
                  pfcDetail.DetailSymbolDefItem.CreateDetailItem, or
                  pfcDetail.DetailNoteItem.Modify. The parameter inTextLines
                  specifies the sequence of text line data objects that describe the
                  contents of the note.
Drawings                                                                        10 - 57
          The method pfcDetail.DetailNoteInstructions.GetIsDisplayed
          returns a boolean indicating if the note is currently displayed.
                                                                                          Drawings
import   com.ptc.pfc.pfcDetail.*;
import   com.ptc.pfc.pfcDrawing.*;
import   com.ptc.pfc.pfcBase.*;
import   com.ptc.pfc.pfcGeometry.*;
import   com.ptc.pfc.pfcSelect.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcTable.*;
import   com.ptc.pfc.pfcView2D.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcAssembly.*;
import   com.ptc.pfc.pfcModel2D.*;
import   com.ptc.pfc.pfcSheet.*;
import   com.ptc.pfc.pfcExceptions.*;
import   com.ptc.pfc.pfcDrawingFormat.*;
import   com.ptc.pfc.pfcDimension2D.*;
import   java.lang.reflect.Array;
import   java.text.*;
import   java.io.*;
/*====================================================================*\
FUNCTION : createSurfNote()
PURPOSE : Utility to create a note that documents the surface name or id.
            The note text will be placed at the upper right corner of the
            selected view.
\*====================================================================*/
    public static void createSurfNote() throws com.ptc.cipjava.jxthrowable
    {
 /*--------------------------------------------------------------------*\
   Get the current drawing & its background view
\*--------------------------------------------------------------------*/
      Session session = pfcGlobal.GetProESession ();
         Model model = session.GetCurrentModel();
     if (model.GetType() != ModelType.MDL_DRAWING)
         throw new RuntimeException ("Current model is not a drawing");
Drawings                                                                        10 - 59
   Interactively select a surface in a drawing view
\*--------------------------------------------------------------------*/
     SelectionOptions options =
         pfcSelect.SelectionOptions_Create ("surface");
     options.SetMaxNumSels (new Integer (1));
/*--------------------------------------------------------------------*\
  Allocate a text item, and set its properties
\*--------------------------------------------------------------------*/
     DetailText text = pfcDetail.DetailText_Create (name);
/*--------------------------------------------------------------------*\
  Allocate a new text line, and add the text item to it
/*--------------------------------------------------------------------*/
     DetailTexts texts = DetailTexts.create();
     texts.insert (0, text);
/*--------------------------------------------------------------------*\
  Set the location of the note text
\*--------------------------------------------------------------------*/
     View2D dwgView = selSurf.GetSelView2D();
     Outline3D outline = dwgView.GetOutline();
     Point3D textPos = outline.get (1);
      FreeAttachment position =
          pfcDetail.FreeAttachment_Create (textPos);
      position.SetView (dwgView);
/*--------------------------------------------------------------------*\
  Set the attachment for the note leader
\*--------------------------------------------------------------------*/
     ParametricAttachment leaderToSurf =
/*--------------------------------------------------------------------*\
  Set the attachment structure
\*--------------------------------------------------------------------*/
     DetailLeaders allAttachments = pfcDetail.DetailLeaders_Create ();
     allAttachments.SetItemAttachment (position);
     Attachments attachs = Attachments.create ();
     attachs.insert (0, leaderToSurf);
     allAttachments.SetLeaders (attachs);
                                                                                         Drawings
/*--------------------------------------------------------------------*\
  Allocate a note description, and set its properties
\*--------------------------------------------------------------------*/
     DetailNoteInstructions instrs =
         pfcDetail.DetailNoteInstructions_Create (textLines);
instrs.SetLeader (allAttachments);
/*--------------------------------------------------------------------*\
  Create the note
\*--------------------------------------------------------------------*/
     DetailNoteItem note =
         (DetailNoteItem) drawing.CreateDetailItem (instrs);
/*--------------------------------------------------------------------*\
  Display the note
\*--------------------------------------------------------------------*/
     note.Show ();
 }
}
•   pfcDetail.DetailNoteItem.GetInstructions
•   pfcDetail.DetailNoteItem.GetSymbolDef
•   pfcDetail.DetailNoteItem.GetLineEnvelope
•   pfcDetail.DetailNoteItem.GetModelReference
                 The method pfcDetail.DetailNoteItem.GetInstructions returns
                 an instructions data object that describes how to construct the
                 detail note item. This method takes a ProBoolean argument,
                 GiveParametersAsNames, which determines whether symbolic
                 representations of parameters and drawing properties in the note
                 text should be displayed, or the actual text seen by the user should
                 be displayed.
Drawings                                                                       10 - 61
                      Note: Pro/ENGINEER does not resolve and replace symbolic
                            callouts for notes which are not displayed. Therefore, if
                            the note is not displayed or is hidden in a layer, the text
                            retrieved may contain symbolic callouts, even when
                            GiveParametersAsNames is false.
                 The method pfcDetail.DetailNoteItem.GetSymbolDef returns
                 the symbol definition that contains the note. The method returns a
                 null value if the note is not a part of a symbol definition.
                              0                      1
                                  Detail NoteText
2 3
•   pfcDetail.DetailNoteItem.Draw
•   pfcDetail.DetailNoteItem.Show
•   pfcDetail.DetailNoteItem.Erase
•   pfcDetail.DetailNoteItem.Remove
•   pfcDetail.DetailNoteItem.Modify
                 The method pfcDetail.DetailNoteItem.Draw temporarily draws
                 a detail note item, so that it is removed during the next draft
                 regeneration.
                                                                                          Drawings
Detail Groups
                 A detail group in J-Link is represented by the interface
                 com.ptc.pfc.pfcDetail.DetailGroupItem. It is a child of the
                 DetailItem interface.
Instructions
Method Introduced:
•   pfcDetail.pfcDetail.DetailGroupInstructions_Create
•   pfcDetail.DetailGroupInstructions.GetName
•   pfcDetail.DetailGroupInstructions.SetName
•   pfcDetail.DetailGroupInstructions.GetElements
•   pfcDetail.DetailGroupInstructions.SetElements
•   pfcDetail.DetailGroupInstructions.GetIsDisplayed
•   pfcDetail.DetailGroupInstructions.SetIsDisplayed
                 The method
                 pfcDetail.pfcDetail.DetailGroupInstructions_Create creates
                 an instruction data object that describes how to construct a detail
                 group for use in pfcDetail.DetailItemOwner.CreateDetailItem
                 and pfcDetail.DetailGroupItem.Modify.
Drawings                                                                        10 - 63
                 The method pfcDetail.DetailGroupInstructions.GetName
                 returns the name of the detail group.
                 The method
                 pfcDetail.DetailGroupInstructions.GetIsDisplayed returns
                 whether the detail group is displayed in the drawing.
                 The method
                 pfcDetail.DetailGroupInstructions.SetIsDisplayed toggles
                 the display of the detail group.
•   pfcDetail.DetailGroupItem.GetInstructions
                 The method pfcDetail.DetailGroupItem.GetInstructions gets a
                 data object that describes how to construct a detail group item. The
                 method returns the data object describing the detail group item.
•   pfcDetail.DetailGroupItem.Draw
•   pfcDetail.DetailGroupItem.Erase
•   pfcDetail.DetailGroupItem.Modify
                 The method pfcDetail.DetailGroupItem.Draw temporarily
                 draws a detail group item, so that it is removed during the next
                 draft generation.
                                                                                         Drawings
import   com.ptc.pfc.pfcBase.*;
import   com.ptc.pfc.pfcGeometry.*;
import   com.ptc.pfc.pfcSelect.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcTable.*;
import   com.ptc.pfc.pfcView2D.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcAssembly.*;
import   com.ptc.pfc.pfcModel2D.*;
import   com.ptc.pfc.pfcSheet.*;
import   com.ptc.pfc.pfcExceptions.*;
import   com.ptc.pfc.pfcDrawingFormat.*;
import   com.ptc.pfc.pfcDimension2D.*;
import   java.lang.reflect.Array;
import   java.text.*;
import   java.io.*;
public   class pfcDrawingExamples {
/*====================================================================*\
 FUNCTION : createGroup()
 PURPOSE : Command to create a new group with selected items
\*====================================================================*/
    public static void createGroup (String groupName)
    throws com.ptc.cipjava.jxthrowable
    {
/*--------------------------------------------------------------------*\
  Select notes, draft entities, symbol instances
\*--------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession ();
     SelectionOptions selOptions =
         pfcSelect.SelectionOptions_Create
("any_note,draft_ent,dtl_symbol");
     Selections selections = session.Select (selOptions, null);
/*--------------------------------------------------------------------*\
  Allocate and fill a sequence with the detail item handles
\*--------------------------------------------------------------------*/
     DetailItems items = DetailItems.create();
Drawings                                                                       10 - 65
      for (int i = 0; i < selections.getarraysize(); i ++)
          {
           items.insert (items.getarraysize(),
                        (DetailItem)selections.get (i).GetSelItem());
          }
/*--------------------------------------------------------------------*\
  Get the drawing which will own the group
\*--------------------------------------------------------------------*/
     Drawing drawing = (Drawing)items.get (0).GetDBParent();
/*--------------------------------------------------------------------*\
  Allocate group data and set the group items
\*--------------------------------------------------------------------*/
     DetailGroupInstructions instrs =
         pfcDetail.DetailGroupInstructions_Create (groupName, items);
/*--------------------------------------------------------------------*\
  Create the group
\*--------------------------------------------------------------------*/
     drawing.CreateDetailItem (instrs);
}
}
Detail Symbols
Detail Symbol Definitions
                 A detail symbol definition in J-Link is represented by the interface
                 pfcDetail.DetailSymbolDefItem. It is a child of the DetailItem
                 interface.
Instructions
Methods Introduced:
•   pfcDetail.pfcDetail.DetailSymbolDefInstructions_Create
•   pfcDetail.DetailSymbolDefInstructions.GetSymbolHeight
•   pfcDetail.DetailSymbolDefInstructions.SetSymbolHeight
•   pfcDetail.DetailSymbolDefInstructions.GetHasElbow
                                                                                          Drawings
•   pfcDetail.DetailSymbolDefInstructions.SetFullPath
•   pfcDetail.DetailSymbolDefInstructions.GetReference
•   pfcDetail.DetailSymbolDefInstructions.SetReference
                 The method
                 pfcDetail.pfcDetail.DetailSymbolDefInstructions_Create
                 creates an instruction data object that describes how to create a
                 symbol definition based on the path and name of the symbol
                 definition. The instructions object is passed to the methods
                 pfcDetailItemOwner.CreateDetailItem and
                 pfcDetailSymbolDefItem.Modify.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.GetHasElbow
                 determines whether the symbol definition includes an elbow.
Drawings                                                                        10 - 67
                 The method
                 pfcDetail.DetailSymbolDefInstructions.SetHasElbow decides
                 if the symbol definition should include an elbow.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.GetIsTextAngleFixe
                 d returns whether the text of the angle is fixed.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.SetIsTextAngleFixe
                 d toggles the requirement that the text angle be fixed.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.GetScaledHeight
                 returns the height of the symbol definition in inches.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.GetAttachments
                 returns the value of the sequence of the possible instance
                 attachment points for the symbol definition.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.SetAttachments sets
                 the value of the sequence of the possible instance attachment points
                 for the symbol definition.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.GetFullPath returns
                 the value of the complete path of the symbol definition file.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.SetFullPath sets the
                 value of the complete path of the symbol definition path.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.GetReference
                 returns the text reference information for the symbol definition. It
                 returns a null value if the text reference is not used. The text
                 reference identifies the text item used for a symbol definition which
                 has a height type of SYMDEF_TEXT_RELATED.
                 The method
                 pfcDetail.DetailSymbolDefInstructions.SetReference sets
                 the text reference information for the symbol definition.
• pfcDetail.DetailSymbolDefItem.ListDetailItems
                                                                                             Drawings
Methods Introduced:
•   pfcDetail.DetailSymbolDefItem.CreateDetailItem
•   pfcDetail.DetailSymbolDefItem.Modify
                 The method
                 pfcDetail.DetailSymbolDefItem.CreateDetailItem creates a
                 detail item in the symbol definition based on the instructions data
                 object. The method returns the detail item in the symbol definition.
•   pfcDetail.DetailItemOwner.RetrieveSymbolDefinition
                 The method
                 pfcDetail.DetailItemOwner.RetrieveSymbolDefinition
                 retrieves a symbol definition from the disk.
Drawings                                                                           10 - 69
                  The method returns the retrieved symbol definition.
/*====================================================================*\
 FUNCTION : createBoxSymdef()
 PURPOSE : To create a symbol definition with the specified name,
            containing a box and a note with the specified text
\*====================================================================*/
   public static void createBoxSymdef (String name, String text)
     throws com.ptc.cipjava.jxthrowable
    {
/*-------------------------------------------------------------------*\
  Get the current drawing & its background view
\*--------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession ();
     Model model = session.GetCurrentModel();
      if (model.GetType() != ModelType.MDL_DRAWING)
          throw new RuntimeException ("Current model is not a drawing");
/*--------------------------------------------------------------------*\
  Set a FREE attachment at the origin of the symbol
\*--------------------------------------------------------------------*/
     Point3D origin = Point3D.create();
     origin.set (0, 0.0);
                                                                                Drawings
     origin.set (1, 0.0);
     origin.set (2, 0.0);
     SymbolDefAttachment attachment =
         pfcDetail.SymbolDefAttachment_Create
                  (SymbolDefAttachmentType.SYMDEFATTACH_FREE, origin);
/*--------------------------------------------------------------------*\
  Create the empty symbol
\*--------------------------------------------------------------------*/
     DetailSymbolDefItem symDef =
         (DetailSymbolDefItem)drawing.CreateDetailItem (instrs);
/*--------------------------------------------------------------------*\
 Calculate the default text height for the symbol based on the drawing
 text height and transform
\*--------------------------------------------------------------------*/
     double textHeight = drawing.GetTextHeight();
     Transform3D matrix =
         drawing.GetSheetTransform (drawing.GetCurrentSheetNumber());
/*--------------------------------------------------------------------*\
 Create four lines to form a box, twice the default text height,
 around the origin
\*--------------------------------------------------------------------*/
     Point3D end1 = Point3D.create ();
     Point3D end2 = Point3D.create ();
     end1.set (0, -defHeight);
     end1.set (1, -defHeight);
     end1.set (2, 0.0);
     end2.set (0, defHeight);
     end2.set (1, -defHeight);
     end2.set (2, 0.0);
Drawings                                                              10 - 71
      ColorRGB colorRGB =
               session.GetRGBFromStdColor (StdColor.COLOR_ERROR);
/*--------------------------------------------------------------------*\
  Add a note with the specified text at the origin
\*--------------------------------------------------------------------*/
     addNote (symDef, origin, text);
 }
/*====================================================================*\
 FUNCTION : addNote()
 PURPOSE : To add a note with the specified text and location to a
            symbol definition.
\*====================================================================*/
    private static void addNote(DetailSymbolDefItem symDef,
                                 Point3D location,
                                 String text)
             throws com.ptc.cipjava.jxthrowable
    {
/*--------------------------------------------------------------------*\
   Allocate a text item, and set its properties
\*--------------------------------------------------------------------*/
     DetailText dText = pfcDetail.DetailText_Create (text);
/*--------------------------------------------------------------------*\
    Allocate a new text line, and add the text item to it
/*--------------------------------------------------------------------*/
     DetailTexts texts = DetailTexts.create();
     texts.insert (0, dText);
      DetailTextLine textLine =
          pfcDetail.DetailTextLine_Create (texts);
/*--------------------------------------------------------------------*\
 Set the location of the note text
\*--------------------------------------------------------------------*/
     FreeAttachment position =
         pfcDetail.FreeAttachment_Create (location);
;
/*--------------------------------------------------------------------*\
 Set the attachment structure
                                                                              Drawings
\*--------------------------------------------------------------------*/
     DetailLeaders allAttachments = pfcDetail.DetailLeaders_Create ();
     allAttachments.SetItemAttachment (position);
/*--------------------------------------------------------------------*\
    Allocate a note description, and set its properties
\*--------------------------------------------------------------------*/
     DetailNoteInstructions instrs =
         pfcDetail.DetailNoteInstructions_Create (textLines);
     instrs.SetLeader (allAttachments);
     instrs.SetHorizontal (HorizontalJustification.H_JUSTIFY_CENTER);
     instrs.SetVertical (VerticalJustification.V_JUSTIFY_MIDDLE);
/*--------------------------------------------------------------------*\
 Create the note
\*--------------------------------------------------------------------*/
     symDef.CreateDetailItem (instrs);
    }
/*====================================================================*\
FUNCTION : addLine()
PURPOSE : Utility to add a line entity to a symbol definition
\*====================================================================*/
private static void addLine (DetailSymbolDefItem symDef,
                             Point3D start,
                             Point3D end,
                             ColorRGB color)
               throws com.ptc.cipjava.jxthrowable
    {
/*--------------------------------------------------------------------*\
  Allocate and initialize a curve descriptor
\*--------------------------------------------------------------------*/
     LineDescriptor geom =
         pfcGeometry.LineDescriptor_Create (start, end);
/*--------------------------------------------------------------------*\
  Allocate data for the draft entity
\*--------------------------------------------------------------------*/
Drawings                                                            10 - 73
         DetailEntityInstructions instrs =
             pfcDetail.DetailEntityInstructions_Create (geom,
                                                        null);
         instrs.SetColor(color);
/*--------------------------------------------------------------------*\
  Create the entity
\*--------------------------------------------------------------------*/
     symDef.CreateDetailItem (instrs);
     }
}
Instructions
Methods Introduced:
•   pfcDetail.pfcDetail.DetailSymbolInstInstructions_Create
•   pfcDetail.DetailSymbolInstInstructions.GetIsDisplayed
•   pfcDetail.DetailSymbolInstInstructions.SetIsDisplayed
•   pfcDetail.DetailSymbolInstInstructions.GetColor
•   pfcDetail.DetailSymbolInstInstructions.SetColor
•   pfcDetail.DetailSymbolInstInstructions.GetSymbolDef
•   pfcDetail.DetailSymbolInstInstructions.SetSymbolDef
•   pfcDetail.DetailSymbolInstInstructions.GetAttachOnDefType
•   pfcDetail.DetailSymbolInstInstructions.SetAttachOnDefType
•   pfcDetail.DetailSymbolInstInstructions.GetDefAttachment
•   pfcDetail.DetailSymbolInstInstructions.SetDefAttachment
•   pfcDetail.DetailSymbolInstInstructions.GetInstAttachment
•   pfcDetail.DetailSymbolInstInstructions.SetInstAttachment
•   pfcDetail.DetailSymbolInstInstructions.GetAngle
•   pfcDetail.DetailSymbolInstInstructions.SetAngle
                                                                                         Drawings
                 pfcDetail.pfcDetail.DetailSymbolInstInstructions_Create
                 creates a data object that contains information about the placement
                 of a symbol instance.
                 The method
                 pfcDetail.DetailSymbolInstInstructions.GetColor returns the
                 color of the detail symbol instance. A null value indicates that the
                 default drawing color is used.
                 The method
                 pfcDetail.DetailSymbolInstInstructions.GetSymbolDef
                 returns the symbol definition used for the instance.
                 The method
                 pfcDetail.DetailSymbolInstInstructions.SetSymbolDef sets
                 the value of the symbol definition used for the instance.
Drawings                                                                       10 - 75
          The method
          pfcDetail.DetailSymbolInstInstructions.GetAttachOnDefTy
          pe returns the attachment type of the instance. The method
          returns a null value if the attachment represents a free attachment.
          The attachment options are as follows:
          The method
          pfcDetail.DetailSymbolInstInstructions.GetDefAttachment
          returns the value that represents the way in which the instance is
          attached to the symbol definition.
          The method
          pfcDetail.DetailSymbolInstInstructions.SetDefAttachment
          specifies the way in which the instance is attached to the symbol
          definition.
          The method
          pfcDetail.DetailSymbolInstInstructions.GetInstAttachment
          returns the value of the attachment of the instance that includes
          location and leader information.
          The method
          pfcDetail.DetailSymbolInstInstructions.SetInstAttachment
          sets value of the attachment of the instance.
          The method
          pfcDetail.DetailSymbolInstInstructions.GetAngle returns the
          value of the angle at which the instance is placed. The method
          returns a null value if the value of the angle is 0 degrees.
           The method
           pfcDetail.DetailSymbolInstInstructions.GetScaledHeight
           returns the height of the symbol instance in the owner drawing or
           model coordinates. This value is consistent with the height value
           shown for a symbol instance in the Properties dialog box in the
           Pro/ENGINEER User Interface.
                                                                                     Drawings
                     partially based on the properties of the symbol
                     definition assigned using the method
                     pfcDetail.DetailSymbolInstInstructions.GetSymb
                     olDef. Changing the symbol definition may change the
                     calculated value for the scaled height.
           The method
           pfcDetail.DetailSymbolInstInstructions.SetScaledHeight
           sets the value of the height of the symbol instance in the owner
           drawing or model coordinates.
           The method
           pfcDetail.DetailSymbolInstInstructions.GetTextValues
           returns the sequence of variant text values used while placing the
           symbol instance.
           The method
           pfcDetail.DetailSymbolInstInstructions.SetTextValues sets
           the sequence of variant text values while placing the symbol
           instance.
           The method
           pfcDetail.DetailSymbolInstInstructions.GetCurrentTransfo
           rm returns the coordinate transformation matrix to place the
           symbol instance.
           The method
           pfcDetail.DetailSymbolInstInstructions.SetGroups sets the
           DetailSymbolGroupOption argument for displaying symbol groups
           in the symbol instance. This argument can have the following
           values:
           •   DETAIL_SYMBOL_GROUP_INTERACTIVE—Symbol groups
               are interactively selected for display. This is the default value
               in the GRAPHICS mode.
           •   DETAIL_SYMBOL_GROUP_ALL—All non-exclusive symbol
               groups are included for display.
Drawings                                                                   10 - 77
                 •    DETAIL_SYMBOL_GROUP_NONE—None of the
                      non-exclusive symbol groups are included for display.
                 •    DETAIL_SYMBOL_GROUP_CUSTOM—Symbol groups
                      specified by the application are displayed.
                 Refer to the section Detail Symbol Groups for more information on
                 detail symbol groups.
•   pfcDetail.DetailSymbolInstItem.GetInstructions
                 The method pfcDetail.DetailSymbolInstItem.GetInstructions
                 returns an instructions data object that describes how to construct
                 a symbol instance. This method takes a ProBoolean argument,
                 GiveParametersAsNames, which determines whether symbolic
                 representations of parameters and drawing properties in the
                 symbol instance should be displayed, or the actual text seen by the
                 user should be displayed.
•   pfcDetail.DetailSymbolInstItem.Draw
•   pfcDetail.DetailSymbolInstItem.Erase
•   pfcDetail.DetailSymbolInstItem.Show
•   pfcDetail.DetailSymbolInstItem.Remove
•   pfcDetail.DetailSymbolInstItem.Modify
                 The method pfcDetail.DetailSymbolInstItem.Draw draws a
                 symbol instance temporarily to be removed on the next draft
                 regeneration.
                                                                                        Drawings
import   com.ptc.pfc.pfcDrawing.*;
import   com.ptc.pfc.pfcBase.*;
import   com.ptc.pfc.pfcGeometry.*;
import   com.ptc.pfc.pfcSelect.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcTable.*;
import   com.ptc.pfc.pfcView2D.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcAssembly.*;
import   com.ptc.pfc.pfcModel2D.*;
import   com.ptc.pfc.pfcSheet.*;
import   com.ptc.pfc.pfcExceptions.*;
import   com.ptc.pfc.pfcDrawingFormat.*;
import   com.ptc.pfc.pfcDimension2D.*;
import   java.lang.reflect.Array;
import   java.text.*;
import   java.io.*;
public   class pfcDrawingExamples {
/*====================================================================*\
 FUNCTION : placeSymInst()
 PURPOSE : Place a CG symbol with no leaders at a specified location
\*====================================================================*/
    public static void placeInst() throws com.ptc.cipjava.jxthrowable
    {
 /*--------------------------------------------------------------------*\
   Get the current drawing
 \*--------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession ();
     Model model = session.GetCurrentModel();
     if (model.GetType() != ModelType.MDL_DRAWING)
         throw new RuntimeException ("Current model is not a drawing");
/*--------------------------------------------------------------------*\
   Retrieve the symbol definition from the system
\*--------------------------------------------------------------------*/
     DetailSymbolDefItem symDef =
Drawings                                                                      10 - 79
          drawing.RetrieveSymbolDefinition ("CG", null, null, null);
/*--------------------------------------------------------------------*\
   Select the locations for the symbol
\*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*\
   Allocate the symbol instance decription
\*--------------------------------------------------------------------*/
     DetailSymbolInstInstructions instrs =
         pfcDetail.DetailSymbolInstInstructions_Create (symDef);
/*--------------------------------------------------------------------*\
 Set the attachment structure
\*--------------------------------------------------------------------*/
          DetailLeaders allAttachments =
              pfcDetail.DetailLeaders_Create ();
          allAttachments.SetItemAttachment (position);
           instrs.SetInstAttachment (allAttachments);
/*--------------------------------------------------------------------*\
 Create and display the symbol
\*--------------------------------------------------------------------*/
          DetailSymbolInstItem symInst =
               (DetailSymbolInstItem) drawing.CreateDetailItem (instrs);
          symInst.Show();
         }
    }
}
                                                                               Drawings
                                 double height)
    throws com.ptc.cipjava.jxthrowable
    {
 /*--------------------------------------------------------------------*\
   Get the current drawing
 \*--------------------------------------------------------------------*/
Session session = pfcGlobal.GetProESession ();
if (model.GetType() != ModelType.MDL_DRAWING)
    throw new RuntimeException ("Current model is not a drawing");
/*--------------------------------------------------------------------*\
  Retrieve the symbol definition from the system
\*--------------------------------------------------------------------*/
DetailSymbolDefItem symDef =
    drawing.RetrieveSymbolDefinition ("detail_symbol_example", "./", null,
                                      null);
/*--------------------------------------------------------------------*\
   Select the locations for the symbol
\*--------------------------------------------------------------------*/
Drawings                                                             10 - 81
/*--------------------------------------------------------------------*\
  Allocate the symbol instance decription
\*--------------------------------------------------------------------*/
DetailSymbolInstInstructions instrs =
    pfcDetail.DetailSymbolInstInstructions_Create (symDef);
/*--------------------------------------------------------------------*\
 Set the symbol height in drawing units
\*--------------------------------------------------------------------*/
if (height > 0)
{
instrs.SetScaledHeight(new Double(height));
}
/*--------------------------------------------------------------------*\
 Set text to the variable text in the symbol. This will be displayed
 instead of the text defined when creating the symbol
\*--------------------------------------------------------------------*/
DetailVariantTexts varTexts;
DetailVariantText varText;
instrs.SetTextValues(varTexts);
}
/*--------------------------------------------------------------------*\
 Display the groups in symbol depending on group name
\*--------------------------------------------------------------------*/
DetailSymbolGroups groups, allGroups;
DetailSymbolGroup group = null;
if (groupName.equals("ALL"))
instrs.SetGroups (DetailSymbolGroupOption.DETAIL_SYMBOL_GROUP_ALL ,
 null);
else if (groupName.equals("NONE"))
instrs.SetGroups (DetailSymbolGroupOption.DETAIL_SYMBOL_GROUP_NONE ,
 null);
else
{
allGroups = instrs.GetSymbolDef().ListSubgroups();
group = getGroup(allGroups , groupName );
if (group != null)
{
groups = DetailSymbolGroups.create();
groups.insert(0, group);
instrs.SetGroups (DetailSymbolGroupOption.DETAIL_SYMBOL_GROUP_CUSTOM ,
/*--------------------------------------------------------------------*\
 Set the location of the note text
\*--------------------------------------------------------------------*/
FreeAttachment position = pfcDetail.FreeAttachment_Create (point);
/*--------------------------------------------------------------------*\
 Set the attachment structure
                                                                              Drawings
\*--------------------------------------------------------------------*/
DetailLeaders allAttachments =
    pfcDetail.DetailLeaders_Create ();
allAttachments.SetItemAttachment (position);
instrs.SetInstAttachment (allAttachments);
/*--------------------------------------------------------------------*\
Create and display the symbol
\*--------------------------------------------------------------------*/
DetailSymbolInstItem symInst =
    (DetailSymbolInstItem) drawing.CreateDetailItem (instrs);
     symInst.Show();
/*====================================================================*\
 FUNCTION : getGroup()
 PURPOSE : Return the specific group depending on the group name.
\*====================================================================*/
    public static DetailSymbolGroup getGroup(DetailSymbolGroups groups,
                                             String groupName)
    throws com.ptc.cipjava.jxthrowable
    {
    DetailSymbolGroup group = null;
    DetailSymbolGroupInstructions groupInstrs;
    int i;
    if (groups.getarraysize() <=0 )
    {
    return null;
    }
/*--------------------------------------------------------------------*\
 Loop through all the groups in the symbol and return the group with
 the selected name
\*--------------------------------------------------------------------*/
   for(i=0;i<groups.getarraysize();i++)
   {
    group = groups.get(i);
Drawings                                                            10 - 83
     groupInstrs = group.GetInstructions();
     if (groupInstrs.GetName().equals(groupName))
     return group;
    }
    return null;
     }
Instructions
Methods Introduced:
•   pfcDetail.pfcDetail.DetailSymbolGroupInstructions_Create
•   pfcDetail.DetailSymbolGroupInstructions.GetItems
•   pfcDetail.DetailSymbolGroupInstructions.SetItems
•   pfcDetail.DetailSymbolGroupInstructions.GetName
•   pfcDetail.DetailSymbolGroupInstructions.SetName
                 The method
                 pfcDetail.pfcDetail.DetailSymbolGroupInstructions_Create
                 creates the pfcDetail.DetailSymbolGroupInstructions data
                 object that stores the name of the symbol group and the list of detail
                 items to be included in the symbol group.
                 The method
                 pfcDetail.DetailSymbolGroupInstructions.GetName returns
                 the name of the symbol group.
                 The method
                 pfcDetail.DetailSymbolGroupInstructions.SetName assigns
                 the name of the symbol group.
                                                                                       Drawings
Detail Symbol Group Information
Methods Introduced:
•   pfcDetail.DetailSymbolGroup.GetInstructions
•   pfcDetail.DetailSymbolGroup.GetParentGroup
•   pfcDetail.DetailSymbolGroup.GetParentDefinition
•   pfcDetail.DetailSymbolGroup.ListChildren
•   pfcDetail.DetailSymbolDefItem.ListSubgroups
•   pfcDetail.DetailSymbolDefItem.IsSubgroupLevelExclusive
•   pfcDetail.DetailSymbolInstItem.ListGroups
                 The method pfcDetail.DetailSymbolGroup.GetInstructions
                 returns the pfcDetail.DetailSymbolGroupInstructions data
                 object that describes how to construct a symbol group.
                 The method
                 pfcDetail.DetailSymbolGroup.GetParentDefinition returns
                 the symbol definition of a given symbol group.
Drawings                                                                     10 - 85
                 The method
                 pfcDetail.DetailSymbolDefItem.IsSubgroupLevelExclusive
                 identifies if the subgroups of a given symbol group stored in the
                 symbol definition at the indicated level are exclusive or
                 independent. If groups are exclusive, only one of the groups at this
                 level can be active in the model at any time. If groups are
                 independent, any number of groups can be active.
•   pfcDetail.DetailSymbolGroup.Delete
•   pfcDetail.DetailSymbolGroup.Modify
•   pfcDetail.DetailSymbolDefItem.CreateSubgroup
•   pfcDetail.DetailSymbolDefItem.SetSubgroupLevelExclusive
•   pfcDetail.DetailSymbolDefItem.SetSubgroupLevelIndependent
                 The method pfcDetail.DetailSymbolGroup.Delete deletes the
                 specified symbol group from the symbol definition. This method
                 does not delete the entities contained in the group.
                                                                                           Drawings
                 ent makes the subgroups of a symbol group independent at the
                 indicated level in the symbol definition.
Detail Attachments
                 A detail attachment in J-Link is represented by the interface
                 pfcDetail.Attachment. It is used for the following tasks:
Method Introduced:
•   pfcDetail.Attachment.GetType
                 The method pfcDetail.Attachment.GetType returns the
                 pfcDetail.AttachmentType object containing the types of detail
                 attachments. The detail attachment types are as follows:
Drawings                                                                         10 - 87
Free Attachment
                 The ATTACH_FREE detail attachment type is represented by the
                 interface pfcDetail.FreeAttachment. It is a child of the
                 pfcDetail.Attachment interface.
Methods Introduced:
•   pfcDetail.FreeAttachment.GetAttachmentPoint
•   pfcDetail.FreeAttachment.SetAttachmentPoint
•   pfcDetail.FreeAttachment.GetView
•   pfcDetail.FreeAttachment.SetView
                 The method pfcDetail.FreeAttachment.GetAttachmentPoint
                 returns the attachment point. This location is in screen coordinates
                 for drawing items, symbol instances and surface finishes on
                 flat-to-screen annotation planes, and in model coordinates for
                 symbols and surface finishes on 3D model annotation planes.
Parametric Attachment
                 The ATTACH_PARAMETRIC detail attachment type is
                 represented by the interface pfcDetail.ParametricAttachment.
                 It is a child of the pfcDetail.Attachment interface.
Methods Introduced:
•   pfcDetail.ParametricAttachment.GetAttachedGeometry
•   pfcDetail.ParametricAttachment.SetAttachedGeometry
                 The method
                 pfcDetail.ParametricAttachment.SetAttachedGeometry
                 assigns the pfcSelect.Selection object representing the item to
                 which the detail attachment is attached. This object must include
                                                                                         Drawings
                 the target drawing view. The attachment will occur at the selected
                 parameters.
Offset Attachment
                 The ATTACH_OFFSET detail attachment type is represented by
                 the interface pfcDetail.OffsetAttachment. It is a child of the
                 pfcDetail.Attachment interface.
Methods Introduced:
•   pfcDetail.OffsetAttachment.GetAttachedGeometry
•   pfcDetail.OffsetAttachment.SetAttachedGeometry
•   pfcDetail.OffsetAttachment.GetAttachmentPoint
•   pfcDetail.OffsetAttachment.SetAttachmentPoint
                 The method
                 pfcDetail.OffsetAttachment.GetAttachedGeometry returns
                 the pfcSelect.Selection object representing the item to which the
                 detail attachment is attached. This includes the drawing view
                 where the attachment is made, if the offset reference is in a model.
                 The method
                 pfcDetail.OffsetAttachment.SetAttachedGeometry assigns
                 the pfcSelect.Selection object representing the item to which the
                 detail attachment is attached. This can include the drawing view.
                 The attachment will occur at the selected parameters.
Drawings                                                                       10 - 89
                 The method pfcDetail.OffsetAttachment.SetAttachmentPoint
                 sets the attachment point in screen coordinates.
Unsupported Attachment
                 The ATTACH_TYPE_UNSUPPORTED detail attachment type is
                 represented by the interface
                 pfcDetail.UnsupportedAttachment. It is a child of the
                 pfcDetail.Attachment interface.
Method Introduced:
•   pfcDetail.UnsupportedAttachment.GetAttachmentPoint
•   pfcDetail.UnsupportedAttachment.SetAttachmentPoint
                 The method
                 pfcDetail.UnsupportedAttachment.GetAttachmentPoint
                 returns the attachment point. This location is in screen coordinates
                 for drawing items, symbol instances and surface finishes on
                 flat-to-screen annotation planes, and in model coordinates for
                 symbols and surface finishes on 3D model annotation planes.
                 The method
                 pfcDetail.UnsupportedAttachment.SetAttachmentPoint
                 assigns the attachment point in screen coordinates.
Most of the objects and methods in J-Link are used with solid
models (parts and assemblies). Because solid objects inherit from
the interface Model, you can use any of the Model methods on any
Solid, Part, or Assembly object.
Topic Page
                                                             11 - 1
Getting a Solid Object
Methods Introduced:
•   pfcSession.BaseSession.CreatePart
•   pfcSession.BaseSession.CreateAssembly
•   pfcAssembly.ComponentPath.GetRoot
•   pfcAssembly.ComponentPath.GetLeaf
•   pfcMFG.MFG.GetSolid
                 The methods pfcSession.BaseSession.CreatePart and
                 pfcSession.BaseSession.CreateAssembly create new solid
                 models with the names you specify.
Solid Information
Methods Introduced:
•   pfcSolid.Solid.GetRelativeAccuracy
•   pfcSolid.Solid.SetRelativeAccuracy
•   pfcSolid.Solid.GetAbsoluteAccuracy
•   pfcSolid.Solid.SetAbsoluteAccuracy
                 You can set the relative and absolute accuracy of any solid model
                 using these methods. Relative accuracy is relative to the size of the
                 solid. For example, a relative accuracy of .01 specifies that the solid
                 must be accurate to within 1/100 of its size. Absolute accuracy is
                 measured in absolute units (inches, centimeters, and so on).
•   pfcSolid.Solid.Regenerate
•   pfcSolid.pfcSolid.RegenInstructions_Create
•   pfcSolid.RegenInstructions.SetAllowFixUI
•   pfcSolid.RegenInstructions.SetForceRegen
•   pfcSolid.RegenInstructions.SetFromFeat
                                                                                          Solid
•   pfcSolid.RegenInstructions.SetRefreshModelTree
•   pfcSolid.RegenInstructions.SetResumeExcludedComponents
•   pfcSolid.RegenInstructions.SetUpdateAssemblyOnly
•   pfcSolid.RegenInstructions.SetUpdateInstances
•   pfcSolid.Solid.GetGeomOutline
•   pfcSolid.Solid.EvalOutline
•   pfcSolid.Solid.GetIsSkeleton
                 The method pfcSolid.Solid.Regenerate causes the solid model to
                 regenerate according to the instructions provided in the form of the
                 pfcSolid.RegenInstructions object. Passing a null value for the
                 instructions argument causes an automatic regeneration.
Solid                                                                            11 - 3
         •   AllowFixUI—Determines whether or not to activate the Fix
             Model user interface, if there is an error.
             Use the method
             pfcSolid.RegenInstructions.SetAllowFixUI to modify this
             parameter.
         •   ForceRegen—Forces the solid model to fully regenerate. All the
             features in the model are regenerated. If this parameter is
             false, Pro/ENGINEER determines which features to
             regenerate. By default, it is false.
             Use the method
             pfcSolid.RegenInstructions.SetForceRegen to modify this
             parameter.
         •   FromFeat—Not currently used. This parameter is reserved for
             future use.
             Use the method pfcSolid.RegenInstructions.SetFromFeat
             to modify this parameter.
         •   RefreshModelTree—Refreshes the Pro/ENGINEER Model Tree
             after regeneration. The model must be active to use this
             attribute. If this attribute is false, the Model Tree is not
             refreshed. By default, it is false.
             Use the method
             pfcSolid.RegenInstructions.SetRefreshModelTree to
             modify this parameter.
         •   ResumeExcludedComponents—Enables Pro/ENGINEER to
             resume the available excluded components of the simplified
             representation during regeneration. This results in a more
             accurate update of the simplified representation.
             Use the method
             pfcSolid.RegenInstructions.SetResumeExcludedCompo
             nents to modify this parameter.
         •   UpdateAssemblyOnly—Updates the placements of an assembly
             and all its sub-assemblies, and regenerates the assembly
             features and intersected parts. If the affected assembly is
             retrieved as a simplified representation, then the locations of
             the components are updated. If this attribute is false, the
             component locations are not updated, even if the simplified
             representation is retrieved. By default, it is false.
             Use the method
             pfcSolid.RegenInstructions.SetUpdateAssemblyOnly to
             modify this parameter.
                                                                                  Solid
         compute the extents of the solid object.
Solid Units
         Each model has a basic system of units to ensure all material
         properties of that model are consistently measured and defined. All
         models are defined on the basis of the system of units. A part can
         have only one system of unit.
Solid                                                                    11 - 5
               –   Velocity—cm/sec
           In J-Link, individual units in the model are represented by the
           interface pfcUnits.Unit.
•   pfcSolid.Solid.ListUnits
•   pfcSolid.Solid.GetUnit
•   pfcUnits.Unit.GetName
•   pfcUnits.Unit.GetExpression
•   pfcUnits.Unit.GetType
                                                                                          Solid
•   pfcUnits.Unit.GetIsStandard
•   pfcUnits.Unit.GetReferenceUnit
•   pfcUnits.Unit.GetConversionFactor
•   pfcUnits.UnitConversionFactor.GetOffset
•   pfcUnits.UnitConversionFactor.GetScale
                  The method pfcSolid.Solid.ListUnits returns the list of units
                  available to the specified model.
Solid                                                                            11 - 7
         The method pfcUnits.Unit.GetIsStandard identifies whether the
         unit is system-defined (if the property IsStandard is set to true) or
         user-defined (if the property IsStandard is set to false).
•   pfcUnits.Unit.Modify
•   pfcUnits.Unit.Delete
•   pfcUnits.Unit.SetName
•   pfcUnits.UnitConversionFactor.SetOffset
•   pfcUnits.UnitConversionFactor.SetScale
                                                                                         Solid
                 The method pfcUnits.Unit.Modify modifies the definition of a
                 unit by applying a new conversion factor specified by the
                 pfcUnits.UnitConversionFactor object and a reference unit.
                      Note: You can delete only custom units and not standard
                            units.
                 The method pfcUnits.Unit.SetName modifies the name of the
                 unit.
•   pfcSolid.Solid.CreateCustomUnit
•   pfcUnits.pfcUnits.UnitConversionFactor_Create
                 The method pfcSolid.Solid.CreateCustomUnit creates a custom
                 unit based on the specified name, the conversion factor given by the
                 pfcUnits.UnitConversionFactor object, and a reference unit.
Solid                                                                           11 - 9
Accessing Systems of Units
Methods Introduced:
•   pfcSolid.Solid.ListUnitSystems
•   pfcSolid.Solid.GetPrincipalUnits
•   pfcUnits.UnitSystem.GetUnit
•   pfcUnits.UnitSystem.GetName
•   pfcUnits.UnitSystem.GetType
•   pfcUnits.UnitSystem.GetIsStandard
                 The method pfcSolid.Solid.ListUnitSystems returns the list of
                 unit systems available to the specified model.
•   pfcUnits.UnitSystem.Delete
•   pfcUnits.UnitSystem.SetName
                                                                                       Solid
Method Introduced:
•   pfcSolid.Solid.CreateUnitSystem
                 The method pfcSolid.Solid.CreateUnitSystem creates a new
                 system of units in the model based on the specified name, the type
                 of unit system given by the pfcUnits.UnitSystemType object, and
                 the types of units specified by the pfcUnits.Units sequence to use
                 for each of the base measurement types (length, force or mass, and
                 temperature).
•   pfcSolid.Solid.SetPrincipalUnits
•   pfcUnits.pfcUnits.UnitConversionOptions_Create
•   pfcUnits.UnitConversionOptions.SetDimensionOption
•   pfcUnits.UnitConversionOptions.SetIgnoreParamUnits
                 The method pfcSolid.Solid.SetPrincipalUnits changes the
                 principal system of units assigned to the solid model based on the
                 the unit conversion options specified by the
                 pfcUnits.UnitConversionOptions object. The method
                 pfcUnits.pfcUnits.UnitConversionOptions_Create creates the
                 pfcUnits.UnitConversionOptions object containing the unit
                 conversion options listed below.
Solid                                                                        11 - 11
                 The types of unit conversion options are as follows:
Mass Properties
Method Introduced:
•   pfcSolid.Solid.GetMassProperty
                 The function pfcSolid.Solid.GetMassProperty provides
                 information about the distribution of mass in the part or assembly.
                 It can provide the information relative to a coordinate system
                 datum, which you name, or the default one if you provide null as
                 the name. It returns a class called MassProperty.
                 •   The volume.
                 •   The surface area.
                 •   The density. The density value is 1.0, unless a material has
                     been assigned.
                 •   The mass.
                                                                                         Solid
Example Code: Retrieving a Mass Property Object
               This method retrieves a MassProperty object from a specified solid
               model. The solid's mass, volume, and center of gravity point are
               then printed.
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcModel.*;
import com.ptc.pfc.pfcBase.*;
import com.ptc.pfc.pfcSolid.*;
public class pfcSolidMassPropExample
{
  public static void printMassProperties (Solid solid)
  {
    MassProperty properties; // Data Structure containing mass property
data.
    Point3D gravity_center;
    try
    {
      properties = solid.GetMassProperty(null);// optional arugument in
this method
                                           // is the name of a ccordinate
system to use
                                               // to compute the mass
properties
      System.out.println("The solid mass is: " + properties.GetMass());
      System.out.println("The solid volume is: " +
properties.GetVolume());
      gravity_center = properties.GetGravityCenter();
      System.out.println("The Center Of Gravity is at ");
      System.out.println("X: " + gravity_center.get(0) + " Y: "
                     + gravity_center.get(1) + " Z: "
                           + gravity_center.get(2));
    }
    catch (jxthrowable x)
    {
    System.out.println("Exception caught: "+x);
  }
  }
Solid                                                                          11 - 13
}
Annotations
Methods Introduced:
•   pfcNote.Note.GetLines
•   pfcNote.Note.SetLines
•   pfcNote.Note.GetURL
•   pfcNote.Note.SetURL
•   pfcNote.Note.Display
•   pfcNote.Note.Delete
•   pfcNote.Note.GetOwner
                 3D model notes are instance of ModelItem objects. They can be
                 located and accessed using methods that locate model items in solid
                 models, and downcast to the Note interface to use the methods in
                 this section.
•   pfcSolid.Solid.ListCrossSections
•   pfcSolid.Solid.GetCrossSection
•   pfcXSection.XSection.GetName
•   pfcXSection.XSection.SetName
•   pfcXSection.XSection.GetXSecType
                                                                                            Solid
•   pfcXSection.XSection.Delete
•   pfcXSection.XSection.Display
•   pfcXSection.XSection.Regenerate
                 The method pfcSolid.Solid.ListCrossSections returns a
                 sequence of cross section objects represented by the Xsection
                 interface. The method pfcSolid.Solid.GetCrossSection searches
                 for a cross section given its name.
Materials
                 J-Link enables you to programmatically access the material types
                 and properties of parts. Using the methods described in the
                 following sections, you can perform the following actions:
Solid                                                                             11 - 15
Methods Introduced:
•   pfcPart.Material.Save
•   pfcPart.Material.Delete
•   pfcPart.Part.GetCurrentMaterial
•   pfcPart.Part.SetCurrentMaterial
•   pfcPart.Part.ListMaterials
•   pfcPart.Part.CreateMaterial
•   pfcPart.Part.RetrieveMaterial
                  The method pfcPart.Material.Save writes to a material file that
                  can be imported into any Pro/ENGINEER part.
                      Note:
                      –     By default, while assigning a material to a sheetmetal part,
                            the method pfcPart.Part.SetCurrentMaterial modifies
                            the values of the sheetmetal properties such as Y factor and
                            bend table according to the material file definition. This
                            modification triggers a regeneration and a modification of
                            the developed length calculations of the sheetmetal part.
                            However, you can avoid this behavior by setting the value of
                            the configuration option
                            material_update_smt_bend_table to never_replace.
                      –     The method pfcPart.Part.SetCurrentMaterial may
                            change the model display, if the new material has a default
                            appearance assigned to it.
                      –     The method may also change the family table, if the
                            parameter PTC_MATERIAL_NAME is a part of the family
                            table.
                  The method pfcPart.Part.ListMaterials returns a list of the
                  materials available in the part.
                                                                                           Solid
                 database with those contained in the material file.
•   pfcPart.Material.GetStructuralMaterialType
•   pfcPart.Material.SetStructuralMaterialType
•   pfcPart.Material.GetThermalMaterialType
•   pfcPart.Material.SetThermalMaterialType
•   pfcPart.Material.GetSubType
•   pfcPart.Material.SetSubType
•   pfcPart.Material.GetPermittedSubTypes
                 The method pfcPart.Material.GetStructuralMaterialType
                 returns the material type for the structural properties of the
                 material. The material types are as follows:
Solid                                                                            11 - 17
                 •    MTL_ISOTROPIC—Specifies a material with an infinite
                      number of planes of material symmetry, making the properties
                      equal in all directions.
                 •    MTL_ORTHOTROPIC—Specifies a material with symmetry
                      relative to three mutually perpendicular planes.
                 •    MTL_TRANSVERSELY_ISOTROPIC—Specifies a material
                      with rotational symmetry about an axis. The properties are
                      equal for all directions in the plane of isotropy.
                 Use the method pfcPart.Material.SetThermalMaterialType to
                 set the material type for the thermal properties of the material.
Methods Introduced:
•   pfcPart.pfcPart.MaterialProperty_Create
•   pfcPart.Material.GetPropertyValue
•   pfcPart.Material.SetPropertyValue
•   pfcPart.Material.SetPropertyUnits
•   pfcPart.Material.RemoveProperty
•   pfcPart.Material.GetDescription
•   pfcPart.Material.SetDescription
•   pfcPart.Material.GetFatigueType
•   pfcPart.Material.SetFatigueType
                                                                                         Solid
•   pfcPart.Material.GetFailureCriterion
•   pfcPart.Material.SetFailureCriterion
•   pfcPart.Material.GetPermittedFailureCriteria
•   pfcPart.Material.GetHardness
•   pfcPart.Material.SetHardness
•   pfcPart.Material.GetHardnessType
•   pfcPart.Material.SetHardnessType
•   pfcPart.Material.GetCondition
•   pfcPart.Material.SetCondition
•   pfcPart.Material.GetBendTable
•   pfcPart.Material.SetBendTable
•   pfcPart.Material.GetCrossHatchFile
•   pfcPart.Material.SetCrossHatchFile
•   pfcPart.Material.GetMaterialModel
•   pfcPart.Material.SetMaterialModel
•   pfcPart.Material.GetPermittedMaterialModels
•   pfcPart.Material.GetModelDefByTests
•   pfcPart.Material.SetModelDefByTests
                  The method pfcPart.pfcPart.MaterialProperty_Create creates
                  a new instance of a material property object.
                  All numerical material properties are accessed using the same set
                  of APIs. You must provide a property type to indicate the property
                  you want to read or modify.
Solid                                                                          11 - 19
          Use the method pfcPart.Material.SetPropertyValue to set the
          value and units of the material property. If the property type does
          not exist for the material, then this method creates it.
                                                                                     Solid
            The methods pfcPart.Material.GetCondition and
            pfcPart.Material.GetCondition return and set the condition for
            the specified material respectively.
Solid                                                                      11 - 21
                                              12
        Windows and Views
Topic Page
Windows                                                       12 - 2
Embedded Browser                                              12 - 4
Views                                                         12 - 4
Coordinate Systems and Transformations                        12 - 6
                                                              12 - 1
Windows
                 This section describes the J-Link methods that access Window
                 objects. The topics are as follows:
•   pfcSession.BaseSession.GetCurrentWindow
•   pfcSession.BaseSession.CreateModelWindow
•   pfcModel.Model.Display
•   pfcSession.BaseSession.ListWindows
•   pfcSession.BaseSession.GetWindow
•   pfcSession.BaseSession.OpenFile
•   pfcSession.BaseSession.GetModelWindow
                 The method pfcSession.BaseSession.GetCurrentWindow
                 provides access to the current active window in Pro/ENGINEER.
•   pfcWindow.Window.GetHeight
•   pfcWindow.Window.GetWidth
•   pfcWindow.Window.GetXPos
Embedded Browser
Methods Introduced:
•   pfcWindow.Window.GetURL
•   pfcWindow.Window.SetURL
•   pfcWindow.Window.GetBrowserSize
•   pfcWindow.Window.SetBrowserSize
                 The methods pfcWindow.Window.GetURL and
                 pfcWindow.Window.SetURL enables you to find and change the
                 URL displayed in the embedded browser in the Pro/ENGINEER
                 window.
Views
                 This section describes the J-Link methods that access View objects.
                 The topics are as follows:
•   pfcView.ViewOwner.RetrieveView
•   pfcView.ViewOwner.GetView
•   pfcView.ViewOwner.ListViews
View Operations
Methods Introduced:
•   pfcView.View.GetName
•   pfcView.View.GetIsCurrent
•   pfcView.View.Reset
•   pfcView.ViewOwner.SaveView
                    To get the name of a view given its identifier, use the method
                    pfcView.View.GetName.
                    To store the current view under the specified name, call the method
                    pfcView.ViewOwner.SaveView.
Coordinate Systems
             Pro/ENGINEER and J-Link use the following coordinate systems:
             Solid coordinates are used by J-Link for all the methods that look at
             geometry and most of the methods that draw three-dimensional
             graphics.
Transformations
Methods Introduced:
•   pfcBase.Transform3D.Invert
•   pfcBase.Transform3D.TransformPoint
•   pfcBase.Transform3D.TransformVector
•   pfcBase.Transform3D.GetMatrix
•   pfcBase.Transform3D.SetMatrix
•   pfcBase.Transform3D.GetOrigin
•   pfcBase.Transform3D.GetXAxis
•   pfcBase.Transform3D.GetYAxis
•   pfcBase.Transform3D.GetZAxis
                 All coordinate systems are treated in J-Link as if they were
                 three-dimensional. Therefore, a point in any of the coordinate
                 systems is always represented by the pfcBase.Point3D class:
                                                …       …    …    0
                                                …       …    …    0
                           X′ Y′ Z′ 1 = X Y Z 1
                                                …       …    …    0
                                                Xs      Ys   Zs   1
pfcGeometry.CoordSystem.GetCoordSys
                               MODEL
           PART                                     ASM
                pfcAssembly.ComponentPath.GetTransform
pfcView.View.GetTransform
SCREEN
pfcAssembly.ComponentPath.GetTransform
WINDOW
•   pfcView.View.GetTransform
•   pfcView.View.SetTransform
•   pfcView.View.Rotate
                  The view matrix describes the transformation from solid to screen
                  coordinates. The method pfcView.View.GetTransform provides
                  the view matrix for the specified view. The method
                  pfcView.View.SetTransform allows you to specify a matrix for
                  the view.
•   pfcGeometry.CoordSystem.GetCoordSys
                    The method pfcGeometry.CoordSystem.GetCoordSys provides
                    the location and orientation of the coordinate system datum in the
                    coordinate system of the solid that contains it. The location is in
•   pfcWindow.Window.GetScreenTransform
•   pfcWindow.Window.SetScreenTransform
•   pfcBase.ScreenTransform.SetPanX
•   pfcBase.ScreenTransform.SetPanY
•   pfcBase.ScreenTransform.SetZoom
                    You can alter the pan and zoom of a window by using a Screen
                    Transform object. This object contains three attributes. PanX and
                    PanY represent the horizontal and vertical movement. Every
                    increment of 1.0 moves the view point one screen width or height.
                    Zoom represents a scaling factor for the view. This number must be
                    greater than zero.
•   pfcAssembly.ComponentPath.GetTransform
                    The method pfcAssembly.ComponentPath.GetTransform
                    provides the matrix for transforming from the solid coordinate
                    system of the assembly member to the solid coordinates of the
                    parent assembly, or the reverse.
                    The following example code uses two methods to transfer the view
                    transformation from one view to another. The method
                    viewTransfer accepts two views and transfers the matrix from the
                    first to the second. This matrix is normalized using the second
                    method, matrixNormalize.
// ViewTransfer method transfers a matrix from one view into the other.
          transform = view1.GetTransform();
          matrix = transform.GetMatrix();
          matrix = matrixNormalize (matrix);
          transform.SetMatrix (matrix);
          view2.SetTransform (transform);
          return (view2);
  }
// Normalization scale
Topic Page
                                                               13 - 1
Solid Geometry Traversal
                 Solid models are made up of 11 distinct types of ModelItem, as
                 follows:
                 •    pfcFeature.Feature
                 •    pfcGeometry.Surface
                 •    pfcGeometry.Edge
                 •    pfcGeometry.Curve (datum curve)
                 •    pfcGeometry.Axis (datum axis)
                 •    pfcGeometry.Point (datum point)
                 •    pfcGeometry.Quilt (datum quilt)
                 •    pfcLayer.Layer
                 •    pfcNote.Note
                 •    pfcDimension.Dimension
                 •    pfcDimension.RefDimension
                 Each model item is assigned a unique identification number that
                 will never change. In addition, each model item can be assigned a
                 string name. Layers, points, axes, dimensions, and reference
                 dimensions are automatically assigned a name that can be
                 changed.
•   pfcModelItem.ModelItemOwner.ListItems
•   pfcFeature.Feature.ListSubItems
•   pfcLayer.Layer.ListItems
•   pfcModelItem.ModelItemOwner.GetItemById
•   pfcModelItem.ModelItemOwner.GetItemByName
•   pfcFamily.FamColModelItem.GetRefItem
•   pfcSelect.Selection.GetSelItem
                                                                                         ModelItem
                 feature or items in the layer.
ModelItem Information
Methods Introduced:
•   pfcModelItem.ModelItem.GetName
•   pfcModelItem.ModelItem.SetName
•   pfcModelItem.ModelItem.GetId
•   pfcModelItem.ModelItem.GetType
                 Certain ModelItems also have a string name that can be changed
                 at any time. The methods GetName and SetName access this
                 name.
                 The method GetId returns the unique integer identifier for the
                 ModelItem.
ModelItem                                                                       13 - 3
Layer Objects
                 In J-Link, layers are instances of ModelItem. The following
                 sections describe how to get layer objects and the operations you
                 can perform on them.
•   pfcModel.Model.CreateLayer
                 The method pfcModel.Model.CreateLayer returns a new layer
                 with the name you specify.
                 See the section “Getting ModelItem Objects” for other methods that
                 can return layer objects.
Layer Operations
Methods Introduced:
•   pfcLayer.Layer.GetStatus
•   pfcLayer.Layer.SetStatus
•   pfcLayer.Layer.ListItems
•   pfcLayer.Layer.AddItem
•   pfcLayer.Layer.RemoveItem
•   pfcLayer.Layer.Delete
                 The methods pfcLayer.Layer.GetStatus and
                 pfcLayer.Layer.SetStatus enable you to access the display status
                 of a layer. The corresponding enumeration class is DisplayStatus
                 and the possible values are Normal, Displayed, Blank, or
                 Hidden.
Topic Page
Access to Features                                           14 - 2
Feature Information                                          14 - 3
Feature Operations                                           14 - 4
Feature Groups and Patterns                                  14 - 6
User Defined Features                                        14 - 8
Creating Features from UDFs                                  14 - 9
                                                              14 - 1
Access to Features
Methods Introduced:
•   pfcFeature.Feature.ListChildren
•   pfcFeature.Feature.ListParents
•   pfcFeature.FeatureGroup.GetGroupLeader
•   pfcFeature.FeaturePattern.GetPatternLeader
•   pfcFeature.FeaturePattern.ListMembers
•   pfcSolid.Solid.ListFailedFeatures
•   pfcSolid.Solid.ListFeaturesByType
•   pfcSolid.Solid.GetFeatureById
                 The methods pfcFeature.Feature.ListChildren and
                 pfcFeature.Feature.ListParents return a sequence of features
                 that contain all the children or parents of the specified feature.
                 To get the first feature in the specified group access the method
                 pfcFeature.FeatureGroup.GetGroupLeader.
•   pfcFeature.Feature.GetFeatType
•   pfcFeature.Feature.GetStatus
•   pfcFeature.Feature.GetIsVisible
•   pfcFeature.Feature.GetIsReadonly
                                                                                         Features
•   pfcFeature.Feature.GetIsEmbedded
•   pfcFeature.Feature.GetNumber
•   pfcFeature.Feature.GetFeatTypeName
•   pfcFeature.Feature.GetFeatSubType
•   pfcRoundFeat.RoundFeat.GetIsAutoRoundMember
                 The enumeration classes FeatureType and FeatureStatus
                 provide information for a specified feature. The following methods
                 specify this information:
Features                                                                        14 - 3
                 The method
                 pfcRoundFeat.RoundFeat.GetIsAutoRoundMember
                 determines whether the specified round feature is a member of an
                 Auto Round feature.
Feature Operations
Methods Introduced:
•   pfcSolid.Solid.ExecuteFeatureOps
•   pfcFeature.Feature.CreateSuppressOp
•   pfcFeature.SuppressOperation.SetClip
•   pfcFeature.SuppressOperation.SetAllowGroupMembers
•   pfcFeature.SuppressOperation.SetAllowChildGroupMembers
•   pfcFeature.Feature.CreateDeleteOp
•   pfcFeature.DeleteOperation.SetClip
•   pfcFeature.DeleteOperation.SetAllowGroupMembers
•   pfcFeature.DeleteOperation.SetAllowChildGroupMembers
•   pfcFeature.DeleteOperation.SetKeepEmbeddedDatums
•   pfcFeature.Feature.CreateResumeOp
•   pfcFeature.ResumeOperation.SetWithParents
•   pfcFeature.Feature.CreateReorderBeforeOp
•   pfcFeature.ReorderBeforeOperation.SetBeforeFeat
•   pfcFeature.Feature.CreateReorderAfterOp
•   pfcFeature.ReorderAfterOperation.SetAfterFeat
•   pfcFeature.FeatureOperations.create
                 The method pfcSolid.Solid.ExecuteFeatureOps causes a
                 sequence of feature operations to run in order. Feature operations
                 include suppressing, resuming, reordering, and deleting features.
                 The optional RegenInstructions argument specifies whether the
                 user will be allowed to fix the model if a regeneration failure occurs.
                                                                                       Features
           of the FeatureOperations object using the method
           pfcFeature.FeatureOperations.create.
           Some of the operations have specific options that you can modify to
           control the behavior of the operation:
Features                                                                      14 - 5
         •   KeepEmbeddedDatums—Specifies whether to retain the
             embedded datums stored in a feature while deleting the
             feature. By default, this option is false.
             Use the method
             pfcFeature.DeleteOperation.SetKeepEmbeddedDatums
             to modify this option.
         •   WithParents—Specifies whether to resume the parents of the
             selected feature.
             Use the method
             pfcFeature.ResumeOperation.SetWithParents to modify
             this option.
         •   BeforeFeat—Specifies the feature before which you want to
             reorder the features.
             Use the
             methodpfcFeature.ReorderBeforeOperation.SetBeforeFe
             at to modify this option.
         •   AfterFeat—Specifies the feature after which you want to
             reorder the features.
             Use the
             methodpfcFeature.ReorderAfterOperation.SetAfterFeat
             to modify this option.
•   pfcFeature.Feature.GetGroup
•   pfcFeature.Feature.GetPattern
•   pfcSolid.Solid.CreateLocalGroup
•   pfcFeature.FeatureGroup.GetPattern
•   pfcFeature.FeatureGroup.GetGroupLeader
•   pfcFeature.FeaturePattern.GetPatternLeader
                                                                                            Features
•   pfcFeature.FeaturePattern.ListMembers
•   pfcFeature.FeaturePattern.Delete
                 The method pfcFeature.Feature.GetGroup returns a handle to
                 the local group that contains the specified feature.
                 To get the first feature in the specified group call the method
                 pfcFeature.FeatureGroup.GetGroupLeader.
Features                                                                           14 - 7
         •   Models that contain groups will get one extra feature in the
             regeneration list, of type
             FeatureType.FEATTYPE_GROUP_HEAD. This will change the
             feature numbers of all subsequent features, including those in
             the group.
         •   Each group automatically contains one new feature in the list of
             features returned from
             pfcFeature.FeatureGroup.ListMembers.
         •   Each group automatically gets a different leader feature (the
             group head feature is the leader). This is returned from
             pfcFeature.FeatureGroup.GetGroupLeader.
         •   Each group pattern contains a series of groups, and each group
             in the pattern will be similarly altered.
         •   Suppress
         •   Delete
         •   Layers
         •   Patterning
         User defined Features (UDFs) are groups of features that are
         stored in a file. When a UDF is placed in a new model the created
         features are automatically assigned to a group. A local group is a
         set of features that have been specifically assigned to a group to
         make modifications and patterning easier.
             Note: All methods in this section can be used for UDFs and
                   local groups.
•   pfcFeature.FeatureGroup.GetUDFName
•   pfcFeature.FeatureGroup.GetUDFInstanceName
•   pfcFeature.FeatureGroup.ListUDFDimensions
•   pfcUDFGroup.UDFDimension.GetUDFDimensionName
                                                                                           Features
                 User defined features (UDF’s) are groups of features that can be
                 stored in a file and added to a new model. A local group is similar to
                 a UDF except it is available only in the model in which is was
                 created.
                 The method
                 pfcUDFGroup.UDFDimension.GetUDFDimensionName
                 provides access to the dimension name specified when the UDF was
                 created, and not the name of the dimension in the current model.
                 This name is required to place the UDF programmatically using the
                 method pfcSolid.Solid.CreateUDFGroup.
•   pfcSolid.Solid.CreateUDFGroup
                 The method pfcSolid.Solid.CreateUDFGroup is used to create
                 new features by retrieving and applying the contents of an existing
                 UDF file. It is equivalent to the Pro/ENGINEER command
                 Feature, Create, User Defined.
Features                                                                          14 - 9
           To understand the following explanation of this method, you must
           have a good knowledge and understanding of the use of UDF’s in
           Pro/ENGINEER. PTC recommends that you read about UDF’s in
           the Pro/ENGINEER on-line help, and practice defining and using
           UDF’s in Pro/ENGINEER before you attempt to use this method.
Creating UDFs
           Creating a UDF requires the following information:
           •    Name—The name of the UDF you are creating and the instance
                name if applicable.
           •    Dependency—Specify if the UDF is independent of the UDF
                definition or is modified by the changers made to it.
           •    Scale—How to scale the UDF relative to the placement model.
           •    Variable Dimension—The new values of the variables
                dimensions and pattern parameters, those whose values can be
                modified each time the UDF is created.
           •    Dimension Display—Whether to show or blank non-variable
                dimensions created within the UDF group.
                                                                                         Features
                     also need to know at what level in an assembly each
                     intersection is going to be visible.
                 •   Orientations—When a UDF contains a feature with a direction
                     that is defined in respect to a datum plane Pro/ENGINEER
                     must know what direction the new feature will point to. When
                     you create such a UDF interactively Pro/ENGINEER prompt
                     you for this information with a flip arrow.
                 •   Quadrants—When a UDF contains a linearly placed feature
                     that references two datum planes to define it’s location in the
                     new model Pro/ENGINEER prompts you to pick the location of
                     the new feature. This is determined by which side of each
                     datum plane the feature must lie. This selection is referred to
                     as the quadrant because the are four possible combinations for
                     each linearly place feature.
                 To pass all the above values to Pro/ENGINEER, J-Link uses a
                 special class that prepares and sets all the options and passes them
                 to Pro/ENGINEER.
•   pfcUDFGroup.pfcUDFGroup.UDFPromptCreateInstructions_Create
                 This static method is used to create an instructions object that can
                 be used to prompt a user for the required values that will create a
                 UDF interactively.
• pfcUDFCreate.pfcUDFCreate.UDFCustomCreateInstructions_Create
Features                                                                       14 - 11
                 This method creates a UDFCustomCreateInstructions object with a
                 specified name. To set the UDF creation parameters
                 programmatically you must modify this object as described below.
                 The members of this class relate closely to the prompts
                 Pro/ENGINEER gives you when you create a UDF interactively.
                 PTC recommends that you experiment with creating the UDF
                 interactively using Pro/ENGINEER before you write the J-Link
                 code to fill the structure.
•   pfcUDFCreate.UDFCustomCreateInstructions.SetInstanceName
•   pfcUDFCreate.UDFCustomCreateInstructions.GetInstanceName
                 If the UDF contains a family table, this field can be used to select
                 the instance in the table. If the UDF does not contain a family
                 table, or if the generic instance is to be selected, the do not set the
                 string.
•   pfcUDFCreate.UDFCustomCreateInstructions.SetDependencyType
•   pfcUDFCreate.UDFCustomCreateInstructions.GetDependencyType
                 The UDFDependencyType object represents the dependency type of
                 the UDF. The choices correspond to the choices available when you
                 create a UDF interactively. This enumerated type takes the
                 following values:
                 •    UDFDEP_INDEPENDENT
                 •    UDFDEP_DRIVEN
                      Note: UDFDEP_INDEPENDENT is the default value, if this
                            option is not set.
•   pfcUDFCreate.UDFCustomCreateInstructions.SetScaleType
•   pfcUDFCreate.UDFCustomCreateInstructions.GetScaleType
•   pfcUDFCreate.UDFCustomCreateInstructions.SetScale
•   pfcUDFCreate.UDFCustomCreateInstructions.GetScale
                 •    UDFSCALE_SAME_SIZE
                 •    UDFSCALE_SAME_DIMS
                 •    UDFSCALE_CUSTOM
                 •    UDFSCALE_nil
                                                                                         Features
                      Note: The default value is UDFSCALE_SAME_SIZE if this
                            option is not set.
                 Scale specifies the scale factor. If the ScaleType is set to
                 UDFSCALE_CUSTOM, SetScale assigns the user defined scale factor.
                 Otherwise, this attribute is ignored.
•   pfcUDFCreate.UDFCustomCreateInstructions.SetDimDisplayType
•   pfcUDFCreate.UDFCustomCreateInstructions.GetDimDisplayType
                 The pfcUDFCreate.UDFDimensionDisplayType object sets the
                 options in Pro/ENGINEER for determining the appearance in the
                 model of UDF dimensions and pattern parameters that were not
                 variable in the UDF, and therefore cannot be modified in the model.
                 This enumerated type takes the following values:
                 •    UDFDISPLAY_NORMAL
                 •    UDFDISPLAY_READ_ONLY
                 •    UDFDISPLAY_BLANK
                      Note: The default value is UDFDISPLAY_NORMAL if this
                            option is not set.
•   pfcUDFCreate.UDFCustomCreateInstructions.SetVariantValues
•   pfcUDFCreate.UDFVariantValues.create
•   pfcUDFCreate.UDFVariantValues.insert
•   pfcUDFCreate.pfcUDFCreate.UDFVariantDimension_Create
•   pfcUDFCreate.pfcUDFCreate.UDFVariantPatternParam_Create
Features                                                                       14 - 13
          pfcUDFVariantValues class represents an array of variable
          dimensions and pattern parameters.
          •   Name—The symbol that the dimension had when the UDF was
              originally defined not the prompt that the UDF uses when it is
              created interactively. To make this name easy to remember,
              before you define the UDF that you plan to create with the
              J-Link, you should modify the symbols of all the dimensions
              that you want to select to be variable. If you get the name
              wrong, pfcSolid.Solid.CreateUDFGroup will not recognize
              the dimension and prompts the user for the value in the usual
              way does not modify the value.
          •   DimensionValue—The new value.
          If you do not remember the name, you can find it by creating the
          UDF interactively in a test model, then using the
          pfcFeature.FeatureGroup.ListUDFDimensions and
          pfcUDFGroup.UDFDimension.GetUDFDimensionName to
          find out the name.
          pfcUDFCreate.pfcUDFCreate.UDFVariantPatternParam_Cr
          eate is a static method which creates a
          pfcUDFCreate.UDFVariantPatternParam. It accepts the
          following parameters:
•   pfcUDFCreate.UDFReferences.create
•   pfcUDFCreate.UDFReferences.insert
•   pfcUDFCreate.pfcUDFCreate.UDFReference_Create
•   pfcUDFCreate.UDFReference.SetIsExternal
•   pfcUDFCreate.UDFReference.SetReferenceItem
                                                                                         Features
•   pfcUDFCreate.UDFCustomCreateInstructions.SetReferences
                 UDFReferences class represents an array of element references.
                 Use pfcUDFCreate.UDFReferences.create to create an empty
                 object and then use pfcUDFCreate.UDFReferences.insert to
                 add UDFReference objects one by one.
                 The method
                 pfcUDFCreate.pfcUDFCreate.UDFReference_Create is a
                 static method creating a UDFReference object. It accepts the
                 following parameters:
Features                                                                       14 - 15
                 After the UDFReferences object has been set, use
                 pfcUDFCreate.UDFCustomCreateInstructions.SetReference
                 s to add the program-defined references.
•   pfcUDFCreate.UDFAssemblyIntersections.create()
•   pfcUDFCreate.UDFAssemblyIntersections.insert()
•   pfcUDFCreate.pfcUDFCreate.UDFAssemblyIntersection_Create
•   pfcUDFCreate.UDFAssemblyIntersection.SetInstanceNames
•   pfcUDFCreate.UDFCustomCreateInstructions.SetIntersections
                 The pfcUDFCreate.UDFAssemblyIntersections class
                 represents an array of element references.
                 Use
                 pfcUDFCreate.pfcUDFCreate.UDFAssemblyIntersections.cr
                 eate to create an empty object and then use
                 pfcUDFCreate.UDFAssemblyIntersections.insert to add
                 pfcUDFCreate.UDFAssemblyIntersection objects one by one.
                 pfcUDFCreate.pfcUDFCreate.UDFAssemblyIntersection_Cr
                 eate is a static method creating a pfcUDFCreate.UDFReference
                 object. It accepts the following parameters:
•   pfcUDFCreate.UDFCustomCreateInstructions.SetOrientations
•   pfcUDFCreate.UDFOrientations.create
•   pfcUDFCreate.UDFOrientations.insert
                 pfcUDFCreate.UDFOrientations class represents an array of
                 orientations that provide the answers to Pro/ENGINEER prompts
                                                                                         Features
                 that use a flip arrow. Each term is a
                 pfcUDFCreate.UDFOrientation object that takes the following
                 values:
Setting Quadrants
Methods Introduced:
•   pfcUDFCreate.UDFCustomCreateInstructions.SetQuadrants
                 The method
                 pfcUDFCreate.UDFCustomCreateInstructions.SetQuadrant
                 s sets an array of points, which provide the X, Y, and Z coordinates
                 that correspond to the picks answering the Pro/ENGINEER
                 prompts for the feature positions. The order of quadrants should
                 correspond to the order in which Pro/ENGINEER prompts for them
                 when the UDF is created interactively.
Features                                                                       14 - 17
Setting the External References
Methods Introduced:
•    pfcUDFCreate.UDFCustomCreateInstructions.SetExtReferences
                    The method
                    pfcUDFCreate.UDFCustomCreateInstructions.SetExtRefere
                    nces sets an external reference assembly to be used when placing
                    the UDF. This will be required when placing the UDF in the
                    component using references outside of that component. References
                    could be to the top level assembly of another component.
Example Code
          UDFReference csys_ref =
            pfcUDFCreate.UDFReference_Create ("REF_CSYS", csys_sel);
instrs.SetReferences (refs);
        UDFVariantDimension var_diam =
          pfcUDFCreate.UDFVariantDimension_Create ("d11", diam);
                                                                                         Features
        UDFVariantValues vals = UDFVariantValues.create();
        vals.set (0, var_diam);
instrs.SetVariantValues (vals);
        /* We need the placement model for the UDF for the call to
           CreateUDFGroup(). If you were placing the UDF in a model other
           than the owner of the coordinate system, the placement would need
           to be provided separately.*/
Example Code
Features                                                                       14 - 19
                    The method returns the FeatureGroup object created, or null if an
                    error occurred. A usage error may be detected, causing an exception
                    to be thrown.
import     com.ptc.cipjava.*;
import     com.ptc.pfc.pfcModelItem.*;
import     com.ptc.pfc.pfcSelect.*;
import     com.ptc.pfc.pfcUDFCreate.*;
import     com.ptc.pfc.pfcSolid.*;
import     com.ptc.pfc.pfcGeometry.*;
import     com.ptc.pfc.pfcFeature.*;
import     com.ptc.pfc.pfcExceptions.*;
import     com.ptc.pfc.pfcBase.*;
import     com.ptc.pfc.pfcAssembly.*;
import     com.ptc.pfc.pfcModel.*;
          UDFCustomCreateInstructions instrs =
            pfcUDFCreate.UDFCustomCreateInstructions_Create ("hole_quadrant");
          if (scale == null)
            {
               instrs.SetScaleType (UDFScaleType.UDFSCALE_SAME_SIZE);
            }
          else
            {
               instrs.SetScaleType (UDFScaleType.UDFSCALE_CUSTOM);
               instrs.SetScale (scale);
            }
      Selection surf_selection =
        pfcSelect.CreateModelItemSelection (placement_surface,
                                                                               Features
reference_path);
       UDFReference ref_1 =
         pfcUDFCreate.UDFReference_Create ("embedding surface?",
                                           surf_selection);
       ref_1.SetIsExternal (true);
           if (!(side_ref instanceof
                 com.ptc.pfc.pfcDatumPlaneFeat.DatumPlaneFeat))
             {
               throw new Exception ("Error: input surface id "+
                                     side_ref_feat_ids[i]+
                                     " is not a datum plane.");
             }
           ModelItems surfs =
            ((Feature)side_ref).ListSubItems (ModelItemType.ITEM_SURFACE);
Features                                                             14 - 21
            }
instrs.SetReferences (refs);
      /*
 If the UDF and the placement both use two normal datum planes as
         dimensioned references, Pro/ENGINEER prompts the user for a pick
to define the quadrant where the UDF will be placed. */
          /*
        This hole UDF should be visible down to the component part level.
To direct this, the UDFAssemblyIntersection should be
created with the component ids, and the visibility level argument equal to
the number of component levels. Alternatively, the
visibility level could be 0 to force the UDF to appear in the assembly
only.*/
instrs.SetIntersections(inters);
          /*
            Create the assembly group.
            */
          FeatureGroup group = null;
                                                                                    Features
      }
class pfcAssemblyUtilities
{
  private static Assembly useAsm;
  private static java.util.Vector path_array;
    /*
        This utility method returns an array of all ComponentPath's to all
        component parts ('leafs') in an assembly.
        */
    public static ComponentPath [] listEachLeafComponent (Assembly assembly)
      throws com.ptc.cipjava.jxthrowable
      {
         useAsm = assembly;
         path_array = new java.util.Vector ();
path_array.copyInto (ret);
          return (ret);
      }
    /*
      This method is used to recursively visit all levels of the assembly
      structure.
      */
    private static void listSubAsmComponents (intseq currentLevel)
      throws com.ptc.cipjava.jxthrowable
      {
         Solid currentComponent;
         ComponentPath currentPath = null;
Features                                                                  14 - 23
          int level = currentLevel.getarraysize();
                      listSubAsmComponents (currentLevel);
                  }
            }
This chapter describes the J-Link methods that provide read access
to the properties of datum features.
Topic Page
                                                             15 - 1
Datum Plane Features
                 The properties of the Datum Plane feature are defined in the
                 pfcDatumPlaneFeat.DatumPlaneFeat data object.
Methods Introduced:
•   pfcDatumPlaneFeat.DatumPlaneFeat.GetFlip
•   pfcDatumPlaneFeat.DatumPlaneFeat.GetConstraints
•   pfcDatumPlaneFeat.DatumPlaneConstraint.GetConstraintType
•   pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneThroughConstraint_Create
•   pfcDatumPlaneFeat.DatumPlaneThroughConstraint.GetThroughRef
•   pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneNormalConstraint_Create
•   pfcDatumPlaneFeat.DatumPlaneNormalConstraint.GetNormalRef
•   pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneParallelConstraint_Create
•   pfcDatumPlaneFeat.DatumPlaneParallelConstraint.GetParallelRef
•   pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneTangentConstraint_Create
•   pfcDatumPlaneFeat.DatumPlaneTangentConstraint.GetTangentRef
•   pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneOffsetConstraint_Create
•   pfcDatumPlaneFeat.DatumPlaneOffsetConstraint.GetOffsetRef
•   pfcDatumPlaneFeat.DatumPlaneOffsetConstraint.GetOffsetValue
•   pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneOffsetCoordSysConstraint_C
    reate
•   pfcDatumPlaneFeat.DatumPlaneOffsetCoordSysConstraint.GetCsysAxis
•   pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneAngleConstraint_Create
•   pfcDatumPlaneFeat.DatumPlaneAngleConstraint.GetAngleRef
•   pfcDatumPlaneFeat.DatumPlaneAngleConstraint.GetAngleValue
•   pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneSectionConstraint_Create
•   pfcDatumPlaneFeat.DatumPlaneSectionConstraint.GetSectionRef
•   pfcDatumPlaneFeat.DatumPlaneSectionConstraint.GetSectionIndex
•   pfcDatumPlaneFeat.DatumPlaneDefaultXConstraint.DatumPlaneDefaultXConstrain
    t_Create
                                                                                         Datum Features
                     creation. Use the method
                     pfcDatumPlaneFeat.DatumPlaneFeat.GetFlip to
                     determine if the datum plane was flipped during creation.
                 •   Constraints—Specifies a collection of constraints (given by the
                     pfcDatumPlaneFeat.DatumPlaneConstraint object). The
                     method
                     pfcDatumPlaneFeat.DatumPlaneFeat.GetConstraints
                     obtains the collection of constraints defined for the datum
                     plane.
                 Use the method
                 pfcDatumPlaneFeat.DatumPlaneConstraint.GetConstraint
                 Type to obtain the type of constraint. The type of constraint is
                 given by the pfcDatumPlaneFeat.DatumPlaneConstraintType
                 enumerated type. The available types are as follows:
Datum Features                                                                  15 - 3
         •   DTMPLN_PRL—Specifies the Parallel constraint. The
             pfcDatumPlaneFeat.DatumPlaneParallelConstraint
             object specifies this constraint. Use the method
             pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlanePa
             rallelConstraint_Create to create a new object. Use the
             method
             pfcDatumPlaneFeat.DatumPlaneParallelConstraint.Get
             ParallelRef to get the reference selection handle for the
             Parallel constraint.
         •   DTMPLN_TANG—Specifies the Tangent constraint. The
             pfcDatumPlaneFeat.DatumPlaneTangentConstraint
             specifies this constraint. Use the method
             pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneTa
             ngentConstraint_Create to create a new object. Use the
             method
             pfcDatumPlaneFeat.DatumPlaneTangentConstraint.Get
             TangentRef to get the reference selection handle for the
             Tangent constraint.
         •   DTMPLN_OFFS—Specifies the Offset constraint. The
             pfcDatumPlaneFeat.DatumPlaneOffsetConstraint object
             specifies this constraint. Use the method
             pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneOf
             fsetConstraint_Create to create a new object. Use the method
             pfcDatumPlaneFeat.DatumPlaneOffsetConstraint.GetOf
             fsetRef to get the reference selection handle for the Offset
             constraint. Use the method
             pfcDatumPlaneFeat.DatumPlaneOffsetConstraint.GetOf
             fsetValue to get the offset value.
             An Offset constraint where the offset reference is a coordinate
             system is given by the
             pfcDatumPlaneFeat.DatumPlaneOffsetCoordSysConstra
             int object. Use the method
             pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneOf
             fsetCoordSysConstraint_Create to create a new object. Use
             the method
             pfcDatumPlaneFeat.DatumPlaneOffsetCoordSysConstr
             aint.GetCsysAxis to get the reference coordinate axis.
         •   DTMPLN_ANG—Specifies the Angle constraint. The
             pfcDatumPlaneFeat.DatumPlaneAngleConstraint object
             specifies this constraint. Use the method
             pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneAn
             gleConstraint_Create to create a new object. Use the method
                                                                                   Datum Features
                     pfcDatumPlaneFeat.pfcDatumPlaneFeat.DatumPlaneSe
                     ctionConstraint_Create to create a new object. Use the
                     method
                     pfcDatumPlaneFeat.DatumPlaneSectionConstraint.Get
                     SectionRef to get the reference selection for the Section
                     constraint. Use the method
                     pfcDatumPlaneFeat.DatumPlaneSectionConstraint.Get
                     SectionIndex to get the section index.
                 •   DTMPLN_DEF_X—Specifies the default RIGHT constraint for
                     the datum plane. The
                     pfcDatumPlaneFeat.DatumPlaneDefaultXConstraint
                     object specifies this constraint. Use the method
                     pfcDatumPlaneFeat.DatumPlaneDefaultXConstraint.Da
                     tumPlaneDefaultXConstraint_Create to create a new
                     object.
                 •   DTMPLN_DEF_Y—Specifies the default TOP constraint for the
                     datum plane. The
                     pfcDatumPlaneFeat.DatumPlaneDefaultYConstraint
                     object specifies this constraint. Use the method
                     pfcDatumPlaneFeat.DatumPlaneDefaultYConstraint.Da
                     tumPlaneDefaultYConstraint_Create to create a new
                     object.
                 •   DTMPLN_DEF_Z—Specifies the default FRONT constraint for
                     the datum plane. The
                     pfcDatumPlaneFeat.DatumPlaneDefaultZConstraint
                     object specifies this constraint. Use the method
                     pfcDatumPlaneFeat.DatumPlaneDefaultZConstraint.Da
                     tumPlaneDefaultZConstraint_Create to create a new
                     object.
Datum Features                                                            15 - 5
Datum Axis Features
                 The properties of the Datum Axis feature are defined in the
                 pfcDatumAxisFeat.DatumAxisFeat data object.
Methods Introduced:
•   pfcDatumAxisFeat.DatumAxisFeat.GetConstraints
•   pfcDatumAxisFeat.pfcDatumAxisFeat.DatumAxisConstraint_Create
•   pfcDatumAxisFeat.DatumAxisConstraint.GetConstraintType
•   pfcDatumAxisFeat.DatumAxisConstraint.GetConstraintRef
•   pfcDatumAxisFeat.DatumAxisFeat.GetDimConstraints
•   pfcDatumAxisFeat.pfcDatumAxisFeat.DatumAxisDimensionConstraint_Create
•   pfcDatumAxisFeat.DatumAxisDimensionConstraint.GetDimOffset
•   pfcDatumAxisFeat.DatumAxisDimensionConstraint.GetDimRef
                 The properties of the pfcDatumAxisFeat.DatumAxisFeat object
                 are described as follows:
                                                                                       Datum Features
                         intRef to get the reference selection handle.
                 •   DimConstraints—Specifies a collection of dimension constraints
                     (given by the
                     pfcDatumAxisFeat.DatumAxisDimensionConstraint
                     object). The method
                     pfcDatumAxisFeat.DatumAxisFeat.GetDimConstraints
                     obtains the collection of dimension constraints applied to the
                     Datum Axis feature.
                     Use the method
                     pfcDatumAxisFeat.pfcDatumAxisFeat.DatumAxisDimen
                     sionConstraint_Create to create a new
                     pfcDatumAxisFeat.DatumAxisDimensionConstraint
                     object. This object contains the following attributes:
                     –   DimOffset—Specifies the offset value for the dimension
                         constraint. Use the method
                         pfcDatumAxisFeat.DatumAxisDimensionConstraint.
                         GetDimOffset to get the offset value.
                     –   DimRef—Specifies the reference selection for the dimension
                         constraint. Use the method
                         pfcDatumAxisFeat.DatumAxisDimensionConstraint.
                         GetDimRef to get the reference selection handle.
Datum Features                                                                15 - 7
Methods Introduced:
•   pfcDatumPointFeat.DatumPointFeat.GetFeatName
•   pfcDatumPointFeat.DatumPointFeat.GetPoints
•   pfcDatumPointFeat.GeneralDatumPoint.GetName
•   pfcDatumPointFeat.pfcDatumPointFeat.DatumPointPlacementConstraint_Create
•   pfcDatumPointFeat.GeneralDatumPoint.GetPlaceConstraints
•   pfcDatumPointFeat.pfcDatumPointFeat.DatumPointDimensionConstraint_Create
•   pfcDatumPointFeat.GeneralDatumPoint.GetDimConstraints
•   pfcDatumPointFeat.DatumPointConstraint.GetConstraintRef
•   pfcDatumPointFeat.DatumPointConstraint.GetConstraintType
•   pfcDatumPointFeat.DatumPointConstraint.GetValue
                 The properties of the pfcDatumPointFeat.DatumPointFeat
                 object are described as follows:
                                                                                        Datum Features
                 The constraints for a datum point are given by the
                 pfcDatumPointFeat.DatumPointConstraint object. This
                 object contains the following attributes:
Datum Features                                                                 15 - 9
Methods Introduced:
•   pfcCoordSysFeat.CoordSysFeat.GetOriginConstraints
•   pfcCoordSysFeat.pfcCoordSysFeat.DatumCsysOriginConstraint_Create
•   pfcCoordSysFeat.DatumCsysOriginConstraint.GetOriginRef
•   pfcCoordSysFeat.CoordSysFeat.GetDimensionConstraints
•   pfcCoordSysFeat.pfcCoordSysFeat.DatumCsysDimensionConstraint_Create
•   pfcCoordSysFeat.DatumCsysDimensionConstraint.GetDimRef
•   pfcCoordSysFeat.DatumCsysDimensionConstraint.GetDimValue
•   pfcCoordSysFeat.DatumCsysDimensionConstraint.GetDimConstraintType
•   pfcCoordSysFeat.CoordSysFeat.GetOrientationConstraints
•   pfcCoordSysFeat.pfcCoordSysFeat.DatumCsysOrientMoveConstraint_Create
•   pfcCoordSysFeat.DatumCsysOrientMoveConstraint.GetOrientMoveConstraintTyp
    e
•   pfcCoordSysFeat.DatumCsysOrientMoveConstraint.GetOrientMoveValue
•   pfcCoordSysFeat.CoordSysFeat.GetIsNormalToScreen
•   pfcCoordSysFeat.CoordSysFeat.GetOffsetType
•   pfcCoordSysFeat.CoordSysFeat.GetOnSurfaceType
•   pfcCoordSysFeat.CoordSysFeat.GetOrientByMethod
                 The properties of the pfcCoordSysFeat.CoordSysFeat object
                 are described as follows:
                                                                                        Datum Features
                     pfcCoordSysFeat.DatumCsysDimensionConstraint
                     object. This object contains the following attributes:
                     –   DimRef—Specifies the reference selection for the dimension
                         constraint. Use the method
                         pfcCoordSysFeat.DatumCsysDimensionConstraint.G
                         etDimRef to get the reference selection handle.
                     –   DimValue—Specifies the value of the reference. Use the
                         method
                         pfcCoordSysFeat.DatumCsysDimensionConstraint.G
                         etDimValue to get the value.
                     –   DimConstraintType—Specifies the type of dimension
                         constraint in terms of the
                         pfcCoordSysFeat.DatumCsysDimConstraintType
                         enumerated type. Use the method
                         pfcCoordSysFeat.DatumCsysDimensionConstraint.G
                         etDimConstraintType to get the constraint type. The
                         constraint types are:
                         -   DTMCSYS_DIM_OFFSET—Specifies the offset type
                             constraint.
                         -   DTMCSYS_DIM_ALIGN—Specifies the align type
                             constraint.
                 •   OrientationConstraints—Specifies a collection of orientation
                     constraints (given by the
                     pfcCoordSysFeat.DatumCsysOrientMoveConstraint
                     object) Use the method
                     pfcCoordSysFeat.CoordSysFeat.GetOrientationConstrai
                     nts to obtain the collection of orientation constraints for the
                     coordinate system. Use the method
                     pfcCoordSysFeat.pfcCoordSysFeat.DatumCsysOrientMo
                     veConstraint_Create to create a new
                     pfcCoordSysFeat.DatumCsysOrientMoveConstraints
                     object. This object contains the following attributes:
Datum Features                                                                15 - 11
              –   OrientMoveConstraintType—Specifies the type of
                  orientation for the constraint. The orientation type is given
                  by the
                  pfcCoordSysFeat.DatumCsysOrientMoveConstraintT
                  ype enumerated type. Use the method
                  pfcCoordSysFeat.DatumCsysOrientMoveConstraint.
                  GetOrientMoveConstraintType to get the orientation
                  type.
              –   OrientMoveValue—Specifies the reference value for the
                  constraint. Use the method
                  pfcCoordSysFeat.DatumCsysOrientMoveConstraint.
                  GetOrientMoveValue to get the reference value.
          •   IsNormalToScreen—Specifies if the coordinate system is
              normal to screen. Use the method
              pfcCoordSysFeat.CoordSysFeat.GetIsNormalToScreen
              to determine if the coordinate system is normal to screen.
          •   OffsetType—Specifies the offset type of the coordinate system in
              terms of the pfcCoordSysFeat.DatumCsysOffsetType
              enumerated type. Use the method
              pfcCoordSysFeat.CoordSysFeat.GetOffsetType to get the
              offset type. The offset types are:
              –   DTMCSYS_OFFSET_CARTESIAN—Specifies a cartesian
                  coordinate system that has been defined by setting the
                  values for the DTMCSYS_MOVE_TRAN_X,
                  DTMCSYS_MOVE_TRAN_Y, and
                  DTMCSYS_MOVE_TRAN_Z or DTMCSYS_MOVE_ROT_X,
                  DTMCSYS_MOVE_ROT_Y, and
                  DTMCSYS_MOVE_ROT_Z orientation constants.
              –   DTMCSYS_OFFSET_CYLINDRICAL—Specifies a
                  cylindrical coordinate system that has been defined by
                  setting the values for the DTMCSYS_MOVE_RAD,
                  DTMCSYS_MOVE_THETA, and
                  DTMCSYS_MOVE_TRAN_ZI orientation constants.
              –   DTMCSYS_OFFSET_SPHERICAL—Specifies a spherical
                  coordinate system that has been defined by setting the
                  values for the DTMCSYS_MOVE_RAD,
                  DTMCSYS_MOVE_THETA, and
                  DTMCSYS_MOVE_TRAN_PHI orientation constants.
                                                                                          Datum Features
                         system placed on the selected surface by using two linear
                         dimensions.
                     –   DTMCSYS_ONSURF_RADIAL—Specifies a coordinate
                         system placed on the selected surface by using a linear
                         dimension and an angular dimension. The radius value is
                         used to specify the linear dimension.
                     –   DTMCSYS_ONSURF_DIAMETER—This type is similar to
                         the DTMCSYS_ONSURF_RADIAL type, except that the
                         diameter value is used to specify the linear dimension. It is
                         available only when planar surfaces are used as the
                         reference.
                 •   OrientByMethod—Specifies the orientation method in terms of
                     the pfcCoordSysFeat.DatumCsysOrientByMethod
                     enumerated type. Use the method
                     pfcCoordSysFeat.CoordSysFeat.GetOrientByMethod to
                     get the orientation method. The available orientation types are:
                     –   DTMCSYS_ORIENT_BY_SEL_REFS—Specifies the
                         orientation by selected references.
                     –   DTMCSYS_ORIENT_BY_SEL_CSYS_AXES—Specifies the
                         orientation by corordinate system axes.
import   com.ptc.pfc.pfcGlobal.pfcGlobal;
import   com.ptc.pfc.pfcSession.Session;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcModel2D.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcFeature.*;
import   com.ptc.pfc.pfcComponentFeat.*;
import   com.ptc.pfc.pfcFamily.FamilyTableRow;
import   com.ptc.pfc.pfcBase.*;
Datum Features                                                                  15 - 13
import    com.ptc.pfc.pfcSelect.*;
import    com.ptc.pfc.pfcModelItem.*;
import    com.ptc.pfc.pfcAssembly.*;
import    com.ptc.pfc.pfcWindow.*;
import    com.ptc.pfc.pfcView2D.*;
import    com.ptc.pfc.pfcDrawing.*;
import    com.ptc.pfc.pfcModelCheck.*;
import    com.ptc.pfc.pfcFamily.*;
import    com.ptc.pfc.pfcDisplay.*;
import    com.ptc.pfc.pfcDatumPlaneFeat.*;
import    com.ptc.pfc.pfcDatumAxisFeat.*;
import    com.ptc.pfc.pfcDatumPointFeat.*;
import    com.ptc.pfc.pfcCoordSysFeat.*;
import java.util.logging.*;
import java.io.*;
import javax.swing.*;
/******************************************************\
CLASS:   pfcReadBasicFeatPropertiesExamples
PURPOSE: Read basic feature properties
\******************************************************/
public class pfcReadBasicFeatPropertiesExamples
{
                                                                                Datum Features
      if (no_of_models == 0)
      {
        session.UIDisplayMessage(messageFile, "RBFPNoModelOpen",
                                               null);
       return;
      }
          ModelItems feature_items =
                                mdl.ListItems(ModelItemType.ITEM_FEATURE);
           switch ( feat.GetFeatType().getValue() )
           {
             case FeatureType._FEATTYPE_DATUM_PLANE :
writeDatumPlaneFeatureProperties(feat);
break;
case FeatureType._FEATTYPE_DATUM_AXIS :
writeDatumAxisFeatureProperties(feat);
break;
case FeatureType._FEATTYPE_DATUM_POINT :
writeDatumPointFeatureProperties (feat);
break;
Datum Features                                                        15 - 15
                  case FeatureType._FEATTYPE_COORD_SYS :
writeDatumCoordSysFeatureProperties (feat);
break;
               }
              }
          }
      }
      catch (jxthrowable x)
      {
        logger.log(Level.SEVERE, "Caught exception: ", x);
      }
     }
      try
      {
        DatumPlaneFeat datumplane = (DatumPlaneFeat)feat;
printMsg("++++++++++++++++++++++++++" );
          if (flip != null)
          {
           printMsg("     - Datum Plane Flipped during creation: " +flip);
          }
          /* Getting constraints */
          DatumPlaneConstraints constraints = datumplane.GetConstraints();
          if (constraints == null)
          printMsg("     - No Constraints (null)");
          else if (constraints.getarraysize() < 0)
          printMsg("     - No Constraints");
          else
          {
          printMsg("    - No of Constraints = " +constraints.getarraysize());
       switch(((DatumPlaneConstraint)constraints.get(j)).
                  GetConstraintType().getValue() )
       {
         case (DatumPlaneConstraintType._DTMPLN_THRU):
         {
           printMsg(
                                                                                 Datum Features
              "      - Constraint type = DTMPLN_THRU");
           break;
          }
          case (DatumPlaneConstraintType._DTMPLN_NORM):
          {
            printMsg("    - Constraint type = DTMPLN_NORM");
           break;
          }
          case (DatumPlaneConstraintType._DTMPLN_PRL):
          {
            printMsg("    - Constraint type = DTMPLN_PRL");
           break;
          }
Datum Features                                                         15 - 17
          case (DatumPlaneConstraintType._DTMPLN_OFFS):
          {
            printMsg("    - Constraint type = DTMPLN_OFFS");
           if (((DatumPlaneOffsetConstraint)constraints.get(j)).
           GetOffsetRef().GetSelItem().GetType() ==
           ModelItemType.ITEM_COORD_SYS)
           {
             printMsg ("       Offset Csys Axis = "
                  +((DatumPlaneOffsetCoordSysConstraint)constraints.get(j)).
                  GetCsysAxis().getValue());
           break;
          }
          case (DatumPlaneConstraintType._DTMPLN_ANG):
          {
            printMsg("    - Constraint type = DTMPLN_ANG");
                                                                              Datum Features
         printMsg ("       Tangent Ref Id = "
                    +((DatumPlaneTangentConstraint)constraints.get(j)).
                    GetTangentRef().GetSelItem().GetId());
         break;
        }
        case (DatumPlaneConstraintType._DTMPLN_SEC):
        {
          printMsg("    - Constraint type = DTMPLN_SEC");
         break;
        }
        case (DatumPlaneConstraintType._DTMPLN_DEF_X):
        {
          printMsg("    - Constraint type = DTMPLN_DEF_X");
         break;
        }
        case (DatumPlaneConstraintType._DTMPLN_DEF_Y):
        {
          printMsg("    - Constraint type = DTMPLN_DEF_Y");
         break;
        }
        case (DatumPlaneConstraintType._DTMPLN_DEF_Z):
        {
          printMsg("    - Constraint type = DTMPLN_DEF_Z");
Datum Features                                                      15 - 19
              break;
            }
           }/* End of switch case */
          }
      }
      }
      catch (jxthrowable x)
      {
        logger.log(Level.SEVERE, "Caught exception: ", x);
      }
     }
      try
      {
        DatumAxisFeat datumaxis = (DatumAxisFeat)feat;
printMsg("++++++++++++++++++++++++++" );
          /* Getting constraints */
          DatumAxisConstraints constraints = datumaxis.GetConstraints();
          if (constraints == null)
           printMsg ("       No Constraints (null)");
          else
          {
            printMsg ("       No of Constraints = "
                      +constraints.getarraysize() );
              if (constraints.get(j).GetConstraintRef()!=null)
              {
                                                                                     Datum Features
         }
     }
     if (dimconstraints == null)
      printMsg ("       - No Dimension Constraints (null)");
     else
     {
       printMsg ("       - Number of Dimension Constraints = "
                 +dimconstraints.getarraysize() );
    catch (jxthrowable x)
    {
      logger.log(Level.SEVERE, "Caught exception: ", x);
    }
Datum Features                                                             15 - 21
    }
    /* Write datum point feature properties */
    public static void writeDatumPointFeatureProperties(Feature feat)
    {
      try
      {
       DatumPointFeat pointfeat = (DatumPointFeat)feat;
      printMsg("++++++++++++++++++++++++++" );
      printMsg (" DatumFeatPointName =" +datumpointfeatname);
      /* Getting points */
                GeneralDatumPoints points = pointfeat.GetPoints();
      if (points == null)
       printMsg ("        - No General Datum Points (null)");
      else
      {
        printMsg ("        - No of points = " +points.getarraysize() );
        for (int j = 0 ; j< points.getarraysize() ; j++)
        {
          printMsg("+ --------- +" );
                                                                              Datum Features
         /* Getting dimension constraints */
         DatumPointDimensionConstraints dimconst =
         points.get(j).GetDimConstraints();
    catch (jxthrowable x)
    {
      logger.log(Level.SEVERE, "Caught exception: ", x);
    }
Datum Features                                                      15 - 23
     {
      CoordSysFeat coordsys    = (CoordSysFeat)feat;
printMsg("++++++++++++++++++++++++++" );
                                                                                Datum Features
       printMsg ("       - No of Orientation Constraints   ="
                 +orientConstraint.getarraysize());
    catch (jxthrowable x)
    {
      logger.log(Level.SEVERE, "Caught exception: ", x);
    }
    try
    {
      handler = new FileHandler
                              ("pfcReadBasicFeatPropertiesExamples.log");
      logger = Logger.global;
      logger.addHandler(handler);
Datum Features                                                        15 - 25
     }
     catch (IOException e)
     {
       printMsg ("Caught exception initializing log file: " + e);
     }
     }
Topic Page
Geometry Traversal                                         16 - 2
Curves and Edges                                           16 - 3
Contours                                                   16 - 7
Surfaces                                                   16 - 8
Axes, Coordinate Systems, and Points                      16 - 12
Interference                                              16 - 13
                                                            16 - 1
Geometry Traversal
              Note:
          •   A simple rectangular face has one contour and four edges.
          •   A contour will traverse a boundary so that the part face is
              always on the right-hand side (RHS). For an external contour
              the direction of traversal is clockwise. For an internal contour
              the direction of traversal is counterclockwise.
          •   If a part is extruded from a sketch that has a U-shaped cross
              section there will be separate surfaces at each leg of the
              U-channel.
          •   If a part is extruded from a sketch that has a square-shaped
              cross section, and a slot feature is then cut into the part to make
              it look like a U-channel, there will be one surface across the legs
              of the U-channel. The original surface of the part is represented
              as one surface with a cut through it.
Geometry Terms
          Following are definitions for some geometric terms:
•   pfcModelItem.ModelItemOwner.ListItems
•   pfcGeometry.Surface.ListContours
•   pfcGeometry.Contour.ListElements
                                                                                         Geometry Evaluation
                 To traverse the geometry, follow these steps:
The t Parameter
                 The geometry of each edge or curve is represented as a set of three
                 parametric equations that represent the values of x, y, and z as
                 functions of an independent parameter, t. The t parameter varies
                 from 0.0 at the start of the curve to 1.0 at the end of it.
Geometry Evaluation                                                             16 - 3
                                                                  t = 1.0
d2C/dt2
dC/dt
 t = 0.0
                                              C[x, y, z] = f(t)
                 •    CIRCLE (pfcGeometry.Circle)
                 •    ELLIPSE (pfcGeometry.Ellipse)
                 •    POLYGON (pfcGeometry.Polygon)
                 •
                                                                                        Geometry Evaluation
                      ARROW (pfcGeometry.Arrow)
                 •    TEXT (pfcGeometry.Text)
•   pfcGeometry.GeomCurve.Eval3DData
•   pfcGeometry.GeomCurve.EvalFromLength
•   pfcGeometry.GeomCurve.EvalParameter
•   pfcGeometry.GeomCurve.EvalLength
•   pfcGeometry.GeomCurve.EvalLengthBetween
                 The methods in GeomCurve provide information about any curve or
                 edge.
Geometry Evaluation                                                            16 - 5
Solid Edge Geometry
Methods Introduced:
•   pfcGeometry.Edge.GetSurface1
•   pfcGeometry.Edge.GetSurface2
•   pfcGeometry.Edge.GetEdge1
•   pfcGeometry.Edge.GetEdge2
•   pfcGeometry.Edge.EvalUV
•   pfcGeometry.Edge.GetDirection
                      Note: The methods in the interface Edge provide information
                            only for solid or surface edges.
                 The methods pfcGeometry.Edge.GetSurface1 and
                 pfcGeometry.Edge.GetSurface2 return the surfaces bounded by
                 this edge. The methods pfcGeometry.Edge.GetEdge1 and
                 pfcGeometry.Edge.GetEdge2 return the next edges in the two
                 contours that contain this edge.
Curve Descriptors
                 A curve descriptor is a data object that describes the geometry of a
                 curve or edge. A curve descriptor describes the geometry of a curve
                 without being a part of a specific model.
Methods Introduced:
•   pfcGeometry.GeomCurve.GetCurveDescriptor
•   pfcGeometry.GeomCurve.GetNURBSRepresentation
                      Note: To get geometric information for an edge, access the
                            CurveDescriptor object for one edge using
                            pfcGeometry.GeomCurve.GetCurveDescriptor.
                 The method pfcGeometry.GeomCurve.GetCurveDescriptor
                 returns a curve’s geometry as a data object.
Contours
                                                                                         Geometry Evaluation
Methods Introduced:
•   pfcGeometry.Surface.ListContours
•   pfcGeometry.Contour.GetInternalTraversal
•   pfcGeometry.Contour.FindContainingContour
•   pfcGeometry.Contour.EvalArea
•   pfcGeometry.Contour.EvalOutline
•   pfcGeometry.Contour.VerifyUV
                 Contours are a series of edges that completely bound a surface. A
                 contour is not a ModelItem. You cannot get contours using the
                 methods that get different types of ModelItem. Use the method
                 pfcGeometry.Surface.ListContours to get contours from their
                 containing surfaces.
Geometry Evaluation                                                             16 - 7
Surfaces
                       Using J-Link you access datum and solid surfaces in the same way.
UV Parameterization
                       A surface in Pro/ENGINEER is described as a series of parametric
                       equations where two parameters, u and v, determine the x, y, and z
                       coordinates. Unlike the edge parameter, t, these parameters need
                       not start at 0.0, nor are they limited to 1.0.
normal
e2 (second derivative)
u direction
e1 (first derivative)
v direction
S[x, y, z] = f (u, v)
                                                                                            Geometry Evaluation
                      pfcGeometry.Cylinder.
                 •    CONE—A conic surface region represented by the class
                      pfcGeometry.Cone.
                 •    TORUS—A toroidal surface region represented by the class
                      pfcGeometry.Torus.
                 •    REVOLVED SURFACE—Generated by revolving a curve
                      about an axis. This is represented by the class
                      pfcGeometry.RevSurface.
                 •    RULED SURFACE—Generated by interpolating linearly
                      between two curve entities. This is represented by the class
                      pfcGeometry.RuledSurface.
                 •    TABULATED CYLINDER—Generated by extruding a curve
                      linearly. This is represented by the class
                      pfcGeometry.TabulatedCylinder.
                 •    QUILT—A combination of two or more surfaces. This is
                      represented by the class pfcGeometry.Quilt.
                      Note: This is used only for datum surfaces.
                 •    COONS PATCH—A coons patch is used to blend surfaces
                      together. It is represented by the class
                      pfcGeometry.CoonsPatch
                 •    FILLET SURFACE—A filleted surface is found where a round
                      or fillet is placed on a curved edge or an edge with a
                      non-consistant arc radii. On a straight edge a cylinder is used to
                      represent a fillet. This is represented by the class
                      pfcGeometry.FilletedSurface.
                 •    SPLINE SURFACE— A nonuniform bicubic spline surface
                      that passes through a grid with tangent vectors given at each
                      point. This is represented by the class
                      pfcGeometry.SplineSurface.
                 •    NURBS SURFACE—A NURBS surface is defined by basic
                      functions (in u and v), expandable arrays of knots, weights, and
                      control points. This is represented by the class
                      pfcGeometry.NURBSSurface.
Geometry Evaluation                                                                16 - 9
                 •    CYLINDRICAL SPLINE SURFACE— A cylindrical spline
                      surface is a nonuniform bicubic spline surface that passes
                      through a grid with tangent vectors given at each point. This is
                      represented by the class
                      pfcGeometry.CylindricalSplineSurface.
                 To determine which type of surface a pfcGeometry.Surface
                 object represents, access the surface type using
                 pfcGeometry.Geometry.GetSurfaceType .
Surface Information
Methods Introduced:
•   pfcGeometry.Surface.GetSurfaceType
•   pfcGeometry.Surface.GetXYZExtents
•   pfcGeometry.Surface.GetUVExtents
•   pfcGeometry.Surface.GetOrientation
Evaluation of Surfaces
                 Surface methods allow you to use multiple surface information to
                 calculate, evaluate, determine, and examine surface functions and
                 problems.
Methods Introduced:
•   pfcGeometry.Surface.GetOwnerQuilt
•   pfcGeometry.Surface.EvalClosestPoint
•   pfcGeometry.Surface.EvalClosestPointOnSurface
•   pfcGeometry.Surface.Eval3DData
•   pfcGeometry.Surface.EvalParameters
•   pfcGeometry.Surface.EvalArea
•   pfcGeometry.Surface.EvalDiameter
•   pfcGeometry.Surface.EvalPrincipalCurv
•   pfcGeometry.Surface.VerifyUV
•   pfcGeometry.Surface.EvalMaximum
•   pfcGeometry.Surface.EvalMinimum
•   pfcGeometry.Surface.ListSameSurfaces
                 The method pfcGeometry.Surface.GetOwnerQuilt returns the
                 Quilt object that contains the datum surface.
                                                                                           Geometry Evaluation
                 The method pfcGeometry.Surface.Eval3DData returns a
                 ISurfXYZData object that contains information about the surface
                 at the specified u and v parameters. The method
                 pfcGeometry.Surface.EvalParameters returns the u and v
                 parameters that correspond to the specified three-dimensional
                 point.
Geometry Evaluation                                                              16 - 11
Surface Descriptors
                 A surface descriptor is a data object that describes the shape and
                 geometry of a specified surface. A surface descriptor allows you to
                 describe a surface in 3D without an owner ID.
Methods Introduced:
•   pfcGeometry.Surface.GetSurfaceDescriptor
•   pfcGeometry.Surface.GetNURBSRepresentation
                 The method pfcGeometry.Surface.GetSurfaceDescriptor
                 returns a surfaces geometry as a data object.
Evaluation of ModelItems
Methods Introduced:
•   pfcGeometry.Axis.GetSurf
•   pfcGeometry.CoordSystem.GetCoordSys
•   pfcGeometry.Point.GetPoint
                 The method pfcGeometry.Axis.GetSurf returns the revolved
                 surface that uses the axis.
                                                                                          Geometry Evaluation
                 standpoints: global and selection based analysis.
Methods Introduced:
•   pfcInterference.pfcInterference.CreateGlobalEvaluator
•   pfcInterference.GlobalEvaluator.ComputeGlobalInterference
•   pfcInterference.GlobalEvaluator.GetAssem
•   pfcInterference.GlobalEvaluator.SetAssem
•   pfcInterference.GlobalInterference.GetVolume
•   pfcInterference.GlobalInterference.GetSelParts
                 To compute all the interferences within an Assembly one has to call
                 pfcInterference.pfcInterference.CreateGlobalEvaluator
                 with a Assembly.Assembly object as an argument. This call
                 returns a GlobalEvaluator object. The GlobalEvaluator can
                 be used to extract an assembly object or to set an assembly object
                 for the interference computation.
                 The method
                 pfcInterference.GlobalEvaluator.ComputeGlobalInterferen
                 ce determines the set of all the interferences within the assembly.
Geometry Evaluation                                                             16 - 13
Analyzing Interference Information
Methods Introduced:
•   pfcSelect.pfcSelect.SelectionPair_Create
•   pfcInterference.pfcInterference.CreateSelectionEvaluator
•   pfcInterference.SelectionEvaluator.GetSelections
•   pfcInterference.SelectionEvaluator.SetSelections
•   pfcInterference.SelectionEvaluator.ComputeInterference
•   pfcInterference.SelectionEvaluator.ComputeClearance
•   pfcInterference.SelectionEvaluator.ComputeNearestCriticalDistance
                 The method pfcSelect.pfcSelect.SelectionPair_Create creates
                 a pfcSelect.SelectionPair object using two
                 pfcSelect.Selection objects as arguments.
                 pfcInterference.SelectionEvaluator.GetSelections and
                 pfcInterference.SelectionEvaluator.SetSelections will extract
                 and set the object to be evaluated respectively.
                 pfcInterference.SelectionEvaluator.ComputeInterference
                 determines the interfering information about the provided
                 selections. This method will return the
                 pfcInterference.InterferenceVolume object or null if the
                 selections do no interfere.
                 pfcInterference.SelectionEvaluator.ComputeClearance
                 computes the clearance data for the two selection. This method
                 returns a pfcInterference.ClearanceData object, which can
                 be used to obtain and set clearance distance, nearest points
                 between selections, and a boolean IsInterferening variable.
                 pfcInterference.SelectionEvaluator.ComputeNearestCritica
                 lDistance finds a critical point of the distance function between
                 two selections.
•   pfcInterference.InterferenceVolume.ComputeVolume
•   pfcInterference.InterferenceVolume.Highlight
•   pfcInterference.InterferenceVolume.GetBoundaries
                                                                                          Geometry Evaluation
                 The method
                 pfcInterference.InterferenceVolume.ComputeVolume will
                 calculate a value for interfering volume.
                 The method
                 pfcInterference.InterferenceVolume.GetBoundaries will
                 return a set of boundary surface descriptors for the interference
                 volume.
Example Code
       try {
        BaseSession session = null; //The Pro/ENGINEER Session Object
        Assembly inter_assem = null; //The Assembly with interferences.
        GlobalEvaluator gbl_eval; //The GlobalEvaluator Object
        GlobalInterferences gbl_inters;//A List of Interferences in the
                                         Model
        GlobalInterference gbl_inter;//an pfcInterference object
        SelectionPair select_pair;//A pfcSelectionPair Object.
        Selection sel1, sel2;//Two Selection object
Geometry Evaluation                                                             16 - 15
          InterferenceVolume vol;//The interference volume object.
          double total_volume;//The interference volume for a particular
                                interference
          gbl_eval = pfcInterference.CreateGlobalEvaluator(assembly);
         //Setting this parameter to TRUE will select only the solid geometry
          //Setting it to false will through an exception.
          gbl_inters = gbl_eval.ComputeGlobalInterference(true);
          if (gbl_inters == null)
     System.out.println("No Interferences detected in " +
     assembly.GetFullName());
          else
             {
       //Find out how many interferences exist in an assembly
       int size = gbl_inters.getarraysize();
       //Then for each interference object display the interfering surfaces
       //and compute the interference volume
       System.out.println("The Total Interference Volume: ");
       for (int i = 0; i < size; i++)
       {
           gbl_inter = gbl_inters.get(i);
          select_pair = gbl_inter.GetSelParts();
          sel1 = select_pair.GetSel1();
          sel2 = select_pair.GetSel2();
          sel1.Highlight(StdColor.COLOR_HIGHLIGHT);
          sel2.Highlight(StdColor.COLOR_HIGHLIGHT);
          vol = gbl_inter.GetVolume();
          total_volume = vol.ComputeVolume();
          System.out.println("Interference " + i + " = " + total_volume);
          vol.Highlight(StdColor.COLOR_ERROR);
      }
            }
         }
     catch (jxthrowable x)
         {
    System.out.println("Caught Exception: " + x);
    x.printStackTrace();
         }
         return;
     }
}
    This chapter describes the J-Link methods and classes that affect
    dimensions and parameters.
Topic Page
    Overview                                                     17 - 2
    The ParamValue Object                                        17 - 2
    Parameter Objects                                            17 - 3
    Dimension Objects                                           17 - 13
                                                                  17 - 1
Overview
                 Dimensions and parameters in Pro/ENGINEER have similar
                 characteristics but also have significant differences. In J-Link, the
                 similarities between dimensions and parameters are contained in
                 the pfcModelItem.BaseParameter interface. This interface
                 allows access to the parameter or dimension value and to
                 information regarding a parameter's designation and modification.
                 The differences between parameters and dimensions are
                 recognizable because Dimension inherits from the interface
                 ModelItem, and can be assigned tolerances, whereas parameters
                 are not ModelItems and cannot have tolerances.
•   pfcModelItem.pfcModelItem.CreateIntParamValue
•   pfcModelItem.pfcModelItem.CreateDoubleParamValue
•   pfcModelItem.pfcModelItem.CreateStringParamValue
•   pfcModelItem.pfcModelItem.CreateBoolParamValue
•   pfcModelItem.pfcModelItem.CreateNoteParamValue
•   pfcModelItem.BaseParameter.GetValue
                 The pfcModelItem utility class contains methods for creating each
                 type of ParamValue object. Once you have established the value
                 type in the object, you can change it. The method
                 pfcModelItem.BaseParameter.GetValue returns the
                 ParamValue associated with a particular parameter or dimension.
• pfcModelItem.ParamValue.Getdiscr
                                                                                           Dimensions and
                                                                                             Parameters
•   pfcModelItem.ParamValue.GetIntValue
•   pfcModelItem.ParamValue.SetIntValue
•   pfcModelItem.ParamValue.GetDoubleValue
•   pfcModelItem.ParamValue.SetDoubleValue
•   pfcModelItem.ParamValue.GetStringValue
•   pfcModelItem.ParamValue.SetStringValue
•   pfcModelItem.ParamValue.GetBoolValue
•   pfcModelItem.ParamValue.SetBoolValue
•   pfcModelItem.ParamValue.GetNoteId
                 The method pfcModelItem.ParamValue.Getdiscr returns a
                 enumeration object that identifies the type of value contained in the
                 ParamValue object. Use this information with the Get and Set
                 methods to access the value. If you use an incorrect Get or Set
                 method an exception of type
                 pfcExceptions.XBadGetParamValue will be thrown.
Parameter Objects
                 The following sections describe the J-Link methods that access
                 parameters. The topics are as follows:
•   pfcModelItem.ParameterOwner.CreateParam
•   pfcModelItem.ParameterOwner.CreateParamWithUnits
•   pfcModelItem.ParameterOwner.GetParam
•   pfcModelItem.ParameterOwner.ListParams
•   pfcModelItem.ParameterOwner.SelectParam
•   pfcModelItem.ParameterOwner.SelectParameters
•   pfcFamily.FamColParam.GetRefParam
                 In J-Link, models, features, surfaces, and edges inherit from the
                 pfcModelItem.ParameterOwner interface, because each of the
                 objects can be assigned parameters in Pro/ENGINEER.
                 The method
                 pfcModelItem.ParameterOwner.SelectParameters allows you
                 to interactively select parameters from the Pro/ENGINEER
                 Parameter dialog box based on the parameter selection options
                 specified by the pfcModelItem.ParameterSelectionOptions
                 object. The top model from which the parameters are selected must
                 be displayed in the current window. Refer to the section Parameter
                 Selection Options for more information.
Methods Introduced:
•   pfcModelItem.pfcModelItem.ParameterSelectionOptions_Create
•   pfcModelItem.ParameterSelectionOptions.SetAllowContextSelection
                                                                                            Dimensions and
                                                                                              Parameters
•   pfcModelItem.ParameterSelectionOptions.SetContexts
•   pfcModelItem.ParameterSelectionOptions.SetAllowMultipleSelections
•   pfcModelItem.ParameterSelectionOptions.SetSelectButtonLabel
                 The method
                 pfcModelItem.pfcModelItem.ParameterSelectionOptions_
                 Create creates a new instance of the
                 ParameterSelectionOptions object that is used by the method
                 pfcModelItem.ParameterOwner.SelectParameters().
•   pfcModelItem.BaseParameter.GetValue
•   pfcModelItem.BaseParameter.SetValue
•   pfcModelItem.Parameter.GetScaledValue
                                                                                      Dimensions and
•   pfcModelItem.Parameter.SetScaledValue
                                                                                        Parameters
•   pfcModelItem.Parameter.GetUnits
•   pfcModelItem.BaseParameter.GetIsDesignated
•   pfcModelItem.BaseParameter.SetIsDesignated
•   pfcModelItem.BaseParameter.GetIsModified
•   pfcModelItem.BaseParameter.ResetFromBackup
•   pfcModelItem.Parameter.GetDescription
•   pfcModelItem.Parameter.SetDescription
•   pfcModelItem.Parameter.GetRestriction
•   pfcModelItem.Parameter.GetDriverType
•   pfcModelItem.Parameter.Reorder
•   pfcModelItem.Parameter.Delete
•   pfcModelItem.NamedModelItem.GetName
                 Parameters inherit methods from the BaseParameter,
                 Parameter, and NamedModelItem interfaces.
                                                                                       Dimensions and
                                                                                         Parameters
Method Introduced:
•   pfcModelItem.ParameterRestriction.GetType
                 The method pfcModelItem.ParameterRestriction.GetType
                 returns the pfcModelItem.RestrictionType object containing the
                 types of parameter restrictions. The parameter restrictions are of
                 the following types:
Enumeration Restriction
                 The PARAMSELECT_ENUMERATION type of parameter
                 restriction is represented by the interface
                 pfcModelItem.ParameterEnumeration. It is a child of the
                 pfcModelItem.ParameterRestriction interface.
Method Introduced:
•   pfcModelItem.ParameterEnumeration.GetPermittedValues
                 The method
                 pfcModelItem.ParameterEnumeration.GetPermittedValues
                 returns a list of permitted parameter values allowed by this
                 restriction in the form of a sequence of the
                 pfcModelItem.ParamValue objects.
Range Restriction
                 The PARAMSELECT_RANGE type of parameter restriction is
                 represented by the interface pfcModelItem.ParameterRange. It
                 is a child of the pfcModelItem.ParameterRestriction interface.
•   pfcModelItem.ParameterRange.GetMaximum
•   pfcModelItem.ParameterRange.GetMinimum
•   pfcModelItem.ParameterLimit.GetType
•   pfcModelItem.ParameterLimit.GetValue
                 The method pfcModelItem.ParameterRange.GetMaximum
                 returns the maximum value limit for the parameter in the form of
                 the pfcModelItem.ParameterLimit object.
                                                                                  Dimensions and
                                                                                    Parameters
                //** createParametersFromProperties () demonstrates how
                Java can read in *system-dependent stored information
                using a "properties" file. Note that the *ParameterOwner
                argument could refer to a model, a feature, a surface, or
                an *edge.**/
    public static void createParametersFromProperties
     (ParameterOwner p_owner) throws com.ptc.cipjava.jxthrowable {
       String prop_value;
       String propsfile = "params.properties";
       ParamValue pv;
    Parameter p;
    try {
       props.load (new BufferedInputStream( new FileInputStream
(propsfile)));
       }
    catch (IOException e)
    {
          System.out.println ("File: "+propsfile+ "cannot be opened.");
          System.out.println ("Cannot load parameters.");
          return;
    }
      Enumeration e = props.propertyNames (); /* Enumeration allows you to
     loop through all properties without determining
     how many there are*/
        ffor (String prop_name = (String)e.nextElement();
        e.hasMoreElements();
        prop_name = (String)e.nextElement())
        {
          prop_value = props.getProperty(prop_name);
            pv = pfcuParamValue.createParamValueFromString(prop_value);
          p = p_owner.GetParam(prop_name);
         if (p == null) // GetParam returns null if it can't find the param.
            {
            p_owner.CreateParam (prop_name, pv);
            }
          else
            {
              p.SetValue (pv);
package com.ptc.pfcu;
import com.ptc.pfc.pfcModelItem.ParamValue;
import com.ptc.pfc.pfcModelItem.pfcModelItem;
/**
       * Parses a string into a ParamValue object. Useful for reading
       * ParamValues from file or from UI TextComponent entry. This method
       * checks if the value is a proper integer, double, or boolean, and if
         * so, returns a value of that type. If the value is not a number or
      boolean,
         * the method returns a String ParamValue;
         */
      public static ParamValue createParamValueFromString(String s)
                                         throws com.ptc.cipjava.jxthrowable
      {
      try {
        int i = Integer.valueOf (s).intValue();
        return pfcModelItem.CreateIntParamValue(i);
        }
    catch (NumberFormatException e)
    {
        //string is not an int, try double
    try
    {
        double d = Double.valueOf (s).doubleValue();
        return pfcModelItem.CreateDoubleParamValue(d);
    }
    catch (NumberFormatException e2)
    {
        //string is not int/double, check if Boolean
        if (s.equalsIgnoreCase("Y") ||
            s.equalsIgnoreCase ("true"))
        {
            return pfcModelItem.CreateBoolParamValue (true);
        }
        else if (s.equalsIgnoreCase("N") ||
            s.equalsIgnoreCase ("false"))
        {
            return pfcModelItem.CreateBoolParamValue (false);
        }
        else
        {
            return pfcModelItem.CreateStringParamValue(s);
Dimension Objects
                                                                                            Dimensions and
                                                                                              Parameters
                     Dimension objects include standard Pro/ENGINEER dimensions as
                     well as reference dimensions. Dimension objects enable you to
                     access dimension tolerances and enable you to set the value for the
                     dimension. Reference dimensions allow neither of these actions.
Getting Dimensions
                     Dimensions and reference dimensions are Pro/ENGINEER model
                     items. See the section “Getting ModelItem Objects” for methods
                     that can return Dimension and RefDimension objects.
Dimension Information
Methods Introduced:
•        pfcModelItem.BaseParameter.GetValue
•        pfcModelItem.BaseParameter.SetValue
•        pfcModelItem.BaseDimension.GetDimValue
•        pfcModelItem.BaseDimension.SetDimValue
•        pfcModelItem.BaseParameter.GetIsDesignated
•        pfcModelItem.BaseParameter.SetIsDesignated
•        pfcModelItem.BaseParameter.GetIsModified
•        pfcModelItem.BaseParameter.ResetFromBackup
•        pfcModelItem.BaseParameter.GetIsRelationDriven
•        pfcDimension.BaseDimension.GetDimType
•        pfcDimension.BaseDimension.GetSymbol
•        pfcDimension.BaseDimension.GetTexts
•        pfcDimension.BaseDimension.SetTexts
                     All the BaseParameter methods are accessible to Dimensions as
                     well as Parameters. See the section “Parameter Objects” for brief
                     descriptions.
                 The pfcModelItem.BaseParameter.GetIsRelationDriven
                 method identifies whether the part or assembly relations control a
                 dimension.
Dimension Tolerances
Methods Introduced:
•   pfcDimension.Dimension.GetTolerance
•   pfcDimension.Dimension.SetTolerance
•   pfcDimension.pfcDimension.DimTolPlusMinus_Create
•   pfcDimension.pfcDimension.DimTolSymmetric_Create
•   pfcDimension.pfcDimension.DimTolLimits_Create
•   pfcDimension.pfcDimension.DimTolSymSuperscript_Create
•   pfcDimension.pfcDimension.DimTolISODIN_Create
                 Only true dimension objects can have geometric tolerances.
                                                                                          Dimensions and
                 •   DimTolSymSuperscript—Displays dimensions as nominal
                                                                                            Parameters
                     with a single value for positive and negative tolerance. The text
                     of the tolerance is displayed in a superscript format with
                     respect to the dimension text.
                 •   DimTolISODIN—Displays the tolerance table type, table
                     column, and table name, if the dimension tolerance is set to a
                     hole or shaft table (DIN/ISO standard).
                 A null value is similar to the nominal option in Pro/ENGINEER.
DimTolLimits limits;
        try {
            dtype = dimension.GetDimType();    // from interface BaseDimension
            if (dtype.equals (DimensionType.DIM_ANGULAR))
            {
                pvalue = dimension.GetValue(); //from interface BaseParameter
                dvalue = pvalue.GetDoubleValue();
Topic Page
Accessing Relations                                           18 - 2
Adding a Customized Function to the Relations Dialog Box in
Pro/ENGINEER                                                  18 - 4
                                                              18 - 1
Accessing Relations
                 In J-Link, the set of relations on any model or model item is
                 represented by the pfcModelItem.RelationOwner interface.
                 Models, features, surfaces, and edges inherit from this interface,
                 because each object can be assigned relations in Pro/ENGINEER.
Methods Introduced:
•   pfcModelItem.RelationOwner.RegenerateRelations
•   pfcModelItem.RelationOwner.DeleteRelations
•   pfcModelItem.RelationOwner.GetRelations
•   pfcModelItem.RelationOwner.SetRelations
•   pfcModelItem.RelationOwner.EvaluateExpression
                 The method
                 pfcModelItem.RelationOwner.RegenerateRelations
                 regenerates the relations assigned to the owner item. It also
                 determines whether the specified relation set is valid.
                 The method
                 pfcModelItem.RelationOwner.EvaluateExpression evaluates
                 the given relations-based expression, and returns the resulting
                 value in the form of the pfcModelItem.ParamValue object. Refer
                 to the section, The ParamValue Object in the chapter, Dimensions
                 and Parameters for more information on this object.
try
                                                                                     Relations
    {
      for(i=0;i<features.getarraysize();i++)
      {
/*=====================================================================*\
  Get the selected feature
\*=====================================================================*/
        feature = features.get(i);
        if (feature == null)
        {
          continue;
        }
/*=====================================================================*\
  Get the dimensions in the current feature
\*=====================================================================*/
        items = feature.ListSubItems(ModelItemType.ITEM_DIMENSION);
        if ((items == null) || (items.getarraysize() == 0))
        {
         continue;
        }
relations = stringseq.create();
/*=====================================================================*\
  Loop through all the dimensions and create relations
\*=====================================================================*/
        for(j=0;j<items.getarraysize(); j++)
        {
         item = items.get(j);
         dimName = item.GetName();
         paramName = "PARAM_" + dimName;
         dimValue = ((Dimension)item).GetDimValue();
             param = feature.GetParam(paramName);
             paramAdded = Boolean.FALSE;
             if (param == null)
             {
              paramValue = pfcModelItem.CreateDoubleParamValue(dimValue);
              feature.CreateParam (paramName, paramValue);
              paramAdded = Boolean.TRUE;
Relations                                                                   18 - 3
             }
             else
             {
              if (param.GetValue().Getdiscr() == ParamValueType.PARAM_DOUBLE)
              {
               paramValue = pfcModelItem.CreateDoubleParamValue(dimValue);
               param.SetValue(paramValue);
               paramAdded = Boolean.TRUE;
             }
            }
            if (paramAdded == Boolean.TRUE)
            {
             relations.append(dimName + " = " + paramName);
            }
            param = null ;
          }
          feature.SetRelations(relations);
        }
        catch(jxthrowable x)
        {
          System.out.println("Exception in createParamDimRelation(): "+x);
          return;
        }
    }
}
•       pfcSession.BaseSession.RegisterRelationFunction
                    The method
                    pfcSession.BaseSession.RegisterRelationFunction registers a
                    custom function that is included in the function list of the Relations
                    dialog box in Pro/ENGINEER. You can add the custom function to
                    relations that are added to models, features, or other relation
                    owners. The registration method takes the following input
                    arguments:
                                                                                          Relations
                            marked as errors. However, these errors can be
                            commented until needed at a later time when the
                            relations functions are reactivated in a
                            Pro/ENGINEEER session.
•   pfcRelations.pfcRelations.RelationFunctionOptions_Create
•   pfcRelations.RelationFunctionOptions.SetArgumentTypes
•   pfcRelations.pfcRelations.RelationFunctionArgument_Create
•   pfcRelations.RelationFunctionArgument.SetType
•   pfcRelations.RelationFunctionArgument.SetIsOptional
•   pfcRelations.RelationFunctionOptions.SetEnableTypeChecking
•   pfcRelations.RelationFunctionOptions.SetEnableArgumentCheckMethod
•   pfcRelations.RelationFunctionOptions.SetEnableExpressionEvaluationMethod
•   pfcRelations.RelationFunctionOptions.SetEnableValueAssignmentMethod
                 Use the method
                 pfcRelations.pfcRelations.RelationFunctionOptions_Create
                 to create the pfcRelations.RelationFunctionOptions object
                 containing the options to enable or disable various relation function
                 related features. Use the methods listed above to access and modify
                 the options. These options are as follows:
Relations                                                                        18 - 5
                      Use the method
                      pfcRelations.pfcRelations.RelationFunctionArgument_C
                      reate to create the
                      pfcRelations.RelationFunctionArgument object containing
                      the attributes of the arguments passed to the custom relation
                      function. These attributes are as follows:
                      –   Type—The type of argument value such as double, integer,
                          and so on in the form of the
                          pfcModelItem.ParamValueType object.
                      –   IsOptional—This boolean attribute specifies whether the
                          argument is optional, indicating that it can be skipped
                          when a call to the custom relation function is made. The
                          optional arguments must fall at the end of the argument
                          list. By default, this attribute is false.
                 •    EnableTypeChecking—This boolean attribute determines
                      whether or not to check the argument types internally. By
                      default, it is false. If this attribute is set to false,
                      Pro/ENGINEER does not need to know the contents of the
                      arguments array. The custom function must handle all user
                      errors in such a situation.
                 •    EnableArgumentCheckMethod—This boolean attribute
                      determines whether or not to enable the arguments check
                      listener function. By default, it is false.
                 •    EnableExpressionEvaluationMethod—This boolean attribute
                      determines whether or not to enable the evaluate listener
                      function. By default, it is true.
                 •    EnableValueAssignmentMethod—This boolean attribute
                      determines whether or not to enable the value assignment
                      listener function. By default, it is false.
Methods Introduced:
•   pfcRelations.RelationFunctionListener.CheckArguments
•   pfcRelations.RelationFunctionListener.AssignValue
•   pfcRelations.RelationFunctionListener.EvaluateFunction
                                                                                       Relations
            arguments are not valid for the custom function, then the listener
            method returns false. Otherwise, it returns true.
            The method
            pfcRelations.RelationFunctionListener.EvaluateFunction
            evaluates a custom relation function invoked on the right hand side
            of a relation. This listener method takes the following input
            arguments:
            The method
            pfcRelations.RelationFunctionListener.AssignValue
            evaluates a custom relation function invoked on the left hand side
            of a relation. It allows you to initialize properties to be stored and
            used by your application. This listener method takes the following
            input arguments:
Relations                                                                     18 - 7
Example 2: Adding and Implementing a New Custom Relation
Function
                 This example code consists two classes such as
                 pfcRelationExamples and RelationListener. The
                 pfcRelationExamples class contains methods that define the
                 options for the custom relation function and register it in the
                 current session. The RelationListener class contains the
                 AssignValue and EvaluateFunction listener methods that are
                 called when the custom function is used.
package com.ptc.jlinkexamples;
import   com.ptc.pfc.pfcGlobal.pfcGlobal;
import   com.ptc.cipjava.*;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcSelect.*;
import   com.ptc.pfc.pfcCommand.*;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcDimension.*;
import   com.ptc.pfc.pfcExceptions.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcFeature.*;
import   com.ptc.pfc.pfcRelations.*;
/*=====================================================================*\
FUNCTION: addCustomRelation
PURPOSE: This function adds new custom relation functions.
\*=====================================================================*/
  public static void addCustomRelation(Session session)
  {
  RelationListener listenerObj;
  RelationFunctionOptions setOptions , getOptions;
  RelationFunctionArgument arg;
  RelationFunctionArguments args;
  try
  {
    listenerObj = new RelationListener();
/*---------------------------------------------------------------------*\
  Create options for custom functions and register them in current session
\*---------------------------------------------------------------------*/
    setOptions = pfcRelations.RelationFunctionOptions_Create ();
    setOptions.SetEnableArgumentCheckMethod(Boolean.FALSE);
                                                                                Relations
      getOptions.SetArgumentTypes(args);
      getOptions.SetEnableExpressionEvaluationMethod(Boolean.TRUE);
      getOptions.SetEnableTypeChecking (Boolean.FALSE);
      getOptions.SetEnableValueAssignmentMethod (Boolean.FALSE);
      session.RegisterRelationFunction("EVAL_AX_B", listenerObj,
                                        getOptions);
  }
  catch (Throwable e)
  {
/*=====================================================================*\
CLASS:   RelationListener
PURPOSE: This class implemented method will be called when the custom
         relation function is used
\*=====================================================================*/
class RelationListener extends DefaultRelationFunctionListener
{
  double aValue = 1;
  double bValue = 0;
/*=====================================================================*\
FUNCTION: AssignValue
PURPOSE: Function called when value is assigned to custom relation
          function
\*=====================================================================*/
Relations                                                              18 - 9
        }
        if (FunctionName.equals("SET_A") )
        {
          aValue = Assignment.GetDoubleValue();
        }
        if (FunctionName.equals("SET_B"))
        {
          bValue = Assignment.GetDoubleValue();
        }
    }
/*=====================================================================*\
FUNCTION: EvaluateFunction
PURPOSE: Function called when value is to be returned from custom
         relation function.
\*=====================================================================*/
  public ParamValue EvaluateFunction (RelationOwner Owner, String
                                     FunctionName, ParamValues Arguments)
                                       throws com.ptc.cipjava.jxthrowable
  {
    ParamValue paramValue = null;
    double ret;
        if (FunctionName.equals("EVAL_AX_B"))
        {
          ret = (aValue * (Arguments.get(0).GetDoubleValue())) + bValue;
          paramValue = pfcModelItem.CreateDoubleParamValue(ret);
        }
        return paramValue;
    }
}
Topic Page
                                                               19 - 1
Structure of Assemblies and Assembly
Objects
         The object Assembly is an instance of Solid. The Assembly object
         can therefore be used as input to any of the Solid and Model
         methods applicable to assemblies. However assemblies do not
         contain solid geometry items. The only geometry in the assembly is
         datums (points, planes, axes, coordinate systems, curves, and
         surfaces). Therefore solid assembly features such as holes and slots
         will not contain active surfaces or edges in the assembly model.
         Assembly features that are solid, such as holes and slots, and
         therefore affect the solid geometry of parts in the assembly
         hierarchy, do not themselves contain the geometry items that
         describe those modifications. These items are always contained in
         the parts whose geometry is modified, within local features created
         for that purpose.
                                                    2       7       3       11
                                                                                         C
      Level 1
                                                                                                                                            Assemblies and
                                 4                                                                       6
                                                                                                                                             Components
                                                    2                   8
                                                                                                 2
                                                                                     9
      Level 2
                        2        3                          2                    2                   4       7                 2
                                                5
                                                                                             3                           12
      Level 3
                                                                                                                              AB
                                     2
                                            5                       3            2           4           3       2             3
                            AB                          6
      Level 4
                    2            3                                                                               A            B’’
                                                            3               9
      Level 5                                                           4
                A                    B’
                                         = assembly or subassembly
= part
                        ComponentIds.get(0)                     =   2       ComponentIds.get(1)                      =   11
                        ComponentIds.get(1)                     =   2       ComponentIds.get(2)                      =   6
                        ComponentIds.get(2)                     =   5       ComponentIds.get(3)                      =   12
                        ComponentIds.get(3)                     =   2       ComponentIds.get(4)                      =   3
                        ComponentIds.get(4)                     =   3
•   pfcComponentFeat.ComponentFeat.GetIsBulkitem
•   pfcComponentFeat.ComponentFeat.GetIsSubstitute
•   pfcComponentFeat.ComponentFeat.GetCompType
•   pfcComponentFeat.ComponentFeat.SetCompType
•   pfcComponentFeat.ComponentFeat.GetModelDescr
•   pfcComponentFeat.ComponentFeat.GetIsPlaced
•   pfcComponentFeat.ComponentFeat.SetIsPlaced
•   pfcComponentFeat.ComponentFeat.GetIsPackaged
•   pfcComponentFeat.ComponentFeat.GetIsUnderconstrained
•   pfcComponentFeat.ComponentFeat.GetIsFrozen
•   pfcComponentFeat.ComponentFeat.GetPosition
•   pfcComponentFeat.ComponentFeat.CopyTemplateContents
•   pfcComponentFeat.ComponentFeat.CreateReplaceOp
                 The method
                 pfcComponentFeat.ComponentFeat.GetIsBulkitem identifies
                 whether an assembly component is a bulk item. A bulk item is a
                 non-geometric assembly feature that should appear in an assembly
                 bill of materials.
                 The method
                 pfcComponentFeat.ComponentFeat.GetIsSubstitute returns
                 a true value if the component is substituted, else it returns a false.
                 When you substitute a component in a simplified representation,
                 you temporarily exclude the substituted component and
                 superimpose the substituting component in its place.
                 The method
                 pfcComponentFeat.ComponentFeat.GetCompType returns
                 the type of the assembly component.
                 The method
                 pfcComponentFeat.ComponentFeat.SetCompType enables
                 you to set the type of the assembly component. The component type
                 identifies the purpose of the component in a manufacturing
                 assembly.
                                                                                       Assemblies and
                           assembly component whose immediate generic is not in
                                                                                        Components
                           session. Handle this exception and typecast the
                           assembly component as pfcSolid.Solid, which in
                           turn can be typecast as pfcFamily.FamilyMember,
                           and use the method
                           pfcFamily.FamilyMember.GetImmediateGenericI
                           nfo to get the model descriptor of the immediate generic
                           model. If you wish to switch off this behavior and
                           continue to run legacy applications in the pre-Wildfire
                           4.0 mode, set the configuration option
                           retrieve_instance_dependencies to
                           "instance_and_generic_deps".
                 The method
                 pfcCompontentFeat.ComponentFeat.GetIsPlaced determines
                 whether the component is placed.
                 The method
                 pfcCompontentFeat.ComponentFeat.GetIsUnderconstraine
                 d determines if the specified component is underconstrained, that
                 is, it possesses some constraints but is not fully constrained.
                 The method
                 pfcCompontentFeat.ComponentFeat.GetIsFrozen determines
                 if the specified component is frozen. The frozen component behaves
                 similar to the packaged component and does not follow the
                 constraints that you specify.
                   The method
                   pfcComponentFeat.ComponentFeat.CopyTemplateContents
                   copies the template model into the model of the specified
                   component.
                   The method
                   pfcCompontentFeat.ComponentFeat.CreateReplaceOp
                   creates a replacement operation used to swap a component
                   automatically with a related component. The replacement
                   operation can be used as an argument to
                   pfcSolid.Solid.ExecuteFeatureOps.
         /**
          * replaceBolts automatically replaces all occurrences of the
          * bolt "phillips7_8" with a new instance "slot7_8". It uses
          * the methods available in the ComponentFeat class, including
          * CreateModelReplace (), which creates a replacement operation
          * for a component, and GetModelDescr (), which returns the model
          * descr corresponding to a particular component feature.
                                                                              Assemblies and
          Solid newBolt;             // The new bolt instance
                                                                               Components
          Features components;       //List of components in the assembly
          ComponentFeat component;
          ModelDescriptor desc;      // Component model descriptor
          CompModelReplace replace;
          FeatureOperations replaceOps;
          String oldInstance = "PHILLIPS7_8";
          String newInstance = "SLOT7_8";
          try {
               session = pfcGlobal.GetProESession();
              bolt = (Solid)session.GetModel ("BOLT", ModelType.MDL_PART);
          }
          catch (jxthrowable x)
          {
               System.out.println ("Caught exception: "+x);
               x.printStackTrace();
               return;
          }
          try {
               row = bolt.GetRow (newInstance);
               newBolt = (Solid)row.CreateInstance();
               replaceOps = FeatureOperations.create();
               components = assembly.ListFeaturesByType (Boolean.FALSE,
                                         FeatureType.FEATTYPE_COMPONENT);
               for (int ii = 0; ii < components.getarraysize(); ii++)
               {
                    component = (ComponentFeat)components.get(ii);
                    desc = component.GetModelDescr();
                    if (desc.GetInstanceName().equals(oldInstance))
                    {
                         replace = component.CreateReplaceOp (newBolt);
                         replaceOps.insert(0, replace);
                    }
               }
               assembly.ExecuteFeatureOps (replaceOps, null);
          }
          catch (jxthrowable x)
          {
               System.out.println ("Caught exception: "+x);
               x.printStackTrace();
               return;
          }
•   pfcComponentFeat.ComponentFeat.Regenerate
                   The method pfcComponentFeat.ComponentFeat.Regenerate
                   regenerates an assembly component. The method regenerates the
                   assembly component just as in an interactive Pro/ENGINEER
                   session.
•   pfcAssembly.pfcAssembly.CreateComponentPath
                   The method
                   pfcAssembly.pfcAssembly.CreateComponentPath returns a
                   component path object, given the Assembly model and the integer
                   id path to the desired component.
•   pfcAssembly.ComponentPath.GetRoot
•   pfcAssembly.ComponentPath.SetRoot
•   pfcAssembly.ComponentPath.GetComponentIds
•   pfcAssembly.ComponentPath.SetComponentIds
•   pfcAssembly.ComponentPath.GetLeaf
•   pfcAssembly.ComponentPath.GetTransform
•   pfcAssembly.ComponentPath.SetTransform
•   pfcAssembly.ComponentPath.GetIsVisible
                   The method pfcAssembly.ComponentPath.GetRoot returns the
                   assembly at the head of the component path object.
                                                                                              Assemblies and
                 solid model at the end of the component path.
                                                                                               Components
                 The method pfcAssembly.ComponentPath.GetTransform
                 returns the coordinate system transformation between the
                 assembly and the particular component. It has an option to provide
                 the transformation from bottom to top, or from top to bottom. This
                 method describes the current position and the orientation of the
                 assembly component in the root assembly.
Assembling Components
Methods Introduced:
•   pfcAssembly.Assembly.AssembleComponent
•   pfcAssembly.Assembly.AssembleByCopy
•   pfcComponentFeat.ComponentFeat.GetConstraints
•   pfcComponentFeat.ComponentFeat.SetConstraints
                 The method pfcAssembly.Assembly.AssembleComponent adds
                 a specified component model to the assembly at the specified initial
                 position. The position is specified in the format defined by the
                 interface pfcBase.Transform3D. Specify the orientation of the
                 three axes and the position of the origin of the component
                 coordinate system, with respect to the target assembly coordinate
                 system.
          The method
          pfcComponentFeat.ComponentFeat.SetConstraints allows
          you to set the constraints for a specified assembly component. The
          input parameters for this method are:
•   pfcComponentFeat.pfcComponentFeat.ConstraintAttributes_Create
•   pfcComponentFeat.ConstraintAttributes.GetForce
•   pfcComponentFeat.ConstraintAttributes.SetForce
•
                                                                                           Assemblies and
    pfcComponentFeat.ConstraintAttributes.GetIgnore
                                                                                            Components
•   pfcComponentFeat.ConstraintAttributes.SetIgnore
                 The method
                 pfcComponentFeat.pfcComponentFeat.ConstraintAttribute
                 s_Create returns the constraint attributes object based on the
                 values of the following input parameters:
•   pfcComponentFeat.pfcComponentFeat.ComponentConstraint_Create
•   pfcComponentFeat.ComponentConstraint.GetType
•   pfcComponentFeat.ComponentConstraint.SetType
•   pfcComponentFeat.ComponentConstraint.SetAssemblyReference
•   pfcComponentFeat.ComponentConstraint.GetAssemblyReference
•   pfcComponentFeat.ComponentConstraint.SetAssemblyDatumSide
•   pfcComponentFeat.ComponentConstraint.GetAssemblyDatumSide
•   pfcComponentFeat.ComponentConstraint.SetComponentReference
•   pfcComponentFeat.ComponentConstraint.GetComponentReference
•   pfcComponentFeat.ComponentConstraint.SetComponentDatumSide
•   pfcComponentFeat.ComponentConstraint.GetComponentDatumSide
•   pfcComponentFeat.ComponentConstraint.SetOffset
•   pfcComponentFeat.ComponentConstraint.GetOffset
•   pfcComponentFeat.ComponentConstraint.SetAttributes
•   pfcComponentFeat.ComponentConstraint.GetAttributes
•   pfcComponentFeat.ComponentConstraint.SetUserDefinedData
•   pfcComponentFeat.ComponentConstraint.GetUserDefinedData
                 The method
                 pfcComponentFeat.pfcComponentFeat.ComponentConstrai
                 nt_Create returns the component constraint object having the
                 following parameters:
                                                                                             Assemblies and
                                                                                              Components
                            assembly.
                     –      ASM_CONSTRAINT_TANGENT——Use this option to
                            control the contact of two surfaces at their tangents.
                     –      ASM_CONSTRAINT_PNT_ON_SRF—Use this option to
                            control the contact of a surface with a point.
                     –      ASM_CONSTRAINT_EDGE_ON_SRF—Use this option to
                            control the contact of a surface with a straight edge.
                     –      ASM_CONSTRAINT_DEF_PLACEMENT—Use this option
                            to align the default coordinate system of the component to
                            the default coordinate system of the assembly.
                     –      ASM_CONSTRAINT_SUBSTITUTE—Use this option in
                            simplified representations when a component has been
                            substituted with some other model
                     –      ASM_CONSTRAINT_PNT_ON_LINE—Use this option to
                            control the contact of a line with a point.
                     –      ASM_CONSTRAINT_FIX—Use this option to force the
                            component to remain in its current packaged position.
                     –      ASM_CONSTRAINT_AUTO—Use this option in the user
                            interface to allow an automatic choice of constraint type
                            based upon the references.
                 •   AssemblyReference—A reference in the assembly.
                 •   AssemblyDatumSide—Orientation of the assembly. This can
                     have the following values:
                     –      Yellow—The primary side of the datum plane which is the
                            default direction of the arrow.
                     –      Red—The secondary side of the datum plane which is the
                            direction opposite to that of the arrow.
                 •   ComponentReference—A reference on the placed component.
                 •   ComponentDatumSide—Orientation of the assembly
                     component. This can have the following values:
Methods Introduced:
•   pfcComponentFeat.ComponentFeat.RedefineThroughUI
•   pfcComponentFeat.ComponentFeat.MoveThroughUI
                 The method
                 pfcComponentFeat.ComponentFeat.RedefineThroughUI
                 must be used in interactive J-Link applications. This method
                 displays the Pro/ENGINEER Constraint dialog box. This enables
                 the end user to redefine the constraints interactively. The control
                 returns to J-Link application when the user selects OK or Cancel
                 and the dialog box is closed.
                 The method
                 pfcComponentFeat.ComponentFeat.MoveThroughUI invokes
                 a dialog box that prompts the user to interactively reposition the
                 components. This interface enables the user to specify the
                 translation and rotation values. The control returns to J-Link
                 application when the user selects OK or Cancel and the dialog box
                 is closed.
                                                                              Assemblies and
import   com.ptc.pfc.pfcSelect.*;
                                                                               Components
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcAssembly.*;
public   class pfcComponentFeatExamples {
/*=====================================================================*\
FUNCTION: highlightConstraints
PURPOSE: Highlights and labels a component's constraints
\*=====================================================================*/
    public static void highlightConstraints ()
    throws com.ptc.cipjava.jxthrowable
    {
/*---------------------------------------------------------------------*\
  Get the constraints for the component.
\*---------------------------------------------------------------------*/
     Session session = pfcGlobal.GetProESession ();
     SelectionOptions options = pfcSelect.SelectionOptions_Create
                                ("membfeat");
     options.SetMaxNumSels (new Integer (1));
     Selections selections = session.Select (options, null);
     if (selections == null || selections.getarraysize () == 0)
         return;
     ModelItem item = selections.get (0).GetSelItem ();
     Feature feature = (Feature)item;
     if (feature.GetFeatType () != FeatureType.FEATTYPE_COMPONENT)
         return;
     ComponentFeat asmcomp = (ComponentFeat) item;
     ComponentConstraints constrs = asmcomp.GetConstraints ();
     if (constrs == null || constrs.getarraysize() == 0)
         return;
     for (int i = 0; i < constrs.getarraysize(); i++)
         {
/*---------------------------------------------------------------------*\
  Highlight the assembly reference geometry
\*---------------------------------------------------------------------*/
          ComponentConstraint c = constrs.get (i);
          Selection asmRef = c.GetAssemblyReference ();
          if (asmRef != null)
              asmRef.Highlight (StdColor.COLOR_ERROR);
/*---------------------------------------------------------------------*\
  Highlight the component reference geometry
\*---------------------------------------------------------------------*/
                                                                                        Assemblies and
            return ("(Point on Surf)");
                                                                                         Components
           case ComponentConstraintType._ASM_CONSTRAINT_EDGE_ON_SRF:
            return ("(Edge on Surf)");
           case ComponentConstraintType._ASM_CONSTRAINT_DEF_PLACEMENT:
            return ("(Default)");
           case ComponentConstraintType._ASM_CONSTRAINT_SUBSTITUTE:
            return ("(Substitute)");
           case ComponentConstraintType._ASM_CONSTRAINT_PNT_ON_LINE:
            return ("(Point on Line)");
           case ComponentConstraintType._ASM_CONSTRAINT_FIX:
            return ("(Fix)");
           case ComponentConstraintType._ASM_CONSTRAINT_AUTO:
            return ("(Auto)");
           default:
            return ("(Unrecognized Type)");
           }
    }
}
/*-----------------------------------------------------------------*\
  Set up the arrays of datum names
\*-----------------------------------------------------------------*/
       String [] asmDatums = {"ASM_D_FRONT", "ASM_D_TOP", "ASM_D_RIGHT"};
       String [] compDatums = {"COMP_D_FRONT",
                               "COMP_D_TOP",
                               "COMP_D_RIGHT"};
/*-----------------------------------------------------------------*\
  Package the component initially
\*-----------------------------------------------------------------*/
       ComponentFeat asmcomp =
           (ComponentFeat) assembly.AssembleComponent (componentModel,
                                                       transf);
/*-----------------------------------------------------------------*\
                                                                              Assemblies and
              assembly.GetItemByName (ModelItemType.ITEM_SURFACE,
                                                                               Components
                                      asmDatums [i]);
           if (asmItem == null)
            {
                interactFlag = true;
                continue;
            }
/*-----------------------------------------------------------------*\
  Find the component datum
\*-----------------------------------------------------------------*/
           ModelItem compItem =
            componentModel.GetItemByName (ModelItemType.ITEM_SURFACE,
                                          compDatums [i]);
           if (compItem == null)
            {
                interactFlag = true;
                continue;
            }
/*-----------------------------------------------------------------*\
  For the assembly reference, initialize a component path.
  This is necessary even if the reference geometry is in the assembly.
\*-----------------------------------------------------------------*/
           intseq ids = intseq.create ();
           ComponentPath path = pfcAssembly.CreateComponentPath (assembly,
                                                                  ids);
/*-----------------------------------------------------------------*\
  Allocate the references
\*-----------------------------------------------------------------*/
           Selection asmSel =
                pfcSelect.CreateModelItemSelection (asmItem, path);
           Selection compSel =
                pfcSelect.CreateModelItemSelection (compItem, null);
/*-----------------------------------------------------------------*\
  Allocate and fill the constraint.
\*-----------------------------------------------------------------*/
           ComponentConstraint constr =
            pfcComponentFeat.ComponentConstraint_Create
                      (ComponentConstraintType.ASM_CONSTRAINT_ALIGN);
           constr.SetAssemblyReference (asmSel);
           constr.SetComponentReference (compSel);
           constrs.insert (constrs.getarraysize(), constr);
Exploded Assemblies
                 These methods enable you to determine and change the explode
                 status of the assembly object.
Methods Introduced:
•   pfcAssembly.Assembly.GetIsExploded
•   pfcAssembly.Assembly.Explode
•   pfcAssembly.Assembly.UnExplode
•   pfcAssembly.Assembly.GetActiveExplodedState
•   pfcAssembly.Assembly.GetDefaultExplodedState
•   pfcAssembly.ExplodedState.Activate
                 The methods pfcAssembly.Assembly.Explode and
                 pfcAssembly.Assembly.UnExplode enable you to determine and
                 change the explode status of the assembly object.
Skeleton Models
                                                                                            Assemblies and
                                                                                             Components
                 Skeleton models are a 3-dimensional layout of the assembly. These
                 models are holders or distributors of critical design information,
                 and can represent space requirements, important mounting
                 locations, and motion.
Methods Introduced:
•   pfcAssembly.Assembly.AssembleSkeleton
•   pfcAssembly.Assembly.AssembleSkeletonByCopy
•   pfcAssembly.Assembly.GetSkeleton
•   pfcAssembly.Assembly.DeleteSkeleton
•   pfcSolid.Solid.GetIsSkeleton
                 The method pfcAssembly.Assembly.AssembleSkeleton adds an
                 existing skeleton model to the specified assembly.
Topic Page
                                                             20 - 1
Working with Family Tables
                 J-Link provides several methods for accessing family table
                 information. Because every model inherits from the interface
                 pfcFamily.FamilyMember, every model can have a family table
                 associated with it.
Accessing Instances
Methods Introduced:
•   pfcFamily.FamilyMember.GetParent
•   pfcFamily.FamilyMember.GetImmediateGenericInfo
•   pfcFamily.FamilyMember.GetTopGenericInfo
•   pfcFamily.FamilyTableRow.CreateInstance
•   pfcFamily.FamilyMember.ListRows
•   pfcFamily.FamilyMember.GetRow
•   pfcFamily.FamilyMember.RemoveRow
•   pfcFamily.FamilyTableRow.GetInstanceName
•   pfcFamily.FamilyTableRow.GetIsLocked
•   pfcFamily.FamilyTableRow.SetIsLocked
                 To get the generic model for an instance, call the method
                 pfcFamily.FamilyMember.GetParent.
                 If you wish to switch off the above behavior and continue to run
                 legacy applications in the pre-Wildfire 4.0 mode, set the
                 configuration option retrieve_instance_dependencies to
                 "instance_and_generic_deps".
                 To get the model descriptor of the top generic model, call the
                 method pfcFamily.FamilyMember.GetTopGenericInfo.
                                                                                        Family Tables
                 Use the method pfcFamily.FamilyMember.RemoveRow to
                 permanently delete the row from the family table.
Accessing Columns
Methods Introduced:
•   pfcFamily.FamilyMember.ListColumns
•   pfcFamily.FamilyMember.GetColumn
•   pfcFamily.FamilyMember.RemoveColumn
•   pfcFamily.FamilyTableColumn.GetSymbol
•   pfcFamily.FamilyTableColumn.GetType
•   pfcFamily.FamColModelItem.GetRefItem
•   pfcFamily.FamColParam.GetRefParam
                 The method pfcFamily.FamilyMember.ListColumns returns a
                 sequence of all columns in the family table.
                 To permanently delete the column from the family table and all
                 changed values in all instances, call the method
                 pfcFamily.FamilyMember.RemoveColumn.
Family Tables                                                                  20 - 3
                 The method pfcFamily.FamilyTableColumn.GetType returns
                 an enumerated value indicating the type of parameter governed by
                 the column in the family table.
•   pfcFamily.FamilyMember.GetCell
•   pfcFamily.FamilyMember.GetCellIsDefault
•   pfcFamily.FamilyMember.SetCell
•   pfcModelItem.ParamValue.GetStringValue
•   pfcModelItem.ParamValue.GetIntValue
•   pfcModelItem.ParamValue.GetDoubleValue
•   pfcModelItem.ParamValue.GetBoolValue
                 The method pfcFamily.FamilyMember.GetCell returns a string
                 ParamValue that corresponds to the cell at the intersection of the
                 row and column arguments. Use the method
                 pfcFamily.FamilyMember.GetCellIsDefault to check if the
                 value of the specified cell is the default value, which is the value of
                 the specified cell in the generic model.
                 The pfcModelItem.ParamValue.GetStringValue,
                 pfcModelItem.ParamValue.GetIntValue,
                 pfcModelItem.ParamValue.GetDoubleValue, and
                 pfcModelItem.ParamValue.GetBoolValue methods are used to
                 get the different types of parameter values.
•   pfcFamily.FamilyMember.AddRow
•   pfcModelItem.pfcModelItem.CreateStringParamValue
•   pfcModelItem.pfcModelItem.CreateIntParamValue
•
                                                                                         Family Tables
    pfcModelItem.pfcModelItem.CreateDoubleParamValue
•   pfcModelItem.pfcModelItem.CreateBoolParamValue
                 Use the method pfcFamily.FamilyMember.AddRow to create a
                 new instance with the specified name, and, optionally, the specified
                 values for each column. If you do not pass in a set of values, the
                 value “*” will be assigned to each column. This value indicates that
                 the instance uses the generic value.
•   pfcFamily.FamilyMember.CreateDimensionColumn
•   pfcFamily.FamilyMember.CreateParamColumn
•   pfcFamily.FamilyMember.CreateFeatureColumn
•   pfcFamily.FamilyMember.CreateComponentColumn
•   pfcFamily.FamilyMember.CreateCompModelColumn
•   pfcFamily.FamilyMember.CreateGroupColumn
•   pfcFamily.FamilyMember.CreateMergePartColumn
•   pfcFamily.FamilyMember.CreateColumn
•   pfcFamily.FamilyMember.AddColumn
•   pfcModelItem.pfcModelItem.CreateStringParamValue
•   pfcModelItem.ParamValues.create
                 The above methods initialize a column based on the input
                 argument. These methods assign the proper symbol to the column
                 header.
Family Tables                                                                   20 - 5
                 The method pfcFamily.FamilyMember.CreateColumn creates
                 a new column given a properly defined symbol and column type.
                 The results of this call should be passed to the method
                 pfcFamily.FamilyMember.AddColumn to add the column to the
                 model's family table.
                 The following example code shows a utility method that adds all the
                 dimensions to a family table. The program lists the dependencies of
                 the assembly and loops through each dependency, assigning the
                 model to a new FamColDimension column object. All the
                 dimensions, parameters, features, and components could be added
                 to the family table using a similar method.
import   com.ptc.cipjava.*;
import   com.ptc.pfc.pfcGlobal.*;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcFeature.*;
import   com.ptc.pfc.pfcModelItem.*;
import   com.ptc.pfc.pfcDimension.*;
import   com.ptc.pfc.pfcFamily.*;
public   class pfcFamilyMemberExamples {
    try {
      session = pfcGlobal.GetProESession();
    }
    catch (jxthrowable x)
      {
        System.out.println("Unable to initialize Pro/ENGINEER session:
"+x);
        return;
      }
    try {
      // list all holes in the solid model
                                                                                 Family Tables
             dim = (Dimension) dimensions.get(jj);
                  // determine if the dimension is a diameter dim.
             if (dim.GetDimType().equals(DimensionType.DIM_DIAMETER))
               {
                   // create the family table column
                   //(method from interface FamilyMember)
                 dim_column = solid.CreateDimensionColumn(dim);
                   // add the column to the Solid
                   // instead of null, you could pass any array of
                      ParamValues
                   // for the initial column values
                 solid.AddColumn(dim_column, null);
               }
           }
      }
    }
    catch (jxthrowable x)
      {
        System.out.println("Exception caught: "+x);
        return;
      }
  }
}
/*====================================================================*\
FUNCTION: addHoleDiameterColumns
PURPOSE: Add all hole diameters to the family table of a model.
\*====================================================================*/
function addHoleDiameterColumns ()
  {
/*------------------------------------------------------------------*\
  Use the current solid model.
\*------------------------------------------------------------------*/
  var session = pfcCreate ("MpfcCOMGlobal").GetProESession ();
  var solid = session.CurrentModel;
  modelTypeClass = pfcCreate ("pfcModelType");
Family Tables                                                           20 - 7
/*------------------------------------------------------------------*\
  List all holes in the solid model
\*------------------------------------------------------------------*/
  var holeFeatures = solid.ListFeaturesByType (true,
                             pfcCreate ("pfcFeatureType").FEATTYPE_HOLE);
  for (var ii =0; ii < holeFeatures.Count; ii++)
      {
          var holeFeat = holeFeatures.Item(ii);
/*------------------------------------------------------------------*\
  List all dimensions in the feature
\*------------------------------------------------------------------*/
          dimensions =
          holeFeat.ListSubItems(pfcCreate
("pfcModelItemType").ITEM_DIMENSION);
/*------------------------------------------------------------------*\
  Determine if the dimension is a diameter dimension
\*------------------------------------------------------------------*/
               if (dim.DimType == pfcCreate
("pfcDimensionType").DIM_DIAMETER)
               {
/*------------------------------------------------------------------*\
  Create the family table column (from pfcFamilyMember class)
\*------------------------------------------------------------------*/
                    var dimColumn = solid.CreateDimensionColumn(dim);
/*------------------------------------------------------------------*\
  Add the column to the family table. Second argument could be
  a sequence of pfcParamValues to use for each family table instance.
\*------------------------------------------------------------------*/
                    solid.AddColumn(dimColumn, void null);
                 }
           }
     }
}
This chapter describes the J-Link methods that enable you to use
action listeners.
Topic Page
                                                             21 - 1
J-Link Action Listeners
                 An ActionListener in Java is a class that is assigned to respond
                to certain events. In J-Link, you can assign action listeners to
                respond to events involving the following tasks:
                •   Changing windows
                •   Changing working directories
                •   Model operations
                •   Regenerating
                •   Creating, deleting, and redefining features
                •   Checking for regeneration failures
                All action listeners in J-Link are defined by these classes:
                                                                                       Action Listeners
     }
     SolidAL1.java:
     public class SolidAL1 extends DefaultSolidActionListener {
         // Include overridden methods here.
     }
Action Sources
Methods introduced:
•   pfcBase.ActionSource.AddActionListener
•   pfcBase.ActionSource.RemoveActionListener
                   Many J-Link classes inherit the ActionSource interface, but only
                   the following classes currently make calls to the methods of
                   registered ActionListeners:
                   •   pfcSession.Session
                       –   Session Action Listener
                       –   Model Action Listener
                       –   Solid Action Listener
                       –   Model Event Action Listener
                       –   Feature Action Listener
                   •   pfcCommand.UICommand
                       –   UI Action Listener
                   •   pfcModel.Model (and it’s subclasses)
                       –   Model Action Listener
                       –   Parameter Action Listener
                   •   pfcSolid.Solid (and it’s subclasses)
                       –   Solid Action Listener
                       –   Feature Action Listener
Action Listeners                                                              21 - 3
                 •    pfcFeature.Feature (and it’s subclasses)
                      –   Feature Action Listener
                      Note: Assigning an action listener to a source not related to it
                            will not cause an error but the listener method will
                            never be called.
•   pfcSession.SessionActionListener.OnAfterDirectoryChange
•   pfcSession.SessionActionListener.OnAfterWindowChange
•   pfcSession.SessionActionListener.OnAfterModelDisplay
•   pfcSession.SessionActionListener.OnBeforeModelErase
•   pfcSession.SessionActionListener.OnBeforeModelDelete
•   pfcSession.SessionActionListener.OnBeforeModelRename
•   pfcSession.SessionActionListener.OnBeforeModelSave
•   pfcSession.SessionActionListener.OnBeforeModelPurge
•   pfcSession.SessionActionListener.OnBeforeModelCopy
•   pfcSession.SessionActionListener.OnAfterModelPurge
                 The
                 pfcSession.SessionActionListener.OnAfterDirectoryChange
                 method activates after the user changes the working directory. This
                 method takes the new directory path as an argument.
                 The
                 pfcSession.SessionActionListener.OnAfterWindowChange
                 method activates when the user activates a window other than the
                 current one. Pass the new window to the method as an argument.
                                                                                       Action Listeners
                   pfcSession.SessionActionListener.OnBeforeModelErase,
                   pfcSession.SessionActionListener.OnBeforeModelRename,
                   pfcSession.SessionActionListener.OnBeforeModelSave, and
                   pfcSession.SessionActionListener.OnBeforeModelCopy take
                   special arguments. They are designed to allow you to fill in the
                   arguments and pass this data back to Pro/ENGINEER. The model
                   names placed in the descriptors will be used by Pro/ENGINEER as
                   the default names in the user interface.
•   pfcSession.Session.UICreateCommand
•   pfcCommand.UICommandActionListener.OnCommand
                   The pfcSession.Session.UICreateCommand method takes a
                   UICommandActionListener argument and returns a UICommand
                   action source with that action listener already registered. This
                   UICommand object is subsequently passed as an argument to the
                   Session.AddUIButton method that adds a command button to a
                   Pro/ENGINEER menu. The
                   pfcCommand.UICommandActionListener.OnCommand
                   method of the registered UICommandActionListener is called
                   whenever the command button is clicked.
•   pfcModel.ModelActionListener.OnAfterModelSave
•   pfcModel.ModelEventActionListener.OnAfterModelCopy
•   pfcModel.ModelEventActionListener.OnAfterModelRename
•   pfcModel.ModelEventActionListener.OnAfterModelErase
•   pfcModel.ModelEventActionListener.OnAfterModelDelete
•   pfcModel.ModelActionListener.OnAfterModelRetrieve
Action Listeners                                                              21 - 5
•   pfcModel.ModelActionListener.OnBeforeModelDisplay
•   pfcModel.ModelActionListener.OnAfterModelCreate
•   pfcModel.ModelActionListener.OnAfterModelSaveAll
•   pfcModel.ModelEventActionListener.OnAfterModelCopyAll
•   pfcModel.ModelActionListener.OnAfterModelEraseAll
•   pfcModel.ModelActionListener.OnAfterModelDeleteAll
•   pfcModel.ModelActionListener.OnAfterModelRetrieveAll
                Methods ending in All are called after any event of the specified
                type. The call is made even if the user did not explicitly request that
                the action take place. Methods that do not end in All are only
                called when the user specifically requests that the event occurs.
                The method
                pfcModel.ModelActionListener.OnAfterModelSave is called
                after successfully saving a model.
                The method
                pfcModel.ModelEventActionListener.OnAfterModelCopy is
                called after successfully copying a model.
                The method
                pfcModel.ModelEventActionListener.OnAfterModelRename
                is called after successfully renaming a model.
                The method
                pfcModel.ModelEventActionListener.OnAfterModelErase is
                called after successfully erasing a model.
                The method
                pfcModel.ModelEventActionListener.OnAfterModelDelete is
                called after successfully deleting a model.
                The method
                pfcModel.ModelActionListener.OnAfterModelRetrieve is
                called after successfully retrieving a model.
                The method
                pfcModel.ModelActionListener.OnBeforeModelDisplay is
                called before displaying a model.
                The method
                pfcModel.ModelActionListener.OnAfterModelCreate is called
                after the successful creation of a model.
                                                                                        Action Listeners
import   com.ptc.cipjava.*;
import   com.ptc.pfc.pfcGlobal.*;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcModelItem.*;
class ModelEventListenerExample
      extends com.ptc.pfc.pfcModel.DefaultModelEventActionListener
{
  public void OnAfterModelCopy (ModelDescriptor From,
                                ModelDescriptor To) throws jxthrowable
    {
      Session s = pfcGlobal.GetProESession ();
      Model m = s.GetModelFromDescr (To);
         if (m == null)
           {
             /* Couldn't find the new model handle - might happen, for
               example, when a copy is saved to disk but not retrieved into
               memory */
             return;
           }
         ParamValue pv =
             pfcModelItem.CreateStringParamValue
          (From.GetFullName().toUpperCase());
           Parameter p = m.GetParam ("COPIED_FROM");
           if (p == null)
           m.CreateParam ("COPIED_FROM", pv);
           else
           p.SetValue (pv);
     }
Action Listeners                                                               21 - 7
    public void OnAfterModelRename (ModelDescriptor From,
    ModelDescriptor To) throws jxthrowable
      {
        Session s = pfcGlobal.GetProESession ();
        Model m = s.GetModelFromDescr (To);
         if (m == null)
           {
             /* Couldn't find the new model handle in memory */
             return;
           }
         ParamValue pv =
         pfcModelItem.CreateStringParamValue
         (From.GetFullName().toUpperCase());
         Parameter p = m.GetParam ("RENAMED_FROM");
         if (p == null)
         m.CreateParam ("RENAMED_FROM", pv);
         else
           p.SetValue (pv);
     }
}
•    pfcSolid.SolidActionListener.OnBeforeRegen
•    pfcSolid.SolidActionListener.OnAfterRegen
•    pfcSolid.SolidActionListener.OnBeforeUnitConvert
•    pfcSolid.SolidActionListener.OnAfterUnitConvert
•    pfcSolid.SolidActionListener.OnBeforeFeatureCreate
•    pfcSolid.SolidActionListener.OnAfterFeatureCreate
•    pfcSolid.SolidActionListener.OnAfterFeatureDelete
                  The pfcSolid.SolidActionListener.OnBeforeRegen and
                  pfcSolid.SolidActionListener.OnAfterRegen methods occur
                  when the user regenerates a solid object within the ActionSource
                  to which the listener is assigned. These methods take the first
                  feature to be regenerated and a handle to the Solid object as
                  arguments.
                                                                                           Action Listeners
                   The pfcSolid.SolidActionListener.OnBeforeUnitConvert and
                   pfcSolid.SolidActionListener.OnAfterUnitConvert methods
                   activate when a user modifies the unit scheme (by selecting the
                   Pro/ENGINEER command Set Up, Units). The methods receive
                   the Solid object to be converted and a Boolean flag that identifies
                   whether the conversion changed the dimension values to keep the
                   object the same size.
                   The pfcSolid.SolidActionListener.OnAfterFeatureCreate
                   method activates after any feature, including datums, has been
                   created. This method takes the new Feature object as an
                   argument.
                   The pfcSolid.SolidActionListener.OnAfterFeatureDelete
                   method activates after any feature has been deleted. The method
                   receives the solid that contained the feature and the (now defunct)
                   ModelItem identifier.
Action Listeners                                                                  21 - 9
Feature Level Action Listeners
Methods Introduced:
•   pfcFeature.FeatureActionListener.OnBeforeDelete
•   pfcFeature.FeatureActionListener.OnBeforeSuppress
•   pfcFeature.FeatureActionListener.OnAfterSuppress
•   pfcFeature.FeatureActionListener.OnBeforeRegen
•   pfcFeature.FeatureActionListener.OnAfterRegen
•   pfcFeature.FeatureActionListener.OnRegenFailure
•   pfcFeature.FeatureActionListener.OnBeforeRedefine
•   pfcFeature.FeatureActionListener.OnAfterCopy
•   pfcFeature.FeatureActionListener.OnBeforeParameterDelete
                 Each method in FeatureActionListener takes as an argument
                 the feature that triggered the event.
                 The method
                 pfcFeature.FeatureActionListener.OnBeforeDelete is called
                 before a feature is deleted.
                 The method
                 pfcFeature.FeatureActionListener.OnBeforeSuppress is
                 called before a feature is suppressed.
                 The method
                 pfcFeature.FeatureActionListener.OnAfterSuppress is called
                 after a successful feature suppression.
                 The method
                 pfcFeature.FeatureActionListener.OnBeforeRegen is called
                 before a feature is regenerated.
                 The method
                 pfcFeature.FeatureActionListener.OnAfterRegen is called
                 after a successful feature regeneration.
                 The method
                 pfcFeature.FeatureActionListener.OnRegenFailure is called
                 when a feature fails regeneration.
                   The method
                   pfcFeature.FeatureActionListener.OnBeforeParameterDele
                                                                                            Action Listeners
                   te is called before a feature parameter is deleted.
Methods Introduced:
•   pfcExceptions.XCancelProEAction.Throw
                   The static method pfcExceptions.XCancelProEAction.Throw
                   must be called from the body of an action listener to cancel the
                   impending Pro/ENGINEER operation.This method will throw a
                   J-Link exception signalling to Pro/ENGINEER to cancel the
                   listener event.
                   •   pfcSession.SessionActionListener.OnBeforeModelErase
                   •   pfcSession.SessionActionListener.OnBeforeModelDelete
                   •   pfcSession.SessionActionListener.OnBeforeModelRename
                   •   pfcSession.SessionActionListener.OnBeforeModelSave
                   •   pfcSession.SessionActionListener.OnBeforeModelPurge
                   •   pfcSession.SessionActionListener.OnBeforeModelCopy
                   •   pfcModel.ModelActionListener.OnBeforeParameterCreate
                   •   pfcModel.ModelActionListener.OnBeforeParameterDelete
                   •   pfcModel.ModelActionListener.OnBeforeParameterModify
                   •   pfcFeature.FeatureActionListener.OnBeforeDelete
                   •   pfcFeature.FeatureActionListener.OnBeforeSuppress
Action Listeners                                                                  21 - 11
          •   pfcFeature.FeatureActionListener.OnBeforeParameterDelete
          •   pfcFeature.FeatureActionListener.OnBeforeParameterCreate
          •   pfcFeature.FeatureActionListener.OnBeforeRedefine
Topic Page
                                                            22 - 1
Exporting Files and 2D Models
Method Introduced:
•   pfcModel.Model.Export
                 The method pfcModel.Model.Export exports model data to a file.
                 The exported files are placed in the current Pro/ENGINEER
                 working directory. The input parameters are:
•   pfcModel.pfcModel.RelationExportInstructions_Create
•   pfcModel.pfcModel.ModelInfoExportInstructions_Create
•   pfcModel.pfcModel.ProgramExportInstructions_Create
•   pfcModel.pfcModel.IGESFileExportInstructions_Create
                                                                         Interface
•   pfcModel.pfcModel.DXFExportInstructions_Create
•   pfcModel.pfcModel.RenderExportInstructions_Create
•   pfcModel.pfcModel.STLASCIIExportInstructions_Create
•   pfcModel.pfcModel.STLBinaryExportInstructions_Create
•   pfcModel.pfcModel.BOMExportInstructions_Create
•   pfcModel.pfcModel.DWGSetupExportInstructions_Create
•   pfcModel.pfcModel.FeatInfoExportInstructions_Create
•   pfcModel.pfcModel.MFGFeatCLExportInstructions_Create
•   pfcModel.pfcModel.MFGOperCLExportInstructions_Create
•   pfcModel.pfcModel.MaterialExportInstructions_Create
•   pfcModel.pfcModel.CGMFILEExportInstructions_Create
•   pfcModel.pfcModel.InventorExportInstructions_Create
•   pfcModel.pfcModel.FIATExportInstructions_Create
•   pfcModel.pfcModel.ConnectorParamExportInstructions_Create
•   pfcModel.pfcModel.CableParamsFileInstructions_Create
•   pfcModel.pfcModel.CATIAFacetsExportInstructions_Create
•   pfcModel.pfcModel.VRMLModelExportInstructions_Create
•   pfcModel.pfcModel.STEP2DExportInstructions_Create
•   pfcModel.pfcModel.MedusaExportInstructions_Create
•   pfcExport.pfcExport.CADDSExportInstructions_Create
•   pfcExport.pfcExport.NEUTRALFileExportInstructions_Create
•   pfcExport.pfcExport.ProductViewExportInstructions_Create
•   pfcSession.BaseSession.ExportDirectVRML
Interface                                                       22 - 3
Export Instructions Table
                                                                                             Interface
            Deprecated Classes                       New Instruction Classes
    IGES3DExportInstructions                  IGES3DNewExportInstructions
    STEPExportInstructions                    STEP3DExportInstructions
    VDAExportInstructions                     VDA3DExportInstructions
    SETExportInstructions                     SET3DExportInstructions
    CATIAExportInstructions                   CATIA3DExportInstructions
Methods Introduced:
•     pfcModel.pfcModel.Export2DOption_Create
•     pfcModel.Export2DOption.SetExportSheetOption
•     pfcModel.Export2DOption.SetModelSpaceSheet
•     pfcModel.Export2DOption.SetSheets
                   The method pfcModel.pfcModel.Export2DOptions_Create
                   creates a new instance of the pfcModel.Export2DOption object.
                   This object contains the following options:
Interface                                                                           22 - 5
             –   EXPORT_CURRENT_TO_PAPER_SPACE—Exports only
                 the drawing’s current sheet as paper space to a single file.
                 This type is the same as
                 EXPORT_CURRENT_TO_MODEL_SPACE for formats
                 that do not support the concept of model space and paper
                 space.
             –   EXPORT_ALL—Exports all the sheets in a drawing to a
                 single file as paper space, if applicable for the format type.
             –   EXPORT_SELECTED—Exports selected sheets in a
                 drawing as paper space and one sheet as model space.
         •   ModelSpaceSheet—Specifies the sheet number that needs be
             exported as model space. This option is applicable only if the
             export formats support the concept of model space and paper
             space and if ExportSheetOption is set to EXPORT_SELECTED.
             Use the method
             pfcModel.Export2DOption.SetModelSpaceSheet to set
             this option.
         •   Sheets—Specifies the sheet numbers that need to be exported
             as paper space. This option is applicable only if
             ExportSheetOption is set to EXPORT_SELECTED. Use the
             method pfcModel.Export2DOption.SetSheets to set this
             option.
•   pfcExport.pfcExport.PDFExportInstructions_Create
•   pfcExport.PDFExportInstructions.SetFilePath
•   pfcExport.PDFExportInstructions.SetOptions
•   pfcExport.pfcExport.PDFOption_Create
•   pfcExport.PDFOption.SetOptionType
•   pfcExport.PDFOption.SetOptionValue
                                                                                          Interface
                 The method
                 pfcExport.pfcExport.PDFExportInstructions_Create creates
                 a new instance of the pfcExport.PDFExportInstructions data
                 object that describes how to export Pro/ENGINEER drawings or
                 solid models to the PDF and U3D formats. The options in this object
                 are described as follows:
Interface                                                                        22 - 7
             –   PDF_STROKE_ALL_FONTS—Specifies the option to
                 stroke all fonts.
         •   PDFOPT_COLOR_DEPTH—Allows you to choose between
             color, grayscale, or monochrome output. This option is given by
             the pfcExport.PDFColorDepth class and takes the following
             values:
             –   PDF_CD_COLOR—Specifies color output. This is the
                 default value.
             –   PDF_CD_GRAY—Specifies grayscale output.
             –   PDF_CD_MONO—Specifies monochrome output.
         •   PDFOPT_HIDDENLINE_MODE—Enables you to set the style
             for hidden lines in the resulting PDF document. This option is
             given by the pfcExport.PDFHiddenLineMode class and takes
             the following values:
             –   PDF_HLM_SOLID—Specifies solid hidden lines.
             –   PDF_HLM_DASHED—Specifies dashed hidden lines. This
                 is the default type.
         •   PDFOPT_SEARCHABLE_TEXT—If true, stroked text is
             searchable. The default value is true.
         •   PDFOPT_RASTER_DPI—Allows you to set the resolution for
             the output of any shaded views in DPI. It can take a value
             between 100 and 600. The default value is 300.
         •   PDFOPT_LAUNCH_VIEWER—If true, launches the Adobe
             Acrobat Reader. The default value is true.
         •   PDFOPT_LAYER_MODE—Enables you to set the availability
             of layers in the document. It is given by the
             pfcExport.PDFLayerMode class and takes the following
             values:
             –   PDF_LAYERS_ALL—Exports the visible layers and
                 entities. This is the default.
             –   PDF_LAYERS_VISIBLE—Exports only visible layers in a
                 drawing.
             –   PDF_LAYERS_NONE—Exports only the visible entities in
                 the drawing, but not the layers on which they are placed.
         •   PDFOPT_PARAM_MODE—Enables you to set the availability
             of model parameters as searchable metadata in the PDF
             document. It is given by the pfcExport.PDFParameterMode
             class and takes the following values:
                                                                                    Interface
                active.
            •   PDFOPT_BOOKMARK_ZONES—If true, adds bookmarks to
                the PDF showing zoomed in regions or zones in the drawing
                sheet. The zone on an A4-size drawing sheet is ignored.
            •   PDFOPT_BOOKMARK_VIEWS—If true, adds bookmarks to
                the PDF document showing zoomed in views on the drawing.
            •   PDFOPT_BOOKMARK_SHEETS—If true, adds bookmarks to
                the PDF document showing each of the drawing sheets.
            •   PDFOPT_BOOKMARK_FLAG_NOTES—If true, adds
                bookmarks to the PDF document showing the text of the flag
                note.
            •   PDFOPT_TITLE—Specifies a title for the PDF document.
            •   PDFOPT_AUTHOR—Specifies the name of the person
                generating the PDF document.
            •   PDFOPT_SUBJECT—Specifies the subject of the PDF
                document.
            •   PDFOPT_KEYWORDS—Specifies relevant keywords in the
                PDF document.
            •   PDFOPT_PASSWORD_TO_OPEN—Sets a password to open
                the PDF document. By default, this option is NULL, which
                means anyone can open the PDF document without a password.
            •   PDFOPT_MASTER_PASSWORD—Sets a password to restrict
                or limit the operations that the viewer can perform on the
                opened PDF document. By default, this option is NULL, which
                means you can make any changes to the PDF document
                regardless of the settings of the modification flags
                PDFOPT_ALLOW_*.
            •   PDFOPT_RESTRICT_OPERATIONS—If true, enables you to
                restrict or limit operations on the PDF document. By default, is
                is false.
Interface                                                                  22 - 9
          •   PDFOPT_ALLOW_MODE—Enables you to set the security
              settings for the PDF document. This option must be set if
              PDFOPT_RESTRICT_OPERATIONS is set to true. It is given
              by the pfcExport.PDFRestrictOperationsMode class and
              takes the following values:
              –   PDF_RESTRICT_NONE—Specifies that the user can
                  perform any of the permitted viewer operations on the PDF
                  document. This is the default value.
              –   PDF_RESTRICT_FORMS_SIGNING—Restricts the user
                  from adding digital signatures to the PDF document.
              –   PDF_RESTRICT_INSERT_DELETE_ROTATE—Restricts
                  the user from inserting, deleting, or rotating the pages in
                  the PDF document.
              –   PDF_RESTRICT_COMMENT_FORM_SIGNING—Restricts        t
                  he user from adding or editing comments in the PDF
                  document.
              –   PDF_RESTRICT_EXTRACTING—Restricts the user from
                  extracting pages from the PDF document.
          •   PDFOPT_ALLOW_PRINTING—If true, allows you to print the
              PDF document. By default, it is true.
          •   PDFOPT_ALLOW_PRINTING_MODE—Enables you to set the
              print resolution. It is given by the
              pfcExport.PDFPrintingMode class and takes the following
              values:
              –   PDF_PRINTING_LOW_RES—Specifies low resolution for
                  printing.
              –   PDF_PRINTING_HIGH_RES—Specifies high resolution
                  for printing. This is the default value.
          •   PDFOPT_ALLOW_COPYING—If true, allows you to copy
              content from the PDF document. By default, it is true.
          •   PDFOPT_ALLOW_ACCESSIBILITY—If true, enables
              visually-impaired screen reader devices to extract data
              independent of the value given by the
              pfcExport.PDFRestrictOperationsMode class. The default
              value is true.
          •   PDFOPT_PENTABLE—If true, uses the standard
              Pro/ENGINEER pentable to control the line weight, line style,
              and line color of the exported geometry. The default value is
              false.
                                                                                   Interface
            •   PDFOPT_LINEJOIN—Enables you to control the treatment of
                the joined corners of connected lines exported to PDF. It is
                given by the pfcExport.PDFLinejoin class and takes the
                following values:
                –   PDF_LINEJOIN_MITER—Specifies the miter join. This is
                    the default.
                –   PDF_LINEJOIN_ROUND—Specifies the round join.
                –   PDF_LINEJOIN_BEVEL—Specifies the bevel join.
            •   PDFOPT_SHEETS—Allows you to specify the sheets from a
                Pro/ENGINEER drawing that are to be exported to PDF. It is
                given by the pfcExport.PrintSheets class and takes the
                following values:
                –   PRINT_CURRENT_SHEET—Only the current sheet is
                    exported to PDF.
                –   PRINT_ALL_SHEETS—All the sheets are exported to PDF.
                    This is the default value.
                –   PRINT_SELECTED_SHEETS—Sheets of a specified range
                    are exported to PDF. If this value is assigned, then the
                    value of the option PDFOPT_SHEET_RANGE must also be
                    known.
            •   PDFOPT_SHEET_RANGE—Specifies the range of sheets in a
                drawing that are to be exported to PDF. If this option is set,
                then the option PDFOPT_SHEETS must be set to the value
                PRINT_SELECTED_SHEETS.
            •   PDFOPT_EXPORT_MODE—Enables you to select the object to
                be exported to PDF and the export format. It is given by the
                pfcExport.PDFExportMode class and takes the following
                values:
                –   PDF_2D_DRAWING—Only drawings are exported to PDF.
                    This is the default value.
Interface                                                                22 - 11
              –   PDF_3D_AS_NAMED_VIEWS—3D models are exported as
                  2D raster images embedded in PDF files.
              –   PDF_3D_AS_U3D_PDF—3D models are exported as U3D
                  models embedded in one-page PDF files.
              –   PDF_3D_AS_U3D—A 3D model is exported as a U3D
                  (.u3d) file. This value ignores the options set for the
                  pfcExport.PDFOptionType class.
          •   PDFOPT_LIGHT_DEFAULT—Enables you to set the default
              lighting style used while exporting 3D models in the U3D
              format to a one-page PDF file, that is when the option
              PDFOPT_EXPORT_MODE is set to PDF_3D_AS_U3D. The
              values for this option are given by the
              pfcExport.PDFU3DLightingMode class.
          •   PDFOPT_RENDER_STYLE_DEFAULT—Enables you to set
              the default rendering style used while exporting
              Pro/ENGINEER models in the U3D format to a one-page PDF
              file, that is when the option PDFOPT_EXPORT_MODE is set to
              PDF_3D_AS_U3D. The values for this option are given by the
              pfcModel.PDFU3DRenderMode class.
          •   PDFOPT_SIZE—Allows you to specify the page size of the
              exported PDF file. The values for this option are given by the
              pfcExport.PlotPaperSize class. If the value is set to
              VARIABLESIZEPLOT, you also need to set the options
              PDFOPT_HEIGHT and PDFOPT_WIDTH.
          •   PDFOPT_HEIGHT—Enables you to set the height for a
              user-defined page size of the exported PDF file. The default
              value is 0.0.
          •   PDFOPT_WIDTH—Enables you to set the width for a
              user-defined page size of the exported PDF file. The default
              value is 0.0.
          •   PDFOPT_ORIENTATION—Enables you to specify the
              orientation of the pages in the exported PDF file. It is given by
              the pfcSheet.SheetOrientation class.
              –   ORIENT_PORTRAIT—Exports the pages in portrait
                  orientation. This is the default value.
              –   ORIENT_LANDSCAPE—Exports the pages in landscape
                  orientation.
          •   PDFOPT_TOP_MARGIN—Allows you to specify the top margin
              of the view port. The default value is 0.0.
          •   PDFOPT_LEFT_MARGIN—Allows you to specify the left
              margin of the view port. The default value is 0.0.
                                                                                      Interface
                default blue background color that appears behind the U3D
                model. You can set any value within the range of 0.0 to 1.0. The
                default value is 1.0.
            •   PDFOPT_ADD_VIEWS—If true, allows you to add view
                definitions to the U3D model from a file. By default, it is true.
            •   PDFOPT_VIEW_TO_EXPORT—Specifies the view or views to
                be exported to the PDF file. It is given by the
                pfcExport.PDFSelectedViewMode class and takes the
                following values:
                –   PDF_VIEW_SELECT_CURRENT—Exports the current
                    graphical area to a one-page PDF file.
                –   PDF_VIEW_SELECT_ALL—Exports all the views to a
                    multi-page PDF file. Each page contains one view with the
                    view name displayed at the bottom center of the view port.
                –   PDF_VIEW_SELECT_BY_NAME—Exports the selected
                    view to a one-page PDF file with the view name printed at
                    the bottom center of the view port. If this value is assigned,
                    then the option PDFOPT_SELECTED_VIEW must also be
                    set.
            •   PDFOPT_SELECTED_VIEW—Sets the option
                PDFOPT_VIEW_TO_EXPORT to the value
                PDF_VIEW_SELECT_BY_NAME, if the corresponding view is
                successfully found.
Exporting 3D Geometry
            J-Link allows you to export three dimensional geometry to various
            formats. Pass the instructions object containing information about
            the desired export file to the method pfcModel.Model.Export.
Interface                                                                   22 - 13
Export Instructions
Methods Introduced:
•   pfcExport.Export3DInstructions.GetConfiguration
•   pfcExport.Export3DInstructions.SetConfiguration
•   pfcExport.Export3DInstructions.GetReferenceSystem
•   pfcExport.Export3DInstructions.SetReferenceSystem
•   pfcExport.Export3DInstructions.GetGeometry
•   pfcExport.Export3DInstructions.SetGeometry
•   pfcExport.Export3DInstructions.GetIncludedEntities
•   pfcExport.Export3DInstructions.SetIncludedEntities
•   pfcExport.Export3DInstructions.GetLayerOptions
•   pfcExport.Export3DInstructions.SetLayerOptions
•   pfcExport.pfcExport.GeometryFlags_Create
•   pfcExport.pfcExport.InclusionFlags_Create
•   pfcExport.pfcExport.LayerExportOptions_Create
•   pfcExport.pfcExport.STEP3DExportInstructions_Create
•   pfcExport.pfcExport.SET3DExportInstructions_Create
•   pfcExport.pfcExport.VDA3DExportInstructions_Create
•   pfcExport.pfcExport.IGES3DNewExportInstructions_Create
•   pfcExport.pfcExport.CATIA3DExportInstructions_Create
•   pfcExport.pfcExport.CATIAModel3DExportInstructions_Create
•   pfcExport.pfcExport.PDGS3DExportInstructions_Create
•   pfcExport.pfcExport.ACIS3DExportInstructions_Create
•   pfcExport.pfcExport.CatiaPart3DExportInstructions_Create
•   pfcExport.pfcExport.CatiaProduct3DExportInstructions_Create
•   pfcExport.pfcExport.CatiaCGR3DExportInstructions_Create
•   pfcExport.pfcExport.JT3DExportInstructions_Create
•   pfcExport.pfcExport.ParaSolid3DExportInstructions_Create
•   pfcExport.Export.UG3DExportInstructions_Create
                 The interface pfcExport.Export3DInstructions contains data to
                 export a part or an assembly to a specifed 3D format. The fields of
                 this interface are:
                                                                                       Interface
                    structure to a single file and the components to component
                    files. It creates component parts and subassemblies with
                    their respective geometry and external references. This
                    option supports all levels of hierarchy.
                –   EXPORT_ASM_ASSEMBLY_FILE—Exports an assembly
                    as multiple files containing geometry information of its
                    components and assembly features.
            •   CoordSystem—The reference coordinate system used for
                export. If this value is null, the system uses the default
                coordinate system.
            •   GeometryFlags—The object describing the type of geometry to
                export. The pfcExport.pfcExport.GeometryFlags_Create
                returns this instruction object. The types of geometry supported
                by the export operation are:
                –   Wireframe—Export edges only.
                –   Solid—Export surfaces along with topology.
                –   Surfaces—Export all model surfaces.
                –   Quilts—Export as quilt.
            •   InclusionFlags—The object returned by the method
                pfcExport.pfcExport.InclusionFlags_Create that
                determines whether to include certain entities. The entities are:
                –   Datums—Determines whether datum curves are included
                    when exporting files. If true the datum curve information is
                    included during export. The default value is false.
                –   Blanked—Determines whether entities on blanked layers
                    are exported. If true entities on blanked layers are
                    exported. The default value is false.
Interface                                                                    22 - 15
                •   LayerExportOptions—The instructions object returned by
                    the method
                    pfcExport.pfcExport.LayerExportOptions_Create that
                    describes how to export layers. To export layers you can specify
                    the following:
                    –     UseAutoId—Enables you to set or remove an interface layer
                          ID. A layer is recognized with this ID when exporting the
                          file to a specified output format. If true, automatically
                          assigns interface IDs to layers not assigned IDs and exports
                          them. The default value is false.
                    –     LayerSetupFile—Specifies the name and complete path of
                          the layer setup file. This file contains the layer assignment
                          information which includes the name of the layer, its
                          display status, the interface ID and number of sub layers.
•   pfcSession.BaseSession.IsConfigurationSupported
•   pfcSession.BaseSession.IsGeometryRepSupported
                 The method
                 pfcSession.BaseSession.IsConfigurationSupported checks
                 whether the specified assembly configuration is valid for a
                                                                                           Interface
                 particular model and the specified export format. The input
                 parameters for this method are:
                 The method
                 pfcSession.BaseSession.IsGeometryRepSupported checks
                 whether the specified geometric representation is valid for a
                 particular export format. The input parameters are :
                 The methods
                 pfcSession.BaseSession.IsConfigurationSupported and
                 pfcSession.BaseSession.IsGeometryRepSupported() must be
                 called before exporting an assembly to the specified export formats
                 except for the CADDS and STEP2D formats. The return values of
                 both the methods must be true for the export operation to be
                 successful.
Interface                                                                        22 - 17
Shrinkwrap Export
                     To improve performance in a large assembly design, you can export
                     lightweight representations of models called shrinkwrap models. A
                     shrinkwrap model is based on the external surfaces of the source
                     part or asssembly model and captures the outer shape of the source
                     model.
Methods Introduced:
•     pfcSolid.Solid.ExportShrinkwrap
                     You can export the specified solid model as a shrinkwrap model
                     using the method pfcSolid.Solid.ExportShrinkwrap. This
                     method takes the ShrinkwrapExportInstruction object as an
                     argument.
Methods Introduced:
• pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetMethod
                                                                                          Interface
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetQuality
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetQuality
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetAutoHoleFilling
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetAutoHoleFilling
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetIgnoreSkeleton
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetIgnoreSkeleton
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetIgnoreQuilts
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetIgnoreQuilts
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetAssignMassProperties
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetAssignMassProperties
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetIgnoreSmallSurfaces
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetIgnoreSmallSurfaces
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetSmallSurfPercentage
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetSmallSurfPercentage
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetDatumReferences
•   pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetDatumReferences
                 The method
                 pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetM
                 ethod returns the method used to create the shrinkwrap. The types
                 of shrinkwrap methods are:
                 •    SWCREATE_SURF_SUBSET—Surface Subset
                 •    SWCREATE_FACETED_SOLID—Faceted Solid
                 •    SWCREATE_MERGED_SOLID—Merged Solid
Interface                                                                       22 - 19
          The method
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetQ
          uality specifies the quality level for the system to use when
          identifying surfaces or components that contribute to the
          shrinkwrap model. Quality ranges from 1 which produces the
          coarsest representation of the model in the fastest time, to 10 which
          produces the most exact representation. Use the method
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetQu
          ality to set the quality level for the system during the shrinkwrap
          export. The default value is 1.
          The method
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetAu
          toHoleFilling returns true if auto hole filling is enabled during
          Shrinkwrap export. The method
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetAu
          toHoleFilling sets a flag that forces Pro/ENGINEER to identify all
          holes and surfaces that intersect a single surface and fills those
          holes during shrinkwrap. The default value is true.
          The method
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetIg
          noreSkeleton and
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetIg
          noreSkeleton determine whether the skeleton model geometry
          must be included in the shrinkwrap model.
          The method
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetIg
          noreQuilts and
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetIg
          noreQuilts determines whether external quilts must be included
          in the shrinkwrap model.
          The method
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetAs
          signMassProperties determines the mass property of the model.
          The method
          pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetAs
          signMassProperties assigns mass properties to the shrinkwrap
          model. The default value is false and the mass properties of the
          original model is assigned to the shrinkwrap model. If the value is
          set to true, the user must assign a value for the mass properties.
                                                                                         Interface
                 mallSurfPercentage and
                 pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetSm
                 allSurfPercentage.
                 The method
                 pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetDa
                 tumReferences and
                 pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetDa
                 tumReferences specify and select the datum planes, points,
                 curves, axes, and coordinate system references to be included in the
                 shrinkwrap model.
•   pfcShrinkwrap.pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions_Create
•   pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.GetAdditionalSurfaces
•   pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.SetAdditionalSurfaces
•   pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.GetOutputModel
•   pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.SetOutputModel
                 The static method
                 pfcShrinkwrap.Shrinkwrap.ShrinkwrapSurfaceSubsetInstr
                 uctions_Create returns an object used to create a shrinkwrap
                 model of surface subset type. Specify the name of the output model
                 in which the shrinkwrap is to be created as an input to this method.
                 The method
                 pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.Get
                 AdditionalSurfaces specifies the surfaces included in the
                 shrinkwrap model while the method
                 pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.SetA
                 dditionalSurfaces selects individual surfaces to be included in the
                 shrinkwrap model.
Interface                                                                      22 - 21
                 The method
                 pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.Get
                 OutputModel returns the template model where the shrinkwrap
                 geometry is to be created while the method
                 pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.SetO
                 utputModel sets the template model.
Methods Intoduced:
•   pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.GetFormat
•   pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.GetFramesFile
•   pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.SetFramesFile
                 The method
                 pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.Get
                 Format returns the the output file format of the shrinkwrap
                 model.
                 The methods
                 pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.Get
                 FramesFile and
                 pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.Set
                 FramesFile enable you to select a frame file to create a faceted
                 solid motion envelope model that represents the full motion of the
                 mechanism captured in the frame file. Specify the name and
                 complete path of the frame file.
•   pfcShrinkwrap.pfcShrinkwrap.ShrinkwrapFacetedPartInstructions_Create
•   pfcShrinkwrap.ShrinkwrapFacetedPartInstructions.GetLightweight
•   pfcShrinkwrap.ShrinkwrapFacetedPartInstructions.SetLightweight
                 The static method
                 pfcShrinkwrap.Shrinkwrap.ShrinkwrapFacetedPartInstru
                                                                                        Interface
                 ctions_Create returns an object used to create a shrinkwrap
                 model of shrinkwrap faceted type. The input parameters of this
                 method are:
•   pfcShrinkwrap.pfcShrinkwrap.ShrinkwrapVRMLInstructions_Create
•   pfcShrinkwrap.ShrinkwrapVRMLInstructions.GetOutputFile
•   pfcShrinkwrap.ShrinkwrapVRMLInstructions.SetOutputFile
                 The static method
                 pfcShrinkwrap.Shrinkwrap.ShrinkwrapVRMLInstructions_
                 Create returns an object used to create a shrinkwrap model of
                 shrinkwrap VRML format. Specify the name of the output model as
                 an input to this method.
                 The method
                 pfcShrinkwrap.ShrinkwrapVRMLInstructions.GetOutputFi
                 le returns the name of the output file to be created and the method
                 pfcShrinkwrap.ShrinkwrapVRMLInstructions.SetOutputFi
                 le specifies the name of the output file to be created.
Interface                                                                     22 - 23
STL Export Options
Methods Introduced:
•   pfcShrinkwrap.pfcShrinkwrap.ShrinkwrapVRMLInstructions_Create
•   pfcShrinkwrap.ShrinkwrapVRMLInstructions.GetOutputFile
•   pfcShrinkwrap.ShrinkwrapVRMLInstructions.SetOutputFile
                 The static method
                 pfcShrinkwrap.Shrinkwrap.ShrinkwrapVRMLInstructions_
                 Create returns an object used to create a shrinkwrap model of
                 shrinkwrap STL format. Specify the name of the output model as
                 an input to this method.
                 The method
                 pfcShrinkwrap.ShrinkwrapSTLInstructions.GetOutputFile
                 returns the name of the output file to be created and the method
                 pfcShrinkwrap.ShrinkwrapSTLInstructions.SetOutputFile
                 specifies the name of the output file to be created.
•   pfcShrinkwrap.pfcShrinkwrap.ShrinkwrapMergedSolidInstructions_Create
•   pfcShrinkwrap.ShrinkwrapMergedSolidInstructions.GetAdditionalComponents
•   pfcShrinkwrap.ShrinkwrapMergedSolidInstructions.SetAdditionalComponents
                 The static method
                 pfcShrinkwrap.Shrinkwrap.ShrinkwrapMergedSolidInstru
                 ctions_Create returns an object used to create a shrinkwrap
                 model of merged solids format. Specify the name of the output
                 model as an input to this method.
                 The methods
                 pfcShrinkwrap.ShrinkwrapMergedSolidInstructions.GetAd
                 ditionalComponents specifies individual components of the
                 assembly to be merged into the shrinkwrap model. Use the method
                 pfcShrinkwrap.ShrinkwrapMergedSolidInstructions.SetAd
                 ditionalComponents to select individual components of the
                 assembly to be merged into the shrinkwrap model.
                    The following example code leverages the fact that when a model
                    with a model program attached is erased or deleted the stop method
                    of the model program is called. This example code uses the stop
                    method to produce a VRML representation of the model in a
                    standard directory for Web publishing.
                                                                                          Interface
import      com.ptc.cipjava.*;
import      com.ptc.pfc.pfcGlobal.*;
import      com.ptc.pfc.pfcSession.*;
import      com.ptc.pfc.pfcModel.*;
  /**
  * The class MakeVRMLOnEraseExample is intended to be used as a model
  * program. The program automatically creates VRML file(s) in a standard
  * directory when the model is erased. The "stop" method will be called
  * when the model is erased.*/
try {
session = pfcGlobal.GetProESession();
/* GetModel when the model program is activated (start). Even if
the model is renamed, the model variable reference will still
be valid. */
model = session.GetModel (modelName, modelType);
}
catch (jxthrowable x)
{
System.out.println ("Caught exception: "+x);
x.printStackTrace ();
}
}
public static void stop ()
{
try {
Interface                                                                       22 - 25
VRMLModelExportInstructions vrml_instrs;
vrml_instrs =
pfcModel.VRMLModelExportInstructions_Create(VRMLdirectory);
model.Export("", vrml_instrs); // Export() ignores filename for VRML
export
}
catch (jxthrowable x)
{
System.out.println ("Caught exception :"+x);
x.printStackTrace ();
}
}
}
Importing Files
Method Introduced:
•   pfcModel.Model.Import
                 The method pfcModel.Model.Import reads a file into
                 Pro/ENGINEER. The format must be the same as it would be if
                 these files were created by Pro/ENGINEER. The parameters are:
Import Instructions
Methods Introduced:
•   pfcModel.pfcModel.RelationImportInstructions_Create
•   pfcModel.pfcModel.IGESSectionImportInstructions_Create
•   pfcModel.pfcModel.ProgramImportInstructions_Create
•   pfcModel.pfcModel.ConfigImportInstructions_Create
•   pfcModel.pfcModel.DWGSetupImportInstructions_Create
•   pfcModel.pfcModel.SpoolImportInstructions_Create
•   pfcModel.pfcModel.ConnectorParamsImportInstructions_Create
•   pfcModel.pfcModel.ASSEMTreeCFGImportInstructions_Create
•   pfcModel.pfcModel.WireListImportInstructions_Create
                                                                                            Interface
                   object to import a file of a specified type into Pro/ENGINEER. The
                   details are as shown in the table below:
                       Note:
                       –      The method pfcModel.Model.Import does not support
                              importing of CADAM type of files.
Interface                                                                         22 - 27
                     –   If a model or the file type STEP, IGES, DWX, or SET
                         already exists, the imported model is appended to the
                         current model. For more information on methods that
                         return models of the types STEP, IGES, DWX, and SET,
                         refer to Getting a Model Object.
Importing 2D Models
Method Introduced:
•   pfcSession.BaseSession.Import2DModel
                 The method pfcSession.BaseSession.Import2DModel imports a
                 two dimensional model based on the following parameters:
Importing 3D Geometry
Methods Introduced:
• pfcSession.BaseSession.GetImportSourceType
                                                                                         Interface
•   pfcSession.BaseSession.ImportNewModel
•   pfcImport.LayerImportFilter.OnLayerImport
                 For some input formats, the method
                 pfcSession.BaseSession.GetImportSourceType returns the
                 type of model that can be imported using a designated file. The
                 input parameters of this method are:
Interface                                                                      22 - 29
                 –   IMPORT_NEW_CATIA_SESSION
                 –   IMPORT_NEW_CATIA_MODEL
                 –   IMPORT_NEW_DXF
                 –   IMPORT_NEW_ACIS
                 –   IMPORT_NEW_PARASOLID
                 –   IMPORT_NEW_ICEM
                 –   IMPORT_NEW_DESKTOP
                 –   IMPORT_NEW_CATIA_PART
                 –   IMPORT_NEW_UG
                 –   IMPORT_NEW_PRODUCTVIEW
                 –   IMPORT_NEW_CATIA_CGR
                 –   IMPORT_NEW_JT
             •   ModelType—Specifies the type of the model. It can be a part,
                 assembly or drawing.
             •   NewModelName—Specifies a name for the imported model.
             •   LayerImportFilter—Specifies the layer filter. This parameter is
                 optional.
             The interface pfcImport.LayerImportFilter has a call back
             function pfcImport.LayerImportFilter.OnLayerImport.
             Pro/ENGINEER passes the object pfcImport.ImportedLayer
             describing each imported layer to the layer filter to allow you to
             perform changes on each layer as it is imported.
•   pfcImport.ImportedLayer.GetName
•   pfcImport.ImportedLayer.SetNewName
•   pfcImport.ImportedLayer.GetSurfaceCount
•   pfcImport.ImportedLayer.GetCurveCount
•   pfcImport.ImportedLayer.GetTrimmedSurfaceCount
•   pfcImport.ImportedLayer.SetAction
                                                                                        Interface
                 Layers are identified by their names. The method
                 pfcImport.ImportedLayer.GetName returns the name of the
                 layer while the method
                 pfcImport.ImportedLayer.SetNewName can be used to set the
                 name of the layer. The name can be numeric or alphanumeric.
                 The method
                 pfcImport.ImportedLayer.GetTrimmedSurfaceCount returns
                 the number of trimmed surfaces on the layer and the method
                 pfcImport.ImportedLayer.GetCurveCount returns the number
                 of curves on the layer.
Interface                                                                     22 - 31
Plotting Files
                 From Pro/ENGINEER Wilfire 5.0 onwards, the
                 pfcModel.PlotInstructions object containing the instructions
                 for plotting files has been deprecated. All the methods listed below
                 for creating and accessing the instruction attributes in
                 pfcModel.PlotInstructions have also been deprecated. Use
                 the new interface type pfcExport.PrinterInstructions and
                 its methods described in the next section.
Methods Deprecated:
•   pfcModel.pfcModel.PlotInstructions_Create
•   pfcModel.PlotInstructions.GetPlotterName
•   pfcModel.PlotInstructions.SetPlotterName
•   pfcModel.PlotInstructions.GetOutputQuality
•   pfcModel.PlotInstructions.SetOutputQuality
•   pfcModel.PlotInstructions.GetUserScale
•   pfcModel.PlotInstructions.SetUserScale
•   pfcModel.PlotInstructions.GetPenSlew
•   pfcModel.PlotInstructions.SetPenSlew
•   pfcModel.PlotInstructions.GetPenVelocityX
•   pfcModel.PlotInstructions.SetPenVelocityX
•   pfcModel.PlotInstructions.GetPenVelocityY
•   pfcModel.PlotInstructions.SetPenVelocityY
•   pfcModel.PlotInstructions.GetSegmentedOutput
•   pfcModel.PlotInstructions.SetSegmentedOutput
•   pfcModel.PlotInstructions.GetLabelPlot
•   pfcModel.PlotInstructions.SetLabelPlot
•   pfcModel.PlotInstructions.GetSeparatePlotFiles
•   pfcModel.PlotInstructions.SetSeparatePlotFiles
•   pfcModel.PlotInstructions.GetPaperSize
•   pfcModel.PlotInstructions.SetPaperSize
                                                                                          Interface
•   pfcModel.PlotInstructions.SetLastPage
Printing Files
                 The printer instructions for printing a file are defined in
                 pfcExport.PrinterInstructions data object.
Methods Introduced:
•   pfcExport.pfcExport.PrinterInstructions_Create
•   pfcExport.PrinterInstructions.SetPrinterOption
•   pfcExport.PrinterInstructions.SetPlacementOption
•   pfcExport.PrinterInstructions.SetModelOption
•   pfcExport.PrinterInstructions.SetWindowId
                 The method pfcExport.pfcExport.PrinterInstructions_Create
                 creates a new instance of the pfcExport.PrinterInstructions
                 object. The object contains the following instruction attributes:
Interface                                                                       22 - 33
                 •    WindowId—Specifies the current window identifier. Set this
                      attribute using the method
                      pfcExport.PrinterInstructions.SetWindowId.
Printer Options
                 The printer settings for printing a file are defined in the
                 pfcExport.PrintPrinterOption object.
Methods Introduced:
•   pfcExport.pfcExport.PrintPrinterOption_Create
•   pfcSession.BaseSession.GetPrintPrinterOptions
•   pfcExport.PrintPrinterOption.SetDeleteAfter
•   pfcExport.PrintPrinterOption.SetFileName
•   pfcExport.PrintPrinterOption.SetPaperSize
•   pfcExport.Export.PrintSize_Create
•   pfcExport.PrintSize.SetHeight
•   pfcExport.PrintSize.SetWidth
•   pfcExport.PrintSize.SetPaperSize
•   pfcExport.PrintPrinterOption.SetPenTable
•   pfcExport.PrintPrinterOption.SetPrintCommand
•   pfcExport.PrintPrinterOption.SetPrinterType
•   pfcExport.PrintPrinterOption.SetQuantity
•   pfcExport.PrintPrinterOption.SetRollMedia
•   pfcExport.PrintPrinterOption.SetRotatePlot
•   pfcExport.PrintPrinterOption.SetSaveMethod
•   pfcExport.PrintPrinterOption.SetSaveToFile
•   pfcExport.PrintPrinterOption.SetSendToPrinter
•   pfcExport.PrintPrinterOption.SetSlew
•   pfcExport.PrintPrinterOption.SetSwHandshake
•   pfcExport.PrintPrinterOption.SetUseTtf
                 The method pfcExport.pfcExport.PrintPrinterOption_Create
                 creates a new instance of the pfcExport.PrintPrinterOption
                 object.
                                                                                     Interface
            •   FileName—Specifies the name of the file to be printed. Use the
                method pfcExport.PrintPrinterOption.SetFileName to set
                the name.
            •   PaperSize—Specifies the parameters of the paper to be printed
                in terms of the pfcExport.PrintSize object. The method
                pfcExport.PrintPrinterOption.SetPaperSize assigns the
                PaperSize option. Use the method
                pfcExport.Export.PrintSize_Create to create a new
                instance of the pfcExport.PrintSize object. This object
                contains the following options:
                –   Height—Specifies the height of paper. Use the method
                    pfcExport.PrintSize.SetHeight to set the paper height.
                –   Width—Specifies the width of paper. Use the method
                    pfcExport.PrintSize.SetWidth to set the paper width.
                –   PaperSize—Specifies the size of the paper used for the plot
                    in terms of the pfcModel.PlotPaperSize object. Use the
                    method pfcExport.PrintSize.SetPaperSize to set the
                    paper size.
            •   PenTable—Specifies the file containing the pen table. Use the
                method pfcExport.PrintPrinterOption.SetPenTable to set
                this option.
            •   PrintCommand—Specifies the command to be used for
                printing. Use the method
                pfcExport.PrintPrinterOption.SetPrintCommand to set
                the command.
            •   PrinterType—Specifies the printer type. Use the method
                pfcExport.PrintPrinterOption.SetPrinterType to assign
                the type.
            •   Quantity—Specifies the number of copies to be printed. Use the
                method pfcExport.PrintPrinterOption.SetQuantity to
                assign the quantity.
Interface                                                                  22 - 35
          •   RollMedia—Determines if roll media is to be used for printing.
              Set it to true to use roll media. Use the method
              pfcExport.PrintPrinterOption.SetRollMedia to assign this
              option.
          •   RotatePlot—Determines if the plot is rotated by 90 degrees. Set
              it to true to rotate the plot. Use the method
              pfcExport.PrintPrinterOption.SetRotatePlot to set this
              option.
          •   SaveMethod—Specifies the save method in terms of the
              pfcExport.PrintSaveMethod class. Use the method
              pfcExport.PrintPrinterOption.SetSaveMethod to specify
              the save method. The available methods are as follows:
              –   PRINT_SAVE_SINGLE_FILE—Plot is saved to a single
                  file.
              –   PRINT_SAVE_MULTIPLE_FILE—Plot is saved to
                  multiple files.
              –   PRINT_SAVE_APPEND_TO_FILE—Plot is appended to a
                  file.
          •   SaveToFile—Determines if the file is saved after printing. Set it
              to true to save the file after printing. Use the method
              pfcExport.PrintPrinterOption.SetSaveToFile to assign
              this option.
          •   SendToPrinter—Determines if the plot is directly sent to the
              printer. Set it to true to send the plot to the printer. Use the
              method pfcExport.PrintPrinterOption.SetSendToPrinter
              to set this option.
          •   Slew—Specifies the speed of the pen in centimeters per second
              in X and Y direction. Use the method
              pfcExport.PrintPrinterOption.SetSlew to set this option.
          •   SwHandshake—Determines if the software handshake method
              is to be used for printing. Set it to true to use the software
              handshake method. Use the method
              pfcExport.PrintPrinterOption.SetSwHandshake to set
              this option.
          •   UseTtf—Specifies whether TrueType fonts or stroked text is
              used for printing. Set this option to true to use TrueType fonts
              and to false to stroke all text. Use the method
              pfcExport.PrintPrinterOption.SetUseTtf to set this option.
Methods Introduced:
•   pfcExport.pfcExport.PrintPlacementOption_Create
•   pfcSession.BaseSession.GetPrintPlacementOptions
•   pfcExport.PrintPlacementOption.SetBottomOffset
                                                                                             Interface
•   pfcExport.PrintPlacementOption.SetClipPlot
•   pfcExport.PrintPlacementOption.SetKeepPanzoom
•   pfcExport.PrintPlacementOption.SetLabelHeight
•   pfcExport.PrintPlacementOption.SetPlaceLabel
•   pfcExport.PrintPlacementOption.SetScale
•   pfcExport.PrintPlacementOption.SetShiftAllCorner
•   pfcExport.PrintPlacementOption.SetSideOffset
•   pfcExport.PrintPlacementOption.SetX1ClipPosition
•   pfcExport.PrintPlacementOption.SetX2ClipPosition
•   pfcExport.PrintPlacementOption.SetY1ClipPosition
•   pfcExport.PrintPlacementOption.SetY2ClipPosition
                 The method
                 pfcExport.pfcExport.PrintPlacementOption_Create creates a
                 new instance of the pfcExport.PrintPlacementOption object.
                 The method
                 pfcSession.BaseSession.GetPrintPlacementOptions retrieves
                 the placement options.
Interface                                                                          22 - 37
          •   KeepPanzoom—Determines whether pan and zoom values of
              the window are used. Set this option to true use pan and zoom
              and false to skip them. Use the method
              pfcExport.PrintPlacementOption.SetKeepPanzoom to
              set this option.
          •   LabelHeight—Specifies the height of the label in inches. Use
              the method
              pfcExport.PrintPlacementOption.SetLabelHeight to set
              this option.
          •   PlaceLabel—Specifies whether you want to place the label on
              the plot. Use the method
              pfcExport.PrintPlacementOption.SetPlaceLabel to set
              this option.
          •   Scale—Specifies the scale used for the plot. Use the method
              pfcExport.PrintPlacementOption.SetScale to set this
              option.
          •   ShiftAllCorner—Determines whether all corners are shifted.Set
              this option to true to shift all corners or to false to skip shifting
              of corners. Use the method
              pfcExport.PrintPlacementOption.SetShiftAllCorner to
              set this option.
          •   SideOffset—Specifies the offset from the sides. Use the method
              pfcExport.PrintPlacementOption.SetSideOffset to set
              this option.
          •   X1ClipPosition—Specifies the first X parameter for defining the
              clip position. Use the method
              pfcExport.PrintPlacementOption.SetX1ClipPosition to
              set this option.
          •   X2ClipPosition—Specifies the second X parameter for defining
              the clip position. Use the method
              pfcExport.PrintPlacementOption.SetX2ClipPosition to
              set this option.
          •   Y1ClipPosition—Specifies the first Y parameter for defining the
              clip position. Use the method
              pfcExport.PrintPlacementOption.SetY1ClipPosition to
              set this option.
          •   Y2ClipPosition—Specifies the second Y parameter for defining
              the clip position. Use the method
              pfcExport.PrintPlacementOption.SetY2ClipPosition to
              set this option.
Methods Introduced:
•   pfcExport.pfcExport.PrintMdlOption_Create
•   pfcSession.BaseSession.GetPrintMdlOptions
•   pfcExport.PrintMdlOption.SetDrawFormat
                                                                                       Interface
•   pfcExport.PrintMdlOption.SetFirstPage
•   pfcExport.PrintMdlOption.SetLastPage
•   pfcExport.PrintMdlOption.SetLayerName
•   pfcExport.PrintMdlOption.SetLayerOnly
•   pfcExport.PrintMdlOption.SetMdl
•   pfcExport.PrintMdlOption.SetQuality
•   pfcExport.PrintMdlOption.SetSegmented
•   pfcExport.PrintMdlOption.SetSheets
•   pfcExport.PrintMdlOption.SetUseDrawingSize
•   pfcExport.PrintMdlOption.SetUseSolidScale
                 The method pfcExport.pfcExport.PrintMdlOption_Create
                 creates a new instance of the pfcExport.PrintMdlOption object.
Interface                                                                    22 - 39
            •   LayerOnly—Prints the specified layer only. Set this option to
                true to print the specified layer. Use the method
                pfcExport.PrintMdlOption.SetLayerOnly to set this
                option.
            •   Mdl—Specifies the model to be printed. Use the method
                pfcExport.PrintMdlOption.SetMdl to set this option.
            •   Quality—Determines the quality of the model to be printed. It
                checks for no line, no overlap, simple overlap, and complex
                overlap. Use the method
                pfcExport.PrintMdlOption.SetQuality to set this option.
            •   Segmented—If set to true, the printer prints the drawing in
                full size, but in segments that are compatible with the selected
                paper size. This option is available only if you are plotting a
                single page. Use the method
                pfcExport.PrintMdlOption.SetSegmented to set this
                option.
            •   Sheets—Specifies the sheets that need to be printed in terms of
                the pfcExport.PrintSheets class. Use the method
                pfcExport.PrintMdlOption.SetSheets to specify the sheets.
                The sheets can be of the following types:
                –   PRINT_CURRENT_SHEET—Only the current sheet is
                    printed.
                –   PRINT_ALL_SHEETS—All the sheets are printed.
                –   PRINT_SELECTED_SHEETS—Sheets of a specified range
                    are printed.
            •   UseDrawingSize—Overrides the paper size specified in the
                printer options with the drawing size. Set this option to true to
                use the drawing size. Use the method
                pfcExport.PrintMdlOption.SetUseDrawingSize to set this
                option.
            •   UseSolidScale—Prints with the scale used in the solid model.
                Set this option to true to use solid scale. Use the method
                pfcExport.PrintMdlOption.SetUseSolidScale to set this
                option.
•   pfcExport.pfcExport.PrinterPCFOptions_Create
•   pfcExport.PrinterPCFOptions.SetPrinterOption
•   pfcExport.PrinterPCFOptions.SetPlacementOption
•   pfcExport.PrinterPCFOptions.SetModelOption
                 The method pfcExport.pfcExport.PrinterPCFOptions_Create
                 creates a new instance of the pfcExport.PrinterPCFOptions
                                                                                          Interface
                 object.
Solid Operations
Method Introduced:
•   pfcSolid.Solid.CreateImportFeat
                 The method pfcSolid.Solid.CreateImportFeat creates a new
                 import feature in the solid and takes the following input
                 arguments:
Interface                                                                       22 - 41
                      –   INTF_STEP
                      –   INTF_VDA
                      –   INTF_SET
                      –   INTF_PDGS
                      –   INTF_ICEM
                      –   INTF_ACIS
                      –   INTF_DXF
                      –   INTF_CDRS
                      –   INTF_STL
                      –   INTF_VRML
                      –   INTF_PARASOLID
                      –   INTF_AI
                      –   INTF_CATIA_PART
                      –   INTF_UG
                      –   INTF_PRODUCTVIEW
                      –   INTF_CATIA_CGR
                      –   INTF_JT
                  •   CoordSys—The pointer to a reference coordinate system. If this
                      is NULL, the function uses the default coordinate system.
                  •   FeatAttr—The attributes for creation of the new import feature
                      given by the pfcModel.ImportFeatAttr object. If this
                      pointer is NULL, the function uses the default attributes.
                  This method will return a feature object when provided with a solid
                  coordinate system name and an import feature's file name. The
                  method will find the coordinate system in the model, set the Import
                  Feature Attributes, and create an import feature. Then the feature
                  is returned.
import    com.ptc.cipjava.*;
import    com.ptc.pfc.pfcSolid.*;
import    com.ptc.pfc.pfcFeature.*;
import    com.ptc.pfc.pfcModel.*;
import    com.ptc.pfc.pfcModelItem.*;
import    com.ptc.pfc.pfcGeometry.*;
public    class pfcImportFeatureExample {
                                                                             Interface
c_systems = solid.ListItems(ModelItemType.ITEM_COORD_SYS);
for (int i = 0; i < c_systems.getarraysize(); i++)
{
if (c_systems.get(i).GetName().equals(csys))
{
c_system = (CoordSystem)c_systems.get(i);
break;
}
}
/*
* Create the import ImportFeatAttr structure
* Join surfaces, make solids from every closed quilt
* using the add operation
*/
feat_attr = pfcModel.ImportFeatAttr_Create();
feat_attr.SetJoinSurfs(true);
feat_attr.SetMakeSolid(true);
feat_attr.SetOperation(OperationType.ADD_OPERATION);
import_feature = solid.CreateImportFeat(data_source,
                                        c_system,
                                        feat_attr);
}
catch (jxthrowable x)
{
System.out.println("Exception Occured:" + x);
}
return import_feature;
}
}
Window Operations
Method Introduced:
•   pfcWindow.Window.ExportRasterImage
                 The method pfcWindow.Window.ExportRasterImage outputs a
                 standard Pro/ENGINEER raster output file.
Interface                                                          22 - 43
               Example Code: Generating Raster Files
try {
RasterImageExportInstructions instructions =
                                             getRasterInstructions (type);
String ext = getExt (type);
window.ExportRasterImage ("pfcoutput"+ext, instructions);
}
catch (UnsupportedRasterTypeException u)
{
System.out.println ("Unsupported raster file type. No output file
                    produced.");
return;
}
catch (jxthrowable x)
{
System.out.println ("Exception caught: "+x);
x.printStackTrace();
return;
}
return;
}
/**
 * outputScreen takes a BaseSession and outputs a raster image file
 * depicting the current window. This method takes as an argument the
 * type of the raster file, but the size and image quality of the raster
 * file are hardcoded.
try {
RasterImageExportInstructions instructions =
                                            getRasterInstructions (type);
String ext = getExt (type);
session.ExportCurrentRasterImage ("pfcoutput"+ext, instructions);
                                                                              Interface
return;
}
return;
}
/**
 * A helper method which creates a RasterImageExportInstructions object
 *based on the type.*/
private static RasterImageExportInstructions getRasterInstructions
(RasterType type) throws jxthrowable, UnsupportedRasterTypeException
{
double rasterHeight = 7.5;
double rasterWidth = 10.0;
DotsPerInch dpi = DotsPerInch.RASTERDPI_100;
RasterDepth depth = RasterDepth.RASTERDEPTH_24;
RasterImageExportInstructions instructions;
switch (type.getValue())
{
case RasterType._RASTER_BMP:
BitmapImageExportInstructions bmp_instrs =
pfcWindow.BitmapImageExportInstructions_Create (rasterHeight,
                                                rasterWidth);
instructions = bmp_instrs;
break;
case RasterType._RASTER_TIFF:
TIFFImageExportInstructions tiff_instrs =
pfcWindow.TIFFImageExportInstructions_Create (rasterHeight, rasterWidth);
instructions = tiff_instrs;
break;
case RasterType._RASTER_JPEG:
JPEGImageExportInstructions jpeg_instrs =
pfcWindow.JPEGImageExportInstructions_Create (rasterHeight, rasterWidth);
instructions = jpeg_instrs;
break;
case RasterType._RASTER_EPS:
EPSImageExportInstructions eps_instrs =
pfcWindow.EPSImageExportInstructions_Create (rasterHeight, rasterWidth);
instructions = eps_instrs;
break;
default:
Interface                                                           22 - 45
throw new UnsupportedRasterTypeException(type);
// This is not required, but it maintains the code even if new Raster
types are added in a future release. The method will throw and catch the
exception until the code can be updated with new types.
}
instructions.SetImageDepth (depth);
instructions.SetDotsPerInch (dpi);
return instructions;
}
/**
 * Helper method to get the file extension corresponding to a RasterType.
*/
private static String getExt (RasterType type)
{
switch (type.getValue())
{
case RasterType._RASTER_BMP:
return ".bmp";
case RasterType._RASTER_TIFF:
return ".tiff";
case RasterType._RASTER_JPEG:
return ".jpg";
case RasterType._RASTER_EPS:
return ".eps";
default:
return "Invalid";
}
}
}
Topic Page
   Overview                                                      23 - 2
   Retrieving Simplified Representations                         23 - 3
   Creating and Deleting Simplified Representations              23 - 4
   Extracting Information About Simplified Representations       23 - 5
   Modifying Simplified Representations                          23 - 8
   Simplified Representation Utilities                           23 - 9
                                                                  23 - 1
Overview
           Using J-Link, you can create and manipulate assembly simplified
           representations just as you can using Pro/ENGINEER
           interactively.
                         Values                             Action
               SIMPREP_NONE                     No action is specified.
               SIMPREP_REVERSE                  Reverse the default rule for
                                                this component (for example,
                                                include it if the default rule is
                                                exclude).
               SIMPREP_INCLUDE                  Include this component in the
                                                simplified representation.
                                                                                          Representations
                                                      component.
                                                                                            Simplified
                    SIMPREP_GRAPHICS                  Use only the graphics
                                                      representation of the
                                                      component.
•   pfcSession.BaseSession.RetrieveAssemSimpRep
•   pfcSession.BaseSession.RetrieveGeomSimpRep
•   pfcSession.BaseSession.RetrieveGraphicsSimpRep
•   pfcSession.BaseSession.RetrieveSymbolicSimpRep
•   pfcSimpRep.pfcSimpRep.RetrieveExistingSimpRepInstructions_Create
                   You can retrieve a named simplified representation from a model
                   using the method
                   pfcSession.BaseSession.RetrieveAssemSimpRep, which is
                   analogous to the Assembly mode option Retrieve Rep in the
                   SIMPLFD REP menu. This method retrieves the object of an existing
                   simplified representation from an assembly without fetching the
                   generic representation into memory. The method takes two
                   arguments, the name of the assembly and the simplified
                   representation data.
Simplified Representations                                                       23 - 3
                 You can retrieve geometry, graphics, and symbolic simplified
                 representations into session using the methods
                 pfcSession.BaseSession.RetrieveGeomSimpRep,
                 pfcSession.BaseSession.RetrieveGraphicsSimpRep, and
                 pfcSession.BaseSession.RetrieveSymbolicSimpRep
                 respectively. Like
                 pfcSession.BaseSession.RetrieveAssemSimpRep, these
                 methods retrieve the simplified representation without bringing the
                 master representation into memory. Supply the name of the
                 assembly whose simplified representation is to be retrieved as the
                 input parameter for these methods. The methods output the
                 assembly. They do not display the simplified representation.
•   pfcSimpRep.pfcSimpRep.CreateNewSimpRepInstructions_Create
•   pfcSolid.Solid.CreateSimpRep
•   pfcSolid.Solid.DeleteSimpRep
                 To create a simplified representation, you must allocate and fill a
                 pfcSimpRep.SimpRepInstructions object by calling the method
                 pfcSimpRep.pfcSimpRep.CreateNewSimpRepInstructions_
                 Create. Specify the name of the new simplified representation as
                 an input to this method. You should also set the default action type
                 and add SimpRepItems to the object.
•   pfcSimpRep.SimpRep.GetInstructions
•   pfcSimpRep.SimpRepInstructions.GetDefaultAction
                                                                                          Representations
•   pfcSimpRep.CreateNewSimpRepInstructions.GetNewSimpName
                                                                                            Simplified
•   pfcSimpRep.SimpRepInstructions.GetIsTemporary
•   pfcSimpRep.SimpRepInstructions.GetItems
                   Given the object to a simplified representation,
                   pfcSimpRep.SimpRep.GetInstructions fills out the
                   pfcSimpRep.SimpRepInstructions object.
                   The pfcSimpRep.SimpRepInstructions.GetDefaultAction,
                   pfcSimpRep.CreateNewSimpRepInstructions.GetNewSimp
                   Name, and
                   pfcSimpRep.SimpRepInstructions.GetIsTemporary methods
                   return the associated values contained in the
                   pfcSimpRep.SimpRepInstructions object.
Simplified Representations                                                       23 - 5
                           com.ptc.pfc.pfcSimpRep.SimpRepActionType type)
{
       try{
       Assembly root_assembly;//The parent assembly
       ModelItems mitems;//All modelitems of type ITEM_SIMPREP from the
                           assembly
       ModelItem mitem;//A modelitem of type ITEM_SIMPREP
       int num_simpreps;//The total number of simp. reps. in the assembly.
       CreateNewSimpRepInstructions instrs;//The instruction object
                                           //for the simplified
                                                         representation.
       SimpRepItems simprepitems;//the components of the simplified rep.
       int num_inst;//the number of components in a simp rep.
       SimpRepItem simitem;//a single component in a simp rep.
       SimpRepActionType action;//the action of a certain SimpRepItem
       boolean found = false;//a check for the match in the outer loop
      boolean equal_intseq = false;//a check if the two sequences are equal
       intseq item_path;//A int sequence path to a given comp of a SimpRep
      SimpRep[] simpreps;//an array of found simpreps to be passed back to
                            user
       Vector simpr = new Vector();//a vector for storing the found reps
       root_assembly = path.GetRoot();
       mitems = root_assembly.ListItems(ModelItemType.ITEM_SIMPREP);
       num_simpreps = mitems.getarraysize();
       if (mitems == null)
         {
         System.out.println("No Simplified Representations exist");
         return null;
         }
       for (int i = 0; i < num_simpreps; i++)
       {
     SimpRep rep = (SimpRep)mitems.get(i);
 System.out.println("Found Simplified representation: " + Sname);
 instrs = (CreateNewSimpRepInstructions)rep.GetInstructions();
 simprepitems = instrs.GetItems();
 num_inst = simprepitems.getarraysize();
 for (int j = 0; j < num_inst; j++)
 {
    simitem = simprepitems.get(i);
         if (simitem.GetItemPath() instanceof SimpRepCompItemPath)
         {
    item_path =
               ((SimpRepCompItemPath)simitem.GetItemPath()).GetItemPath();
    equal_intseq = CompareSeq(item_path, path.GetComponentIds());
    if (equal_intseq)
    {
        action = simitem.GetAction().GetType();
        if (action .equals(type))
        {
  System.out.println("Found a match: SimpRep: " + srep.GetName());
  simpr.addElement(srep);
                                                                             Representations
                     description");
 return null;
                                                                               Simplified
      }
      else
      {
 simpreps = new SimpRep [simpr.size()];
 simpr.copyInto(simpreps);
 return simpreps;
      }
      }
      catch (jxthrowable x)
      {
 System.out.println("Exception Caught " + x);
 x.printStackTrace();
      }
      return null;
   }
   /**
   * This method compares to intseq object for equivalence
   **/
   public static boolean CompareSeq(intseq seq1, intseq seq2) throws
                                                              jxthrowable
{
      int len1 = seq1.getarraysize();
      int len2 = seq2.getarraysize();
      if (len1 != len2)
 return false;
      for (int i = 0; i < len1; i++)
 if (seq1.get(i) != seq2.get(i))
    return false;
      return true;
   }
}
Simplified Representations                                          23 - 7
Modifying Simplified Representations
Methods Introduced:
•   pfcSimpRep.SimpRep.GetInstructions
•   pfcSimpRep.SimpRep.SetInstructions
•   pfcSimpRep.SimpRepInstructions.SetDefaultAction
•   pfcSimpRep.CreateNewSimpRepInstructions.SetNewSimpName
•   pfcSimpRep.SimpRepInstructions.SetIsTemporary
                 Using J-Link, you can modify the attributes of existing simplified
                 representations. After you create or retrieve a simplified
                 representation, you can make calls to the set methods listed in this
                 section to designate new values for the fields in the
                 pfcSimpRep.SimpRepInstructions object.
•   pfcSimpRep.SimpRepInstructions.SetItems
•   pfcSimpRep.pfcSimpRep.SimpRepItem_Create
•   pfcSimpRep.SimpRep.SetInstructions
•   pfcSimpRep.pfcSimpRep.SimpRepReverse_Create
•   pfcSimpRep.pfcSimpRep.SimpRepInclude_Create
•   pfcSimpRep.pfcSimpRep.SimpRepExclude_Create
•   pfcSimpRep.pfcSimpRep.SimpRepSubstitute_Create
•   pfcSimpRep.pfcSimpRep.SimpRepGeom_Create
•   pfcSimpRep.pfcSimpRep.SimpRepGraphics_Create
                                                                                              Representations
How to Add Items
                                                                                                Simplified
                   1.   Get the pfcSimpRep.SimpRepInstructions object, as
                        described in the previous section.
                   2.   Specify the action to be applied to the item with a call to one of
                        following methods.
                   3.   Initialize a pfcSimpRep.SimpRepItem object for the item by
                        calling the method
                        pfcSimpRep.pfcSimpRep.SimpRepItem_Create .
                   4.   Add the item to the pfcSimpRep.SimpRepItem sequence. Put
                        the new pfcSimpRep.SimpRepInstructions using
                        pfcSimpRep.SimpRepInstructions.SetItems .
                   5.   Reassign the pfcSimpRep.SimpRepInstructions object to
                        the corresponding pfcSimpRep.SimpRep object by calling
                        pfcSimpRep.SimpRep.SetInstructions .
•   pfcModelItem.ModelItemOwner.ListItems
•   pfcModelItem.ModelItemOwner.GetItemById
•   pfcSolid.Solid.GetSimpRep
•   pfcSolid.Solid.SelectSimpRep
•   pfcSolid.Solid.ActivateSimpRep
•   pfcSolid.Solid.GetActiveSimpRep
Simplified Representations                                                           23 - 9
          This section describes the utility methods that relate to simplified
          representations.
Topic Page
Overview                                                   24 - 2
Starting and Stopping Pro/ENGINEER                         24 - 4
Connecting to a Pro/ENGINEER Process                       24 - 7
Full Asynchronous Mode                                     24 - 9
Troubleshooting Asynchronous J-Link                      24 - 14
                                                           24 - 1
Overview
           Asynchronous mode is a multiprocess mode in which the J-Link
           application and Pro/ENGINEER can perform concurrent
           operations. Unlike the synchronous modes, asynchronous mode
           uses JNI (Java Native Interface) and RPC (remote procedure calls)
           as the means of communication between the application and
           Pro/ENGINEER.
                                                                                           Asynchronous Mode
                    Environment section of the System window that you access from
                    the Control Panel.
Asynchronous Mode                                                                 24 - 3
                 Asynchronous J-Link applications must load the pfcasyncmt
                 library prior to calls made to the asynchronous methods. This can
                 be accomplished by adding the following line to your application.
System.loadLibrary (“pfcasyncmt”)
Methods Introduced:
•    pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_Start
•    pfcAsyncConnection.AsyncConnection.End
                                                                                             Asynchronous Mode
                    applications are not terminated when Pro/ENGINEER terminates.
                    This is useful when the application needs to perform
                    Pro/ENGINEER operations intermittently, and therefore, must
                    start and stop Pro/ENGINEER more than once during a session.
Asynchronous Mode                                                                   24 - 5
Example Code
                 This example demonstrates how to use J-Link in asynchronous
                 mode. The method starts Pro/ENGINEER asynchronously,
                 retrieves a Session, and opens a model in Pro/ENGINEER.
import   com.ptc.cipjava.*;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcAsyncConnection.*;
/**
 * This asynchronous class is a simple asynchronous application. It makes
 * Pro/ENGINEER run in batch mode, without user input. The application
 * starts Pro/ENGINEER, performs the designated operations, and shuts down
 * Pro/ENGINEER.
 */
public class pfcAsyncStartExample {
            AsyncConnection connection =
                              pfcAsyncConnection.AsyncConnection_Start
                              ("pro -g:no_graphics -i:rpc_input", null);
        catch (jxthrowable x)
          {
            System.out.println("Exception: " + x);
          }
    }
                                                                                          Asynchronous Mode
Connecting to a Pro/ENGINEER Process
Methods Introduced:
•   pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_Connect
•   pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_ConnectWS
•   pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_GetActive
    Connection
•   pfcAsyncConnection.AsyncConnection.Disconnect
                    A simple asynchronous application can also connect to a
                    Pro/ENGINEER process that is already running on a local
                    computer. The method
                    pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
                    _Connect performs this connection. This method fails to connect if
                    multiple Pro/ENGINEER sessions are running. If several versions
                    of Pro/ENGINEER are running on the same computer, try to
                    connect by specifying user and display parameters. However, if
                    several versions of Pro/ENGINEER are running in the same user
                    and display parameters, the connection may not be possible.
                    pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
                    _ConnectWS connects to both Pro/ENGINEER and
                    Pro/INTRALINK 3.x workspaces simultaneously.
                    pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
                    _GetActiveConnection returns the current connection to a
                    Pro/ENGINEER session.
Asynchronous Mode                                                                24 - 7
                 The connection to a Pro/ENGINEER process uses information
                 provided by the name service daemon. The name service daemon
                 accepts and supplies information about the processes running on
                 the specified hosts. The application manager, for example, uses the
                 name service when it starts up Pro/ENGINEER and other
                 processes. The name service daemon is set up as part of the
                 Pro/ENGINEER installation.
•   pfcAsyncConnection.AsyncConnection.GetConnectionId
•   pfcAsyncConnection.ConnectionId.GetExternalRep
•   pfcSession.BaseSession.GetConnectionId
•   pfcAsyncConnection.pfcAsyncConnection.ConnectionId_Create
•   pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_ConnectById
                 Each Pro/ENGINEER process maintains a unique identity for
                 communications purposes. Use this ID to reconnect to a
                 Pro/ENGINEER process.
                 The method
                 pfcAsyncConnection.AsyncConnection.GetConnectionId
                 returns a data structure containing the connection ID.
                 The method
                 pfcAsyncConnection.pfcAsyncConnection.ConnectionId_Cr
                 eate takes a string representation and creates a ConnectionId
                 data object. The method
                 pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
                 _ConnectById connects to Pro/ENGINEER at the specified
                 connection ID.
•   pfcAsyncConnection.AsyncConnection.IsRunning
                    To find out whether a Pro/ENGINEER process is running, use the
                    method pfcAsyncConnectionAsyncConnection.IsRunning.
                                                                                            Asynchronous Mode
Getting the Session Object
Method Introduced:
•   pfcAsyncConnection.AsyncConnection.GetSession
                    The method
                    pfcAsyncConnection.AsyncConnection.GetSession returns
                    the session object representing the Pro/ENGINEER session. Use
                    this object to access the contents of the Pro/ENGINEER session.
                    See the Session Objects chapter for additional information.
Methods Introduced:
•   pfcAsyncConnection.AsyncConnection.EventProcess
•   pfcAsyncConnection.AsyncConnection.WaitForEvents
•   pfcAsyncConnection.AsyncConnection.InterruptEventProcessing
•   pfcAsyncConnection.AsyncActionListener.OnTerminate
Asynchronous Mode                                                                  24 - 9
          The control loop of an application running in full asynchronous
          mode must contain a call to the method
          pfcAsyncConnection.AsyncConnection.EventProcess, which
          takes no arguments. This method allows the application to respond
          to messages sent from Pro/ENGINEER. For example, if the user
          selects a menu button that is added by your application,
          pfcAsyncConnection.AsyncConnection.EventProcess
          processes the call to your listener and returns when the call
          completes. For more information on listeners and adding menu
          buttons, see the Session Objects chapter.
          The method
          pfcAsyncConnection.AsyncConnection.WaitForEvents
          provides an alternative to the development of an event processing
          loop in a full asynchronous mode application. Call this function to
          have the application wait in a loop for events to be passed from
          Pro/ENGINEER. No other processing takes place while the
          application is waiting. The loop continues until
          pfcAsyncConnection.AsyncConnection.InterruptEventProc
          essing is called from a J-Linkcallback action, or until the
          application detects the termination of Pro/ENGINEER.
                                                                                              Asynchronous Mode
                         listener.
                    2.   The application goes into a control loop calling EventProcess
                         which allows the application to respond to the Pro/ENGINEER
                         events.
import   com.ptc.cipjava.*;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcCommand.*;
import   com.ptc.pfc.pfcAsyncConnection.*;
import   com.ptc.pfc.pfcExceptions.*;
Asynchronous Mode                                                                   24 - 11
          addTerminationListener ();
          addMenuButton();
          while (!exit_flag)
            {
              // Could do other regular processing here, but the
                 EventProcess()calls should happen regularly, so that
                 Pro/ENGINEER does not appear slow in responding to menu
                 button picks //
                try
                  {
                      connection.EventProcess ();
                      Thread.sleep (100);
                  }
                catch (java.lang.InterruptedException ex)
                  {
                  }
            }
          // Wait here a bit so Pro/ENGINEER can finish shutting down.
          try
            {
                Thread.sleep (2000);
                connection.EventProcess ();
            }
          catch (java.lang.InterruptedException ex)
            {
            }
    }
  /**
   * Starts Pro/ENGINEER.
   */
  void startProE (String[] args) throws com.ptc.cipjava.jxthrowable
    {
      try
        {
          // args[0] = Pro/ENGINEER command
          // args[1] = text path for menu/message files
         connection = pfcAsyncConnection.AsyncConnection_Start (args [0],
args[1]);
        }
      catch (XToolkitGeneralError error)
        {
          printMsg ("Could not start Pro/ENGINEER.");
          System.exit (0);
        }
      return;
    }
  /**Adds a menu and a menu button to the Pro/E menubar.*/
  void addMenuButton () throws com.ptc.cipjava.jxthrowable
    {
                                                                                   Asynchronous Mode
    void addTerminationListener () throws com.ptc.cipjava.jxthrowable
      {
        connection.AddActionListener ((AsyncActionListener)this);
        printMsg ("Termination listener added.");
      }
     }
}
Asynchronous Mode                                                        24 - 13
Troubleshooting Asynchronous J-Link
General Problems
             •   pfcasyncmt
             •   jnicipjavamtz
             •   jniadaptsmtz
             •   cipstdmtz
             •   ctoolsmtz
             •   baselibmtz
             •   i18nmtz
             Look at what is printed on stdout/stderr. There can be
             unresolved symbols. NT usually reports unresolved symbols in a
             pop-up dialog so you will see it immediately. UNIX systems will
             print the error to stderr. If that does not help, then enable the
             debug output from the operating system's dynamic loader, start
             with reading the main page.
                                                                                               Asynchronous Mode
                    CLASSPATH, usually to the CLASSPATH environment or an
                    appropriate place in your servlet engine's configuration.
                    Make sure that you have jar files from only one version of J-Link in
                    your CLASSPATH. If you have both async and sync jar files, the
                    VM will pick up incorrect classes.
                    pfcExceptions.XToolkitGeneralError or
                    pfcExceptions.CommError on the first call to
                    pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
                    _Start or
                    pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
                    _Connect.
Asynchronous Mode                                                                    24 - 15
              pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
              _Start hangs, even though Pro/ENGINEER already started.
              pfcExceptions.XToolkitGeneralError or
              pfcExceptions.CommError on the first call to
              pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
              _Start or
              pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
              _Connect
Topic Page
                                                                25 - 1
Managing Application Arguments
                 J-Link passes application data to and from tasks in other
                 applications as members of a sequence of pfcArgument.Argument
                 objects. Application arguments consist of a label and a value. The
                 value may be of any one of the following types:
                 •    Integer
                 •    Double
                 •    Boolean
                 •    ASCII string (a non-encoded string, provided for compatibility
                      with arguments provided from C applications)
                 •    String (a fully encoded string)
                 •    pfcSelect.Selection (a selection of an item in a
                      Pro/ENGINEER session)
                 •    pfcBase.Transform3D (a coordinate system transformation
                      matrix)
Methods Introduced:
•   pfcArgument.pfcArgument.CreateIntArgValue
•   pfcArgument.pfcArgument.CreateDoubleArgValue
•   pfcArgument.pfcArgument.CreateBoolArgValue
•   pfcArgument.pfcArgument.CreateASCIIStringArgValue
•   pfcArgument.pfcArgument.CreateStringArgValue
•   pfcArgument.pfcArgument.CreateSelectionArgValue
•   pfcArgument.pfcArgument.CreateTransformArgValue
•   pfcArgument.ArgValue.Getdiscr
•   pfcArgument.ArgValue.GetIntValue
•   pfcArgument.ArgValue.SetIntValue
•   pfcArgument.ArgValue.GetDoubleValue
•   pfcArgument.ArgValue.SetDoubleValue
•   pfcArgument.ArgValue.GetBoolValue
•   pfcArgument.ArgValue.SetBoolValue
•   pfcArgument.ArgValue.GetASCIIStringValue
•   pfcArgument.ArgValue.SetASCIIStringValue
                                                                                         Application Libraries
•   pfcArgument.ArgValue.SetTransformValue
                   The class pfcArgument.ArgValue contains one of the seven types
                                                                                             Task Based
                   of values. J-Link provides different methods to create each of the
                   seven types of argument values.
                   Use the methods listed above to access and modify the argument
                   values.
Modifying Arguments
Methods Introduced:
•   pfcArgument.pfcArgument.Argument_Create
•   pfcArgument.Arguments.create
•   pfcArgument.Argument.GetLabel
•   pfcArgument.Argument.SetLabel
•   pfcArgument.Argument.GetValue
•   pfcArgument.Argument.SetValue
                   The method pfcArgument.pfcArgument.Argument_Create
                   creates a new argument. Provide a name and value as the input
                   arguments of this method.
Methods Introduced:
•   pfcSession.BaseSession.LoadProToolkitDll
•   pfcSession.BaseSession.LoadProToolkitLegacyDll
•   pfcSession.BaseSession.GetProToolkitDll
•   pfcProToolkit.Dll.ExecuteFunction
•   pfcProToolkit.Dll.GetId
•   pfcProToolkit.Dll.IsActive
•   pfcProToolkit.Dll.Unload
                  Use the method pfcSession.BaseSession.LoadProToolkitDll to
                  register and start a Pro/TOOLKIT DLL. The input parameters of
                  this method are similar to the fields of a registry file and are as
                  follows:
                                                                                            Application Libraries
                       Note:   The method
                               pfcSession.BaseSession.LoadProToolkitLegacyDll
                                                                                                Task Based
                               must be used only by a pre-Widlfire 4.0 J-Link
                               application to load a pre-Wildfire 4.0 Pro/TOOLKIT
                               DLL.
                   Use the method pfcSession.BaseSession.GetProToolkitDll to
                   obtain a Pro/TOOLKIT DLL handle. Specify the Application_Id,
                   that is, the DLL’s identifier string as the input parameter of this
                   method. The method returns the DLL object or null if the DLL was
                   not in session. The Application_Id can be determined as follows:
Methods Introduced:
•   pfcSession.BaseSession.RegisterTask
•   pfcJLink.JLinkTaskListener.OnExecute
•   pfcSession.BaseSession.UnregisterTask
                 Use the method pfcSession.BaseSession.RegisterTask to
                 register the task or tasks to be executed. This method has two input
                 parameters:
                                                                                             Application Libraries
                   when you exit the application using the application's stop method.
                                                                                                 Task Based
Launching Tasks from J-Link Task Libraries
                   The methods described in this section allow you to launch tasks
                   from a predefined J-Link task library.
Methods Introduced:
•   pfcSession.BaseSession.StartJLinkApplication
•   pfcJLink.JLinkApplication.ExecuteTask
•   pfcJLink.JLinkApplication.IsActive
•   pfcJLink.JLinkApplication.Stop
                   Use the method
                   pfcSession.BaseSession.StartJLinkApplication to start a
                   J-Link application. The input parameters of this method are
                   similar to the fields of a registry file and are as follows:
Topic Page
Overview                                                      26 - 2
Getting Mouse Input                                           26 - 2
Displaying Graphics                                           26 - 3
Display Lists and Graphics                                    26 - 8
                                                              26 - 1
Overview
                 The methods described in this section allow you to draw temporary
                 graphics in a display window. Methods that are identified as 2D are
                 used to draw entities (arcs, polygons, and text) in screen
                 coordinates. Other entities may be drawn using the current model’s
                 coordinate system or the screen coordinate system’s lines, circles,
                 and polylines. Methods are also included for manipulating text
                 properties and accessing mouse inputs.
                 •    MOUSE_BTN_LEFT
                 •    MOUSE_BTN_RIGHT
                 •    MOUSE_BTN_MIDDLE
                 •    MOUSE_BTN_LEFT_DOUBLECLICK
Methods Introduced:
•   pfcSession.Session.UIGetNextMousePick
•   pfcSession.Session.UIGetCurrentMouseStatus
                 The method pfcSession.Session.UIGetNextMousePick returns
                 the mouse position when you press a mouse button. The input
                 argument is the mouse button that you expect the user to select.
Method Introduced:
•   pfcSession.Session.UIPickMouseBox
                 The method pfcSession.Session.UIPickMouseBox draws a
                 dynamic rectangle from a specified point in screen coordinates to
                 the current mouse position until the user presses the left mouse
                                                                                        Graphics
                 button. The return value for this method is of the type
                 pfcBase.Outline3D.
Displaying Graphics
                 All the methods in this section draw graphics in the
                 Pro/ENGINEER current window and use the color and linestyle set
                 by calls to pfcSession.BaseSession.SetStdColorFromRGB and
                 pfcSession.BaseSession.SetLineStyle. The methods draw the
                 graphics in the Pro/ENGINEER graphics color. The default
                 graphics color is white.
Methods Introduced:
•   pfcDisplay.Display.SetPenPosition
•   pfcDisplay.Display.DrawLine
•   pfcDisplay.Display.DrawPolyline
•   pfcDisplay.Display.DrawCircle
•   pfcDisplay.Display.DrawArc2D
•   pfcDisplay.Display.DrawPolygon2D
Graphics                                                                       26 - 3
                 The method pfcDisplay.Display.SetPenPosition sets the point
                 at which you want to start drawing a line. The method
                 pfcDisplay.Display.DrawLine draws a line to the given point
                 from the position given in the last call to either of the two methods.
                 Call pfcDisplay.Display.SetPenPosition() for the start of the
                 polyline, and pfcDisplay.Display.DrawLine for each vertex. If
                 you use these methods in two-dimensional modes, use screen
                 coordinates instead of solid coordinates.
•   pfcDisplay.Display.GetCurrentGraphicsColor
•   pfcDisplay.Display.SetCurrentGraphicsColor
•   pfcDisplay.Display.GetCurrentGraphicsMode
•   pfcDisplay.Display.SetCurrentGraphicsMode
                 The method pfcDisplay.Display.GetCurrentGraphicsColor
                 returns the Pro/ENGINEER standard color used to display
                 graphics. The Pro/ENGINEER default is COLOR_DRAWING
                 (white). The method
                 pfcDisplay.Display.SetCurrentGraphicsColor allows you to
                 change the color used to draw subsequent graphics.
                 •    DRAW_GRAPHICS_NORMAL—Pro/ENGINEER draws
                      graphics in the required color in each invocation.
                                                                                     Graphics
               draw graphics on the screen. The static method
               DrawRubberbandLine prompts the user to pick a screen point.
               The example uses the ‘complement mode’ to cause the line to
               display and erase as the user moves the mouse around the window.
      session.UIDisplayMessage (MSGFILE,
            "USER Pick first location for rubberband line",
            null);
      /* Expect the user to pick with left button */
      mouse = session.UIGetNextMousePick (MouseButton.MOUSE_BTN_LEFT);
Graphics                                                                    26 - 5
/*Get mouse position */
  mouse = session.UIGetCurrentMouseStatus (false);
  while (mouse.GetSelectedButton () == null)
       {
     session.SetPenPosition (first_pos);
     Point3D second_pos = transformPosition (session,mouse.GetPosition());
     session.SetCurrentGraphicsMode (current_mode);
     return;
     }
          return out;
     }
}
                                                                                           Graphics
•   pfcDisplay.Display.DrawText2D
                 The method pfcDisplay.Display.DrawText2D places text at a
                 position specified in screen coordinates. If you want to add text to a
                 particular position on the solid, you must transform the solid
                 coordinates into screen coordinates by using the view matrix.
•   pfcDisplay.Display.GetTextHeight
•   pfcDisplay.Display.SetTextHeight
•   pfcDisplay.Display.GetWidthFactor
•   pfcDisplay.Display.SetWidthFactor
•   pfcDisplay.Display.GetRotationAngle
•   pfcDisplay.Display.SetRotationAngle
•   pfcDisplay.Display.GetSlantAngle
•   pfcDisplay.Display.SetSlantAngle
                 These methods control the attributes of text added by calls to
                 pfcDisplay.Display.DrawText2D.
Graphics                                                                          26 - 7
                 •    Slant angle of the text, in clockwise degrees
•   pfcDisplay.Display.GetDefaultFont
•   pfcDisplay.Display.GetCurrentFont
•   pfcDisplay.Display.SetCurrentFont
•   pfcDisplay.Display.GetFontById
•   pfcDisplay.Display.GetFontByName
                 The method pfcDisplay.Display.GetDefaultFont returns the
                 default Pro/ENGINEER text font. The text fonts are identified in
                 Pro/ENGINEER by names and by integer identifiers. To find a
                 specific font, use the methods pfcDisplay.Display.GetFontById
                 or pfcDisplay.Display.GetFontByName.
                 When you add graphics items to the 2D display list, they will be
                 regenerated after each repaint (when zooming and panning) and
                 will be included in plots created by Pro/ENGINEER. When you add
                 graphics to the 3D display list, you get the further benefit that the
                 graphics survive a change to the orientation of the solid and are
                 displayed even when you spin the solid dynamically.
•   pfcDisplay.DisplayListener.OnDisplay
•   pfcDisplay.Display.CreateDisplayList2D
•   pfcDisplay.Display.CreateDisplayList3D
•   pfcDisplay.DisplayList2D.Display
•   pfcDisplay.DisplayList3D.Display
•   pfcDisplay.DisplayList2D.Delete
                                                                                             Graphics
•   pfcDisplay.DisplayList3D.Delete
                 A display listener is a class that acts similarly to an action listener.
                 You must implement the method inherited from the
                 pfcDisplay.DisplayListener interface. The implementation
                 should provide calls to methods on the provided
                 pfcDisplay.Display object to produce 2D or 3D graphics.
                 pfcDisplay.DisplayList2D.Display or
                 pfcDisplay.DisplayList3D.Display will display or redisplay the
                 elements in your display list. The application should delete the
                 display list data when it is no longer needed.
Exceptions
                 Possible exceptions that might be thrown by displaying graphics
                 methods are shown in the following table:
Graphics                                                                            26 - 9
                         Exception                           Reason
                    XToolkitNotExist         The display list is empty.
                    XToolkitNotFound         The method could not find the display
                                             list or the font specified in a previous
                                             call to
                                             pfcDisplay.Display.SetCurrentFon
                                             t was not found.
                    XToolkitCantOpen         The use of display lists is disabled.
                    XToolkitAbort            The display was aborted.
                    XToolkitNotValid         The specified display list is invalid.
                    XToolkitInvalidItem      There is an invalid item in the display
                                             list.
                    XToolkitGeneralError     The specified display list is already in
                                             the process of being displayed.
Example Code
                   This example demonstrates the use of pfcDisplay methods with
                   3D display lists. The static method AddCircleDisplay() creates a
                   new 3D display list whose graphics are generated by the code in the
                   OnDisplay() method of the Display Circles class. This display list
                   places circles at all of the vertices of a part model on the screen.
package com.ptc.jlinkexamples;
import     com.ptc.pfc.pfcDisplay.*;
import     com.ptc.pfc.pfcSession.*;
import     com.ptc.pfc.pfcModel.*;
import     com.ptc.pfc.pfcModelItem.*;
import     com.ptc.pfc.pfcGeometry.*;
import     com.ptc.pfc.pfcBase.*;
import     com.ptc.cipjava.*;
                                                                                   Graphics
}
/*======================================================================*
\
      CLASS:   DisplayCircles
      PURPOSE: Display list listener class - determines how the display
list
              shows the graphics.
\*======================================================================*
\
class DisplayCircles extends DefaultDisplayListener
{
  private static final double RADIUS = 0.5; // Constant for circle size
             display.SetCurrentGraphicsColor (StdColor.COLOR_ERROR);
                    // Use error color: magenta
Graphics                                                                 26 - 11
               Point3D vertex_1 = edge.Eval3DData(0.0).GetPoint();
               Point3D vertex_2 = edge.Eval3DData(1.0).GetPoint();
Topic Page
External Data                                          27 - 2
Exceptions                                             27 - 9
                                                       27 - 1
External Data
                This chapter describes how to store and retrieve external data.
                External data enables a J-Link application to store its own data in
                a Pro/ENGINEER database in such a way that it is invisible to the
                Pro/ENGINEER user. This method is different from other means of
                storage accessible through the Pro/ENGINEER user interface.
                                                                                          External Data
                   J-Link and Pro/TOOLKIT share external data in the same manner.
                   J-Link external data is accessible by Pro/TOOLKIT and the reverse
                   is also true. However, an error will result if J-Link attempts to
                   access external data previously stored by Pro/TOOLKIT as a
                   stream.
•     pfcModel.Model.AccessExternalData
•     pfcModel.Model.TerminateExternalData
•     pfcExternal.ExternalDataAccess.IsValid
                   The method pfcModel.Model.AccessExternalData prepares
                   Pro/ENGINEER to read external data from the model file. It
                   returns the pfcExternal.ExternalDataAccess object that is
                   used to read and write data. This method should be called only once
                   for any given model in session.
External Data                                                                    27 - 3
Storing External Data
Methods Introduced:
•   pfcExternal.ExternalDataAccess.CreateClass
•   pfcExternal.ExternalDataClass.CreateSlot
•   pfcExternal.ExternalDataSlot.SetValue
                 The first step in storing external data in a new class and slot is to
                 set up a class using the method
                 pfcExternal.ExternalDataAccess.CreateClass, which provides
                 the class name. The method outputs
                 pfcExternal.ExternalDataClass, used by the application to
                 reference the class.
•   pfcExternal.pfcExternal.CreateIntExternalData
•   pfcExternal.pfcExternal.CreateDoubleExternalData
•   pfcExternal.pfcExternal.CreateStringExternalData
                 These methods initialize a pfcExternal.ExternalData object
                 with the appropriate data inputs.
•   pfcExternal.ExternalDataAccess.LoadAll
•   pfcExternal.ExternalDataAccess.ListClasses
•   pfcExternal.ExternalDataClass.ListSlots
•   pfcExternal.ExternalDataSlot.GetValue
                                                                                      External Data
•   pfcExternal.ExternalData.Getdiscr
•   pfcExternal.ExternalData.GetIntegerValue
•   pfcExternal.ExternalData.GetDoubleValue
•   pfcExternal.ExternalData.GetStringValue
                 For improved performance, external data is not loaded
                 automatically into memory with the model. When the model is in
                 session, call the method
                 pfcExternal.ExternalDataAccess.LoadAll to retrieve all the
                 external data for the specified model from the Pro/ENGINEER
                 model file and put it in the workspace. The method needs to be
                 called only once to retrieve all the data.
                 •    pfcExternal.ExternalData.GetIntegerValue
                 •    pfcExternal.ExternalData.GetDoubleValue
                 •    pfcExternal.ExternalData.GetStringValue
External Data                                                                27 - 5
Example Code
                  This example demonstrates the usage of external data in J-Link. It
                  provides utility methods to convert a Java hashtable
                  (java.util.Hashtable) to a model's external data, and to convert
                  external data to a hashtable.
                   + Any other Java object = String external data using the object's
                  toString() method.
package com.ptc.jlinkexamples;
import com.ptc.pfc.pfcExternal.*;
import com.ptc.pfc.pfcModel.*;
                                                                                    External Data
              }
            else
              {
                /* If value is a String, toString() returns its value.
                   Else, value becomes the String representation of the
Object.*/
                    String str_value = value.toString();
                    data = pfcExternal.CreateStringExternalData (str_value);
                }
        return;
    }
        if (the_class != null)
          {
            ExternalDataSlots slots = the_class.ListSlots();
External Data                                                              27 - 7
                Object value = null; /* Holder for slot value */
                ExternalDataSlot the_slot = slots.get(i);
                                                                                           External Data
            {
              ExternalDataSlot the_slot = slots.get(i);
              if (the_slot.GetName().equals (name))
                  return the_slot;
            }
          /* Slot not found */
          return null;
      }
Exceptions
                   Most exceptions thrown by external data methods in J-Link extend
                   pfcExceptions.XExternalDataError, which is a subclass of
                   pfcExceptions.XToolkitError.
                   Exception                                     Cause
    pfcXExternalDataInvalidObject                Generated when a model or class is
                                                 invalid.
    pfcXExternalDataClassOrSlotExists            Generated when creating a class or
                                                 slot and the proposed class or slot
                                                 already exists.
    pfcXExternalDataNamesTooLong                 Generated when a class or slot
                                                 name is too long.
    pfcXExternalDataSlotNotFound                 Generated when a specified class or
                                                 slot does not exist.
External Data                                                                     27 - 9
             Exception                           Cause
 pfcXExternalDataEmptySlot         Generated when the slot you are
                                   attempting to read is empty.
 pfcXExternalDataInvalidSlotName   Generated when a specified slot
                                   name is invalid.
 pfcXBadGetExternalData            Generated when you try to access an
                                   incorrect data type in a
                                   pfcExternal.ExternalData
                                   object.
    This chapter lists J-Link APIs that support Windchill servers and
    server operations in a connected Pro/ENGINEER session.
Topic Page
    Introduction                                                 28 - 2
    Accessing a Windchill Server from a Pro/ENGINEER Session 28 - 2
    Accessing Workspaces                                         28 - 6
    Workflow to Register a Server                                28 - 8
    Aliased URL                                                  28 - 9
    Server Operations                                           28 - 10
    Utility APIs                                                28 - 37
    Sample Batch Workflow                                       28 - 38
                                                                 28 - 1
Introduction
           The methods introduced in this chapter provide support for the
           basic Windchill server operations from within Pro/ENGINEER.
           With these methods, operations such as registering a Windchill
           server, managing workspaces, and check in or check out of objects
           will be possible via J-Link. The capabilities of these APIs are
           similar to the operations available from within the Pro/ENGINEER
           Wildfire client, with some restrictions.
                                                                                            Connectivity APIs
                       to files in the server workspaces and commonspaces. The server
                       alias is chosen by the user or application and it need not have
                                                                                               Windchill
                       any direct relationship to the codebase URL. An alias can be
                       any normal name, such as my_alias.
Methods Introduced:
•   pfcSession.BaseSession.AuthenticateBrowser
•   pfcSession.BaseSession.GetServerLocation
•   pfcServer.ServerLocation.GetClass
•   pfcServer.ServerLocation.GetLocation
•   pfcServer.ServerLocation.GetVersion
•   pfcServer.ServerLocation.ListContexts
•   pfcServer.ServerLocation.CollectWorkspaces
                   Use the method pfcSession.BaseSession.AuthenticateBrowser
                   to set the authentication context using a valid username and
                   password. A successful call to this method allows the
                   Pro/ENGINEER session to register with any server that accepts the
                   username and password combination. A successful call to this
                   method also ensures that an authentication dialog box does not
                   appear during the registration process. You can call this method
                   any number of times to set the authentication context for any
                   number of Windchill servers, provided that you register the
                   appropriate servers or servers immediately after setting the
                   context.
Methods Introduced:
•   pfcSession.BaseSession.RegisterServer
•   pfcServer.Server.Activate
•   pfcServer.Server.Unregister
                                                                                          Connectivity APIs
                   server has been registered, you may create a new workspace.
                                                                                             Windchill
                       Note: While working with the Windchill ProductPoint server,
                             specify the value of the input argument
                             WorkspaceName as NULL for this method.
                   The method pfcServer.Server.Activate sets the specified server
                   as the active server in the Pro/ENGINEER session.
•   pfcServer.Server.GetIsActive
•   pfcServer.Server.GetAlias
•   pfcServer.Server.GetContext
•   pfcWPP.WPPServer.GetServerTargetfolder
•   pfcWPP.WPPServer.SetServerTargetfolder
                   The method pfcServer.Server.GetIsActive specifies if the server
                   is active.
•   pfcSession.BaseSession.GetActiveServer
•   pfcSession.BaseSession.GetServerByAlias
•   pfcSession.BaseSession.GetServerByUrl
•   pfcSession.BaseSession.ListServers
                 The method pfcSession.BaseSession.GetActiveServer returns
                 returns the active server handle.
Accessing Workspaces
                 For every workspace, a new distinct storage location is maintained
                 in the user’s personal folder on the server (server-side workspace)
                 and on the client (client-side workspace cache). Together, the
                 server-side workspace and the client-side workspace cache make up
                 the workspace.
•   pfcServer.pfcServer.WorkspaceDefinition_Create
•   pfcServer.WorkspaceDefinition.GetWorkspaceName
•   pfcServer.WorkspaceDefinition.GetWorkspaceContext
•   pfcServer.WorkspaceDefinition.SetWorkspaceName
•   pfcServer.WorkspaceDefinition.SetWorkspaceContext
                                                                                          Connectivity APIs
                   The interface pfcServer.WorkspaceDefinition contains the
                                                                                             Windchill
                   name and context of the workspace. The method
                   pfcServer.ServerLocation.CollectWorkspaces returns an
                   array of workspace data. Workspace data is also required for the
                   method pfcServer.Server.CreateWorkspace to create a
                   workspace with a given name and a specific context.
                   The method
                   pfcServer.pfcServer.WorkspaceDefinition_Create creates a
                   new workspace definition object suitable for use when creating a
                   new workspace on the server.
                   The method
                   pfcServer.WorkspaceDefinition.GetWorkspaceName
                   retrieves the name of the workspace.
                   The method
                   pfcServer.WorkspaceDefinition.GetWorkspaceContext
                   retrieves the context of the workspace.
                   The method
                   pfcServer.WorkspaceDefinition.SetWorkspaceName sets the
                   name of the workspace.
                   The method
                   pfcServer.WorkspaceDefinition.SetWorkspaceContext sets
                   the context of the workspace.
•   pfcServer.Server.CreateWorkspace
•   pfcServer.Server.GetActiveWorkspace
•   pfcServer.Server.SetActiveWorkspace
•   pfcServer.ServerLocation.DeleteWorkspace
                                                                                             Connectivity APIs
                   Perform the following steps to register a Windchill server with a
                   new workspace:
                                                                                                Windchill
                   1.   Perform steps 1 to 4 in the preceding section to register the
                        Windchill server with an existing workspace.
                   2.   Use the method pfcServer.ServerLocation.ListContexts to
                        choose the required context for the server.
                   3.   Create a new workspace with the required context using the
                        method pfcServer.Server.CreateWorkspace. This method
                        automatically makes the created workspace active.
                        Note: You can create a workspace only after the server is
                              registered.
Aliased URL
                   An aliased URL serves as a handle to the server objects. You can
                   access the server objects in the commonspace (shared folders) and
                   the workspace using an aliased URL. An aliased URL is a unique
                   identifier for the server object and its format is as follows:
Server Operations
          After registering the Windchill server with Pro/ENGINEER, you
          can start accessing the data on the Windchill servers. The
          Pro/ENGINEER interaction with Windchill servers leverages the
          following locations:
                                                                                          Connectivity APIs
                                                                                             Windchill
Save
Methods Introduced:
•   pfcModel.Model.Save
•   pfcWPP.pfcWPP.ServerSynchronizeConflict_Create
•   pfcWPP.WPPServer.SynchronizeServer
•   pfcWPP.ServerSynchronizeConflict.GetDescription
•   pfcWPP.WPPServer.GetServerSynchronizationState
                 The method
                 pfcWPP.pfcWPP.ServerSynchronizeConflict_Create creates
                 the ServerSynchronizeConflicts object containing the
                 description of the conflicts encountered during server
                 synchronization.
                 The method
                 pfcWPP.WPPServer.GetServerSynchronizationState
                 specifies if the contents of the Windchill ProductPoint server are
                 synchronized with the local cache. This method returns true if the
                 server is synchronized, and false, if otherwise.
Upload
                 An upload transfers Pro/ENGINEER files and any other
                 dependencies from the local workspace cache to the server-side
                 workspace.
Methods Introduced:
•   pfcServer.Server.UploadObjects
•   pfcServer.Server.UploadObjectsWithOptions
•   pfcServer.pfcServer.UploadOptions_Create
                                                                                          Connectivity APIs
                   pfcServer.UploadOptions interface. These options allow you to
                                                                                             Windchill
                   upload the entire workspace, auto-resolve missing references, and
                   indicate the target folder location for the new content during the
                   upload. You must save the object to the workspace using
                   pfcModel.Model.Save, or import it to the workspace using
                   pfcSession.BaseSession.ImportToCurrentWS before
                   attempting to upload it.
                   The methods available for setting the upload options are described
                   in the following section.
CheckIn
                   After you have finished working on objects in your workspace, you
                   can share the design changes with other users. The checkin
                   operation copies the information and files associated with all
                   changed objects from the workspace to the Windchill database.
Methods Introduced:
•   pfcServer.Server.CheckinObjects
•   pfcServer.pfcServer.CheckinOptions_Create
•   pfcServer.UploadBaseOptions.SetDefaultFolder
•   pfcServer.UploadBaseOptions.SetNonDefaultFolderAssignments
•   pfcServer.UploadBaseOptions.SetAutoresolveOption
•   pfcServer.CheckinOptions.SetBaselineName
•   pfcServer.CheckinOptions.SetBaselineNumber
•   pfcServer.CheckinOptions.SetBaselineLocation
                If you pass NULL as the value of the options parameter, the checkin
                operation is similar to the Auto Check-In option in
                Pro/ENGINEER. For more details on Auto Check-In, refer to the
                online help for Pro/ENGINEER.
                                                                                                 Connectivity APIs
                       modification.
                                                                                                    Windchill
Retrieval
                   Standard J-Link provides several methods that are capable of
                   retrieving models. When using these methods with Windchill
                   servers, remember that these methods do not check out the object to
                   allow modifications.
Methods Introduced:
•   pfcSession.BaseSession.RetrieveModel
•   pfcSession.BaseSession.RetrieveModelWithOpts
•   pfcSession.BaseSession.OpenFile
                   The methods pfcSession.BaseSession.RetrieveModel,
                   pfcSession.BaseSession.RetrieveModelWithOpts, and
                   pfcSession.BaseSession.OpenFile load an object into a session
                   given its name and type. The methods search for the object in the
                   active workspace, the local directory, and any other paths specified
                   by the search_path configuration option. For Windchill
                   ProductPoint servers, the method
                   pfcSession.BaseSession.RetrieveModelWithOpts supports the
                   instance<generic> notation for the name of the object.
Methods Introduced:
•   pfcServer.Server.CheckoutObjects
•   pfcServer.Server.CheckoutMultipleObjects
•   pfcServer.pfcServer.CheckoutOptions_Create
•   pfcServer.CheckoutOptions.SetDependency
•   pfcServer.CheckoutOptions.SetSelectedIncludes
•   pfcServer.CheckoutOptions.SetIncludeInstances
•   pfcServer.CheckoutOptions.SetVersion
•   pfcServer.CheckoutOptions.SetDownload
•   pfcServer.CheckoutOptions.SetReadonly
                 The method pfcServer.Server.CheckoutObjects checks out and
                 optionally downloads the object to the workspace based on the
                 configuration specifications of the workspace. The input arguments
                 of this method are as follows:
                                                                                            Connectivity APIs
                       –      SERVER_DEPENDENCY_ALL—All objects that are
                                                                                               Windchill
                              dependent on the selected object are checked out.
                       –      SERVER_DEPENDENCY_REQUIRED—All models
                              required to successfully retrieve the originally selected
                              model from the CAD application are selected for checkout.
                       –      SERVER_DEPENDENCY_NONE—None of the dependent
                              objects are checked out.
                   •   IncludeInstances—Specifies the rule for including instances
                       from the family table during checkout. The type of instances
                       given by the ServerIncludeInstances class are as follows:
                       –      SERVER_INCLUDE_ALL—All the instances of the
                              selected object are checked out.
                       –      SERVER_INCLUDE_SELECTED—The application can
                              select the family table instance members to be included
                              during checkout.
                       –      SERVER_INCLUDE_NONE—No additional instances from
                              the family table are added to the object list.
                   •   SelectedIncludes—Specifies the sequence of URLs to the
                       selected instances, if IncludeInstances is of type
                       SERVER_INCLUDE_SELECTED.
                   •   Version—Specifies the version of the checked out object. If this
                       value is set to NULL, the object is checked out according to the
                       current workspace configuration.
                   •   Download—Specifies the checkout type as download or link.
                       The value download specifies that the object content is
                       downloaded and checked out, while link specifies that only the
                       metadata is downloaded and checked out.
                   •   Readonly—Specifies the checkout type as a read-only checkout.
                       This option is applicable only if the checkout type is link.
Undo Checkout
Method Introduced:
•     pfcServer.Server.UndoCheckout
                  Use the method pfcServer.Server.UndoCheckout to undo a
                  checkout of the specified object. When you undo a checkout, the
                  changes that you have made to the content and metadata of the
                  object are discarded and the content, as stored in the server, is
                  downloaded to the workspace. This method is applicable only for
                  the model in the active Pro/ENGINEER session.
Methods Introduced:
•     pfcWPP.WPPServer.SetWsimpexFolderoption
•     pfcSession.BaseSession.ExportFromCurrentWS
                                                                                             Connectivity APIs
•   pfcSession.BaseSession.SetWSExportOptions
                                                                                                Windchill
•   pfcSession.pfcSession.WSExportOptions_Create
•   pfcSession.WSExportOptions.SetIncludeSecondaryContent
                   The method pfcWPP.WPPServer.SetWsimpexFolderoption
                   sets the target folder to import data or the source folder to the
                   Windchill ProductPoint servers or to export data from these
                   servers. Set the target folder location using this method before calls
                   to pfcSession.BaseSession.ExportFromCurrentWS and
                   pfcSession.BaseSession.ImportToCurrentWS. This function is
                   used for Windchill ProductPoint servers only.
Methods Introduced:
• pfcSession.BaseSession.CopyFileToWS
                                                                                            Connectivity APIs
•   pfcSession.BaseSession.CopyFileFromWS
                   Use the method pfcSession.BaseSession.CopyFileToWS to copy
                                                                                               Windchill
                   a file from the disk to the workspace. The file can optionally be
                   added as secondary content to a given workspace file. For Windchill
                   ProductPoint servers, use this method to copy a viewable file from
                   disk as a new item in the target folder specified by the method
                   pfcWPP.WPPServer.SetServerTargetfolder. If the viewable
                   file is added as secondary content, a dependency is created between
                   the Pro/ENGINEER model and the viewable file.
•   pfcServer.Server.IsObjectCheckedOut
•   pfcServer.Server.IsObjectModified
                 The methods described in this section verify the current status of
                 the object in the workspace. The method
                 pfcServer.Server.IsObjectCheckedOut specifies whether the
                 object is checked out for modification.
Methods Introduced:
•   pfcWPP.WPPServer.LockServerObjects
•   pfcWPP.pfcWPP.ServerLockConflict_Create
•   pfcWPP.ServerLockConflict.GetObjectName
•   pfcWPP.ServerLockConflict.GetConflictMessage
•   pfcWPP.WPPServer.GetServerObjectLockStatus
•   pfcWPP.WPPServer.GetServerObjectsLockStatus
•   pfcWPP.pfcWPP.ServerLockStat_Create
•   pfcWPP.ServerLockStat.GetObjectName
•   pfcWPP.ServerLockStat.GetStatus
                                                                                               Connectivity APIs
                   operation. Use the method
                   pfcWPP.ServerLockConflict.GetObjectName to access the
                                                                                                  Windchill
                   name of the object for which the lock conflict occurred. Use the
                   method pfcWPP.ServerLockConflict.GetConflictMessage to
                   get details of the lock conflict.
                   The method
                   pfcWPP.WPPServer.GetServerObjectsLockStatus checks the
                   lock status of a set of objects on the Windchill ProductPoint server.
                   Specify the full path, name, and extension for the input objects. The
                   method returns an array of pfcServerLockStat objects that
                   contain information regarding the lock status of the input objects.
Delete Objects
Method Introduced:
•     pfcServer.Server.RemoveObjects
                      The method pfcServer.Server.RemoveObjects deletes the array
                      of objects from the workspace. When passed with the ModelNames
                      array as NULL, this method removes all the objects in the active
                      workspace.
•     pfcExceptions.XToolkitCheckoutConflict.GetConflictDescription
                      An exception is provided to capture the error condition while
                      performing the following server operations using the specified APIs:
             Operation                                         API
    Checkin an object or workspace      pfcServer.Server.CheckinObjects
    Checkout an object                  pfcServer.Server.CheckoutObjects
    Undo checkout of an object          pfcServer.Server.UndoCheckout
    Upload object                       pfcServer.Server.UploadObjects
    Download object                     pfcServer.Server.CheckoutObjects (with
                                        download as true)
    Delete workspace                    pfcServer.ServerLocation.DeleteWorkspace
    Remove object                       pfcServer.Server.RemoveObjects
                                                                                           Connectivity APIs
Example Code: Server APIs
                                                                                              Windchill
                   The following code demonstrates the implementation of the
                   Windchill server APIs described in the previous sections.
package com.ptc.jlinkexamples;
import   com.ptc.cipjava.*;
import   com.ptc.pfc.pfcServer.*;
import   com.ptc.pfc.pfcModel.*;
import   com.ptc.pfc.pfcSession.*;
import   com.ptc.pfc.pfcSolid.*;
import   com.ptc.pfc.pfcModel2D.*;
import   com.ptc.pfc.pfcModelItem.ParamValue;
import   com.ptc.pfc.pfcModelItem.Parameter;
import   com.ptc.pfc.pfcModelItem.pfcModelItem;
import   com.ptc.pfc.pfcExport.*;
import   com.ptc.pfc.pfcFamily.FamColParam;
import   com.ptc.pfc.pfcFamily.FamilyMember;
import   com.ptc.pfc.pfcFamily.FamilyTableRow;
import   com.ptc.pfc.pfcFeature.*;
import   com.ptc.pfc.pfcComponentFeat.*;
import   com.ptc.pfc.pfcExceptions.*;
import java.util.logging.*;
import java.io.IOException;
import java.util.*;
/**
 * The Pro/ENGINEER session.
 */
protected Session session;
/**
 * The active server for the session.
 */
/**
 * The workspace path for the server (needed to copy content to this
location).
 */
private String workspacePath = null;
/**
 * Indicator for whether the session is interactive or not.
 */
private boolean interactiveSession = true;
/**
 * Message file name for information to be shown to the user.
 */
private static final String messageFile = "jlexamples.txt";
/**
 * Builds a workspace path String from the given server and workspace
*/
protected static String makeWSPath (Server server, String workspaceName)
throws jxthrowable
{
return ("wtws://"+server.GetAlias()+"/"+workspaceName);
}
/**
 * Builds a ProjectLink path String from the given server/context
*/
protected String makeProjectLinkFolder (Server server, String path)
throws jxthrowable
{
String serverClass = server.GetClass();
if (serverClass.equals ("ProjectLink"))
{
return ("wtpub://"+server.GetAlias()+"/"+path);
}
else
{
return
("wtpub://"+server.GetAlias()+"/Projects/"+server.GetContext()+"/"+path);
}
}
                                                                                Connectivity APIs
/**
                                                                                   Windchill
 * Outputs details on a checkout or other server error.
 */
protected void handleConflict (XToolkitCheckoutConflict xtcc)
{
try
{
String conflictDescription = xtcc.GetConflictDescription();
if (interactiveSession)
{
stringseq messageArguments = stringseq.create();
messageArguments.set(0, conflictDescription);
session.UIDisplayLocalizedMessage(messageFile, "JLServerEX Conflict",
messageArguments);
}
else
{
System.out.println ("Conflict occurred: " + xtcc);
}
}
catch (jxthrowable x)
{
logger.log(Level.SEVERE, "Caught exception: ", x);
}
}
/*--------------------------------------------------------------------*\
Check if the current object is modifiable.
\*--------------------------------------------------------------------*/
if (locationParam != null)
{
String locationParamValue = locationParam.GetValue().GetStringValue();
if (locationParamValue.length() > 0)
{
targetFolder = makeServerFolder (activeServer, locationParamValue);
}
}
boolean modifiable =
activeServer.IsObjectCheckedOut(activeServer.GetActiveWorkspace(),
model.GetFileName());
if (!modifiable)
{
activeServer.CheckoutObjects(null, model.GetFileName(), true, null);
}
/*--------------------------------------------------------------------*\
Look for a parameter used by this example. If its not in the
model, create it.
\*--------------------------------------------------------------------*/
Parameter instanceParam = model.GetParam(instanceParamName);
if (instanceParam == null)
{
ParamValue instanceParamValue =
pfcModelItem.CreateStringParamValue("Generic");
instanceParam = model.CreateParam(instanceParamName, instanceParamValue);
}
/*--------------------------------------------------------------------*\
Add the parameter to the family table, if not already present.
\*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*\
Use the version of the model to construct a unique new instance
name for this example.
/*--------------------------------------------------------------------*\
                                                                                Connectivity APIs
Add the new instance and set the value of the example parameter
for this instance.
                                                                                   Windchill
\*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*\
Instantiate the instance. This also serves to verify the
instance, allowing it to be checked in.
\*--------------------------------------------------------------------*/
instance.Erase();
/*--------------------------------------------------------------------*\
Save and checkin the changed model.
\*--------------------------------------------------------------------*/
model.Save();
activeServer.CheckinObjects(model, null);
}
catch (XToolkitCheckoutConflict xtcc)
{
handleConflict (xtcc);
}
catch (jxthrowable x)
{
logger.log(Level.SEVERE, "Caught exception: ", x);
}
catch (Throwable x)
{
logger.log(Level.SEVERE, "Caught exception: ", x);
}
}
/**
 * Action for each part in the assembly.   Checkout the part,
ExportInstructions instrs;
GeometryFlags flags = pfcExport.GeometryFlags_Create();
flags.SetAsSolids(true);
IGES3DNewExportInstructions igesInstrs =
pfcExport.IGES3DNewExportInstructions_Create(AssemblyConfiguration.EXPORT
_ASM_SINGLE_FILE,
flags);
instrs = igesInstrs;
String outputPath = model.GetInstanceName().toLowerCase() + ".igs";
model.Export(outputPath, instrs);
return true;
}
/**
 * Recursive method to collect a list of distinct component parts in the
assembly
*/
private HashMap buildAssemblyPartMap (Solid solid, HashMap map) throws
jxthrowable
{
/*--------------------------------------------------------------------*\
If the part is not already in the map, add it, unless its an instance.
If its an instance, add the generic instead.
\*--------------------------------------------------------------------*/
if (solid.GetType() == ModelType.MDL_PART)
{
String genericName = solid.GetGenericName();
                                                                              Connectivity APIs
for (int i = 0; i < components.getarraysize(); i++)
{
                                                                                 Windchill
ComponentFeat component = (ComponentFeat)components.get(i);
ModelDescriptor descr = component.GetModelDescr();
Solid componentModel = (Solid)session.GetModelFromDescr(descr);
/**
 * Add an IGES file as secondary content for each part in the assembly.
 */
public void addIGESToAllParts ()
{
/*--------------------------------------------------------------------*\
Get the target models to be processed: the active part or assembly,
or the current solid in the active drawing
\*--------------------------------------------------------------------*/
try
{
Model m = session.GetCurrentModel();
if (m.GetType() == ModelType.MDL_DRAWING)
{
Model2D m2d = (Model2D) m;
m = m2d.ListModels().get(0);
}
/*--------------------------------------------------------------------*\
Save some details about the active server to use for each visited
model.
\*--------------------------------------------------------------------*/
activeServer = session.GetActiveServer();
String workspaceName = activeServer.GetActiveWorkspace();
workspacePath = makeWSPath (activeServer, workspaceName);
/*--------------------------------------------------------------------*\
/*--------------------------------------------------------------------*\
Check in all changes
\*--------------------------------------------------------------------*/
activeServer.CheckinObjects(null, null);
/**
 * Add a primary content DXF file to the server (generated from the active
drawing).
 */
public void createOrUpdateDXF ()
{
/*--------------------------------------------------------------------*\
Obtain current drawing handle and export to DXF
\*--------------------------------------------------------------------*/
try
Model m = session.GetCurrentModel();
                                                                              Connectivity APIs
DXFExportInstructions exportInstructions =
pfcModel.DXFExportInstructions_Create();
                                                                                 Windchill
m.Export(dxfName, exportInstructions);
/*--------------------------------------------------------------------*\
If the DXF file already exists in the project, check it out by its
object name.
\*--------------------------------------------------------------------*/
try
{
String dxfPath = activeServer.GetAliasedUrl(dxfName);
if (dxfPath != null)
{
activeServer.CheckoutObjects(null, dxfName, true, null);
}
}
catch (XToolkitNotFound xtnf)
{
/*--------------------------------------------------------------------*\
Ignore XToolkitNotFound as this signals that the file is not already
on the server.
\*--------------------------------------------------------------------*/
}
/*--------------------------------------------------------------------*\
Get the full disk path to the output DXF file as the source of the
File Copy operation.
\*--------------------------------------------------------------------*/
String currentDirectory = session.GetCurrentDirectory();
/*--------------------------------------------------------------------*\
Copy the file to the workspace as a top-level object.
\*--------------------------------------------------------------------*/
session.CopyFileToWS(diskDXFPath, workspacePath, null);
/*--------------------------------------------------------------------*\
Checkin the workspace. If the object is new, it will go to
the Plans folder.
activeServer.CheckinObjects(null, options);
                                                                              Connectivity APIs
catch (Exception x)
{
                                                                                 Windchill
logger.log(Level.SEVERE, "Caught exception: ", x);
}
}
activeServer = session.GetActiveServer();
if (designModels != null)
{
session.ImportToCurrentWS(designModels, RelCriterion.FILE_INCLUDE_ALL);
}
/*--------------------------------------------------------------------*\
Prepare the checkin options; by default the imported parts
and assemblies go in the "Designs" folder.
\*--------------------------------------------------------------------*/
CheckinOptions options = pfcServer.CheckinOptions_Create();
options.SetDefaultFolder(designFolder);
/*--------------------------------------------------------------------*\
Import drawing models.
\*--------------------------------------------------------------------*/
if (planModels != null)
{
session.ImportToCurrentWS(planModels, RelCriterion.FILE_INCLUDE_NONE);
/*--------------------------------------------------------------------*\
The imported drawings go in the "Plans" folder.
\*--------------------------------------------------------------------*/
String plansFolder = makeProjectLinkFolder (activeServer, "Plans");
FolderAssignment assignment =
pfcServer.FolderAssignment_Create(plansFolder, drawingName);
assignments.append(assignment);
}
options.SetNonDefaultFolderAssignments(assignments);
}
/*--------------------------------------------------------------------*\
Check in the entire workspace using the options.
\*--------------------------------------------------------------------*/
activeServer.CheckinObjects(null, options);
/*--------------------------------------------------------------------*\
Clean the workspace, and free allocated memory
\*--------------------------------------------------------------------*/
activeServer.RemoveObjects(null);
}
catch (XToolkitCheckoutConflict xtcc)
{
handleConflict (xtcc);
}
catch (jxthrowable x)
{
logger.log(Level.SEVERE, "Caught exception: ", x);
}
                                                                                           Connectivity APIs
Utility APIs
                                                                                              Windchill
                   The methods specified in this section enable you to obtain the
                   handle to the server objects to access them. The handle may be the
                   aliased URL or the model name of the http URL. These utilities
                   enable the conversion of one type of handle to another.
Methods Introduced:
•   pfcServer.Server.GetAliasedUrl
•   pfcSession.BaseSession.GetModelNameFromAliasedUrl
•   pfcSession.BaseSession.GetAliasFromAliasedUrl
•   pfcSession.BaseSession.GetUrlFromAliasedUrl
                   The method pfcServer.Server.GetAliasedUrl enables you to
                   search for a server object by its name. Specify the complete
                   filename of the object as the input, for example, test_part.prt.
                   The method returns the aliased URL for a model on the server. For
                   more information regarding the aliased URL, refer to the section
                   Aliased URL. During the search operation, the workspace takes
                   precedence over the shared space.
                   You can also use this method to search for files that are not in the
                   Pro/ENGINEER format. For example, my_text.txt, prodev.dat,
                   intf_file.stp, and so on.
                   The method
                   pfcSession.BaseSession.GetModelNameFromAliasedUrl
                   returns the name of the object from the given aliased URL on the
                   server.
Topic Page
                                                               A-1
Critical Technical Changes
            This section describes the changes in Pro/ENGINEER Wildfire 5.0
            and J-Link that might require alteration of existing J-Link
            applications.
pfcDetail.DetailSymbolInstItem.GetInstructions
            The method pfcDetail.DetailSymbolInstItem.GetInstructions
            now takes a new Boolean argument GiveParametersAsNames. Set
            this argument to true to display symbolic representations of
            parameters and drawing properties in the symbol instance. Set it to
            false to display the actual text seen by the user. To ensure that
            the compilation succeeds, rebuild your existing J-Link applications
            calling the method
            pfcDetail.DetailSymbolInstItem.GetInstructions.
Printing Instructions
            The interface pfcModel.PlotInstructions containing the
            instructions for plotting files has been deprecated. Existing J-Link
            methods for creating and accessing the instruction attributes have
            also been deprecated. Use the new interface type
            pfcExport.PrinterInstructions and its methods instead.
            Refer to the Superseded Methods section for the complete list of
            methods that have been deprecated.
                                                                                         Technical Changes
                 No-Resolve mode, the methods pfcSolid.Solid.Regenerate and
                                                                                            Summary of
                 pfcSolid.Solid.ExecuteFeatureOps throw an exception
                 pfcExceptions.XToolkitBadContext.
New Methods
                 The following section describes the new J-Link methods.
Drawings
Datum Features
                                                                                Technical Changes
 pfcDatumPlaneFeat.DatumPlaneOffsetConstraint
                                                                                   Summary of
 .GetOffsetRef
 pfcDatumPlaneFeat.DatumPlaneOffsetConstraint
 .GetOffsetValue
 pfcDatumPlaneFeat.pfcDatumPlaneFeat.Datum
 PlaneOffsetCoordSysConstraint_Create
 pfcDatumPlaneFeat.DatumPlaneOffsetCoordSys
 Constraint.GetCsysAxis
 pfcDatumPlaneFeat.pfcDatumPlaneFeat.Datum
 PlaneAngleConstraint_Create
 pfcDatumPlaneFeat.DatumPlaneAngleConstraint
 .GetAngleRef
 pfcDatumPlaneFeat.DatumPlaneAngleConstraint
 .GetAngleValue
 pfcDatumPlaneFeat.pfcDatumPlaneFeat.Datum
 PlaneSectionConstraint_Create
 pfcDatumPlaneFeat.DatumPlaneSectionConstrai
 nt.GetSectionRef
 pfcDatumPlaneFeat.DatumPlaneSectionConstrai
 nt.GetSectionIndex
 pfcDatumPlaneFeat.DatumPlaneDefaultXConstr
 aint.DatumPlaneDefaultXConstraint_Create
 pfcDatumPlaneFeat.DatumPlaneDefaultYConstr
 aint.DatumPlaneDefaultYConstraint_Create
 pfcDatumPlaneFeat.DatumPlaneDefaultZConstra
 int.DatumPlaneDefaultZConstraint_Create
 Datum Axis Feature
 pfcDatumAxisFeat.DatumAxisFeat.GetConstrain    Provides read access to the
 ts                                             properties of the Datum Axis
 pfcDatumAxisFeat.pfcDatumAxisFeat.DatumAxis    feature.
 Constraint_Create
 pfcDatumAxisFeat.DatumAxisConstraint.Get
 ConstraintType
                                                                                  Technical Changes
 pfcCoordSysFeat.DatumCsysDimensionConstrain
                                                                                     Summary of
 t.GetDimConstraintType
 pfcCoordSysFeat.CoordSysFeat.GetOrientation
 Constraints
 pfcCoordSysFeat.pfcCoordSysFeat.DatumCsys
 OrientMoveConstraint_Create
 pfcCoordSysFeat.DatumCsysOrientMove
 Constraint.GetOrientMoveConstraintType
 pfcCoordSysFeat.DatumCsysOrientMove
 Constraint.GetOrientMoveValue
 pfcCoordSysFeat.CoordSysFeat.GetIsNormalTo
 Screen
 pfcCoordSysFeat.CoordSysFeat.GetOffsetType
 pfcCoordSysFeat.CoordSysFeat.GetOnSurface
 Type
 pfcCoordSysFeat.CoordSysFeat.GetOrientBy
 Method
Export to PDF
Printing Files
                                                                                     Technical Changes
 pfcExport.PrintSize.SetWidth
 pfcExport.PrintSize.SetPaperSize
                                                                                        Summary of
 pfcExport.PrintPrinterOption.SetPenTable
 pfcExport.PrintPrinterOption.SetPrintCommand
 pfcExport.PrintPrinterOption.SetPrinterType
 pfcExport.PrintPrinterOption.SetQuantity
 pfcExport.PrintPrinterOption.SetRollMedia
 pfcExport.PrintPrinterOption.SetRotatePlot
 pfcExport.PrintPrinterOption.SetSaveMethod
 pfcExport.PrintPrinterOption.SetSaveToFile
 pfcExport.PrintPrinterOption.SetSendToPrinter
 pfcExport.PrintPrinterOption.SetSlew
 pfcExport.PrintPrinterOption.SetSwHandshake
 pfcExport.PrintPrinterOption.SetUseTtf
 Placement Options
 pfcExport.pfcExport.PrintPlacementOption_        Creates the
 Create                                           pfcExport.PrintPlacemen
                                                  tOption object.
 pfcSession.BaseSession.GetPrintPlacement         Returns the
 Options                                          pfcExport.PrintPlacemen
                                                  tOption object containing the
                                                  placement options.
 pfcExport.PrintPlacementOption.SetBottomOffset   Accesses and modifies the
 pfcExport.PrintPlacementOption.SetClipPlot       placement options.
 pfcExport.PrintPlacementOption.SetKeep
 Panzoom
 pfcExport.PrintPlacementOption.SetLabelHeight
 pfcExport.PrintPlacementOption.SetPlaceLabel
 pfcExport.PrintPlacementOption.SetScale
 pfcExport.PrintPlacementOption.SetShiftAllCorn
 er
 pfcExport.PrintPlacementOption.SetSideOffset
 pfcExport.PrintPlacementOption.SetX1Clip
 Position
                                                                                     Technical Changes
 pfcUI.pfcUI.FileOpenRegisterOptions_Create       Open dialog box.
                                                                                        Summary of
 pfcUI.FileOpenRegisterOptions.SetFile
 Description
 pfcUI.FileOpenRegisterOptions.SetFileType
 pfcUI.FileOpenRegisterListener.FileOpenAccess
 pfcUI.FileOpenRegisterListener.OnFileOpen
 Register
 File > Save
 pfcSession.BaseSession.UIRegisterFileSave        Adds a new file type in the
 pfcUI.pfcUI.FileSaveRegisterOptions_Create       Save a Copy dialog box.
 pfcUI.FileSaveRegisterOptions.SetFile
 Description
 pfcUI.FileSaveRegisterOptions.SetFileType
 pfcUI.FileSaveRegisterListener.FileSaveAccess
 pfcUI.FileSaveRegisterListener.OnFileSave
 Register
 Navigation Area
 pfcSession.Session.NavigatorPaneBrowserAdd       Adds custom panes containing
 pfcSession.Session.NavigatorPaneBrowserIconSet   custom Web pages to the
 pfcSession.Session.NavigatorPaneBrowserURL       Navigation area.
 Set
Utility
Superseded Methods
                 The following table lists the superseded methods in this release.
• IMPORT_NEW_CATIA_PART
                                                                                      Technical Changes
                 •   IMPORT_NEW_UG
                                                                                         Summary of
                 •   IMPORT_NEW_PRODUCTVIEW
                 •   IMPORT_NEW_CATIA_CGR
                 •   IMPORT_NEW_JT
                 The class pfcModel.IntfType also contains new 3D feature
                 import formats. The J-Link method
                 pfcSolid.Solid.CreateImportFeat supports the following new
                 import formats:
                 •   INTF_ICEM
                 •   INTF_ACIS
                 •   INTF_DXF
                 •   INTF_CDRS
                 •   INTF_STL
                 •   INTF_VRML
                 •   INTF_PARASOLID
                 •   INTF_AI
                 •   INTF_CATIA_PART
                 •   INTF_UG
                 •   INTF_PRODUCTVIEW
                 •   INTF_CATIA_CGR
                 •   INTF_JT
Export Formats
             New export formats have been added to the class
             pfcModel.ExportType. The following table lists the new export
             formats and the new instructions object added for each format:
                                                                                        Technical Changes
                 pfcExport.PDFOptionType.
                                                                                           Summary of
ProductView Export Formats
                 The J-Link method pfcModel.Model.Export now supports export
                 to any one of the ProductView formats listed in the next table.
                 These formats have been defined in a new class
                 pfcExport.ProductViewFormat.
Topic Page
                                                              B-1
Installing J-Link
              J-Link is available on the same CD as Pro/ENGINEER. When
              Pro/ENGINEER is installed using PTC.SetUp, one of the optional
              components is “API Toolkits”. This includes Pro/TOOLKIT,
              Pro/Web.Link, and J-Link.
Sample Applications
              The J-Link sample applications are available in the location
              jlink/jlink_appls.
InstallTest
                                 Location                          Main Class
                  jlink/jlink_appls/install_test              StartInstallTest
                                                                                         Sample Applications
                       setenv CLASSPATH ".:<Pro/ENGINEER
                       loadpoint>/text/java/pfc.jar:$CLASSPATH"
                       On NT set the CLASSPATH as:
                       set CLASSPATH=.;<Pro/ENGINEER
                       loadpoint>\text\java\pfc.jar;%CLASSPATH%
                  3.   Compile the java files in the directory using the command
                       javac *.java.
                       Note: The java file AsyncInstallTest.java is not compiled
                             because it is used in the asynchronous mode only.
                             Before compiling, rename this file to a non-Java file,
                             that is, AsyncInstallTest.bak.
                  4.   Create a config.pro file if you are using Java 1.1. Add the
                       following line to this file:
                       jlink_java2       off
                       Note: For more information on the supported JDK versions
                             for synchronous J-Link refer to
                             http://www.ptc.com/partners/hardware/curren
                             t/jlink.htm.
                  5.   Run Pro/ENGINEER.
InstallTest
                                 Location                         Main Class
                  jlink/jlink_appls/install_test             AsyncInstallTest
                                                                                         Sample Applications
                       setenv LD_LIBRARY_PATH "<Pro/E
                       loadpoint>/sun4_solaris/lib:$LD_LIBRARY_PATH"
                       setenv PRO_COMM_MSG_EXE "<Pro/E
                       loadpoint>/sun4_solaris/obj/pro_comm_msg"
                       On NT set the library path as:
                       set path=<Pro/E loadpoint>\i486_nt\lib;%PATH%
                       set PRO_COMM_MSG_EXE=<Pro/E
                       loadpoint>\i486_nt\obj\pro_comm_msg.exe
                  4.   Compile the java files in the directory using the command
                       javac *.java.
                       Note:
                  •    The java file "StartInstallTest.java" does not get compiled
                       as it is used in the synchronous mode only. Before compiling,
                       rename this file to a non java file, that is,
                       StartInstallTest.bak.
                  •    Remove any .class files compiled previously using
                       synchronous J-Link.
                  •    Rename or remove the registry file (protk.dat or prodev.dat)
                       from the location from where you are running the Jlink
                       asynchronous test.
                  5.   Run the application java [asynchronous flags]
                       AsyncInstallTest <command to run Pro/ENGINEER>.
                       Note: For more information on the supported JDK versions
                             for asynchronous J-Link and the value of the
                             asynchronous flags refer to
                             http://www.ptc.com/partners/hardware/current/jlink.ht
                             m
jlinkasyncexamples
                        Location                        Main Class
            jlink/jlink_appls/jlink            Many independent examples
            asyncexamples
Parameter Editor
                       Location                         Main Class
            jlink/jlink_appls/jlink            com.ptc.jlinkdemo.parame
            _param                             ditor.ParamEditor
                                                                                         Sample Applications
                       –   On Windows, execute the batch file compile.bat.
                  4.   Start Pro/ENGINEER from a directory containing the protk.dat
                       file. Create or retrieve any model that contains parameters.
                  5.   Select J-Link Parameter Editor from the Applications Menu.
                       The system will display a graphical interface that contains a
                       list of parameters for the selected model as shown in the
                       following figure.
                                                                                         Sample Applications
                  The save check example demonstrates a synchronous J-Link utility
                  that presents a user interface that identifies if any problems exist
                  in the model you are about to save. If any problems exist in the
                  assigned parameter values or if a material has not been assigned to
                  a part, the user interface will appear with information about the
                  problems.
                  The instructions to setup and run the save check example are
                  similar to the instructions for the round checker utility. To access
                  the interface, choose Tools, Perform Release Checks.
Topic Page
                                                                   C-1
Supported Java Virtual Machine Versions
         The machine information for the JVM versions supported by J-Link
         is available at
http://www.ptc.com/partners/hardware/current/jlink.htm
                                                                                               Debugging
                  2.   Use the technique described in the section Overriding the Java
                       command used by Synchronous J-Link to set the Java command
                       to the appropriate debug command line, for example,
                       [JDK_HOME]/bin/java.exe -Xdebug
                  3.   Start Pro/ENGINEER and let it invoke the Java application.
                  4.   Attach your Java debugger to the process that was started by
                       Pro/ENGINEER.
                  If you need to debug within the application start method, you can
                  make the first invocation within that method a UI popup dialog box
                  (javax.swing.JOptionPane) which will allow time to attach the
                  debugger to the process.
CLASSPATH Variables
Synchronous Mode
                  If you are using the default JVM and are running J-Link
                  applications on your machine, you need to add only your application
                  classes to the classpath. The mechanisms to accomplish this are:
Topic Page
   Introduction                                                D-2
   Implications of DRM on J-Link                               D-2
   Additional DRM Implications                                 D-6
                                                               D-1
Introduction
           Digital Rights Management (DRM) helps to control access to your
           intellectual property. Intellectual property could be sensitive design
           and engineering information that you have stored within
           Pro/ENGINEER parts, assemblies, or drawings. You can control
           access by applying policies to these Pro/ENGINEER objects. Such
           objects remain protected by the policies even after they are
           distributed or downloaded. Pro/ENGINEER objects for which you
           have applied policies are called DRM-protected objects. For more
           information on the use of DRM in Pro/ENGINEER Wildfire 4.0,
           refer to the DRM online help.
           If the user tries to open a model lacking the COPY permission into a
           session with a J-Link application running, Pro/ENGINEER
           prompts the user to spawn a new session. Also, new J-Link
           applications will not be permitted to start when the
           Pro/ENGINEER session lacks COPY permission.
Exception Types
           Some J-Link methodsrequire specific permissions in order to
           operate on a DRM-protected object. If these methodscannot proceed
           due to DRM restrictions, the following exceptions are thrown:
                                                                                          Digital Rights
                                                                                          Management
                      at some point.
                  The following table lists the methods along with the permission
                  required and implications of operating on DRM-protected objects.
                                                                                          Digital Rights
                                                                                          Management
                       checks if the permission level includes COPY. If the level
                       includes COPY, Pro/ENGINEER opens the file.
                  3.   If COPY permission is not included, the following message is
                       displayed:
                  4.   If the user clicks Cancel, the file is not opened in the current
                       Pro/ENGINEER session and no new session is spawned.
                  5.   If the user clicks OK, an additional session of Pro/ENGINEER
                       is spawned which does not permit any J-Link application.
                       J-Link applications set to automatically start by
                       Pro/ENGINEER will not be started. Asynchronous applications
                       will be unable to connect to this session.
                  6.   The new session of Pro/ENGINEER is automatically
                       authenticated with the same session credentials as were used
                       in the previous session.
                  7.   The model that Pro/ENGINEER was trying to load in the
                       previous session is loaded in this session.
                  8.   Other models already open in the previous session will not be
                       loaded in the new session.
                  9.   Session settings from the previous session will not be carried
                       into the new session.
Topic Page
Example 1                                                        E-2
Example 2                                                        E-2
Example 3                                                        E-3
Example 4                                                        E-4
Example 5                                                        E-5
                                                                 E-1
Example 1
                               E1                    E5
                                                               E6
                         E4                                          Face B
                                                C2
                                    C1
         Face A                      E2
E3 E7
Example 2
E1
                                                          E5
      Face A
                    E4
                                    .                .          E2
E6
E3
                                          Face B
                                                                 Face C
                                                                                             Geometry Traversal
                                                                  Protrusion feature
Face A
Face C
Face B
Face D
      Face A
                                                        Base part
                                                        No features added
Face B
. .
                                                                                          Geometry Traversal
                     Face A
                     This part was extruded from a rectangular cross section. The slot
                     and hole features were added later.
Topic Page
                                                                 F-1
Surface Parameterization
         A surface in Pro/ENGINEER contains data that describes the
         boundary of the surface, and a pointer to the primitive surface on
         which it lies. The primitive surface is a three-dimensional
         geometric surface parameterized by two variables (u and v). The
         surface boundary consists of closed loops (contours) of edges. Each
         edge is attached to two surfaces, and each edge contains the u and v
         values of the portion of the boundary that it forms for both surfaces.
         Surface boundaries are traversed clockwise around the outside of a
         surface, so an edge has a direction in each surface with respect to
         the direction of traversal.
         •   Cone
         •   Coons Patch
         •   Cylinder
         •   Cylindrical Spline Surface
         •   Fillet Surface
         •   General Surface of Revolution
         •   NURBS Surface
         •   Plane
         •   Ruled Surface
         •   Spline Surface
         •   Tabulated Cylinder
         •   Torus
                                                                                             Representations
                                                                                                Geometry
                  The plane entity consists of two perpendicular unit vectors (e1 and
                  e2), the normal to the plane (e3), and the origin of the plane.
                  Data Format:
                  e1[3]          Unit vector, in the u direction
                  e2[3]          Unit vector, in the v direction
                  e3[3]          Normal to the plane
                  origin[3]      Origin of the plane
                  Parameterization:
                  (x, y, z) = u * e1 + v * e2 + origin
Cylinder
       Parameterization:
       (x, y, z) = radius * [cos(u) * e1 + sin(u) * e2] +
                  v * e3 + origin
Engineering Notes:
Cone
       Data Format:
       e1[3]        Unit vector, in the u direction
       e2[3]        Unit vector, in the v direction
       e3[3]        Normal to the plane
       origin[3]    Origin of the cone
       alpha        Angle between the axis of the cone
                    and the generating line
Torus
                                                                                          Representations
                                                                                             Geometry
                  The generating curve of a torus is an arc of radius R2 with its
                  center at a distance R1 from the origin. The starting point of the
                  generating arc is located at a distance R1 + R2 from the origin, in
                  the direction of the first vector of the local coordinate system. The
                  radial distance of a point on the torus is R1 + R2 * cos(v), and the
                  height of the point along the axis of revolution is R2 * sin(v).
                  Data Format:
                  e1[3]        Unit vector, in the u direction
                  e2[3]        Unit vector, in the v direction
                  e3[3]        Normal to the plane
                  origin[3]    Origin of the torus
                  radius1      Distance from the center of the
                               generating arc to the axis of
                               revolution
                  radius2      Radius of the generating arc
                  Parameterization:
                  (x, y, z) = (R1 + R2 * cos(v)) * [cos(u) * e1 +
                              sin(u) * e2] + R2 * sin(v) * e3 +
                              origin
            Data Format:
            e1[3]          Unit vector, in the u direction
            e2[3]          Unit vector, in the v direction
            e3[3]          Normal to the plane
            origin[3]      Origin of the surface of revolution
            curve          Generating curve
            Parameterization:
            curve(v) = (c1, c2, c3) is a point on the curve.
Ruled Surface
Data Format:
                                                                                        Representations
                  e1[3]       Unit vector, in the u direction
                                                                                           Geometry
                  e2[3]       Unit vector, in the v direction
                  e3[3]       Normal to the plane
                  origin[3]   Origin of the ruled surface
                  curve_1     First generating curve
                  curve_2     Second generating curve
                  Parameterization:
                  (x', y', z') is the point in local coordinates.
                  (x', y', z') = (1 - v) * C1(u) + v * C2(u)
                  (x, y, z) = x' * e1 + y' * e2 + z' * e3 + origin
Tabulated Cylinder
                  Data Format:
                  e1[3]       Unit vector, in the u direction
                  e2[3]       Unit vector, in the v direction
                  e3[3]       Normal to the plane
                  origin[3]   Origin of the tabulated cylinder
                  curve       Generating curve
Coons Patch
             Data Format:
             le_curve                  u = 0 boundary
             ri_curve                  u = 1 boundary
             dn_curve                  v = 0 boundary
             up_curve                  v = 1 boundary
             point_matrix[2][2]        Corner points
             uvder_matrix[2][2]        Corner mixed derivatives
Fillet Surface
                  Data Format:
                  pnt_spline      P(v) spline   running along the u = 0 boundary
                  ctr_spline      C(v) spline   along the centers of the
                                  fillet arcs
                  tan_spline      T(v) spline   of unit tangents to the
                                                                                             Representations
                                  axis of the   fillet arcs
                                                                                                Geometry
                  Parameterization:
                  R(v) = P(v) - C(v)
                  (x,y,z) = C(v) + R(v) * cos(u) + T(v) X R(v) *
                            sin(u)
Spline Surface
                  Data Format:
                  u_par_arr[]         Point parameters, in the u
                                      direction, of size Nu
                  v_par_arr[]         Point parameters, in the v
                                      direction, of size Nv
                  point_arr[][3]      Array of interpolant points, of
                                      size Nu x Nv
                  u_tan_arr[][3]      Array of u tangent vectors
                                      at interpolant points, of size
                                      Nu x Nv
Engineering Notes:
NURBS Surface
          The NURBS surface is defined by basis functions (in u and v),
          expandable arrays of knots, weights, and control points.
          Data Format:
          deg[2]                 Degree of the basis
                                 functions (in u and v)
          u_par_arr[]            Array of knots on the
                                 parameter line u
          v_par_arr[]            Array of knots on the
                                 parameter line v
Definition:
N1 N2
                                                                                                                                 Representations
                                                   ∑ ∑ Ci, j × Bi, k ( u ) × Bj, l ( v )
                                                                                                                                    Geometry
                           R ( u, v ) = -----------------------------------------------------------------------------
                                        i = 0j = 0
                                                    N1 N2
                  k       = degree in u
                  l       = degree in v
                  N1      = (number of knots in u) - (degree in u) - 2
                  N2      = (number of knots in v) - (degree in v) - 2
                  Bi,k    = basis function in u
                  Bj, l   = basis function in v
                  wij      = weights
                  Ci, j    = control points (x,y,z) * wi,j
Engineering Notes:
Geometry Representations                                                                                                F - 11
         Data Format:
         e1[3]        x' vector of the local coordinate
                      system
         e2[3]        y' vector of the local coordinate
                      system
         e3[3]        z' vector of the local coordinate
                      system, which corresponds to the
                      axis of revolution of the surface
         origin[3]    Origin of the local coordinate
                      system
         splsrf       Spline surface data structure
                                                                                              Representations
                  A cylindrical spline surface can be obtained, for example, by
                                                                                                 Geometry
                  creating a smooth rotational blend (shown in the figure on the
                  previous page).
                  •   Arc
                  •   Line
                  •   NURBS
                  •   Spline
Line
                  Data Format:
                  end1[3]      Starting point of the line
                  end2[3]      Ending point of the line
                  Parameterization:
                  (x, y, z) = (1 - t) * end1 + t * end2
Geometry Representations                                                             F - 13
Arc
         The arc entity is defined by a plane in which the arc lies. The arc is
         centered at the origin, and is parameterized by the angle of rotation
         from the first plane unit vector in the direction of the second plane
         vector. The start and end angle parameters of the arc and the
         radius are also given. The direction of the arc is counterclockwise if
         the start angle is less than the end angle, otherwise it is clockwise.
         Data Format:
         vector1[3]       First vector that defines the
                          plane of the arc
         vector2[3]       Second vector that defines the
                          plane of the arc
         origin[3]        Origin that defines the plane
                          of the arc
         start_angle      Angular parameter of the starting
                          point
         end_angle        Angular parameter of the ending
                          point
         radius           Radius of the arc.
         Parameterization:
         t' (the unnormalized parameter) is
            (1 - t) * start_angle + t * end_angle
         (x, y, z) = radius * [cos(t') * vector1 +
            sin(t') * vector2] + origin
Spline
         The spline curve entity is a nonuniform cubic spline, defined by a
         series of three-dimensional points, tangent vectors at each point,
         and an array of unnormalized spline parameters at each point.
         Data Format:
         par_arr[]        Array of spline parameters
                          (t) at each point.
         pnt_arr[][3]     Array of spline interpolant points
         tan_arr[][3]     Array of tangent vectors at
                          each point
Parameterization:
                                                                                                          Representations
                                                                                                             Geometry
NURBS
                  The NURBS (nonuniform rational B-spline) curve is defined by
                  expandable arrays of knots, weights, and control points.
                  Data Format:
                  degree            Degree of the basis function
                  params[]          Array of knots
                  weights[]         Array of weights for rational
                                    NURBS, otherwise NULL.
                  c_pnts[][3]       Array of control points
Definition:
                                                               ∑ C i × B i, k ( t )
                                              R ( t ) = --------------------------------------
                                                        i=0                                  -
                                                                N
                                                               ∑ wi × Bi, k ( t )
                                                              i=0
Geometry Representations                                                                         F - 15
                 k     = degree of basis function
wi = weights
References:
This appendix lists and briefly describes the classes that make up
the J-Link interface.
Topic Page
                                                               G-1
List of J-Link Classes
                       The following table briefly describes the classes in the J-Link
                       interface.
                                                                                                          J-Link Classes
 Describes the base parameter.
 BeamSectionFeat                        pfcBeamSectionFeat        Downcast of pfcFeature.Feature.
 This feature type specifies a beam section.
 BendBackFeat                           pfcBendBackFeat           Downcast of pfcFeature.Feature.
 This feature type specifies a bend back feature, which is used in the Pro/NC-SHEETMETAL module.
 BendFeat                               pfcBendFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a bend feature.
 BldOperationFeat                       pfcBldOperationFeat       Downcast of pfcFeature.Feature.
 This feature type specifies a build operation.
 BOMExportInstructions                  pfcModel                  pfc-
                                                                  Model.BOMExportInstructions_Create
                                                                  ()
 Used to export a BOM for an assembly.
 BSpline                                pfcGeometry               Downcast of pfcGeometry.Curve.
 This class defines a B-spline curve.
 BSplinePoint                           pfcGeometry               BSplinePoints.get()
 This class defines a B-spline point.
 BSplinePoints                          pfcGeometry               BSplinePoints.create(), BSpline.Get-
                                                                  Points()
 This data type is used to specify an array of B-spline points.
 BulkObjectFeat                         pfcBulkObjectFeat         Downcast of pfcFeature.Feature.
 This feature type specifies a bulk object.
 CableCosmeticFeat                      pfcCableCosmeticFeat      Downcast of pfcFeature.Feature.
 This feature type specifies a cosmetic feature used with the Pro/CABLING module.
 CableFeat                              pfcCableFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a cabling feature.
 CableLocationFeat                      pfcCableLocationFeat      Downcast of pfcFeature.Feature.
 This feature type specifies a cable location.
                                                                                                            J-Link Classes
 CMMMeasureStepFeat                   pfcCMMMeasureStepFeat        Downcast of pfcFeature.Feature.
 This feature type specifies a measured step feature, which is used in the Pro/CMM module.
 CMMVerifyFeat                        pfcCMMVerifyFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a verify feature, which is used in the Pro/CMM module.
 ColorRGB                             pfcBase                      pfcBase.ColorRGB_Create(), Ses-
                                                                   sion.GetRGBFromStdColor()
 Specifies the red, green, and blue (RGB) values of a color.
 CompModelReplace                     pfcComponentFeat             ComponentFeat.CreateReplaceOp()
 Used to replace one model in a component with another.
 ComponentFeat                        pfcComponentFeat             Downcast of pfcFeature.Feature.
 Specifies a component feature.
 ComponentPath                        pfcAssembly                  Selection.GetPath()
 This class describes a component path.
 ComponentType                        pfcComponentFeat             ComponentType.FromInt() or by using
                                                                   any of the static instances (e.g.,
                                                                   COMP_WORKPIECE)
 This enumerated type lists the possible component types.
 CompositeCurve                       pfcGeometry                  Downcast of pfcGeometry.Curve.
 This class defines a composite curve.
 Cone                                 pfcGeometry                  Downcast of pfcGeometry.Surface.
 This class defines a cone.
 ConnectorParamExportInstruc-         pfcModel                     pfc-
 tions                                                             Model.ConnectorParamExportInstructi
                                                                   ons_Create()
 Used to write the parameters of a connector to a file.
 ContMapFeat                          pfcContMapFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a contour map, which is used in the Pro/DIEFACE module.
 Contour                              pfcGeometry                  Contours.get(), Contour.FindContain-
                                                                   ingContour()
 This class describes a contour.
                                                                                                                J-Link Classes
 Stores the results of an edge evaluation.
 CustomizeFeat                         pfcCustomizeFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a customized feature.
 CutFeat                               pfcCutFeat                      Downcast of pfcFeature.Feature.
 This feature type specifies a cut feature.
 CutMotionFeat                         pfcCutMotionFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a cut motion feature, which is used in the Pro/NC module.
 Cylinder                              pfcGeometry                     Downcast of pfcGeometry.Surface.
 This class defines a cylinder.
 DatumAxisFeat                         pfcDatumAxisFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a datum axis feature.
 DatumPlaneFeat                        pfcDatumPlaneFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a datum plane.
 DatumPointFeat                        pfcDatumPointFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a datum point.
 DatumQuiltFeat                        pfcDatumQuiltFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a datum quilt.
 DatumSurfaceFeat                      pfcDatumSurfaceFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a datum surface.
 DeclareFeat                           pfcDeclareFeat                  Downcast of pfcFeature.Feature.
 This feature type specifies a declared feature.
 DeformAreaFeat                        pfcDeformAreaFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a deformed area.
 DeleteOperation                       pfcFeature                      Feature.CreateDeleteOp()
 This class defines a delete operation.
 Dependencies                          pfcModel                        Dependencies.create(), Model.ListDe-
                                                                       pendencies()
 This data type is used to specify the first-level dependencies for an object.
 Dependency                            pfcModel                        Dependencies.get()
                                                                                                             J-Link Classes
 This feature type specifies a driven-tool profile.
 DrvToolSketchFeat                      pfcDrvToolSketchFeat        Downcast of pfcFeature.Feature.
 This feature type specifies a driven-tool sketch.
 DrvToolSurfFeat                        pfcDrvToolSurfFeat          Downcast of pfcFeature.Feature.
 This feature type specifies a driven-tool surface.
 DrvToolTwoCntrFeat                     pfcDrvToolTwoCntrFeat       Downcast of pfcFeature.Feature.
 This feature type specifies a tool with two centers.
 DWGSetupExportInstructions             pfcModel                    pfc-
                                                                    Model.DWGSetupExportInstructions_
                                                                    Create()
 Used to export a drawing setup file.
 DXFExportInstructions                  pfcModel                    pfc-
                                                                    Model.DXFExportInstructions_Create(
                                                                    )
 Used to export a drawing in DXF format.
 EarFeat                                pfcEarFeat                  Downcast of pfcFeature.Feature.
 This feature type specifies an ear feature.
 Edge                                   pfcGeometry                 Edges.get(), Edge.GetEdge1(),
                                                                    Edge.GetEdge2()
 Describes the edge, including the next and previous edge, and the two surfaces.
 EdgeBendFeat                           pfcEdgeBendFeat             Downcast of pfcFeature.Feature.
 This feature type specifies an edge bend.
 EdgeEvalData                           pfcGeometry                 Edge.EvalUV()
 This class provides edge evaluation data.
 Edges                                  pfcGeometry                 Edges.create(), Contour.ListEle-
                                                                    ments(),
 This data type is used to specify an array of edges.
 Ellipse                                pfcGeometry                 Downcast of pfcGeometry.Curve.
 This class defines an ellipse.
 EtchFeat                               pfcEtchFeat                 Downcast of pfcFeature.Feature.
                                                                                                                  J-Link Classes
 This class describes a system parameter column in a family table.
 FamColUDF                             pfcFamily                          Not returned.
 This class describes a UDF column in a family table.
 FamilyMember                          pfcFamily                          FamilyMember.GetParent()
 This class describes a member in a family table.
 FamilyTableColumn                     pfcFamily                          FamilyMember.AddColumn(), Fami-
                                                                          lyTableColumns.get(),
 This class specifies a column in a family table.
 FamilyTableColumns                    pfcFamily                          FamilyTableColumns.create(), Family-
                                                                          Member.ListColumns()
 This data type is used to specify a list of columns in a family table.
 FamilyTableRow                        pfcFamily                          FamilyMember.AddRow(), Family-
                                                                          Member.GetRow(), FamilyTable-
                                                                          Rows.get()
 This class specifies a row in a family table.
 FamilyTableRows                       pfcFamily                          FamilyTableRows.create(), Family-
                                                                          Member.ListRows()
 This data type is used to specify a list of rows in a family table.
 FamIParNote                           pfcFamily                          Not returned.
 This class specifies an integer parameter note.
 FeatIdExportInstructions              pfcModel                           Base class; not returned.
 Base class of instructions classes that export data for a single feature.
 FeatInfoExportInstructions            pfcModel                           pfc-
                                                                          Model.FeatInfoExportInstructions_Cre
                                                                          ate()
 Used to export information about one feature in a part or assembly.
 Feature                               pfcFeature                         Solid.GetFeatureByName(),Feature-
                                                                          Operation.GetOpFeature(). Also, by
                                                                          downcasting pfcModelItem.Mod-
                                                                          elItem.
 This class defines the feature information.
 FeatureActionListener_u               pfcFeature                         Base class; not returned.
J-Link Classes                                                                                           G - 11
                 Class                            Package                        Returned by
 Abstract base class that all user-defined FeatureActionListener classes must extend.
 FeatureActionListener                   pfcFeature                 Base class; not returned.
 Interface that must be implemented by user-defined classes that respond to Feature events.
 FeatureGroup                            pfcFeature                 Feature.GetGroup()
 This class describes a feature group.
 FeatureOperation                        pfcFeature                 FeatureOperations.get()
 This class defines a feature operation.
 FeatureOperations                       pfcFeature                 FeatureOperations.create()
 This class specifies a list of feature operations.
 FeaturePattern                          pfcFeature                 Feature.GetPattern(), Feature-
                                                                    Group.GetPattern()
 This class specifies a feature pattern.
 FeaturePlacement                        pfcFeature                 Feature.GetPlacement()
 Specifies the placement of a feature.
 Features                                pfcFeature                 Features.create(), Feature.ListChil-
                                                                    dren(), Feature.ListParents(), Feature-
                                                                    Pattern.ListMembers()
 This data type specifies an array of features.
 FeatureStatus                           pfcFeature                 FeatureStatus.FromInt() or by using
                                                                    any of the static instances (e.g.,
                                                                    FEAT_ACTIVE)
 This enumerated type specifies the feature status.
 FeatureType                             pfcFeature                 FeatureType.FromInt() or by using any
                                                                    of the static instances (e.g.,
                                                                    FEATTYPE_PROTRUSION)
 This enumerated type lists the possible feature types.
 FIATExportInstructions                  pfcModel                   pfc-
                                                                    Model.FIATExportInstructions_Create
                                                                    ()
 Used to export a part or assembly in FIAT format.
 FirstFeat                               pfcFirstFeat               Downcast of pfcFeature.Feature.
 This feature type specifies the first feature in a model.
 FixtureSetupFeat                        pfcFixtureSetupFeat        Downcast of pfcFeature.Feature.
 This feature type specifies a fixture setup.
 FlangeFeat                              pfcFlangeFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a flange.
                                                                                                                  J-Link Classes
 This feature type specifies a flattened-harness feature.
 FormFeat                                pfcFormFeat                  Downcast of pfcFeature.Feature.
 This feature type specifies a form feature.
 FreeFormFeat                            pfcFreeFormFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a free-form feature.
 FreeNotePlacement                       pfcNote                      pfcNote.FreeNotePlacement_Create()
 Specifies the location of the attachment point “free” -- at a parametric point with respect to the model out-
 line. For example, (0.5, 0.5, 0.5) would be the center, whereas (0.0, 0.0, 1.1) would be just outside one of
 the corners.
 GeomCopyFeat                            pfcGeomCopyFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a geometric copy feature.
 GeomCurve                               pfcGeometry                  RevolvedSurface.GetProfile(), Ruled-
                                                                      Surface.GetProfile1(), RuledSur-
                                                                      face.GetProfile2(),TabulatedCylinder.
                                                                      GetProfile()
 This class provides information for a geometry curve.
 GeomExportFlags                         pfcModel                     pfcModel.GeomExportFlags_Create()
 Stores extend-surface and Bezier options for use when exporting geometric information from a model.
 GeomExportInstructions                  pfcModel                     Base class; not returned.
 Base class to classes used to export precise geometric information from a model.
 GraphFeat                               pfcGraphFeat                 Downcast of pfcFeature.Feature.
 This feature type specifies a graph.
 GrooveFeat                              pfcGrooveFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a groove.
 HoleFeat                                pfcHoleFeat                  Downcast of pfcFeature.Feature.
 This feature type specifies a hole feature.
 IGES3DExportInstructions                pfcModel                     pfc-
                                                                      Model.IGES3DExportInstructions_Cre
                                                                      ate()
 Used to export a part or assembly in IGES format.
J-Link Classes                                                                                           G - 13
                 Class                             Package                         Returned by
                                                                                                                    J-Link Classes
 This class specifies the identifier of a Material. For internal use only.
 MaterialRemovalFeat                    pfcMaterialRemovalFeat          Downcast of pfcFeature.Feature.
 This feature type specifies a material removal feature.
 Materials                              pfcPart                         Materials.create(), PartListMaterials()
 This data type is used to specify a list of materials.
 Matrix3D                               pfcBase                         Matrix3D.create(), Transform3D.Get-
                                                                        Matrix()
 This data type is used to describe a three-dimensional matrix.
 MeasureFeat                            pfcMeasureFeat                  Downcast of pfcFeature.Feature.
 This feature type specifies a measure feature.
 MergeFeat                              pfcMergeFeat                    Downcast of pfcFeature.Feature.
 This feature type specifies a merge feature.
 MFG                                    pfcMFG                          Session.CreateMFG(). Also, by down-
                                                                        casting pfcModel.Model.
 This class describes a manufacturing object.
 MFGCLExportInstructions                pfcModel                        Base class; not returned.
 Base class to classes that export cutter-location files.
 MFGFeatCLExportInstructions            pfcModel                        pfc-
                                                                        Model.MFGFeatCLExportInstructions
                                                                        _Create()
 Used to export a cutter location (CL) file for one NC sequence in a manufacturing assembly.
 MFGGatherFeat                          pfcMFGGatherFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a gather feature.
 MFGMergeFeat                           pfcMFGMergeFeat                 Downcast of pfcFeature.Feature.
 This feature type specifies a manufacturing merge feature.
 MFGOperCLExportInstructions            pfcModel                        pfc-
                                                                        Model.MFGOperCLExportInstructions
                                                                        _Create()
 Used to export a cutter location (CL) file for all the NC sequences in an operation.
 MFGRefineFeat                          pfcMFGRefineFeat                Downcast of pfcFeature.Feature.
J-Link Classes                                                                                             G - 15
               Class                              Package                         Returned by
                                                                                                              J-Link Classes
 Specifies a list of model item types.
 ModelOId                                pfcModel                pfcModelOId.ModelOId_Create(),
                                                                 Model.GetOId()
 This class describes a model owner. For internal use only.
 Models                                  pfcModel                Models.create(), Session.ListModels()
 This data type is used to specify a list of models.
 ModelType                               pfcModel                ModelType.FromInt() or by using any
                                                                 of the static instances (e.g.,
                                                                 MDL_ASSEMBLY)
 This enumerated type lists the supported model types.
 MoldFeat                                pfcMoldFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a mold feature.
 NamedModelItem                          pfcModelItem            Base class; not returned.
 This class specifies the name of a model item.
 NeckFeat                                pfcNeckFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a neck feature.
 Note                                    pfcNote                 pfcSolid.CreateNote()
 Specifies the information for a note.
 NoteLeader                              pfcNote                 pfcNote.NoteLeader_Create()
 Specifies the note leader information.
 NoteLeaders                             pfcNote                 NoteLeaders.create(), Parametric-
                                                                 NotePlacement.GetLeaders()
 Specifies an array of note leaders.
 NoteLeaderType                          pfcNote                 NoteLeaderType.FromInt() or by using
                                                                 any of the static instances (e.g.,
                                                                 NOTE_LEADER_NONE)
 This enumerated type lists the possible kids of note leader.
 NotePlacement                           pfcNote                 Note.GetPlacement()
 Specifies the placement of the note.
 Object                                  pfcObject               Base class; not returned.
J-Link Classes                                                                                       G - 17
               Class                              Package                          Returned by
                                                                                                                 J-Link Classes
                                                                      DIMTOL_PARAM)
 Enumeration of parameters types that is used to specify which parameters to display.
 ParamValue                              pfcModelItem                 BaseParameter.GetValue(), Family-
                                                                      Member.GetCell(), ParamValues.get(),
 This class describes the value of the parameter.
 ParamValues                             pfcModelItem                 ParamValues.create()
 This data type is used to specify an array of parameters.
 ParamValueType                          pfcModelItem                 ParamValueType.FromInt() or by using
                                                                      any of the static instances (e.g.,
                                                                      PARAM_STRING)
 This enumerated type lists the possible kinds of parameter value.
 Parent                                  pfcObject                    Child.GetDBParent()
 This class specifies a parent object.
 Part                                    pfcPart                      Session.CreatePart()
 This class defines the material data for a part.
 PatchFeat                               pfcPatchFeat                 Downcast of pfcFeature.Feature.
 This feature type specifies a patch.
 PipeBranchFeat                          pfcPipeBranchFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a pipe branch.
 PipeExtendFeat                          pfcPipeExtendFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a pipe extension.
 PipeFeat                                pfcPipeFeat                  Downcast of pfcFeature.Feature.
 This feature type specifies a pipe feature.
 PipeFollowFeat                          pfcPipeFollowFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a follow feature, which is used in pipe routing.
 PipeJoinFeat                            pfcPipeJoinFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a pipe join feature.
 PipeJointFeat                           pfcPipeJointFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a pipe joint.
J-Link Classes                                                                                          G - 19
                Class                              Package                         Returned by
                                                                                                                  J-Link Classes
 ProcessStepFeat                       pfcProcessStepFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a process step feature, which is used in the Pro/PROCESS for ASSEMBLIES
 module.
 ProgramExportInstructions             pfcModel                        pfc-
                                                                       Model.ProgramExportInstructions_Cre
                                                                       ate()
 Used to export a program file for a part or assembly, which can be edited to change the model.
 ProtrusionFeat                        pfcProtrusionFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a protrusion.
 Quilt                                 pfcGeometry                     Surface.GetOwnerQuilt(). Also, by
                                                                       downcasting pfcModelItem.Mod-
                                                                       elItem.
 This class defines a quilt.
 RefDimension                          pfcDimension                    Downcast of pfcModelItem.Mod-
                                                                       elItem.
 This class describes a reference dimension.
 RegenInstructions                     pfcSolid                        pfcSolid.RegenInstructions_Create()
 This class describes the regeneration instructions of a feature.
 RelationExportInstructions            pfcModel                        pfc-
                                                                       Model.RelationExportInstructions_Cre
                                                                       ate ()
 Used to export a list of the relations and parameters in a part or assembly.
 RemoveSurfacesFeat                    pfcRemoveSurfacesFeat           Downcast of pfcFeature.Feature.
 This feature type specifies a removed-surface feature.
 RenderExportInstructions              pfcModel                        pfc-
                                                                       Model.RenderExportInstructions_Crea
                                                                       te()
 Used to export a part or assembly in RENDER format.
 ReorderAfterOperation                 pfcFeature                      Feature.CreateReorderAfterOp()
 This class defines how to reorder the features in the regeneration order list.
 ReorderBeforeOperation                pfcFeature                      Feature.CreateReorderBeforeOp()
 This class determines how to move the features backward in the regeneration order list.
J-Link Classes                                                                                           G - 21
                Class                              Package                        Returned by
                                                                                                               J-Link Classes
 SETExportInstructions                  pfcModel                    pfc-
                                                                    Model.SETExportInstructions_Create(
                                                                    )
 This class defines a ruled surface.
 SETFeat                                pfcSETFeat                  Downcast of pfcFeature.Feature.
 This feature type specifies a SET file.
 ShaftFeat                              pfcShaftFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a shaft.
 SheetmetalClampFeat                    pfcSheetmetalClampFeat      Downcast of pfcFeature.Feature.
 This feature type specifies a sheetmetal clamp.
 SheetmetalConversionFeat               pfcSheetmetalConversion-    Downcast of pfcFeature.Feature.
                                        Feat
 This feature type specifies a conversion feature, which is used in the Pro/NC-SHEETMETAL module.
 SheetmetalCutFeat                      pfcSheetmetalCutFeat        Downcast of pfcFeature.Feature.
 This feature type specifies a sheetmetal cut feature.
 SheetmetalOptimizeFeat                 pfcSheetmetalOpti-          Downcast of pfcFeature.Feature.
                                        mizeFeat
 This feature type specifies an optimize feature, used in the Pro/NC-SHEETMETAL module.
 SheetmetalPopulateFeat                 pfcSheetmetalPopulateFeat   Downcast of pfcFeature.Feature.
 This feature type specifies a populate feature, which is used in the Pro/NC-SHEETMETAL module.
 SheetmetalPunchPointFeat               pfcSheetmetalPunchPoint-    Downcast of pfcFeature.Feature.
                                        Feat
 This feature type specifies a punch point, which is used in the Pro/NC-SHEETMETAL module.
 SheetmetalShearFeat                    pfcSheetmetalShearFeat      Downcast of pfcFeature.Feature.
 This feature type specifies a sheetmetal shear feature.
 SheetmetalZoneFeat                     pfcSheetmetalZoneFeat       Downcast of pfcFeature.Feature.
 This feature type specifies a sheetmetal zone.
 ShellFeat                              pfcShellFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a shell.
 ShrinkageFeat                          pfcShrinkageFeat            Downcast of pfcFeature.Feature.
J-Link Classes                                                                                        G - 23
               Class                              Package                           Returned by
 This feature type specifies a shrinkage feature, which is used in the Pro/MOLD and Pro/CAST modules.
 ShrinkDimFeat                         pfcShrinkDimFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a shrink dimension feature, which is used in the Pro/MOLD and Pro/CAST
 modules.
 SilhouetteTrimFeat                    pfcSilhouetteTrimFeat         Downcast of pfcFeature.Feature.
 This feature type specifies a silhouette trim feature.
 STLASCIIExportInstructions            pfcModel                      pfc-
                                                                     Model.SLAASCIIExportInstructions_
                                                                     Create()
 Used to export a part or assembly to an ASCII STL file.
 STLBinaryExportInstructions           pfcModel                      pfc-
                                                                     Model.SLABinaryExportInstructions_
                                                                     Create()
 Used to export a part or assembly in a binary STL file.
 SlotFeat                              pfcSlotFeat                   Downcast of pfcFeature.Feature.
 This feature type specifies a slot.
 SMMFGApproachFeat                     pfcSMMFGApproachFeat          Downcast of pfcFeature.Feature.
 This feature type specifies an approach feature, which is used in sheetmetal manufacturing.
 SMMFGCosmeticFeat                     pfcSMMFGCosmeticFeat          Downcast of pfcFeature.Feature.
 This feature type specifies a cosmetic feature used in sheetmetal manufacturing.
 SMMFGCutFeat                          pfcSMMFGCutFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a cut feature for sheetmetal manufacturing.
 SMMFGFormFeat                         pfcSMMFGFormFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a form feature used in sheetmetal manufacturing.
 SMMFGMaterialRemoveFeat               pfcSMMFGMaterialRe-           Downcast of pfcFeature.Feature.
                                       moveFeat
 This feature type specifies a material removal feature, which is used in sheetmetal manufacturing.
 SMMFGOffsetFeat                       pfcSMMFGOffsetFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a sheetmetal offset feature.
 SMMFGPunchFeat                        pfcSMMFGPunchFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a sheetmetal punch feature.
 SMMFGShapeFeat                        pfcSMMFGShapeFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a sheetmetal shape feature.
 SMMFGSlotFeat                         pfcSMMFGSlotFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a sheetmetal slot.
                                                                                                                   J-Link Classes
 Interface to be implemented by user-defined classes that respond to solid events.
 SolidifyFeat                           pfcSolidifyFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a solidify feature, which is used in the Pro/COMPOSITE module.
 SolidPipeFeat                          pfcSolidPipeFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a solid pipe feature.
 SpinalBendFeat                         pfcSpinalBendFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a spinal bend.
 Spline                                 pfcGeometry                  Downcast of pfcGeometry.Curve.
 This class defines a spline.
 SplinePoint                            pfcGeometry                  SplinePoints.get()
 This class defines a spline point.
 SplinePoints                           pfcGeometry                  SplinePoints.create(), Spline.Get-
                                                                     Points()
 This data type is used to specify an array of spline points.
 SplitFeat                              pfcSplitFeat                 Downcast of pfcFeature.Feature.
 This feature type specifies a split feature.
 SplitSurfaceFeat                       pfcSplitSurfaceFeat          Downcast of pfcFeature.Feature.
 This feature type specifies a split-surface feature.
 SpoolFeat                              pfcSpoolFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a spool.
 SpringBackFeat                         pfcSpringBackFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a spring-back feature.
 StdColor                               pfcBase                      Session.SetTextColor(), GetRGB-
                                                                     FromStdColor(), StdColor.FromInt(),
                                                                     or by using any of the static instances
                                                                     (e.g., COLOR_SHEETMETAL)
 This enumerated type lists the supported color types.
 StdLineStyle                           pfcBase                      Session.SetLineStyle(), StdLine-
                                                                     Style.FromInt(), or by using any of the
                                                                     static instances (e.g., LINE_SOLID)
J-Link Classes                                                                                            G - 25
               Class                               Package                       Returned by
                                                                                                                J-Link Classes
                                                                     dow.GetTransform()
 This class provides information about the transformation.
 TransformedSurface                       pfcGeometry                Downcast of pfcGeometry.Surface.
 This class defines a transformed surface.
 TurnFeat                                 pfcTurnFeat                Downcast of pfcFeature.Feature.
 This feature type specifies a turn feature, which is used in the manufacturing module.
 TwistFeat                                pfcTwistFeat               Downcast of pfcFeature.Feature.
 This feature type specifies a twist feature.
 UDFClampFeat                             pfcUDFClampFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a UDF clamp.
 UDFFeat                                  pfcUDFFeat                 Downcast of pfcFeature.Feature.
 This feature type specifies a UDF feature.
 UDFNotchFeat                             pfcUDFNotchFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a UDF notch feature.
 UDFPunchFeat                             pfcUDFPunchFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a UDF punch feature.
 UDFRmdtFeat                              pfcUDFRmdtFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a UDF for rapid mold design.
 UDFThreadFeat                            pfcUDFThreadFeat           Downcast of pfcFeature.Feature.
 This feature type specifies a UDF thread feature.
 UDFWorkRegionFeat                        pfcUDFWorkRegionFeat       Downcast of pfcFeature.Feature.
 This feature type specifies a UDF work region feature.
 UDFZoneFeat                              pfcUDFZoneFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a UDF zone feature.
 UICommand                                pfcCommand                 Session.UICreateCommand()
 An action-listener object for menu commands.
 UICommandActionListener_u                pfcCommand                 Base class; not returned.
 Abstract base class that all user-defined UICommandActionListener classes must extend.
J-Link Classes                                                                                         G - 27
               Class                              Package                              Returned by
                                                                                                               J-Link Classes
 This feature type specifies a wall, which is used in the Pro/NC-SHEETMETAL module.
 WaterLineFeat                         pfcWaterLineFeat             Downcast of pfcFeature.Feature.
 This feature type specifies a waterline feature.
 WeldEdgePrepFeat                      pfcWeldEdgePrepFeat          Downcast of pfcFeature.Feature.
 This feature type specifies a preparation edge, which is used in the Pro/WELDING module.
 WeldFilletFeat                        pfcWeldFilletFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a welding fillet.
 WeldGrooveFeat                        pfcWeldGrooveFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a weld groove.
 WeldingRodFeat                        pfcWeldingRodFeat            Downcast of pfcFeature.Feature.
 This feature type specifies a welding rod.
 WeldPlugSlotFeat                      pfcWeldPlugSlotFeat          Downcast of pfcFeature.Feature.
 This feature type specifies a plug-slot feature, which is used in the Pro/WELDING module.
 WeldSpotFeat                          pfcWeldSpotFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a welding spot.
 Window                                pfcWindow                    Session.GetCurrentWindow(), Ses-
                                                                    sion.CreateModelWindow(), Ses-
                                                                    sion.OpenFile(),
                                                                    Session.GetWindow(), Windows.get()
 This class describes the attributes of a window.
 WindowOId                             pfcWindow                    pfcWindow.WindowOId_Create()
 This class specifies a window identifier. For internal use only.
 Windows                               pfcWindow                    Session.ListWindows(), Windows.cre-
                                                                    ate()
 This data type is used to specify an array of windows.
 WorkcellFeat                          pfcWorkcellFeat              Downcast of pfcFeature.Feature.
 This feature type specifies a workcell.
 XBadArgument                          pfcExceptions                Created, thrown in J-Link code.
 This exception is thrown when you specify an invalid argument.
J-Link Classes                                                                                        G - 29
               Class                            Package                           Returned by
                         A                   requirements 5-3
                                         navigating the tree 5-9
abstract keyword 2-6                     Netscape Navigator
Accuracy                                     Java2 plugin not recommended 5-6
    getting and setting 11-2                 requirements 5-3
ActionListener                           searching for a string 5-13
    creating 21-2                        supported web browsers 5-3
    definition 2-6                       Swing
    description of the class 3-10            class path-NT 5-4
    events 21-2
                                             class path-UNIX 5-4
    feature-level 21-10
    session-level 21-4                       download JFC archive 5-3
    solid-level 21-8                         Java Foundation Class 5-3
    types 21-2                           topic/object selection frame 5-6
    UI command 21-5                      tree updating
ActionSource interface 21-3                  defined 5-6
    definition 3-11                          Java2 plugin requirements 5-6
Activate                              Applications
    window 12-4                          creating 3-14
Adapters 2-6                             hierarchy 3-14
Add                                      registering 1-4
    items to a layer 13-4                running 1-5
Allocate                                 setting up 1-2
    simplified representations 23-4      standalone 1-2
allow_stop field 1-3                  Arcs
APIWizard                                description 16-4
    browsing                             representation F-14
        objects 5-9                   Area
        user’s guide 5-11                surface 16-11
    defined 5-2                       Arguments, optional 4-2
    display frame 5-7                 Arrays 3-7
    find (search mechanism) 5-13         sample class 3-8
    interface defined 5-6             Arrows 16-5
    Internet Explorer                 Assemblies
        Java2 plug in 5-3                coordinate systems 12-8
        Java2 plugin 5-6                 creating 11-2
                                         hierarchy 19-3
                                                                                Index - i
  structure of 19-2                          Contours, locating in a model 16-7
Axes 16-12                                   Coons patches
  evaluating 16-12                              geometry representation F-8
                                             Coordinate systems 12-6, 16-12
                         B                      assemblies 12-8
                                                datum 12-8
Bounding box 11-5                               drawing 12-7
Browsing                                        Drawing View 12-7
   objects with APIWizard 5-9                   evaluating 16-12
   Pro/TOOLKIT user’s guide with APIWizard      screen 12-7
             5-11                               section 12-8
B-splines                                       solid 12-6
   description 16-4                             window 12-7
Button                                       Coordinate transformations 12-6
   placing 8-14                              Copy
Buttons                                         models 9-9
   creating 8-2                              Create
Bytecodes 2-4                                   action listeners 21-2
                                                applications 3-14
                         C                      assembly 11-2
catch block                                     buttons 8-2
   using multiple 3-22                          family table columns 20-5
catch keyword 2-7                               family table instance 20-3
Cells                                           layer 13-4
   accessing 20-4                               local group 14-7
Child.GetDBParent description                   material 11-15
   method 10-21                                 menus 8-2
Children 14-2                                   parameters 17-4
cipjava 3-14                                    part 11-2
Circles 16-5                                    simplified representations 23-4
Classes                                         UDFs 14-9
   list of G-2                                  window 12-2
   types 3-2                                 Create Interactively Defined UDFs 14-11
Clear                                        Creating UDFs 14-10
   window 12-3                               Curves 16-3
Close                                           data structures F-13
   window 12-4                                  determining the type 16-4
Collect                                         principal 16-11
   garbage 2-4                                  t parameter 16-3
Colors 6-7                                      types 16-4
Commands                                            reserved 16-5
   designating 8-12                          Cylinders 16-9
Comments 2-7                                    geometry representation F-3
Composite curves                                spline surfaces F-11
   description 16-4                             tabulated 16-9
Cones                                               geometry representation F-7
   class representation 16-9
   geometry representation F-4                                       D
Configuration file
                                             Data types 2-6
   PROTKDAT option 1-4
                                                enums 3-9
   toolkit_registry_file option 1-4
                                             delay_start field 1-3
Configuration options 6-5
                                             Delete
Constants 2-4
                                                feature pattern 14-6
Contours
                                                models 9-9
   evaluating 16-7
                                                row from a family table 20-3
   traversing 16-2
                                                                                        Index - iii
    patterns 14-6                         Inheritance
    read-only 14-3                            of ActionListeners 3-11
    resuming 14-4                             of arrays 3-8
    suppressing 14-4                          of enumerated types 3-10
    user-defined 14-9                         of Pro/ENGINEER-related objects 3-3, 3-5
Fields                                        of sequences 3-6
    of ActionListeners 3-11                   of utilities 3-13
    of arrays 3-8                             overview 2-3
    of enumerated types 3-9               Initialize
    of Pro/ENGINEER-related objects 3-4       ActionListeners 3-11
    of sequences 3-6                          arrays 3-8
    of utilities 3-13                         dictionaries 3-9
Files                                         Pro/ENGINEER-related objects 3-2, 3-4
    exporting 22-2                            sequences 3-6
    JAR 1-7                                   utilities 3-12
    message 6-8                           Install
        contents 6-8                          See J-Link Installing B-2
    naming restrictions 6-8               Installation
    plotting 22-32                            See J-Link Installing B-2
Fillet surfaces                           instanceof operator 2-5
    geometry representation F-8           Interactive selection 7-2
final keyword 2-5                         Interactively Defined UDFs
finally keyword 2-7                           create 14-11
Find                                      Internet Explorer
    APIWizard search mechanism 5-13           Java2 plug in 5-3
FocusListener 2-7                             requirements 5-3
Frames                                    ItemListener 2-7
    display frame in APIWizard 5-7
    topic/object selection 5-6                                     J
                         G                JAR files 1-7
                                          Java
Garbage collection 2-4                       bytecodes 2-4
General surface of revolution F-6            comments 2-7
Generic model                                data types 2-6
   getting 20-3                              enumerated types 3-9
Geometry                                     equivalents to constants 2-4
   solid edge 16-6                           event handling 2-6
   terms 16-2                                implementation 2-3
   traversal 16-2                            inheritance 2-3
Groups 14-6, 14-9                            jar command 1-7
                                             javadoc 2-8
                         H                   JDBC 2-2
                                             JDK
Hierarchy                                        functionality 2-2
   application 3-14                          JVM 2-4
Highlight                                    keywords 2-4
   selections 7-5                            overview 2-3
                                             platform independence 2-4
                         I                   polymorphism 2-3
Implementation                            Java Virtual Machine 2-4
   and inheritance 2-3                    java.applet API 2-2
Import                                    java.awt API 2-2
   packages 3-14                          java.io API 2-2
Information                               java.lang API 2-2
   Drawing 10-6                           java_app_class field 1-3
                                                                                          Index - v
   requirements 5-3                    pfcArgument.ArgValue.Getdiscr method
   Swing required 5-3                     description 25-3
new keyword 2-5                        pfcAssembly.Assembly.AssembleByCopy method
Normalize                                 description 19-10
   matrix 12-11                        pfcAssembly.Assembly.AssembleComponent
Notification of events 2-6                       method
NURBS                                     description 19-9
   representation F-15                 pfcAssembly.Assembly.AssembleSkeleton method
   surface F-10                           description 19-21
                                       pfcAssembly.Assembly.AssembleSkeletonByCopy
                         O                       method
                                          description 19-21
Objects                                pfcAssembly.Assembly.CreateComponentPath
  browsing with APIWizard 5-9                    method
Open                                      description 19-8
  file 9-4                             pfcAssembly.Assembly.DeleteSkeleton method
Operations                                description 19-21
  Drawing 10-7                         pfcAssembly.Assembly.GetActiveExplodedState
  feature 14-4                                   method
  layer 13-4                              description 19-20
  model 9-9                            pfcAssembly.Assembly.GetDefaultExplodedState
  solid 11-3, 22-41                              method
  view 12-5                               description 19-21
  window 12-3, 22-43                   pfcAssembly.Assembly.GetIsExploded method
Optional arguments 4-2                    description 19-20
Outlines                               pfcAssembly.Assembly.GetSkeleton method
  contour 16-7                            description 19-21
Overload                               pfcAssembly.Assembly.UnExplod method
  methods 2-4                             description 19-20
Override                               pfcAssembly.ComponentFeat.GetIsVisible method
  methods 2-4                             description 19-9
                                       pfcAssembly.ComponentPath.GetComponentIds
                         P                       method
package keyword 2-5                       description 19-9
Packages                               pfcAssembly.ComponentPath.GetLeaf method
   importing 3-14                         description 11-2, 19-9
Parameters 17-4                        pfcAssembly.ComponentPath.GetRoot method
   information 17-7                       description 11-2, 19-8
ParamValue objects 17-2                pfcAssembly.ComponentPath.GetTransform method
Parents 14-2                              description 19-9
Parts 11-15                            pfcAssembly.ComponentPath.SetComponentIds
   creating 11-2                                 method
Pattern leaders 14-2, 14-7                description 19-9
Patterns 14-6                          pfcAssembly.ComponentPath.SetRoot method
pfcArgument.Argument.GetLabel method      description 19-8
   description 25-3                    pfcAssembly.ComponentPath.SetTransform method
pfcArgument.Argument.GetValue method      description 19-9
   description 25-3                    pfcAssembly.ExplodedState.Activate method
pfcArgument.Argument.SetLabel method      description 19-21
   description 25-3                    pfcAsyncConnection.AsyncActionListener.OnTermi
pfcArgument.Argument.SetValue method             nate method
   description 25-3                       description 24-10
pfcArgument.Argument_Create method     pfcAsyncConnection.AsyncConnection.Disconnect
   description 25-3                              method
pfcArgument.Arguments.create method       description 24-7
   description 25-3                    pfcAsyncConnection.AsyncConnection.End method
                                                                                       Index - vii
   description 19-6                                    pfcDetail.DetailGroupInstructions interface
pfcComponentFeat.ComponentFeat.Regenerate                 description 10-63
          method                                       pfcDetail.DetailGroupInstructions.Create method
   description 19-8                                       description 10-63
pfcComponentFeat.ComponentFeat.SetCompType             pfcDetail.DetailGroupInstructions.GetElements
          method                                                 method
   description 19-4                                       description 10-64
pfcDetail.Attachment.GetType method                    pfcDetail.DetailGroupInstructions.GetIsDisplayed
   description 10-87                                             method
pfcDetail.Detail.DetailNoteItem interface                 description 10-64
   description 10-56                                   pfcDetail.DetailGroupInstructions.GetName method
pfcDetail.Detail.DetailSymbolInstInstructions             description 10-64
          interface                                    pfcDetail.DetailGroupInstructions.SetElements
   description 10-74                                             method
pfcDetail.DetailEntityInstructions.Create method          description 10-64
   description 10-51                                   pfcDetail.DetailGroupInstructions.SetIsDisplayed
pfcDetail.DetailEntityInstructions.GetColor method               method
   description 10-52                                      description 10-64
pfcDetail.DetailEntityInstructions.GetFontName         pfcDetail.DetailGroupInstructions.SetName method
          method                                          description 10-64
   description 10-52                                   pfcDetail.DetailGroupInstructions_Create method
pfcDetail.DetailEntityInstructions.GetGeometry            description 10-50
          method                                       pfcDetail.DetailGroupItem.Draw method
   description 10-52                                      description 10-64
pfcDetail.DetailEntityInstructions.GetIsConstruction   pfcDetail.DetailGroupItem.Erase method
          method                                          description 10-64
   description 10-52                                   pfcDetail.DetailGroupItem.GetInstructions method
pfcDetail.DetailEntityInstructions.GetView method         description 10-64
   description 10-53                                   pfcDetail.DetailGroupItem.Modify method
pfcDetail.DetailEntityInstructions.GetWidth method        description 10-64
   description 10-53                                   pfcDetail.DetailItemOwner.CreateDetailItem method
pfcDetail.DetailEntityInstructions.SetColor method        description 10-50
   description 10-52                                   pfcDetail.DetailItemOwner.ListDetailItems method
pfcDetail.DetailEntityInstructions.SetFontName            description 10-50
          method                                       pfcDetail.DetailItemOwner.RetrieveSymbolDefinitio
   description 10-52                                             n method
pfcDetail.DetailEntityInstructions.SetGeometry            description 10-69
          method                                       pfcDetail.DetailNoteInstructions interface
   description 10-52                                      description 10-56
pfcDetail.DetailEntityInstructions.SetIsConstruction   pfcDetail.DetailNoteInstructions.Create method
          method                                          description 10-57
   description 10-52                                   pfcDetail.DetailNoteInstructions.GetColor method
pfcDetail.DetailEntityInstructions.SetView method         description 10-58
   description 10-53                                   pfcDetail.DetailNoteInstructions.GetHorizontal
pfcDetail.DetailEntityInstructions.SetWidth method               method
   description 10-53                                      description 10-58
pfcDetail.DetailEntityItem.Draw method                 pfcDetail.DetailNoteInstructions.GetIsDisplayed
   description 10-55                                             method
pfcDetail.DetailEntityItem.Erase method                   description 10-58
   description 10-55                                   pfcDetail.DetailNoteInstructions.GetIsMirrored
pfcDetail.DetailEntityItem.GetInstructions method                method
   description 10-55                                      description 10-58
pfcDetail.DetailEntityItem.GetSymbolDef method         pfcDetail.DetailNoteInstructions.GetIsReadOnly
   description 10-55                                             method
pfcDetail.DetailEntityItem.Modify method                  description 10-58
   description 10-55                                   pfcDetail.DetailNoteInstructions.GetLeader method
                                                                                              Index - ix
   description 10-69                                     description 10-78
pfcDetail.DetailSymbolInstInstructions.Create         pfcDetail.DetailSymbolInstItem.Erase method
          method                                         description 10-78
   description 10-75                                  pfcDetail.DetailSymbolInstItem.GetInstructions
pfcDetail.DetailSymbolInstInstructions.GetAngle                 method
          method                                         description 10-78
   description 10-76                                  pfcDetail.DetailSymbolInstItem.Modify method
pfcDetail.DetailSymbolInstInstructions.GetAttachOn       description 10-79
          DefType method                              pfcDetail.DetailSymbolInstItem.Remove method
   description 10-76                                     description 10-78
pfcDetail.DetailSymbolInstInstructions.GetColor       pfcDetail.DetailSymbolInstItem.Show method
          method                                         description 10-78
   description 10-75                                  pfcDetail.FreeAttachment.GetAttachmentPoint
pfcDetail.DetailSymbolInstInstructions.GetCurrentT              method
          ransform method                                description 10-88
   description 10-77                                  pfcDetail.FreeAttachment.GetView method
pfcDetail.DetailSymbolInstInstructions.GetDefAttac       description 10-88
          hment method                                pfcDetail.FreeAttachment.SetAttachmentPoint
   description 10-76                                            method
pfcDetail.DetailSymbolInstInstructions.GetInstAttac      description 10-88
          hment method                                pfcDetail.FreeAttachment.SetView method
   description 10-76                                     description 10-88
pfcDetail.DetailSymbolInstInstructions.GetIsDisplay   pfcDetail.OffsetAttachment.GetAttachedGeometry
          ed method                                             method
   description 10-75                                     description 10-89
pfcDetail.DetailSymbolInstInstructions.GetSymbolD     pfcDetail.OffsetAttachment.GetAttachmentPoint
          ef method                                             method
   description 10-75                                     description 10-89
pfcDetail.DetailSymbolInstInstructions.GetTextValu    pfcDetail.OffsetAttachment.SetAttachedGeometry
          es method                                             method
   description 10-77                                     description 10-89
pfcDetail.DetailSymbolInstInstructions.SetAngle       pfcDetail.OffsetAttachment.SetAttachmentPoint
          method                                                method
   description 10-77                                     description 10-90
pfcDetail.DetailSymbolInstInstructions.SetAttachOn    pfcDetail.ParametricAttachment.GetAttachedGeome
          DefType method                                        try method
   description 10-76                                     description 10-89
pfcDetail.DetailSymbolInstInstructions.SetColor       pfcDetail.ParametricAttachment.SetAttachedGeomet
          method                                                ry method
   description 10-75                                     description 10-89
pfcDetail.DetailSymbolInstInstructions.SetDefAttac    pfcDetail.UnsupportedAttachment.GetAttachmentPo
          hment method                                          int method
   description 10-76                                     description 10-90
pfcDetail.DetailSymbolInstInstructions.SetInstAttac   pfcDetail.UnsupportedAttachment.SetAttachmentPoi
          hment method                                          nt method
   description 10-76                                     description 10-90
pfcDetail.DetailSymbolInstInstructions.SetIsDisplay   pfcDimension.BaseDimension.GetDimType method
          ed method                                      description 17-14
   description 10-75                                  pfcDimension.BaseDimension.GetSymbol method
pfcDetail.DetailSymbolInstInstructions.SetSymbolD        description 17-14
          ef method                                   pfcDimension.BaseDimension.GetTexts method
   description 10-75                                     description 17-14
pfcDetail.DetailSymbolInstInstructions.SetTextValue   pfcDimension.BaseDimension.SetTexts method
          s method                                       description 17-14
   description 10-77                                  pfcDimension.Dimension.GetTolerance method
pfcDetail.DetailSymbolInstItem.Draw method               description 17-14
                                                                                        Index - xi
pfcFamily.FamColModelItem.GetRefItem method                 14-4
   description 13-3                               pfcFeature.Feature.CreateResumeOp method 14-4
pfcFamily.FamColParam.GetRefParam method 17-4     pfcFeature.Feature.CreateSuppressOp method 14-4
pfcFamily.FamilyMember.AddRow method              pfcFeature.Feature.GetFeatSubType method
   description 20-5                                  description 14-3
pfcFamily.FamilyMember.CreateColumn method        pfcFeature.Feature.GetFeatType method
   description 20-6                                  description 14-3
pfcFamily.FamilyMember.CreateCompModelColum       pfcFeature.Feature.GetFeatTypeName method
          n method                                   description 14-3
   description 20-5                               pfcFeature.Feature.GetGroup method
pfcFamily.FamilyMember.CreateComponentColumn         description 14-7
          method                                  pfcFeature.Feature.GetIsVisible method
   description 20-5                                  description 14-3
pfcFamily.FamilyMember.CreateDimensionColumn      pfcFeature.Feature.GetNumber method
          method                                     description 14-3
   description 20-5                               pfcFeature.Feature.GetPattern method
pfcFamily.FamilyMember.CreateGroupColumn             description 14-7
          method                                  pfcFeature.Feature.GetStatus method
   description 20-5                                  description 14-3
pfcFamily.FamilyMember.CreateMergePartColumn      pfcFeature.Feature.ListParents method
          method                                     description 14-2
   description 20-5                               pfcFeature.Feature.ListSubItems method
pfcFamily.FamilyMember.CreateParamColumn             description 13-3
          method                                  pfcFeature.FeatureActionListener.OnAfterCopy
   description 20-5                                         method
pfcFamily.FamilyMember.GetCell method                description 21-11
   description 20-4                               pfcFeature.FeatureActionListener.OnAfterRegen
pfcFamily.FamilyMember.GetCellIsDefault method              method 21-10
   description 20-4                                  description 21-10
pfcFamily.FamilyMember.GetColumn method           pfcFeature.FeatureActionListener.OnAfterSuppress
   description 20-3                                         method
pfcFamily.FamilyMember.ListColumns method            description 21-10
   description 20-3                               pfcFeature.FeatureActionListener.OnBeforeDelete
pfcFamily.FamilyMember.ListRows method                      method 21-10
   description 20-3                                  description 21-10
pfcFamily.FamilyMember.RemoveColumn method        pfcFeature.FeatureActionListener.OnBeforeParamet
   description 20-3                                         erDelete method
pfcFamily.FamilyMember.RemoveRow method              description 21-11
   description 20-3                               pfcFeature.FeatureActionListener.OnBeforeRedefine
pfcFamily.FamilyMember.SetCell method                       method 21-10
   description 20-4                                  description 21-11
pfcFamily.FamilyTableColumn.GetType method        pfcFeature.FeatureActionListener.OnBeforeRegen
   description 20-4                                         method 21-10
pfcFamily.FamilyTableRow.CreateInstance method       description 21-10
   description 9-2                                pfcFeature.FeatureActionListener.OnBeforeSuppress
pfcFamily.FamTabColumn.GetSymbol method                     method 21-10
   description 20-3                                  description 21-10
pfcFamily.FamTableRow.GetInstanceName method      pfcFeature.FeatureActionListener.OnRegenFailure
   description 20-3                                         method 21-10
pfcFamily.FamTableRow.SetIsLocked method             description 21-10
   description 20-3                               pfcFeature.FeatureGroup.GetPattern method
pfcFeature.DeleteOperation.SetClip option 14-4       description 14-7
pfcFeature.Feature.CreateDeleteOp method 14-4     pfcFeature.FeatureGroup.GetUDFName method
pfcFeature.Feature.CreateReorderAfterOp method       description 14-9
          14-4                                    pfcFeature.FeatureGroup.ListUDFDimensions
pfcFeature.Feature.CreateReorderBeforeOp method             method
                                                                                       Index - xiii
pfcMFG.MFG.GetSolid method                       description 9-6, 9-8
   description 11-2                           pfcModel.Model.GetVersionStamp method
pfcModel.Import2DInstructions interface          description 9-6, 9-8
   description 22-28                          pfcModel.Model.Import method
pfcModel.Model.Backup method                     description 22-26
   description 9-9                            pfcModel.Model.ListDeclaredModels method
pfcModel.Model.CheckIsModifiable method          description 9-6, 9-8
   description 9-8                            pfcModel.Model.ListDependencies method
pfcModel.Model.CheckIsSaveAllowed method         description 9-6, 9-8
   description 9-9                            pfcModel.Model.Rename method
pfcModel.Model.Copy method                       description 9-9 to 9-10
   description 9-9                            pfcModel.Model.Save method
pfcModel.Model.CopyAndRetrieve method            description 9-9 to 9-10, 28-12
   description 9-9                            pfcModel.Model.SaveAs method
pfcModel.Model.CreateLayer method                description 9-9
   description 13-4                           pfcModel.Model.SetCommonName method
pfcModel.Model.Delete method                     description 9-10
   description 9-9 to 9-10                    pfcModel.ModelDescriptor.GetFullName method
pfcModel.Model.Display method                    description 9-3
   description 9-9 to 9-10, 12-2              pfcModel.ModelDescriptor.SetDevice method
pfcModel.Model.Erase method                      description 9-3
   description 9-9 to 9-10                    pfcModel.ModelDescriptor.SetFileVersion method
pfcModel.Model.EraseWithDependencies method      description 9-3
   description 9-10                           pfcModel.ModelDescriptor.SetGenericName method
pfcModel.Model.Export method                     description 9-3
   description 22-2, 22-17                    pfcModel.ModelDescriptor.SetHost method
pfcModel.Model.GetBranch method                  description 9-3
   description 9-6, 9-8                       pfcModel.ModelDescriptor.SetInstanceName
pfcModel.Model.GetCommonName method                     method
   description 9-6                               description 9-3
pfcModel.Model.GetDescr method                pfcModel.ModelDescriptor.SetModelType method
   description 9-6 to 9-7                        description 9-3
pfcModel.Model.GetFileName method             pfcModel.ModelDescriptor.SetPath method
   description 9-6                               description 9-3
pfcModel.Model.GetFullName method             pfcModel.ModelDescriptor_Create method
   description 9-3, 9-7                          description 9-3
pfcModel.Model.GetGenericName method             used in a code example 9-5
   description 9-7                            pfcModel.Models
pfcModel.Model.GetInstanceName method            information 9-6
   description 9-7                            pfcModel.PlotInstructions_Create method 22-32
pfcModel.Model.GetIsCommonNameModifiable      pfcModel2D.Model2D.AddModel method
          method                                 description 10-7
   description 9-6                            pfcModel2D.Model2D.AddSimplifiedRep method
pfcModel.Model.GetIsModified method              description 10-8
   description 9-6, 9-8                       pfcModel2D.Model2D.Create View method
pfcModel.Model.GetOrigin method                  description 10-8
   description 9-7                            pfcModel2D.Model2D.CreateDrawingDimension
pfcModel.Model.GetRelationId method                     method
   description 9-7                               description 10-8
pfcModel.Model.GetReleaseLevel method         pfcModel2D.Model2D.CreateView method
   description 9-6, 9-8                          description 10-15
pfcModel.Model.GetRevision method             pfcModel2D.Model2D.DeleteModel method
   description 9-6, 9-8                          description 10-7
pfcModel.Model.GetType method                 pfcModel2D.Model2D.DeleteSimplifiedRep method
   description 9-7                               description 10-8
pfcModel.Model.GetVersion method              pfcModel2D.Model2D.GetTextHeight method
                                                                                       Index - xv
pfcModelItem.CreateIntParamValue method           pfcNote.Note.Delete function
   description 17-2                                  description 11-14
pfcModelItem.CreateStringParamValue method        pfcNote.Note.Display method
   description 17-2                                  description 11-14
pfcModelItem.ModelItem.GetId method               pfcNote.Note.GetLines method
   description 13-3                                  description 11-14
pfcModelItem.ModelItem.GetName method             pfcNote.Note.GetOwner method
   description 13-3                                  description 11-14
pfcModelItem.ModelItem.GetType method             pfcNote.Note.GetURL method
   description 13-3                                  description 11-14
pfcModelItem.ModelItem.SetName method             pfcNote.Note.SetURL method
   description 13-3                                  description 11-14
pfcModelItem.ModelItemOwner.GetItemById           pfcPart.Material.Delete method
          method                                     description 11-16
   description 10-26, 10-50, 13-3                 pfcPart.Material.GetBendTable method
pfcModelItem.ModelItemOwner.GetItemByName            description 11-21
          method                                  pfcPart.Material.GetCondition method
   description 13-3                                  description 11-21
pfcModelItem.ModelItemOwner.ListItems method      pfcPart.Material.GetCrossHatchFile method
          13-2                                       description 11-21
   description 10-26, 10-49, 13-3, 16-3           pfcPart.Material.GetFailureCriterion method
   using 16-3                                        description 11-20
pfcModelItem.NamedModelItem.GetName method        pfcPart.Material.GetFatigueMaterialFinish function
   description 17-8                                  description 11-20
pfcModelItem.ParameterOwner.CreateParam method    pfcPart.Material.GetFatigueMaterialType method
   description 17-4                                  description 11-20
pfcModelItem.ParameterOwner.GetParam method       pfcPart.Material.GetFatigueType method
   description 17-4                                  description 11-20
pfcModelItem.ParameterOwner.GetRefParam           pfcPart.Material.GetHardness method
          method 17-4                                description 11-21
pfcModelItem.ParameterOwner.ListParams method     pfcPart.Material.GetHardnessType method
   description 17-4                                  description 11-21
pfcModelItem.ParameterOwner.SelectParam method    pfcPart.Material.GetMaterialModel method
   description 17-4                                  description 11-21
pfcModelItem.ParamValue.GetBoolValue method       pfcPart.Material.GetModelDefByTests method
          17-3                                       description 11-21
pfcModelItem.ParamValue.Getdiscr method           pfcPart.Material.GetPermittedFatigueMaterialTypes
   description 17-3                                         method
pfcModelItem.ParamValue.GetDoubleValue method        description 11-20
          17-3                                    pfcPart.Material.GetPermittedFatigueTypes method
pfcModelItem.ParamValue.GetIntValue method           description 11-20
          17-3                                    pfcPart.Material.GetPropertyValue method
pfcModelItem.ParamValue.GetStringValue method        decription 11-19
          17-3                                    pfcPart.Material.GetStructuralMaterialType method
pfcModelItem.ParamValue.SetBoolValue method          description 11-17
          17-3                                    pfcPart.Material.GetSubType method
pfcModelItem.ParamValue.SetDoubleValue method        description 11-18
          17-3                                    pfcPart.Material.GetThermalMaterialType method
pfcModelItem.ParamValue.SetIntValue method 17-3      description 11-17
pfcModelItem.ParamValue.SetStringValue method     pfcPart.Material.RemoveProperty method
          17-3                                       description 11-20
pfcModelItem.ParamValues.create method            pfcPart.Material.Save method
          description 20-5                           description 11-16
pfcModelItem.pfcModelItem.CreateStringParamVal    pfcPart.Material.SetBendTable method
          ue method                                  description 11-21
   description 20-5                               pfcPart.Material.SetCondition method
                                                                                         Index - xvii
pfcServer.CheckinOptions.SetKeepCheckedout            description 28-13
          method                                   pfcServer.Server.UploadObjectsWithOptions method
   description 28-14                                  description 28-13
pfcServer.CheckoutOptions.SetDependency method     pfcServer.Server.UploadOptions_Create method
   description 28-16                                  description 28-13
pfcServer.CheckoutOptions.SetDownload method       pfcServer.ServerLocation.CollectWorkspaces
   description 28-16                                         function
pfcServer.CheckoutOptions.SetIncludeInstances         description 28-4
          method                                   pfcServer.ServerLocation.DeleteWorkspace method
   description 28-16                                  description 28-8
pfcServer.CheckoutOptions.SetReadonly method       pfcServer.ServerLocation.GetClass method
   description 28-16                                  description 28-4
pfcServer.CheckoutOptions.SetSelectedIncludes      pfcServer.ServerLocation.GetLocation method
          method                                      description 28-4
   description 28-16                               pfcServer.ServerLocation.GetVersion method
pfcServer.CheckoutOptions.SetVersion method           description 28-4
   description 28-16                               pfcServer.ServerLocation.ListContexts method
pfcServer.pfcServer.CheckinOptions_Create method      description 28-4
   description 28-14                               pfcServer.UploadBaseOptions.SetAutoresolveOption
pfcServer.pfcServer.CheckoutOptions_Create                   method
          method                                      description 28-13
   create 28-16                                    pfcServer.UploadBaseOptions.SetDefaultFolder
pfcServer.pfcServer.WorkspaceDefinition_Create               method
          method                                      description 28-13
   description 28-7                                pfcServer.UploadBaseOptions.SetNonDefaultFolder
pfcServer.Server.Activate method                             Assignments method
   description 28-5                                   description 28-13
pfcServer.Server.CheckinObjects method             pfcServer.WorkspaceDefinition.GetWorkspaceName
   description 28-14                                         method
pfcServer.Server.CheckoutMultipleObjects method       description 28-7
   description 28-16                               pfcServer.WorkspaceDefinition.SetWorkspaceName
pfcServer.Server.CheckoutObjects method                      method
   description 28-16                                  description 28-7
pfcServer.Server.CreateWorkspace method            pfcSession.BaseSession.AuthenticateBrowser
   description 28-7 to 28-8                                  method
pfcServer.Server.GetActiveWorkspace method            description 28-3, 28-5
   description 28-8                                pfcSession.BaseSession.ChangeDirectory method
pfcServer.Server.GetAlias method                      description 6-5
   description 28-5                                pfcSession.BaseSession.CopyFileFromWS method
pfcServer.Server.GetAliasedUrl method                 description 28-21
   description 28-37                               pfcSession.BaseSession.CopyFileToWS method
pfcServer.Server.GetContext method                    description 28-21
   description 28-5                                pfcSession.BaseSession.CreateAssembly method
pfcServer.Server.GetIsActive method                   description 11-2
   description 28-5                                pfcSession.BaseSession.CreateDrawingFromTempla
pfcServer.Server.IsObjectCheckedOut method                   te method
   description 28-22                                  description 10-2
pfcServer.Server.RemoveObjects method              pfcSession.BaseSession.CreateModelWindow
   description 28-24                                         method
pfcServer.Server.SetActiveWorkspace method            description 12-2
   description 28-8                                pfcSession.BaseSession.CreatePart method
pfcServer.Server.UndoCheckout method                  description 11-2
   description 28-18                               pfcSession.BaseSession.ExecuteModelCheck
pfcServer.Server.Unregister method                           method
   description 28-5                                   description 9-11
pfcServer.Server.UploadObjects method              pfcSession.BaseSession.ExportfromCurrentWS
                                                                                        Index - xix
   description 28-6                                 pfcSession.WSImportExportMessage.GetFileName
pfcSession.pfcSession.WSExportOptions_Create                  method
          method                                       description 28-19
   description 28-20                                pfcSession.WSImportExportMessage.GetMessageTy
pfcSession.Session.GetCurrentSelectionBuffer                  pe method
          method                                       description 28-19
   description 7-8                                  pfcSession.WSImportExportMessage.GetResolution
pfcSession.Session.NavigatorPaneBrowserAdd                    method
          method                                       description 28-19
   description 6-18                                 pfcSession.WSImportExportMessage.GetSucceeded
pfcSession.Session.NavigatorPaneBrowserIconSet                method
          method                                       description 28-19
   description 6-18                                 pfcSheet.SheetOwner.AddSheet method
pfcSession.Session.NavigatorPaneBrowserURLSet          description 10-11
          method                                    pfcSheet.SheetOwner.DeleteSheet method
   description 6-19                                    description 10-11
pfcSession.Session.UIAddButton method               pfcSheet.SheetOwner.GetCurrentSheetNumber
   description 8-2 to 8-3                                     method
pfcSession.Session.UIAddMenu method                    description 10-11
   description 8-2 to 8-3                           pfcSheet.SheetOwner.GetNumberOfSheets method
pfcSession.Session.UIAddSubMenu method                 description 10-11
   description 8-2                                  pfcSheet.SheetOwner.GetSheetBackgroundView
pfcSession.Session.UIClearMessage method 6-10                 10-52
pfcSession.Session.UICreateCommand method           pfcSheet.SheetOwner.GetSheetBackgroundView
   description 8-2 to 8-3, 21-5                               method
pfcSession.Session.UICreateMaxPriorityCommand          description 10-11, 10-21
          method                                    pfcSheet.SheetOwner.GetSheetData method
   description 8-3                                     description 10-10
pfcSession.Session.UIDisplayFeatureParams method    pfcSheet.SheetOwner.GetSheetFormat method
   description 6-13                                    description 10-11
pfcSession.Session.UIDisplayMessage method          pfcSheet.SheetOwner.GetSheetScale method
   description 6-10                                    description 10-11
pfcSession.Session.UIReadIntMessage method          pfcSheet.SheetOwner.GetSheetTransform method
   description 6-13                                    description 10-10
pfcSession.Session.UIReadRealMessage method         pfcSheet.SheetOwner.RegenerateSheet method
   description 6-13                                    description 10-12
pfcSession.Session.UIReadStringMessage method       pfcSheet.SheetOwner.ReorderSheet method
   description 6-13                                    description 10-11
pfcSession.Session.UISelectDirectory method         pfcSheet.SheetOwner.SetCurrentSheetNumber
   description 6-16                                           method
pfcSession.Session.UIShowMessageDialog method          description 10-12
   description 6-9                                  pfcSheet.SheetOwner.SetSheetFormat method
pfcSession.SessionActionListener.OnAfterDirectory      description 10-12
          Change method                             pfcSheet.SheetOwner.SetSheetScale method
   description 21-4                                    description 10-12
pfcSession.SessionActionListener.OnAfterModelDis    pfcShrinkwrap.ShrinkwrapFacetedFormatInstruction
          play method 21-5                                    s. GetShrinkwrapFacetedFormat method
pfcSession.SessionActionListener.OnAfterWindowC        description 22-22
          hange method                              pfcShrinkwrap.ShrinkwrapFacetedFormatInstruction
   description 21-4                                           s.GetFramesFile method
pfcSession.WSExportOptions.SetIncludeSecondary         description 22-22
          Content method                            pfcShrinkwrap.ShrinkwrapFacetedFormatInstruction
   description 28-20                                          s.SetFramesFile method
pfcSession.WSImportExportMessage.GetDescriptio         description 22-22
          n method                                  pfcShrinkwrap.ShrinkwrapFacetedPartInstructions.G
   description 28-19                                          etLightweight method
                                                                                           Index - xxi
pfcSimpRep.RetrieveExistingSimpRepInstructions_    pfcSolid.Solid.GetRelativeAccuracy method 11-2
          Create method                            pfcSolid.Solid.GetUnit method
   description 23-3                                   description 11-7
pfcSimpRep.SimpRep.GetInstructions method          pfcSolid.Solid.ListCrossSections method
   description 23-5                                   Description 11-15
pfcSoild.Solid.ExecuteFeatureOps method            pfcSolid.Solid.ListFailedFeatures method
   description 14-4                                   description 14-2
pfcSolid.RegenInstructions.SetAllowFixUI method    pfcSolid.Solid.ListFeaturesByType method
   description 11-4                                   description 14-2
pfcSolid.RegenInstructions.SetForceRegen method    pfcSolid.Solid.ListUnits method
   description 11-4                                   description 11-7
pfcSolid.RegenInstructions.SetFromFeat method      pfcSolid.Solid.ListUnitSystems method
   description 11-4                                   description 11-10
pfcSolid.RegenInstructions.SetRefreshModelTree     pfcSolid.Solid.Regenerate method
          method                                      description 11-3
   description 11-4                                pfcSolid.Solid.SetAbsoluteAccuracy method 11-2
pfcSolid.RegenInstructions.SetResumeExcludedCo     pfcSolid.Solid.SetPrincipalUnits method
          mponents method                             description 11-11
   description 11-4                                pfcSolid.Solid.SetRelativeAccuracy method 11-2
pfcSolid.RegenInstructions.SetUpdateAssemblyOnly   pfcSolid.SolidActionListener.OnAfterFeatureCreate
          method                                             method
   description 11-4                                   description 21-9
pfcSolid.RegenInstructions.SetUpdateInstances      pfcSolid.SolidActionListener.OnAfterFeatureDelete
          method                                             method
   description 11-5                                   description 21-9
pfcSolid.RegenInstructions_Create method           pfcSolid.SolidActionListener.OnAfterRegenerate
          11-3, 22-41                                        method
pfcSolid.Solid.CreateCustomUnit method                description 21-8
   description 11-9                                pfcSolid.SolidActionListener.OnAfterUnitConvert
pfcSolid.Solid.CreateImportFeat method                       method
   description 22-41                                  description 21-9
pfcSolid.Solid.CreateSimpRep method                pfcSolid.SolidActionListener.OnBeforeFeatureCreat
   description 23-4                                          e method
pfcSolid.Solid.CreateUDFGroup method                  description 21-9
   description 14-9, 14-15                         pfcSolid.SolidActionListener.OnBeforeRegenerate
pfcSolid.Solid.CreateUnitSystem method                       method
   description 11-11                                  description 21-8
pfcSolid.Solid.DeleteSimpRep method                pfcSolid.SolidActionListener.OnBeforeUnitConvert
   description 23-4                                          method
pfcSolid.Solid.ExportShrinkwrap method                description 21-9
   description 22-18                               pfcTable.Table.CheckIfIsFromFormat method
pfcSolid.Solid.GetAbsoluteAccuracy method 11-2        description 10-40
pfcSolid.Solid.GetCrossSection method              pfcTable.Table.DeleteColumn method
   description 11-15                                  description 10-42
pfcSolid.Solid.GetFeatureById method               pfcTable.Table.DeleteRow method
   description 14-2                                   description 10-42
pfcSolid.Solid.GetGeomOutline method               pfcTable.Table.DeleteTable method
   description 11-5                                   description 10-42
pfcSolid.Solid.GetHasRetrievalErrors method        pfcTable.Table.Display method
   description 9-4                                    description 10-41
pfcSolid.Solid.GetIsSkeleton method                pfcTable.Table.Erase method
   description 19-21                                  description 10-41
pfcSolid.Solid.GetMassProperty method              pfcTable.Table.GetCellComponentModel method
   description 11-12                                  description 10-48
pfcSolid.Solid.GetPrincipalUnits method            pfcTable.Table.GetCellNote method
   description 11-10                                  description 10-41
                                                                                       Index - xxiii
          method                                  pfcUnits.UnitConversionFactor.GetOffset method
   description 14-13                                 description 11-8
pfcUDFCreate.UDFVariantValues.create method       pfcUnits.UnitConversionFactor.GetScale method
   description 14-13                                 description 11-8
pfcUDFCreate.UDFVariantValues.insert method       pfcUnits.UnitConversionOptions.SetDimensionOpti
   description 14-13                                        on method
pfcUDFGroup.UDFDimension.GetUDFDimensionN            description 11-12
          ame method                              pfcUnits.UnitConversionOptions.SetIgnoreParamUn
   description 14-9, 14-14                                  its method
pfcUDFGroup.UDFPromptCreateInstructions_Creat        description 11-12
          e method                                pfcUnits.UnitSystem.Delete method
   description 14-11                                 description 11-11
pfcUI.FileOpenOptions.SetFilterString method      pfcUnits.UnitSystem.GetIsStandard method
   description 6-15                                  description 11-10
pfcUI.FileOpenOptions.SetPreselectedItem method   pfcUnits.UnitSystem.GetName method
   description 6-15                                  description 11-10
pfcUI.FileUIOptions.SetDefaultPath method         pfcUnits.UnitSystem.GetType method
   description 6-15                                  description 11-10
pfcUI.FileUIOptions.SetDialogLabel method         pfcUnits.UnitSystem.GetUnit method
   description 6-15                                  description 11-10
pfcUI.MessageDialogOptions.SetButtons methods     pfcView.View.GetName method
   description 6-9                                   description 12-5
pfcUI.MessageDialogOptions.SetDefaultButton       pfcView.View.GetTransform method
          method                                     description 12-10
   description 6-9                                pfcView.View.Reset method
pfcUI.MessageDialogOptions.SetDialogLabel            description 12-5
          method                                  pfcView.View.Rotate method
   description 6-9                                   description 12-10
pfcUI.MessageDialogOptions.SetMessageDialogTyp    pfcView.View.SetTransform method
          e method                                   description 12-10
   description 6-10                               pfcView.View2D.GetDisplay method
pfcUI.pfcUI.MessageDialogOptions_Create()            description 10-22
          method                                  pfcView.View2D.GetIsBackground method
   description 6-9                                   description 10-21
pfcUnits.pfcUnits.UnitConversionFactor_Create     pfcView.View2D.GetIsScaleUserdefined method
          method                                     description 10-21
   description 11-9                               pfcView.View2D.GetLayerDisplayStatus method
pfcUnits.pfcUnits.UnitConversionOptions_Create       description 10-22
          method                                  pfcView.View2D.GetModel method
   description 11-11                                 description 10-21
pfcUnits.Unit.Delete method                       pfcView.View2D.GetName method
   description 11-9                                  description 10-22
pfcUnits.Unit.GetConversionFactor method          pfcView.View2D.GetOutline method
   description 11-8                                  description 10-21
pfcUnits.Unit.GetExpression method                pfcView.View2D.GetScale method
   description 11-7                                  description 10-21
pfcUnits.Unit.GetIsStandard method                pfcView.View2D.GetSheetNumber method
   description 11-8                                  description 10-21
pfcUnits.Unit.GetName method                      pfcView.View2D.GetTransform method
   description 11-7                                  description 10-22
pfcUnits.Unit.GetReferenceUnit method             pfcView.ViewOwner.GetView method
   description 11-8                                  description 12-5
pfcUnits.Unit.GetType method                      pfcView.ViewOwner.ListViews method
   description 11-7                                  description 12-5
pfcUnits.Unit.Modify method                       pfcView.ViewOwner.RetrieveView method
   description 11-9                                  description 12-5
                                                                                      Index - xxv
   Adding to the Graphics Window 8-15             Ruled surfaces 16-9
   Using Trail files to determine names 8-16         geometry representation F-6
Popup Menus 8-15                                  Run
   Accessing 8-16                                    applications 1-5
Popup menus                                          model program 1-6
   Adding 8-17
Preprocessors 2-4                                                        S
Principal curve 16-11
private keyword 2-5                               Save
Pro/ENGINEER                                         models 9-9
   accessing 6-7                                     view 12-5
Pro/J.Link                                        Screen coordinate system 12-7
   class types 3-2                                Search
   menu option 1-6                                   APIWizard search mechanism 5-13
   programs 1-2                                      using the APIWizard 5-13
ProBrowserAuthenticate() function                 Selection 7-2
   description 28-3                                  accessing data 7-4
ProServerConflictsDescriptionGet() function          controlling display 7-5
   description 28-25                              Sequences 3-6
protected keyword 2-5                                sample class 3-7
protk.dat file 1-2                                Session objects
public keyword 2-5                                   getting 6-2
                                                  Session.Select method
                        R                            used in a code example 7-6
                                                  Set up
Refresh                                              applications 1-2
   window 12-3, 22-43                                machine 1-2
Regenerate                                           model programs 1-5
   events 21-5                                    Sheets
   solids 11-3, 22-41                                Drawing 10-10
Register                                          Simplified representations
   applications 1-4                                  adding items 23-8
Registry file 1-2                                    creating 23-4
Remove                                               deleting 23-4
   items from a layer 13-4                               items 23-8
Rename                                               extracting information from 23-5
   models 9-9                                        modifying 23-8
Repaint                                              retrieving
   events 21-5                                           geometry 23-4
   window 12-3, 22-43                                    graphics 23-4
Reset                                                utilities 23-9
   view 12-5                                      Solids
Restrictions                                         accuracy 11-2
   on text message files 6-8                         coordinate system 12-6
   on threads 4-2                                    geometry traversal 13-2
Retrieve                                             getting a solid object 11-2
   geometry of a simplified representation 23-4      information 11-2
   graphics of a simplified representation 23-4      mass properties 11-12
   material 11-15                                    operations 11-3, 22-41
   model                                          Splines
       code example 9-5                              cylindrical spline surface F-11
   simplified representations 23-3                   description 16-4
   view 12-5                                         representation F-14
Revolved surfaces 16-9                               surface F-9
Rotate                                            Standalone applications 1-2
   view 12-6                                      Start method 1-7
Index - xxvii