KEMBAR78
Creo Object TOOLKIT Java User's Guide | PDF | Menu (Computing) | Java (Programming Language)
0% found this document useful (0 votes)
17 views766 pages

Creo Object TOOLKIT Java User's Guide

Uploaded by

manish.vestdelhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views766 pages

Creo Object TOOLKIT Java User's Guide

Uploaded by

manish.vestdelhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 766

Creo Object TOOLKIT Java

User’s Guide
5.0.2.0
Copyright © 2018 PTC Inc. and/or Its Subsidiary Companies. All Rights Reserved.

User and training guides and related documentation from PTC Inc. 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.

UNAUTHORIZED USE OF SOFTWARE OR ITS DOCUMENTATION CAN RESULT IN CIVIL


DAMAGES AND CRIMINAL PROSECUTION.

PTC regards software piracy as the crime it is, and we view offenders accordingly. We do not tolerate the
piracy of PTC software products, and we pursue (both civilly and criminally) those who do so using all legal
means available, including public and private surveillance resources. As part of these efforts, PTC uses data
monitoring and scouring technologies to obtain and transmit data on users of illegal copies of our software.
This data collection is not performed on users of legally licensed software from PTC and its authorized
distributors. If you are using an illegal copy of our software and do not consent to the collection and
transmission of such data (including to the United States), cease using the illegal version, and contact PTC to
obtain a legally licensed copy.

Important Copyright, Trademark, Patent, and Licensing Information: See the About Box, or copyright
notice, of your PTC software.

UNITED STATES GOVERNMENT RIGHTS

PTC software products and software documentation are “commercial items” as that term is defined at 48 C.F.
R. 2.101. Pursuant to Federal Acquisition Regulation (FAR) 12.212 (a)-(b) (Computer Software) (MAY 2014)
for civilian agencies or the Defense Federal Acquisition Regulation Supplement (DFARS) at 227.7202-1(a)
(Policy) and 227.7202-3 (a) (Rights in commercial computer software or commercial computer software
documentation) (FEB 2014) for the Department of Defense, PTC software products and software
documentation are provided to the U.S. Government under the PTC commercial license agreement. Use,
duplication or disclosure by the U.S. Government is subject solely to the terms and conditions set forth in the
applicable PTC software license agreement.

PTC Inc., 140 Kendrick Street, Needham, MA 02494 USA


Contents

About This Guide ......................................................................................................10


Setting Up Creo Object TOOLKIT Java .......................................................................13
Setting Up Your Machine .....................................................................................14
Setting Up a Synchronous Creo Object TOOLKIT Java Program ............................14
Overview of Creo Object TOOLKIT Java .....................................................................21
Setting Up Object TOOLKIT Java.........................................................................22
Installing Creo Object TOOLKIT Java...................................................................22
Licensing for Creo Object TOOLKIT Java ............................................................22
Unlocking, Running, and Signing the Creo Object TOOLKIT Java
Application......................................................................................................23
Class Types .......................................................................................................25
Creating Applications ..........................................................................................37
Domains of Creo Object TOOLKIT Java ...............................................................46
Compatibility with J-Link ......................................................................................46
Creo Object TOOLKIT Java Support for Creo .......................................................46
Support for Multi-CAD Models Using Creo Unite ...................................................48
Version Compatibility: Creo Parametric and Creo Object TOOLKIT Java.................49
Retrieving Creo Datecode ...................................................................................50
Compatibility of Deprecated Methods ...................................................................50
Visit Methods......................................................................................................51
Sample Applications ...........................................................................................53
Creo Object TOOLKIT Java Programming Considerations ...........................................54
Creo Object TOOLKIT Java Thread Restrictions ...................................................55
Parent-Child Relationships Between Creo Object TOOLKIT Java Objects...............55
Run-Time Type Identification in Creo Object TOOLKIT Java ..................................56
The Creo Object TOOLKIT Java Online Browser .........................................................57
Online Documentation Creo Object TOOLKIT Java APIWizard ..............................58
Session Objects ........................................................................................................61
Overview of Session Objects ...............................................................................62
Getting the Session Object ..................................................................................62
Creo License Data ..............................................................................................64
Directories .........................................................................................................64
Initializing Objects...............................................................................................69
Accessing the Creo User Interface .......................................................................70
Selection ..................................................................................................................82
Interactive Selection ...........................................................................................83
Accessing Selection Data....................................................................................85
Programmatic Selection ......................................................................................87

3
Selection Buffer ..................................................................................................88
Ribbon Tabs, Groups, and Menu Items .......................................................................92
Creating Ribbon Tabs, Groups, and Menu Items ...................................................93
About the Ribbon Definition File ...........................................................................95
Localizing the Ribbon User Interface Created by the Creo Object TOOLKIT Java
Applications ....................................................................................................99
Support for Legacy Creo Object TOOLKIT Java Applications .................................99
Menus, Commands, and Pop-up Menus ................................................................... 101
Introduction ...................................................................................................... 102
Menu Bar Definitions......................................................................................... 102
Menus Buttons and Menus ................................................................................ 102
Designating Commands .................................................................................... 105
Pop-up Menus.................................................................................................. 108
User Interface Foundation Classes for Dialogs .......................................................... 111
Introduction ...................................................................................................... 112
Models ................................................................................................................... 114
Overview of Model Objects ................................................................................ 115
Getting a Model Object...................................................................................... 115
Model Descriptors............................................................................................. 115
Retrieving Models............................................................................................. 117
Model Information............................................................................................. 117
Model Operations ............................................................................................. 121
Running Creo ModelCHECK ............................................................................. 123
Drawings ................................................................................................................ 131
Overview of Drawings in Creo Object TOOLKIT Java .......................................... 132
Creating Drawings from Templates..................................................................... 132
Obtaining Drawing Models ................................................................................ 134
Drawing Information.......................................................................................... 135
Drawing Operations .......................................................................................... 136
Merge Drawings ............................................................................................... 137
Drawing Sheets ................................................................................................ 138
Drawing Views ................................................................................................. 143
Drawing Dimensions ......................................................................................... 150
Drawing Tables................................................................................................. 158
Drawing Views And Models ............................................................................... 167
View States ...................................................................................................... 184
Drawing Models................................................................................................ 184
Drawing Edges ................................................................................................. 184
Detail Items ...................................................................................................... 185
Detail Entities ................................................................................................... 188
OLE Objects..................................................................................................... 191
Detail Notes ..................................................................................................... 191
Detail Groups ................................................................................................... 195
Detail Symbols ................................................................................................. 197
Detail Attachments............................................................................................ 208

4 Creo Object TOOLKIT JavaUser’s Guide


Solid....................................................................................................................... 212
Getting a Solid Object ....................................................................................... 213
Solid Information .............................................................................................. 213
Displaying a Solid ............................................................................................. 214
Solid Operations ............................................................................................... 214
Regenerating a Solid ........................................................................................ 217
Combined States of a Solid ............................................................................... 220
Solid Units........................................................................................................ 224
Mass Properties ............................................................................................... 230
Part Properties ................................................................................................. 231
Annotations...................................................................................................... 231
Materials .......................................................................................................... 232
Annotations: Annotation Features and Annotations .................................................... 239
Overview of Annotation Features ....................................................................... 240
Creating Annotation Features ............................................................................ 240
Redefining Annotation Features......................................................................... 240
Accessing Annotations...................................................................................... 242
Accessing and Modifying Annotation Elements ................................................... 245
Automatic Propagation of Annotation Elements................................................... 252
Detail Tree ....................................................................................................... 253
Annotation Text Styles....................................................................................... 253
Annotation Orientation ...................................................................................... 256
Annotation Associativity .................................................................................... 261
Accessing Set Datum Tags................................................................................ 262
Designating Dimensions and Symbols................................................................ 263
Surface Finish Annotations................................................................................ 263
Symbol Annotations .......................................................................................... 265
Notes............................................................................................................... 266
Annotations: Geometric Tolerances .......................................................................... 271
Reading Geometric Tolerances.......................................................................... 272
Deleting a Geometric Tolerance ......................................................................... 273
Validating a Geometric Tolerance....................................................................... 273
Geometric Tolerance Layout .............................................................................. 273
Additional Text for Geometric Tolerances ............................................................ 274
Geometric Tolerance Text Style.......................................................................... 275
Creating a Geometric Tolerance......................................................................... 276
Attaching the Geometric Tolerances ................................................................... 280
Windows and Views ................................................................................................ 286
Windows .......................................................................................................... 287
Embedded Browser .......................................................................................... 290
Views............................................................................................................... 291
Coordinate Systems and Transformations .......................................................... 292
ModelItem .............................................................................................................. 298
Solid Geometry Traversal .................................................................................. 299
Getting ModelItem Objects ................................................................................ 299

Contents 5
ModelItem Information ...................................................................................... 300
Duplicating ModelItems ..................................................................................... 301
Layer Objects ................................................................................................... 302
Feature Element Tree.............................................................................................. 308
Overview of Feature Creation ............................................................................ 309
Feature Element Values .................................................................................... 311
Feature Element Special Values ........................................................................ 312
Feature Element Paths ..................................................................................... 312
Feature Element Tree ....................................................................................... 313
Creating FET Using WCreateFeature ................................................................. 314
Feature Elements ............................................................................................. 315
Creating Patterns.............................................................................................. 317
Redefining Features ......................................................................................... 318
Element Diagnostics ......................................................................................... 318
Features................................................................................................................. 319
Access to Features ........................................................................................... 320
Feature Information .......................................................................................... 321
Feature Operations........................................................................................... 325
Feature Groups and Patterns............................................................................. 328
User Defined Features ...................................................................................... 331
Creating Features from UDFs ............................................................................ 332
Datum Features ...................................................................................................... 344
Datum Plane Features ...................................................................................... 345
Datum Axis Features ........................................................................................ 347
General Datum Point Features .......................................................................... 348
Datum Coordinate System Features................................................................... 350
Cross Sections........................................................................................................ 354
Listing Cross Sections....................................................................................... 355
Extracting Cross-Sectional Geometry................................................................. 356
Creating and Modifying Cross Sections .............................................................. 358
Mass Properties of Cross Sections..................................................................... 360
Line Patterns of Cross Section Components ....................................................... 360
External Objects...................................................................................................... 362
Summary of External Objects ............................................................................ 363
External Objects and Object Classes ................................................................. 364
External Object Data ......................................................................................... 365
External Object References............................................................................... 371
Element Trees: Sections .......................................................................................... 373
Overview.......................................................................................................... 374
Creating Section Models ................................................................................... 374
Element Trees: Sketched Features........................................................................... 386
Overview.......................................................................................................... 387
Creating Features Containing Sections .............................................................. 387
Creating Features with 2D Sections ................................................................... 388

6 Creo Object TOOLKIT JavaUser’s Guide


Creating Features with 3D Sections ................................................................... 388
Holes ..................................................................................................................... 390
Accessing Threaded Hole Properties ................................................................. 391
Geometry Evaluation ............................................................................................... 392
Geometry Traversal .......................................................................................... 393
Curves and Edges ............................................................................................ 394
Contours .......................................................................................................... 398
Surfaces .......................................................................................................... 400
Axes, Coordinate Systems, and Points ............................................................... 404
Interference...................................................................................................... 405
Tessellation ...................................................................................................... 407
Geometry Objects............................................................................................. 411
Tracing a Ray ................................................................................................... 417
Measurement ................................................................................................... 418
Dimensions and Parameters .................................................................................... 420
Overview.......................................................................................................... 421
The ParamValue Object .................................................................................... 421
Parameter Objects............................................................................................ 422
Table Parameters ............................................................................................. 432
Driven and Driving Parameters .......................................................................... 433
Dimension Objects............................................................................................ 433
Relations ................................................................................................................ 454
Accessing Relations ......................................................................................... 455
Accessing Post Regeneration Relations ............................................................. 456
Adding a Customized Function to the Relations Dialog Box.................................. 456
Assemblies and Components................................................................................... 460
Structure of Assemblies and Assembly Objects................................................... 461
Assembling Components .................................................................................. 467
Redefining and Rerouting Assembly Components............................................... 473
Exploded Assemblies........................................................................................ 474
Skeleton Models ............................................................................................... 477
Flexible Components and Inheritance Features in an Assembly ........................... 478
Variant Items for Flexible Components ............................................................... 479
Gathering Components by Rule ......................................................................... 480
Family Tables.......................................................................................................... 487
Working with Family Tables ............................................................................... 488
Creating Family Table Instances ........................................................................ 490
Creating Family Table Columns ......................................................................... 491
Operations on Family Table Instances ................................................................ 491
Family Table Utilities ......................................................................................... 492
Action Listeners ...................................................................................................... 494
Creo Object TOOLKIT Java Action Listeners ...................................................... 495
Creating an ActionListener Implementation......................................................... 495
Action Sources ................................................................................................. 496

Contents 7
Types of Action Listeners .................................................................................. 497
Cancelling an ActionListener Operation .............................................................. 505
Interface ................................................................................................................. 507
Exporting Files and 2D Models .......................................................................... 508
Exporting to PDF and U3D ................................................................................ 517
Exporting 3D Geometry..................................................................................... 524
Shrinkwrap Export ............................................................................................ 526
Importing Files.................................................................................................. 533
Importing 3D Geometry ..................................................................................... 535
Printing Files .................................................................................................... 549
Automatic Printing of 3D Models ........................................................................ 557
Solid Operations ............................................................................................... 561
Window Operations .......................................................................................... 564
Simplified Representations ...................................................................................... 566
Overview.......................................................................................................... 567
Retrieving Simplified Representations ................................................................ 568
Creating and Deleting Simplified Representations ............................................... 569
Extracting Information About Simplified Representations ..................................... 569
Modifying Simplified Representations................................................................. 570
Simplified Representation Utilities ...................................................................... 572
Expanding LightWeight Graphics Simplified Representations............................... 574
Running J-Link Applications in Asynchronous Mode .................................................. 575
Overview.......................................................................................................... 576
Simple Asynchronous Mode .............................................................................. 577
Starting and Stopping Creo Parametric............................................................... 578
Connecting to a Creo Parametric Process .......................................................... 579
Full Asynchronous Mode ................................................................................... 581
Troubleshooting Asynchronous J-Link ................................................................ 583
Task Based Application Libraries .............................................................................. 586
Managing Application Arguments....................................................................... 587
Launching a Creo Parametric TOOLKIT DLL ...................................................... 588
Creating Creo Object TOOLKIT Java Task Libraries ............................................ 590
Launching Tasks from Creo Object TOOLKIT Java Task Libraries ........................ 591
Graphics................................................................................................................. 594
Overview.......................................................................................................... 595
Getting Mouse Input.......................................................................................... 595
Cosmetic Properties ......................................................................................... 596
Graphics Colors................................................................................................ 605
Line Styles for Graphics .................................................................................... 607
Displaying Graphics .......................................................................................... 608
Display Lists and Graphics ................................................................................ 611
External Data .......................................................................................................... 613
External Data ................................................................................................... 614
Exceptions ....................................................................................................... 618

8 Creo Object TOOLKIT JavaUser’s Guide


Windchill Connectivity APIs...................................................................................... 620
Introduction ...................................................................................................... 621
Accessing a Windchill Server from a Creo Session.............................................. 621
Accessing Workspaces ..................................................................................... 624
Workflow to Register a Server............................................................................ 626
Aliased URL ..................................................................................................... 627
Server Operations ............................................................................................ 627
Utility APIs ....................................................................................................... 638
Technical Summary of Changes ............................................................................... 640
Summary of Technical Changes......................................................................... 641
Technical Summary of Changes for Creo 4.0 M030 ............................................. 676
Technical Summary of Changes for Creo 4.0 M040 ............................................. 678
Technical Summary of Changes for Creo 4.0 M050 ............................................. 679
Technical Summary of Changes for Creo 4.0 M060 ............................................. 680
Technical Summary of Changes for Creo 5.0.0.0................................................. 681
Technical Summary of Changes for Creo 5.0.1.0................................................. 692
Technical Summary of Changes for Creo 5.0.2.0................................................. 692
Appendix A.Advanced Licensing Options .................................................................. 694
Advance Licensing Options for Creo Object TOOLKIT Java ................................. 695
Appendix B.Installing and Working with J-Link ........................................................... 696
Installing J-Link................................................................................................. 697
Domains of J-Link ............................................................................................. 697
Running J-Link Applications .............................................................................. 697
Sample Applications for J-Link ........................................................................... 699
Appendix C.Sample Applications for J-Link ............................................................... 700
Sample Applications ......................................................................................... 701
Appendix D.Java Options and Debugging ................................................................. 707
Supported Java Virtual Machine Versions ........................................................... 708
Synchronous Creo Object TOOLKIT Java .......................................................... 708
Debugging a Synchronous Mode Application ...................................................... 708
CLASSPATH Variables...................................................................................... 709
Appendix E.Geometry Traversal ............................................................................... 710
Example 1........................................................................................................ 711
Example 2........................................................................................................ 711
Example 3........................................................................................................ 712
Example 4........................................................................................................ 712
Example 5........................................................................................................ 713
Appendix F.Geometry Representations..................................................................... 714
Surface Parameterization .................................................................................. 715
Edge and Curve Parameterization ..................................................................... 724
Appendix G.Creo Object TOOLKIT Java Classes ...................................................... 728
List of Creo Object TOOLKIT Java Classes ........................................................ 729
Index...................................................................................................................... 757

Contents 9
About This Guide

This section contains information about the contents of this user’s guide and the
conventions used.

Purpose
This manual describes how to use Creo Object TOOLKIT Java, an object-based
Java toolkit API for Creo Parametric and Creo Direct. Creo Object TOOLKIT
Java makes possible the development of Java programs that access the internal
components of a Creo session, to customize Creo models.

Note
Creo Object TOOLKIT Java is supported with Creo Parametric and Creo
Direct. It is not supported with the other Creo applications.
To check which methods are supported for Creo Direct, refer to the Creo
Object TOOLKIT Java APIWizard. The methods that are supported for Creo
Direct have the comment “This method is enabled for Creo Direct” in the
APIWizard.

Audience
This manual is intended for experienced Creo Parametric and Creo Direct users
who are already familiar with Java or another object-oriented language.

10 Creo Object TOOLKIT JavaUser’s Guide


Prerequisites
This manual assumes you have the following knowledge:
• Creo Parametric
• Creo Direct
• The syntax and language structure of Java.

Documentation
The documentation for Creo Object TOOLKIT Java includes the following:
• Creo Object TOOLKIT Java User’s Guide
• An online browser that describes the syntax of the Creo Object TOOLKIT
Java methods and provides a link to the online version of this manual. The
online version of the documentation is updated more frequently than the
printed version. If there are any discrepancies, the online version is the correct
one.

Conventions
The following table lists conventions and terms used throughout this book.
Convention Description
UPPERCASE Creo—type menu name (for example, PART).
Boldface Windows-type menu name or menu or dialog box
option (for example, View), or utility. Boldface
font is also used for keywords, Creo Object
TOOLKIT Java methods, names of dialog box
buttons, and Creo commands.
Monospace(Courier) Code samples appear in courier font like
this. Java aspects (methods, classes, data types,
object names, and so on) also appear in Courier font.
Emphasis Important information appears in italics like this.
Italic font is also used for file names and uniform
resource locators (URLs).
Choose Highlight a menu option by placing the arrow cursor
on the option and pressing the left mouse button.
Select A synonym for “choose” as above, Select also
describes the actions of selecting elements on a
model and checking boxes.
Element An element describes redefinable characteristics of a
feature in a model.
Mode An environment in Creo in which you can perform a
group of closely related functions (Drawing, for
example).
Model An assembly, part, drawing, format, notebook, case
study, sketch, and so on.
Option An item in a menu or an entry in a configuration file
or a setup file.
Solid A part or an assembly.

About This Guide 11


Convention Description
<creo_loadpoint> The location where the Creo applications are
installed, for example, C:\Program Files\
PTC\Creo 1.0.
<creo_otk_java_loadpoint_app> The location where the Creo Object TOOLKIT Java
application files are installed, that is, <creo_
loadpoint>\<datecode>\Common Files\
otk\otk_java.
<creo_otk_java_loadpoint_doc> The location where the Creo Object TOOLKIT Java
documentation files are installed, that is, <creo_
loadpoint>\<datecode>\Common Files\
otk_java_doc.
<creo_toolkit_loadpoint> The location where the Creo Parametric TOOLKIT
application is installed, that is, <creo_
loadpoint>\<datecode>\Common Files\
protoolkit.
<creo_jlink_loadpoint> The location where the J-Link sample applications
are installed, that is, <creo_loadpoint>\
<datecode>\Common Files\otk_java_
free.

Note
• Important information that should not be overlooked appears in notes like
this.
• All references to mouse clicks assume use of a right-handed mouse.

Software Product Concerns and Documentation Comments


For resources and services to help you with PTC software products, see the Creo
PTC Customer Service Guide. It includes instructions for using the World Wide
Web or fax transmissions for customer support.
In regard to documentation, PTC welcomes your suggestions and comments. You
can send feedback in the following ways:
• Send comments electronically to MCAD-documentation@ptc.com.
• Fill out and mail the PTC Documentation Survey in the customer service
guide.

12 Creo Object TOOLKIT JavaUser’s Guide


1
Setting Up Creo Object TOOLKIT
Java
Setting Up Your Machine............................................................................................14
Setting Up a Synchronous Creo Object TOOLKIT Java Program...................................14

This chapter describes how to set up your environment so you can run Creo
Object TOOLKIT Java.

13
Setting Up Your Machine
See Java Options and Debugging on page 707 for more information about
supported Java Virtual Machines and how to setup Creo application.

Setting Up a Synchronous Creo Object


TOOLKIT Java Program
A synchronous Creo Object TOOLKIT Java application is started and managed by
Creo application. Control belongs to either Creo or the application, but not both at
the same time.
All Creo Object TOOLKIT Java applications must be packaged as a jar. The
.class files will be ignored, even if their locations are present either in the
java_app_classpath field in the registry file, or in the classpath. Refer to
the section Unlockin on page 23, for more information.
You can run synchronous Creo Object TOOLKIT Java programs as standalone
applications or model-specific programs. Most of the required settings for these
two programs are independent of the programs themselves. This enables you to
convert an application program to a model program, or vice versa.

Standalone Applications
You can start the Creo Object TOOLKIT Java application independently at any
time, regardless of which models are in session. A registry file contains key
information regarding the execution of the program.
Using application programs you can make additions to the Creo user interface,
gather or change data associated with the models in session, or add session-level
ActionListener routines.

Registry File
A registry file contains Creo-specific information about the standalone application
you want to load.
The registry file called creotk.dat or protk.dat is a simple text file, where
each line consists of one predefined keyword followed by a value. The standard
form of the creotk.dat or protk.dat file is as follows:
name java_demo
startup otk_java
toolkit object
creo_type direct
java_app_class MyJavaApp
java_app_classpath <full path to the application classes
and archives>
java_app_start start

14 Creo Object TOOLKIT JavaUser’s Guide


java_app_stop stop
allow_stop true
delay_start true
text_dir <path to text directory used by
message and menu related commands>
end
The fields of the registry file are as follows:
• name—Assigns a unique name to this Creo Object TOOLKIT Java
application. The name identifies the application when there is more than one
in the creotk.dat or 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 Creo should use to communicate with the
Creo Object TOOLKIT Java application. For Creo Object TOOLKIT Java
applications, set startup to otk_java.
• toolkit—Specifies the name of the Toolkit which was used to create the
customization. The valid values for this field are object and protoolkit.
An application created in Creo Object TOOLKIT Java must always have the
value of this field set as object.

Note
This field can also be used to indicate other toolkits. Its default value is
protoolkit, which specifies that the customizing application was
created in Creo Parametric TOOLKIT. If you set the value for this field as
protoolkit, or omit this field, then the application can be used only
with Creo Parametric.

• creo_type—Specifies the Creo applications that support the Creo Object


TOOLKIT Java applications. The valid values for this field are:
○ parametric—This is the default value. Specify parametric to load
the Creo Object TOOLKIT Java application in Creo Parametric.
○ direct—Specify direct to load the Creo Object TOOLKIT Java
application in Creo Direct.

Note
Other Creo applications will be supported in future releases.

Setting Up Creo Object TOOLKIT Java 15


• java_app_class—Specifies the fully qualified package and name of a
Java class. This class contains the Creo Object TOOLKIT Java application’s
start and stop methods.
• java_app_classpath—An optional field to specify the full path to the
Creo Object TOOLKIT Java application jar file. Refer to the section
CLASSPATH Variables on page 709 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 20 for more information.
• java_app_stop—Specifies the stop method of your program. See the
section Start and Stop Methods on page 20 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 Creo Object
TOOLKIT Java application if it is set to true. Creo application does not start
the Creo Object TOOLKIT Java application during startup. If this field is
missing or is set to false, the Creo Object TOOLKIT Java application starts
automatically.
• text_dir—Specifies the location of the text directory that contains the
language-specific directories. The language-specific directories contain the
message files, menu files, resource files and UI bitmaps in the language
supported by the Creo Object TOOLKIT Java application. The files must be
located under a directory called text or text/<language>, if localized
messages are used in the application. This field has a character limit of 2047
wide characters (wchar_t).
• rbn_path—Specifies the name of the ribbon file along with its path, which
must be loaded when you open the Creo application. The location of the
ribbon file is relative to the location of the text directory. The field text_dir
specifies the path for the text directory. For example, if you want to specify a
ribbon file dma_rbn.rbn placed at text_dir/dma/dma_rbn.rbn,
specify rbn_path as dma/dma_rbn.rbn.
If the field is not specified, by default, the ribbon file with its location, text_
dir/toolkitribbonui.rbn is used.
• end—Indicates the end of the description of the Creo Object TOOLKIT Java
application. You can define multiple Creo Object TOOLKIT Java applications
in the registry files. All these applications are started by Creo application.

16 Creo Object TOOLKIT JavaUser’s Guide


Registering a Creo Object TOOLKIT Java
Application
Registering a Creo Object TOOLKIT Java application means providing
information about the files that form the Creo Object TOOLKIT Java application
to Creo application. To do this, create a small text file, called the Creo Object
TOOLKIT Java “registry file,” that Creo application will find and read.
Creo application searches for the registry file in the following order:
1. A file called creotk.dat or protk.dat in the current directory
2. A file named in a creotk.dat, protk.dat, or toolkit_registry_
file statement in theCreo application configuration file
3. A file called creotk.dat or protk.dat in the directory <creo_
loadpoint>\<datecode>\Common Files\<machine type>\
text\<language>
4. A file called creotk.dat or protk.dat in the directory <creo_
loadpoint>\<datecode>\Common Files\text
In the last two options, the variables are as follows:
• <creo_loadpoint>—The Creo loadpoint (not the Creo Object TOOLKIT
Java loadpoint)
• <machine type>—The machine-specific subdirectory such as x86e_
win64 or i486_nt
• <language>—The language of Creo application with which the Creo
Object TOOLKIT Java application is used such as usascii (English),
german, or japanese
If more than one registry file having the same filename exists in this search path,
Creo Object TOOLKIT Java stops searching after finding the first instance of the
file and starts all the Creo Object TOOLKIT Java applications specified in it. If
more than one registry file having different filenames exists in this search path,
Creo application stops searching after finding one instance of each of them and
starts all the Creo Object TOOLKIT Java applications specified in them.
Option 1 is used normally during development, because the Creo Object
TOOLKIT Java application is seen only if you start Creo application from the
specific directory that contains creotk.dat or protk.dat.
Option 2 or 4 is recommended when making an end-user installation, because it
makes sure that the registry file is found irrespective of the directory used to start
Creo application.
Option 3 enables you to have a different registry file for each platform, and for
each Creo application language. This is more commonly used for Creo Object
TOOLKIT Java applications that have a platform dependent setup.

Setting Up Creo Object TOOLKIT Java 17


Starting and Stopping a Standalone Application
If the delay_start field in the registry file is set to false, the Creo Object
TOOLKIT Java application starts automatically when you start Creo. Otherwise
start the program by following these steps:
1. From the Creo Parametric toolbar, select Utilities ▶ Auxiliary Applications.
2. Choose the name of the application.
3. Click Start.
• Start—activates start method
• Stop— activates stop method
If the allow_stop field in the registry file is set to true, you can click Stop in
the Auxiliary Applications dialog box to stop the application. Click Start to restart
it. If the allow_stop field is set to false, the program runs until the Creo
Parametric session ends.

Setting Up a Model Program


A model program is a Creo Object TOOLKIT Java program specific to a
particular solid model, that is part or assembly. Creo application activates the start
method for a program when it loads the part into memory and activates the stop
method when it erases the part from memory.
Using model programs you can add programming logic to the interaction with a
solid model. You can create a dialog box to drive the regeneration of a part or
create model-specific utilities to generate reports or engineering information from
a model. As Java programs are platform independent, the same model program
runs on any Windows installation of Creo application.
To setup a model program you need to:
• Associate and run a Creo Object TOOLKIT Java application with a model
• Create a JAR file for Model-Program Dependency

Associating and Running a Creo Object TOOLKIT Java


Application with a Model
1. Load the solid model that you want to associate and run with the Creo Object
TOOLKIT Java application.
2. From the PART or ASSEMBLY menu, select Tools ▶ Program ▶ Object
TOOLKIT Java.
3. If the application is stored in a Java archive (JAR) file, click Add File in the

18 Creo Object TOOLKIT JavaUser’s Guide


Model Programs dialog box and add the JAR file to the list of Java archive
files. If the application is stored in a .class file proceed to the next step.
4. Click Add and enter the following information in the Java Application
Properties dialog box:

• Application Name—A unique name for this Object TOOLKIT Java


application. The maximum size of the name is 31 characters for the name,
plus the end-of-string character.
• Class Name—The Java class that contains the start and stop methods for
the Creo Object TOOLKIT Java application. This class must reside in a
JAR file you have added to the list or in a directory that is part of your
CLASSPATH.
• Start Method Name—The method in the Class Name class that will
be called whenever the model is loaded into a session.
• Stop Method Name—The method in the Class Name class that will be
called whenever the model is erased.
The Creo Object TOOLKIT Java application immediately attempts to run. If it
cannot start successfully an exception condition is listed in the Status column of
the Model Programs dialog box.

JAR File Needed for Model-Program Dependency


Although individual class files are associated with a model, there is no
dependency between the model and the program. Therefore, Windchill server is
not able to recognize the relationship between the class files and the model. To
create a dependency, include all the class files and the source code in a Java
archive file (jar file). JAR files are created through the command jar, which is a
part of the standard Java Development Kit (JDK) package.
To create a JAR file use a command similar to the following command string:
jar cvf0 myjar.jar *.java *.class

Note
You must use the command-line switch 0 (zero) because JAVA cannot read
classes from compressed JAR files.

You can add JAR files to, or remove them from, a model by using the buttons on
the left side of the model program interface. All the JAR files for the model
program must be placed in the Creo search path.

Setting Up Creo Object TOOLKIT Java 19


Note
When naming a Creo Object TOOLKIT Java model program JAR file, you
must use lower case.

Start and Stop Methods


All synchronous Creo Object TOOLKIT Java programs must have a static start
and stop method regardless of whether they will run standalone or as model
programs. You can give these methods any name you want because you identify
them in the registry file or in the model program setup. The Creo application
automatically calls these methods upon starting or stopping a program. All
methods that you want to call in a particular program must be called in the start
and stop methods, or you must use the start method to register listeners to react to
events in the Creo user interface.
For example:
public static void startMyProgram()
{
runMyUtilities();
configureMyModels();
addMyUI();
}

public static void stop() {


cleanupModels();
outputToPrinterFiles();
}
Creo Object TOOLKIT Java start and stop methods must be public, static, return
void and take no arguments. You can configure applications based on the Creo
version and build or custom command line arguments using methods described in
the Session Objects on page 61 chapter.

20 Creo Object TOOLKIT JavaUser’s Guide


2
Overview of Creo Object TOOLKIT
Java
Setting Up Object TOOLKIT Java ...............................................................................22
Installing Creo Object TOOLKIT Java .........................................................................22
Licensing for Creo Object TOOLKIT Java ...................................................................22
Unlocking, Running, and Signing the Creo Object TOOLKIT Java Application ................23
Class Types ..............................................................................................................25
Creating Applications.................................................................................................37
Domains of Creo Object TOOLKIT Java ......................................................................46
Compatibility with J-Link.............................................................................................46
Creo Object TOOLKIT Java Support for Creo ..............................................................46
Support for Multi-CAD Models Using Creo Unite ..........................................................48
Version Compatibility: Creo Parametric and Creo Object TOOLKIT Java .......................49
Retrieving Creo Datecode ..........................................................................................50
Compatibility of Deprecated Methods..........................................................................50
Visit Methods ............................................................................................................51
Sample Applications ..................................................................................................53

This chapter provides an overview of Creo Object TOOLKIT Java.

21
Setting Up Object TOOLKIT Java
Object TOOLKIT is a Creo 3.0 object-based Java toolkit API.

Installing Creo Object TOOLKIT Java


Creo Object TOOLKIT Java is available on the same CD as Creo. When Creo
application is installed, one of the optional components is API Toolkits. This
includes Creo Parametric TOOLKIT, Creo Object TOOLKIT C++, Creo Object
TOOLKIT Java and J-Link so on.
When you select the option Creo Object TOOLKIT Java and Jlink, both Creo Object
TOOLKIT Java and J-Link are installed.

Note
J-Link is not available as a separate installation in the product CD.

The following Creo Object TOOLKIT Java directories are created under the Creo
loadpoint. Creo Object TOOLKIT Java is automatically installed in these
directories:
• <creo_loadpoint>\<datecode>\Common Files\otk\otk_
java—Contains all the libraries and example applications specific to Creo
Object TOOLKIT Java.
• <creo_loadpoint>\<datecode>\Common Files\otk_java_
doc—Contains documentation files specific to Creo Object TOOLKIT Java.
• <creo_loadpoint>\<datecode>\Common Files\otk_java_
free—Contains all the example applications specific to J-Link.
Refer to the section Installing and Working with J-Link on page 696, for
information on J-Link installation.

Licensing for Creo Object TOOLKIT Java


Creo Object TOOLKIT Java requires the development license to develop and
unlock the Creo Object TOOLKIT Java application, and the runtime license to run
the application.
To develop and test the Creo Object TOOLKIT Java application, you must have
the Creo Object TOOLKIT Java development license. Customers who already
have the Creo Parametric TOOLKIT license can alternately use the Creo Object
TOOLKIT Java extension license with Creo Parametric TOOLKIT license.
The Creo Object TOOLKIT Java runtime license is required to run an unlocked
Creo Object TOOLKIT Java application.

22 Creo Object TOOLKIT JavaUser’s Guide


From Creo Object TOOLKIT Java 4.0 F000 onward, advanced licensing is
supported. TOOLKIT-for-3D_Drawings is a advanced license. Certain
methods are available under the 222 license option. Methods that require license
222 have the comment “LICENSE: 222” added in the APIWizard.

Note
If you have only the Creo Object TOOLKIT Java extension license and your
application has methods available under license 222, then the manifest file
must have information about the 222 license. If the license information is not
present in the manifest file, and you run the application, exception is thrown
for the licensed methods. For example, the manifest file must contain the
following line:
PTC_LICENSE_222: 1

Unlocking, Running, and Signing the


Creo Object TOOLKIT Java Application
Before you distribute your application executable to the end user, you must unlock
it.
To unlock a Creo Object TOOLKIT Java application, you must have either of the
following licenses:
• Creo Object TOOLKIT Java development license, or
• Creo Object TOOLKIT Java extension license along with Creo Parametric
TOOLKIT license to be present and unused on your license server
To unlock your application, enter the following command:
<creo_loadpoint>/<app_name>/bin/protk_unlock.bat [-java] [<classname>
<jarpath> <one or more pairs of class name and path to jar files>
where, <app_name>—Parametric for Creo Parametric and Direct for
Creo Direct.
You can provide more than one Creo Parametric TOOLKIT binary file on the
command line.

Note
Once you have unlocked the executable, you can distribute your application
program to Creo Object TOOLKIT Java users in accordance with the license
agreement.

Overview of Creo Object TOOLKIT Java 23


If the Creo Parametric license server is configured to add a Creo Parametric
TOOLKIT license as a startup option, protk_unlock.bat will cause the
license server to hold only the Creo Parametric TOOLKIT option for 15 minutes.
The license will not be available for any other development activity or unlocking
during this period.
If the only available Creo Parametric TOOLKIT license is locked to a Creo
Parametric license, the entire Creo Parametric license including the Creo
Parametric TOOLKIT option will be held for 15 minutes. PTC recommends you
configure your Creo Parametric TOOLKIT license option as a startup option to
avoid tying up your Creo Parametric licenses.

Note
Only one license will be held for the specified time period, even if multiple
applications were successfully unlocked.

Unlocking the application may also require one or more advanced licensing
options. Your Creo Object TOOLKIT Java application may have calls to methods,
which require one or more advanced licensing options. The protk_unlock
application will detect whether any functions using advanced licenses are in use in
the application, and if so, will make a check for the availability of the advanced
license option. If that option is not present, unlocking will not be permitted. If
they are present, the unlock will proceed. Advanced options are not held on the
license server for any length of time. Refer to the chapter Advanced Licensing
Options on page 694, for more information.
If the required licenses are available, the protk_unlock.bat application will
unlock the Creo Object TOOLKIT Java application immediately.

Note
Once an application binary has been unlocked, it should not be modified in
any way (which includes statically linking the unlocked binary with other
libraries after the unlock). The unlocked binary must not be changed or else
Creo Parametric will again consider it "locked".

You require any of the following licenses to be present and unused on your license
server to run an unlocked Creo Object TOOLKIT Java application:
• Creo Object TOOLKIT Java runtime license, or
• Creo Object TOOLKIT Java development license, or
• Both Creo Object TOOLKIT Java extension license and Creo Parametric
TOOLKIT license

24 Creo Object TOOLKIT JavaUser’s Guide


Note
If a Creo Object TOOLKIT Java code has multi-byte characters, then save the
file in UTF-8 without BOM encoding format. Use the option –encoding
UTF-8 with the javac compiler to build class files.

During the unlocking process, PTC’s digital signature is added to the unlocked
Creo Object TOOLKIT Java application. You can also sign your Creo Object
TOOLKIT Java applications using the standard Java utility jarsigner. Please
refer to the Oracle documentation for more information on this utility.

Unlock Messages
The following table lists the messages that can be returned when you unlock a
Creo Object TOOLKIT Java application.
Message Cause
<application name>:Successfully unlocked The application is unlocked successfully.
application.
Usage: protk_unlock.bat <one or more Creo No arguments supplied.
Parametric TOOLKIT executables or DLLs>
<application name>:ERROR: No READ access You do not have READ/WRITE access for the
executable.
<application name>:ERROR: No WRITE access
<application name>:Executable is not a Creo Object The executable is not linked with the Creo Object
TOOLKIT Java application. TOOLKIT Java libraries, or does not use any
methods from those libraries.
<application name>:Executable is already unlocked. The executable is already unlocked.
Error: Licenses do not contain Creo Parametric A requirement for unlocking a Creo Object
TOOLKIT License Code. TOOLKIT Java application.
ERROR: No Creo Parametric licenses are available Could not contact the license server.
for the startup command specified
<application name>:Unlocking this application The application uses methods that require an
requires option TOOLKIT-for-3D_Drawings. advanced option; and this option is not available.

The license option 222, that is, the TOOLKIT-for-


3D_Drawings license is not available.
<application name>:Unlocking this application The application uses methods that require an
requires option TOOLKIT-for-Mechanica. advanced option; and this option is not available.

Class Types
Creo Object TOOLKIT Java is made up of a number classes in many packages.
The following are the eight main classes.

Overview of Creo Object TOOLKIT Java 25


• Creo-Related Interfaces—Contain unique methods and attributes
that are directly related to the functions in the Creo application. See the section
Creo-Related Interfaces on page 27 for additional information.
• Compact Data Classes—Classes containing data needed as arguments to
some Creo Object TOOLKIT Java methods. See the section Compact Data
Classes on page 28 for additional information.
• Union Classes—A class with a potential for multiple types of values. See
the section Unions on page 29 for additional information.
• Sequence Classes—Expandable arrays of objects or primitive data types.
See the section Sequences on page 30 for more information.
• Array Classes—Arrays that are limited to a certain size. See the section
Arrays on page 31 for more information.
• Enumeration Classes—Defines enumerated types. See the section
Enumeration Classes on page 33 for more information.
• ActionListener Classes—Enables you to specify programs that will
run only if certain events in the Creo application take place. See the section
Action Listeners on page 34 for more information.
• Utility Classes—Contains static methods used to initialize certain Creo
Object TOOLKIT Java objects. See the section Utilities on page 36 for more
information.
Each class shares specific rules regarding initialization, attributes, methods,
inheritance, or exceptions. The following seven sections describe these classes in
detail.

List of Classes and Methods


PTC provides a list of all the available Creo Object TOOLKIT Java classes and
methods. The information is available in the file otk_methods.txt located at
creo_otk_java_loadpoint_doc. The file is a tab delimited text file,
which can be read in Microsoft Excel.
The file lists all the methods in the pfc and wfc interfaces along with their
description. The file has the following fields:
• Java Package, Java Class, and Java Method—Lists the Creo Object
TOOLKIT Java packages, classes and methods.
• Exposure—Specifies PMA if the method is supported in Creo Parametric.
The field specifies PMA/DMA when the method is supported in both Creo
Parametric and Creo Direct.
• Description—Describes the class or method.

26 Creo Object TOOLKIT JavaUser’s Guide


Creo-Related Interfaces
The Creo-related interfaces contain methods that directly manipulate objects in the
Creo application. 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 the Creo objects cannot be created directly but are returned
by a Get or Create method.
For example, pfcSession.Session.GetCurrentModel returns a Model
object set to the current model and
pfcModelItem.ParameterOwner.CreateParam returns a newly created
Parameter object for manipulation.

Attributes
Attributes within Creo-related objects 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);
Some attributes that have been designated as read can only be accessed by the
Get method.

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;

window.Activate(); // The window has not yet been


initialized.

Repaint(); // There is no invoking object.


The following calls are legal:
WSession session = (WSession) pfcGlobal.GetProESession();
Window window = session.GetCurrentWindow();
// You have initialized the window object.
window.Activate()
window.Repaint()

Overview of Creo Object TOOLKIT Java 27


Inheritance
All Creo 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,
pfcModelItem.ModelItem

Feature myfeature; // Previously initialized

String name = myfeature.GetName();// GetName is in the


// class ModelItem.
However, if you have a reverse situation, you need to explicitly cast the object.
For example:
ModelItem item; // You know this is a Feature -- perhaps
// you previously checked its type.
int number = ((Feature)item).GetNumber();
// GetNumber() is a Feature method.

Exceptions
Almost every Creo Object TOOLKIT Java 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.

Compact Data Classes


Compact data classes are data-only classes. They are used, as needed, for
arguments and return values for some Creo Object TOOLKIT Java methods. They
do not represent actual objects in the Creo application.

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.

28 Creo Object TOOLKIT JavaUser’s Guide


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);

Methods
You must start Methods from the object in question and you must first initialize
that object. For example, the following calls are illegal:
SelectionOptions options;

options.SetMaxNumSels(); // The object has not been


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 Creo Object TOOLKIT Java 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.
The following is an example of a Creo Object TOOLKIT Java union:
class ParamValue
{
public:
ParamValueType Getdiscr ();
String GetStringValue ();
void SetStringValue (String value);
int GetIntValue ();
void SetIntValue (int value);

Overview of Creo Object TOOLKIT Java 29


boolean GetBoolValue ();
void SetBoolValue (boolean value);
double GetDoubleValue ();
void SetDoubleValue (double value);
int GetNoteId ();
void SetNoteId (int value);
};

Sequences
Sequences are expandable arrays of primitive data types or objects in Creo Object
TOOLKIT Java. 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 Creo Object TOOLKIT Java
classes. Therefore, you cannot cast sequence objects to any other type of Creo
Object TOOLKIT Java 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;
To construct this array of features, you must insert each member of the list
separately while casting it to a Feature.

30 Creo Object TOOLKIT JavaUser’s Guide


Exceptions
If you try to get or remove an object beyond the last object in the sequence, the
exception cipjava.XNoAttribute is thrown.

Example Code: Sequence Class


The following example code shows the sequence class
com.ptc.pfc.pfcModel.Models.
package com.ptc.pfc.pfcModel;

public class Models extends jxobject_i


{
public int getarraysize() throws jxthrowable
public Model get (int idx) throws jxthrowable
public void set (
int idx,
Model value
) throws jxthrowable

public void removerange


(
int frominc,
int toexcl
) throws jxthrowable

public void insert


(
int atidx,
Model value
) throws jxthrowable

public void insertseq


(
int atidx,
pfcModel.Models value
) throws jxthrowable

public static pfcModel.Models create() throws jxthrowable


}

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.

Overview of Creo Object TOOLKIT Java 31


Initialization
You cannot construct one of these objects using the Java keyword new. Static
creation methods are available for each array type. For example, the method
pfcBase.Point2D.create returns an empty Point2D array object for you
to fill in.

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 Creo Object TOOLKIT Java classes.

Exceptions
If you try to access an object that is not within the size of the array, the exception
cipjava.XNoAttribute is thrown.

Example Code - Array Class


The following example code shows the array class
com.ptc.pfc.pfcBase.Point2D.
package com.ptc.pfc.pfcBase;

public class Point2D extends jxobject_i


{
public double get (int idx0) throws jxthrowable

public void set (


int idx0,
double value
) throws jxthrowable

public static Point2D create() throws jxthrowable


};

32 Creo Object TOOLKIT JavaUser’s Guide


Enumeration Classes
In Creo Object TOOLKIT Java, enumeration classes are used in the same way that
an enum is used in C or C++. An enumeration class defines a limited number of
static final instances which correspond to the members of the enumeration. Each
static final instance has a corresponding static final integer constant. In the
FeatureType enumeration class the static instance FEATTYPE_HOLE has as
it’s integer equivalent _FEATTYPE_HOLE . Enumeration classes in Creo Object
TOOLKIT Java generally have names of the form XYZType or XYZStatus.
Enumeration instances are passes whenever a method requires you to choose
among multiple options. Use the integer constants where an int is required (such
as cases in a switch statement).

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:
• PARAM_INTEGER—An instance of the ParamValueType enumeration
class that is used to indicate that a parameter stores an integer value. The
corresponding integer is _PARAM_INTEGER.
• ITEM_FEATURE—An instance of the ModelItemType enumeration class
that is used to indicate that a model item is a feature. The corresponding
integer is_ ITEM_FEATURE.
An enumeration class always has an integer attribute named “__Last”, which is
one more than the highest acceptable numerical value for that enumeration class.

Methods
Enumeration classes have one method that you are likely to use:
• getValue—Returns the integer value of an enumeration instance.

Inheritance
Enumeration classes do not inherit from any other Creo Object TOOLKIT Java
classes.

Overview of Creo Object TOOLKIT Java 33


Exceptions
Enumeration classes do not throw exceptions.

Example Code: Enumeration Class


The following example code shows the enumeration class
com.ptc.pfc.pfcBase.Placement.
package com.ptc.pfc.pfcBase;

public final class Placement


{
public static final int _PLACE_INSIDE = 0;

public static final Placement PLACE_INSIDE =


new Placement (_PLACE_INSIDE);

public static final int _PLACE_ON_BOUNDARY = 1;

public static final Placement PLACE_ON_BOUNDARY =


new Placement (_PLACE_ON_BOUNDARY);

public static final int _PLACE_OUTSIDE = 2;

public static final Placement PLACE_OUTSIDE =


new Placement (_PLACE_OUTSIDE);

public static final int __Last = 3;

public static Placement FromInt (int value)

public int getValue()


};

Action Listeners
Use ActionListeners in Creo Object TOOLKIT Java to assign programmed
reactions to events that occur within the Creo application. Creo Object TOOLKIT
Java defines a set of action listener interfaces that can be implemented enabling
Creo application to call your Creo Object TOOLKIT Java application when
specific events occur. These interfaces are designed to respond to events from
action sources in Creo application. Examples of action sources include the
session, user-interface commands, models, solids, parameters, and features.

34 Creo Object TOOLKIT JavaUser’s Guide


Initialization
For each of its defined ActionListener interfaces, Creo Object TOOLKIT
Java 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.
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 Creo Object TOOLKIT Java
You implement an action listener class by inheriting the appropriate default class
and overriding the methods that respond to specific events. For the other
events,Creo calls the empty methods inherited from the default class.
Construct your ActionListener classes using the Java keyword new. Then
assign your ActionListener to an ActionSource using the
AddActionListener() method of the action source.

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 Creo Object TOOLKIT Java 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.

Example Code - Array Class


The following example code shows part of the SolidActionListener
interface.
package com.ptc.pfc.pfcSolid;

Overview of Creo Object TOOLKIT Java 35


public interface SolidActionListener extends
jxobject,
com.ptc.pfc.pfcBase.ActionListener

{
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 Creo Object TOOLKIT Java 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");

Attributes
Utilities do not have any accessible attributes.

36 Creo Object TOOLKIT JavaUser’s Guide


Methods
Utilities contain only static methods used for initializing certain Creo Object
TOOLKIT Java objects.

Inheritance
Utilities do not inherit from any other Creo Object TOOLKIT Java classes.

Exceptions
Methods in utilities can throw jxthrowable type exceptions.

Sample Utility Class


The following code example shows the utility class
com.ptc.pfc.pfcGlobal.pfcGlobal.
package com.ptc.pfc.pfcGlobal;

public class pfcGlobal


{
public static pfcSession.Session GetProESession()
throws jxthrowable

public static stringseq GetProEArguments()


throws jxthrowable

public static string GetProEVersion()


throws jxthrowable

public static string GetProEBuildCode()


throws jxthrowable
}

Creating Applications
The following sections describe how to create applications. The topics are as
follows:
• Importing Packages on page 37
• Application Hierarchy on page 38
• Exception Handling on page 38

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:

Overview of Creo Object TOOLKIT Java 37


For the Parameter class only:
import com.ptc.pfc.pfcModelItem.Parameter;
For the package pfcBase (all classes):
import com.ptc.pfc.pfcBase.*;
You might also need to import the methods in com.ptc.cipjava, which
contains the underlying Creo Object TOOLKIT Java structure, including
exceptions and certain sequences.. Use the following statement:
import com.ptc.cipjava.*;

Application Hierarchy
The rules of object orientation require a certain hierarchy of object creation when
you start a Creo Object TOOLKIT Java application. The method invoked must be
pfcGlobal.GetProESession, which returns a handle to the current session
of the Creo application. To get the full scope of Creo Object TOOLKIT Java
functionality, the application should cast the session object to WSession.
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:
1. Get a handle to the session:
2. Get the models that are active in the session:
3. Get the feature model items in each model:
4. Filter out the features of type hole:
5. Get the subitems in each feature that are axes:

Exception Handling
Nearly all Creo Object TOOLKIT Java 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;

38 Creo Object TOOLKIT JavaUser’s Guide


In fact, the jxthrowable exception is never actually thrown. It is the parent
class of all the exceptions that are thrown by Creo Object TOOLKIT Java
methods and satisfies Java’s requirement that a method’s declaration include the
exceptions that it throws.

Note
Exceptions thrown by Creo Object TOOLKIT Java methods are not
documented in the Creo Object TOOLKIT Java User's Guide. Refer to the
APIWizard for more information on method specific exceptions.

The following figure organizes the Creo Object TOOLKIT Java exceptions into
three categories to facilitate the discussion that follows.

Overview of Creo Object TOOLKIT Java 39


Creo Object TOOLKIT Java Exception Classes

40 Creo Object TOOLKIT JavaUser’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.
The following table describes these exceptions.
Exception Purpose
XInvalidArrayDimIndex, Illegal index value used when accessing a cipjava
XInvalidArrayIndex, array, sequence, or dictionary. (The Creo Object
XInvalidDictIndex, XNegativeIndex TOOLKIT Java interface does not currently include
any dictionary classes.)
XLicense Licensing error (license does not exist, lost, server
down, etc.)
XMsgStringTooLong Communication synchronization problem between
Creo and Creo Object TOOLKIT Java application.
Restart the Creo Object TOOLKIT Java 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 Creo
Object TOOLKIT Java application.
XCannotConnect, XConnectionClosed, Communication problems between Creo and Creo
XFlushFailed Object TOOLKIT Java application.
Other, internal errors Internal assertions that should not append and which
need not be caught individually.

PFC/WFC Exceptions
The PFC/WFC exceptions are thrown by the classes that make up Creo Object
TOOLKIT Java’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.
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 Creo
Object TOOLKIT Java methods, but you may
instantiate and throw this from certain
ActionListener methods to cancel the corresponding
action in the Creo application.
XCannotAccess The contents of a Creo Object TOOLKIT Java object
cannot be accessed in this situation.
XEmptyString An empty string was passed to a method that does
not accept this type of input.

Overview of Creo Object TOOLKIT Java 41


Exception Purpose
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 Creo Object TOOLKIT Java application
failed due to an exception.
XJLinkApplicationInactive Unable to operate on the requested
JLinkApplication object because it has been
shut down.
XJLinkTaskExists Indicates that a Creo Object TOOLKIT Java task
with the given name already exists in session.
XJLinkTaskNotFound Indicates that the Creo Object TOOLKIT Java task
with the given name could not be found and run.
XMethodForbidden Indicates that the specified method is not supported
in the Creo environment..
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 Creo 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 Creo model type.

Creo Parametric TOOLKIT Errors


The XToolkitError exception provides access to error codes from Creo
Parametric TOOLKIT functions that Creo Object TOOLKIT Java uses internally
and to the names of the functions returning such errors. XToolkitError is the
exception you are most likely to encounter because Creo Object TOOLKIT Java is
built on top of Creo Parametric TOOLKIT. The following table lists the integer
values that can be returned by the XToolkitError.GetErrorCode()
method and shows the corresponding Creo Parametric TOOLKIT constant that

42 Creo Object TOOLKIT JavaUser’s Guide


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.
XToolkitError Child Class Creo Parametric TOOLKIT #
Error
XToolkitGeneralError PRO_TK_GENERAL_ERROR -1
XToolkitBadInputs PRO_TK_BAD_INPUTS -2
XToolkitUserAbort PRO_TK_USER_ABORT -3
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
XToolkitSuppressedPar PRO_TK_SUPP_PARENTS -13
ents
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
XToolkitUnavailableSec PRO_TK_UNAV_SEC -20
tion
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
XToolkitAmbiguous PRO_TK_E_AMBIGUOUS -36
XToolkitDeadLock PRO_TK_E_DEADLOCK -37
XToolkitBusy PRO_TK_E_BUSY -38

Overview of Creo Object TOOLKIT Java 43


XToolkitError Child Class Creo Parametric TOOLKIT #
Error
XToolkitInUse PRO_TK_E_IN_USE -39
XToolkitNoLicense PRO_TK_NO_LICENSE -40
XToolkitBsplUnsuitable PRO_TK_BSPL_UNSUITABLE_ -41
Degree DEGREE
XToolkitBsplNonStdEnd PRO_TK_BSPL_NON_STD_ -42
Knots END_
KNOTS
XToolkitBsplMultiInner PRO_TK_BSPL_MULTI_ -43
Knots INNER_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
XToolkitCheckoutCon PRO_TK_CHECKOUT_ -49
flict CONFLICT
XToolkitCreateViewBad PRO_TK_CRE_VIEW_BAD_ -50
Sheet SHEET
XToolkitCreateViewBadMo PRO_TK_CRE_VIEW_BAD_ -51
del MODEL
XToolkitCreateViewBad PRO_TK_CRE_VIEW_BAD_ -52
Parent PARENT
XToolkitCreateViewBad PRO_TK_CRE_VIEW_BAD_ -53
Type TYPE
XToolkitCreateViewBadEx PRO_TK_CRE_VIEW_BAD_ -54
plode EXPLODE
XToolkitUnattachedFeats PRO_TK_UNATTACHED_FEATS -55
XToolkitRegenerateAgain PRO_TK_REGEN_AGAIN -56
XToolkitDrawingCreateEr PRO_TK_DWGCREATE_ERRORS -57
rors
XToolkitUnsupported PRO_TK_UNSUPPORTED -58
XToolkitNoPermission PRO_TK_NO_PERMISSION -59
XToolkitAuthentication PRO_TK_AUTHENTICATION_ -60
Failure FAILURE
XToolkitAppNoLicense PRO_TK_APP_NO_LICENSE -92
XToolkitAppExcessCall PRO_TK_APP_XS_CALLBACKS -93
backs
XToolkitAppStartup PRO_TK_APP_STARTUP_FAIL -94
Failed
XToolkitAppInitializa PRO_TK_APP_INIT_FAIL -95
tionFailed
XToolkitAppVersionMis PRO_TK_APP_VERSION_ -96
match MISMATCH
XToolkitAppCommunica PRO_TK_APP_COMM_FAILURE -97
tionFailure
XToolkitAppNewVersion PRO_TK_APP_NEW_VERSION -98

44 Creo Object TOOLKIT JavaUser’s Guide


The exception XProdevError represents a general error that occurred while
executing a Pro/DEVELOP function and is equivalent to an XZToolkit general
Error. (PTC does not recommend the use of Pro/DEVELOP functions.)
The exception XExternalDataError and it’s children are thrown from
External Data methods. See the chapter on External Data for more information.

Approaches to Creo Object TOOLKIT Java Exception


Handling
To deal with the exceptions generated by Creo Object TOOLKIT Java methods
surround each method with a try-catch-finally block. For example:
try {
JLinkObject.DoSomething()
}
catch (jxthrowable x) {
// Respond to the exception.
}
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!
{
// Respond to the exception.
}
If you do not want to surround every block of code with a try statement, you can
declare your methods to throw the jxthrowable object. For example:
public class MyClass {

public void MyMethod() throws jxthrowable


{
// Includes Pro/Object TOOLKIT Java function calls
}
}

Overview of Creo Object TOOLKIT Java 45


However, you must surround any calls to MyMethod() with a try block.

Domains of Creo Object TOOLKIT Java


Creo Object TOOLKIT Java consists of the following domains:
• pfc—This domain provides classes that support basic functionality.
• wfc—This domain provides classes that support advanced functionality.
• uifc—This domain provides classes that allow you to create user interface
components. Refer to the PTC Creo UI Editor User’s Guide, for more
information on how to create and customize the user interface components.

Compatibility with J-Link


The pfc domain has the same structure and functional coverage as J-Link.
Applications based on J-Link can be run as Creo Object TOOLKIT Java, after you
make the following changes:
• The application should be packaged as a .jar, which must be included in the
classpath. Refer to the section CLASSPATH Variables on page 709, for more
information.
• This jar must be unlocked. Refer to the section Unlockin on page 23, for more
information.
• The classpath should contain otk.jar.
• The registry should indicate startup as otk_java. Refer to the section
Registry File on page 14, for more information.

Creo Object TOOLKIT Java Support for


Creo
Methods Introduced:
• wfcSession.WSession.RunAsCreoType
• wfcSession.WSession.GetCreoType
Creo Object TOOLKIT Java supports applications in synchronous modes for Creo
Parametric. It also supports Creo Direct in certain functional areas.

Note
Creo Object TOOLKIT Java does not support other Creo applications, such as,
Creo Layout, Creo Simulate and so on.

46 Creo Object TOOLKIT JavaUser’s Guide


In future, the methods of Creo Object TOOLKIT Java will be enhanced to extend
support to all Creo applications.
To check which methods from pfc and wfc domains are supported for Creo
Direct, refer to the Creo Object TOOLKIT Java APIWizard. The methods that are
supported for Creo Direct have the comment “This method is enabled for “Creo
Direct” in the APIWizard. All the methods or a subset of methods in the following
areas is supported for Creo Direct:
• Model, Part, Assembly
• Solid
• File Operations
• Selection
• Geometry
• Window
• PDM Interaction
• External Data
Creo Direct supports all the methods in the uifc domain.
If you call a method that is not supported in the Creo application, the
XMethodForbidden exception is thrown.
You can also develop the Creo Direct applications in Creo Parametric
environment. You can simulate the Creo type at runtime and check for
XMethodForbidden exceptions.
Use the method wfcSession.WSession.RunAsCreoType to run the Creo
Object TOOLKIT Java application in the specified Creo environment. Specify the
Creo application using the enumerated data type wfcSession.CreoType. The
valid values are:
• CREO_PARAMETRIC
• CREO_DIRECT

Note
The method wfcSession.WSession.RunAsCreoType must be used
only with Creo Parametric environment. If used with other Creo environments,
the method returns the XMethodForbidden exception. Therefore, you must
remove the call to this method before deploying the final application.

The method wfcSession.WSession.GetCreoType returns the Creo


environment to which the Creo Object TOOLKIT Java application is connected.

Overview of Creo Object TOOLKIT Java 47


The keywords toolkit and creo_type defined in the registry file are used to
specify the information required to run a Creo Object TOOLKIT Java application
in a non-Creo Parametric environment. The non-Creo Parametric applications read
the information from the registry file.
For example, the standard form of the registry file in executable mode for Creo
Direct is as follows:
name
java_demo
startup
otk_java
toolkit
object
creo_type
direct
java_app_class
MyJavaApp
java_app_classpath <full path to the application jar file>
java_app_start
start
java_app_stop
stop
allow_stop
true
delay_start
true
text_dir
<path to text directory used by
message and menu related commands>
end

The keyword toolkit has two values:


• protoolkit for applications based on Creo Parametric TOOLKIT
• object for applications based on Creo Object TOOLKIT Java
If you run an application of type protoolkit in any Creo environment other
than Creo Parametric, an error message appears. Similarly, if you try to run the
Creo Object TOOLKIT Java application in a Creo environment other than the one
mentioned in the registry file, an error message appears.
The Auxiliary Applications dialog box is available within the non-Creo Parametric
applications.

Support for Multi-CAD Models Using Creo


Unite
Creo Unite enables you to open non-Creo parts and assemblies in Creo Parametric
and other Creo applications such as Creo Simulate and Creo Direct without
creating separate Creo models. You can then assemble the part and assembly
models that you opened as components of Creo assemblies to create multi-CAD
assemblies of mixed content.
You can open the part and assembly models of the following non-Creo file
formats in Creo applications:
• CATIA V5 (.CATPart, .CATProduct)
• CATIA V5 CGR

48 Creo Object TOOLKIT JavaUser’s Guide


• CATIA V4 (.Model)
• SolidWorks (.sldasm, .sldprt)
• NX (.prt)
Most of theCreo Object TOOLKIT Java methods support multi-CAD assemblies.
The methods which do not support assemblies of mixed content will throw the
exception pfcExceptions.XToolkitUnsupported, when a non-native
part or assembly is passed as the input model.

Version Compatibility: Creo Parametric


and Creo Object TOOLKIT Java
In many situations it will be inconvenient or impossible to ensure that the users of
your Creo Object TOOLKIT Java application use the same build of Creo
Parametric used to compile and link the Creo Object TOOLKIT Java application.
This section summarizes the rules for mixing Creo Object TOOLKIT Java and
Creo Parametric versions. The Creo Object TOOLKIT Java version is the Creo
Parametric CD version from which the user installed the Creo Object TOOLKIT
Java version used to compile and link the application.
Method Introduced:
• wfcSession.WSession.GetReleaseNumericVersion
This method returns the version number of the Creo Parametric executable to
which the Creo Object TOOLKIT Java application is connected. This number is
an absolute number and represents the major release of the product. The version
number of Creo Parametric2.0 is 31.
The following points summarize the rules for mixing Creo Object TOOLKIT Java
and Creo Parametric versions:
• Creo Parametric release newer than a Creo Object TOOLKIT Java release:
This works in many, but not all, cases. The communication method used to
link Creo Object TOOLKIT Java to Creo Parametric provides full
compatibility between releases. However, there are occasional cases where
changes internal to Creo Parametric may require changes to the source code of
a Creo Object TOOLKIT Java application in order that it continues to work
correctly. Whether you need to convert Creo Object TOOLKIT Java
applications depends on what functionality it uses and what functionality
changed in Creo Parametric and Creo Object TOOLKIT Java. PTC makes
every effort to keep these effects to a minimum. The Release Notes for Creo
Object TOOLKIT Java detail any conversion work that could be necessary for
that release.
• Creo Parametric build newer than aCreo Object TOOLKIT Java build.

Overview of Creo Object TOOLKIT Java 49


This is always supported.

Retrieving Creo Datecode


Method Introduced:
• wfcSession.WSession.GetDisplayDateCode
The method wfcSession.WSession.GetDisplayDateCode returns the
user-visible datecode string from the Creo application. Applications that present a
datecode string to users in messages and information should use the Creo datecode
format.

Compatibility of Deprecated Methods


In a release cycle, some methods are deprecated, and new methods are added. The
deprecated methods are supported in the current release, and then obsoleted in a
future release. You can either choose to let the deprecated methods work in the
current release, or allow only new methods to work. Use the methods explained in
this section along with the compatibility value to work with either deprecated or
new methods for the current release.
Methods Introduced:
• pfcSession.AppInfo.GetCompatibility
• pfcSession.AppInfo.SetCompatibility
• pfcSession.Session.AppInfo_Create
• pfcSession.Session.GetAppInfo
• pfcSession.Session.SetAppInfo
The methods pfcSession.AppInfo.GetCompatibility and
pfcSession.AppInfo.SetCompatibility get and set the compatibility
value for the specified application using the enumerated data type
pfcSession.CreoCompatibility. The valid values are:
• CompatibilityUndefined—Specifies that compatibility value is not
set. The default compatibility value is used.
• C3Compatible—Specifies that the methods deprecated in Creo Object
TOOLKIT Java 4.0 are compatible and continue working in Creo Object
TOOLKIT Java 4.0. By default the compatibility is set to
pfcC3Compatible.
• C4Compatible—Specifies that the methods deprecated in Creo Object
TOOLKIT Java 4.0 will not work in Creo Object TOOLKIT Java 4.0. If your
application uses the deprecated methods, you must replace these methods with
new methods and rebuild you applications.

50 Creo Object TOOLKIT JavaUser’s Guide


Note
If you rebuild or run Creo Object TOOLKIT Java applications from previous
releases in the current release, the compatibility is set C3Compatible to
current release. For example, if you rebuild a Creo Object TOOLKIT Java 3.0
application in release 4.0, the compatibility is set to C3Compatible. To set
the compatibility to the current release, use the method
pfcSession.AppInfo.SetCompatibility.

The method pfcSession.Session.AppInfo_Create creates a new


instance of the pfcAppInfo object.
The methods pfcSession.Session.GetAppInfo and
pfcSession.Session.SetAppInfo get and set the information for an
application in terms of their compatibility value as a pfcSession.AppInfo
object.

Visit Methods
Methods Introduced:
• wfcClient.VisitingClient.ApplyAction
• wfcClient.VisitingClient.ApplyFilter
• wfcAssembly.WAssembly.VisitComponents
• wfcFeature.WFeatureGroup.VisitDimensions
• wfcModel.WModel.VisitItems
• wfcFeature.WFeature.VisitItems
• wfcModel.WModel.VisitDetailItems
In a Creo Object TOOLKIT Java application, you may often want to perform an
operation on all the objects that belong to another object, such as all the features in
a part, or all the surfaces in a feature. For such cases, Creo Object TOOLKIT Java
provides an appropriate visit method. The visit method is an alternative to passing
back an array of data.
The method wfcAssembly.WAssembly.VisitComponents visits all the
components in an assembly. The input argument visitingClient specifies an object
of type VisitingClient that contains the visit action and filter methods for
visiting items.

Overview of Creo Object TOOLKIT Java 51


The method wfcClient.VisitingClient.ApplyAction is the method
that you want to be called for each item and pass its pointer to the Creo Object
TOOLKIT Java visit method. This method is referred to as the visit action
method. The Creo Object TOOLKIT Java visit method calls the visit action
method once for every visited item.
The method wfcClient.VisitingClient.ApplyFilter is referred to as
the filter method. The filter method is called for each visited item before the
action method. The return value of the filter method controls whether the action
method must be called for that item. You can use the filter method as a way of
visiting only a particular subset of the items in the list.
The filter method must return one of the following values defined in enumerated
data type Status:
• TK_CONTINUE—Specifies that the visit action method must not visit this
object, but continue to visit the subsequent objects.
• Any other value—Specifies that the visit action method must be called for this
object. The return value must be passed as the input argument to the visit
action method.
The visit action method must return one of the following values defined in
enumerated data type Status:
• TK_NO_ERROR—Specifies that the visit action method must continue visiting
the other objects in the list.
• TK_E_NOT_FOUND—Specifies that no items of the specified type were
found and therefore no objects could be visited.
• Any other value (including TK_CONTINUE)—Terminates the visit. Typically
this status is returned from the visit action method on termination, so that the
calling method knows the reason for the abnormal termination of the visit.
For the method wfcSolid.WSolid.VisitItems, the actual type of item
passed to the methods wfcClient.VisitingClient.ApplyAction and
wfcClient.VisitingClient.ApplyFilter is of type
ptc.com.wfc.wfcModelItem.WModelItem. To make the methods of
WModelItem available in ModelItem, cast ModelItem to WModelItem.
Similarly, for the method wfcAssembly.WAssembly.VisitComponents,
to make the methods of WComponentFeat available in pfcObject, cast
pfcObject to WComponentFeat.
The method wfcFeature.WFeatureGroup.VisitDimensions traverses
the members of the feature group.
Use the method wfcModel.WModel.VisitItems visits the
pfcModelItem.ModelItemType objects in the model for the specified type
of item.
The method wfcFeature.WFeature.VisitItems visits the annotation
elements in the specified feature.

52 Creo Object TOOLKIT JavaUser’s Guide


The method wfcModel.WModel.VisitDetailItems visits the
pfcDetailType objects in the model for the specified drawing and sheet of a
detail item.

Sample Applications
The Creo Object TOOLKIT Java sample applications are available in the location
<creo_otk_java_loadpoint_app>\otk_java_examples.
The application otk_java_examples is a collection of example source files
for Creo Object TOOLKIT Java. It covers most of the areas of Creo Object
TOOLKIT Java.
You will find more examples under <creo_loadpoint>\<datecode>\
Common Files\jlink\jlink_appls\jlinkexamples, which can be
run as a Creo Object TOOLKIT Java application. Refer to the
sectionCompatibility with J-Link on page 46 , for more information on how to run
J-Link applications as Creo Object TOOLKIT Java applications.

Overview of Creo Object TOOLKIT Java 53


3
Creo Object TOOLKIT Java
Programming Considerations
Creo Object TOOLKIT Java Thread Restrictions..........................................................55
Parent-Child Relationships Between Creo Object TOOLKIT Java Objects .....................55
Run-Time Type Identification in Creo Object TOOLKIT Java .........................................56

This chapter contains information needed to develop an application using Creo


Object TOOLKIT Java.

54 Creo Object TOOLKIT JavaUser’s Guide


Creo Object TOOLKIT Java Thread
Restrictions
When you run a synchronous Creo Object TOOLKIT Java program, you should
configure your program so it does not interfere with the main thread of the Creo
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).
Creating a nonblocking frame causes a new thread to begin, which can have
unexpected results when running with Creo application. For example, you can use
the javax.swing.JDialog class and set modal true. You cannot use
javax.swing.JWindow, however, because it starts a thread.

Parent-Child Relationships Between Creo


Object TOOLKIT Java Objects
Some Creo Object TOOLKIT Java objects inherit from either the interface
com.ptc.pfc.pfcObject.Parent or
com.ptc.pfc.pfcObject.Child. These interfaces are used to maintain a
relationship between the two objects. This has nothing to do with Java inheritance.
In Creo Object TOOLKIT Java, the Child is owned by the Parent.
Methods Introduced:
• 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 Creo Object TOOLKIT Java.
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 (Creo Parametric TOOLKIT)
Session Application (Creo Object TOOLKIT Java)

Creo Object TOOLKIT Java Programming Considerations 55


Run-Time Type Identification in Creo
Object TOOLKIT Java
Creo Object TOOLKIT Java and the Java language provides several methods to
identify the type of an object. Each has its adavantages and disadvantages.
Many Creo Object TOOLKIT Java classes provide read access to a type enum (for
example, the Feature class has a GetFeatType method, returning a
FeatureType enumeration value representing the type of the feature). Based
upon the type, a user can downcast the Feature object to a particular subtype,
such as ComponentFeat, which is an assembly component.

56 Creo Object TOOLKIT JavaUser’s Guide


4
The Creo Object TOOLKIT Java
Online Browser
Online Documentation Creo Object TOOLKIT Java APIWizard .....................................58

This chapter describes how to use the online browser provided with Creo Object
TOOLKIT Java.

57
Online Documentation Creo Object
TOOLKIT Java APIWizard
Creo Object TOOLKIT Java provides an online browser called the Creo Object
TOOLKIT Java APIWizard that displays detailed documentation. This browser
displays information from the Creo Object TOOLKIT Java User’s Guide and API
specifications derived from Creo Object TOOLKIT Java header file data.
The Creo Object TOOLKIT Java APIWizard contains the following items:
• Definitions of Creo Object TOOLKIT Java packages and their hierarchical
relationships
• Definitions of Creo Object TOOLKIT Java classes and interfaces
• Descriptions of Creo Object TOOLKIT Java methods
• Declarations of data types used by Creo Object TOOLKIT Java methods
• The Creo Object TOOLKIT Java User’s Guide, which you can browse by
topic or by class
• Code examples for Creo Object TOOLKIT Java methods (taken from the
sample applications provided as part of the Creo Object TOOLKIT Java
installation)
Read the Release Notes and README file for the most up-to-date information on
documentation changes.

Note
• The Creo Object TOOLKIT Java User’s Guide is also available in PDF format.
This file is located at:
<creo_otk_java_loadpoint_doc>\otk_javaug.pdf
• From Creo 4.0 F000, the applet based APIWizard is no longer supported. Use
the non-applet based APIWizard instead.

Installing the APIWizard


The Creo Object TOOLKIT Java installation procedure automatically installs the
Creo Object TOOLKIT Java APIWizard. The files reside in a directory under the
Creo Object TOOLKIT Java load point. The location for the Creo Object
TOOLKIT Java APIWizard files is:
<creo_otk_java_loadpoint_doc>\objecttoolkit_Creo

58 Creo Object TOOLKIT JavaUser’s Guide


APIWizard Overview
The APIWizard supports Internet Explorer, Firefox, and Chromium browsers.
Start the Creo Object TOOLKIT Java APIWizard by pointing your browser to:
<creo_otk_java_loadpoint_doc>\objecttoolkit_Creo\index.html
A page containing links to the Creo Object TOOLKIT Java APIWizard and User’s
Guide will open in the web browser.

Non-Applet APIWizard Top Page


The top page of non-applet based APIWizard has links to the Creo Object
TOOLKIT Java APIWizard and User’s Guide. The APIWizard opens an HTML
page that contains links to Creo Object TOOLKIT Java classes and related
methods. The User’s Guide opens an HTML page that displays the Table of
Contents of the User’s Guide, with links to the chapters, and sections under the
chapters.
Click APIWizard to open the list of Creo Object TOOLKIT Java classes and
related methods. Click a class or method name to read more about it.
You can search for specified information in the APIWizard. Use the search field at
the top left pane to search for methods. You can search for information using the
following criteria:
• Search by method names
• Search using wildcard character *, where * (asterisk) matches zero or more
nonwhite space characters
The resulting method names are displayed in a drop down list with links to html
pages.

You can also hover the mouse over after you enter a string in the search field.
The following search options are displayed:
• Class/Methods—Searches for classes and methods.
• DMA Methods—Searches for methods that are supported in Creo Direct.
• Global Methods—Searches only for global methods.
• Compact Class/Methods—Reserved for future use.
• Licensed Methods—Searches for methods which are available under license
222. In the search field, specify “*”. It displays all the methods under this
license.
• Exceptions—Searches only for exceptions.
Select an option and the search results are displayed based on this criteria.

The Creo Object TOOLKIT Java Online Browser 59


User’s Guide
Click User’s Guide to access the Creo Object TOOLKIT Java User’s Guide.

60 Creo Object TOOLKIT JavaUser’s Guide


5
Session Objects
Overview of Session Objects......................................................................................62
Getting the Session Object.........................................................................................62
Creo License Data.....................................................................................................64
Directories ................................................................................................................64
Initializing Objects .....................................................................................................69
Accessing the Creo User Interface..............................................................................70

This chapter describes how to program on the session level using Creo Object
TOOLKIT Java.

61
Overview of Session Objects
The Session object (contained in the class
com.ptc.pfc.pfcSession.Session) is the highest level object in Creo
Object TOOLKIT Java. Any program that accesses data from Creo application
must first get a handle to the Session object before accessing more specific
data.
The Session object contains methods to perform the following operations:
• Accessing models and windows (described in the Models and Windows
chapters).
• Working with the Creo user interface.
• Allowing interactive selection of items within the session.
• Accessing global settings such as line styles, colors, and configuration options.
The following sections describe these operations in detail.

Getting the Session Object


Method Introduced:
• pfcSession.pfcSession.GetCurrentSession
• pfcSession.pfcSession.GetCurrentSessionWithCompatibility
• pfcGlobal.pfcGlobal.GetProESession
For every application, Creo assigns a unique session. The session contains license
information, the compatibility information as a
pfcSession.CreoCompatibility object, and other additional data of the
application. When a session is assigned to an application, Creo sets the
compatibility to CompatibilityUndefined in the associated AppInfo
object. You must set the compatibility of the application before working with
sessions. To set the compatibility, call the method
pfcSession.pfcSession.GetCurrentSessionWithCompatibili
ty. Use the values defined in the enumerated data type
pfcSession.CreoCompatibility to set the compatibility of the
application. See Compatibility of Deprecated Methods on page 50 for more
information on compatibility and AppInfo object. Use the method
pfcSession.pfcSession.GetCurrentSession to get the current
Session object in synchronous mode. If the compatibility is not set, the method
throws the exception pfcExceptions.XCompatibilityNotSet.
If a Creo Object TOOLKIT Java application has more than one starting method,
then you must set the compatibility for each method, when you retrieve the current
session for the first time.

62 Creo Object TOOLKIT JavaUser’s Guide


The method pfcGlobal.pfcGlobal.GetProESession also gets the
Session object. This method will be deprecated in a future release of Creo. If
you call this method without setting the compatibility, the method sets the
compatibility to C3Compatible. This setting ensures forward compatibility of
the Creo applications. If you set a specific compatibility using the method
pfcSession.pfcSession.GetCurrentSessionWithCompatibili
ty, and call the method pfcGlobal.pfcGlobal.GetProESession then
all calls to pfcGlobal.pfcGlobal.GetProESession return the session
with the set compatibility.

Note
You can make multiple calls to this method, but each call gives you a handle
to the same object.

Getting Session Information


Methods Introduced:
• pfcGlobal.pfcGlobal.GetProEArguments
• pfcGlobal.pfcGlobal.GetProEVersion
• pfcGlobal.pfcGlobal.GetProEBuildCode
The method pfcGlobal.pfcGlobal.GetProEArguments returns an
array containing the command line arguments passed to Creo application if these
arguments follow one of two formats:
• Any argument starting with a plus sign (+) followed by a letter character.
• Any argument starting with a minus (-) followed by a capitalized letter.
The first argument passed in the array is the full path to the Creo executable.
The method pfcGlobal.pfcGlobal.GetProEVersion returns a string
that represent theCreo version, for example “Wildfire”.
The method pfcGlobal.pfcGlobal.GetProEBuildCode returns a string
that represents the build code of the Creo session.

Note
The preceding methods can only access information in synchronous mode.

Session Objects 63
Creo License Data
Method Introduced:
• wfcSession.WSession.IsOptionOrdered
The method wfcSession.WSession.IsOptionOrdered returns a
boolean value indicating if the specified Creo license option is currently available
in the Creo session. For example, Pro/MESH option.

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 Creo
application.
The method pfcSession.BaseSession.ChangeDirectory changes
Creo to another working directory.

File Handling
Methods Introduced:
• pfcSession.BaseSession.ListFiles
• pfcSession.BaseSession.ListSubdirectories
• wfcSession.WSession.UIEditFile
• wfcSession.WSession.ParseFileName
• wfcSession.ParsedFileNameData.GetDirectoryPath
• wfcSession.ParsedFileNameData.GetName
• wfcSession.ParsedFileNameData.GetExtension
• wfcSession.ParsedFileNameData.GetVersion
• wfcSession.WSession.DisplayInformationWindow
The method pfcSession.BaseSession.ListFiles returns a list of files
in a directory, given the directory path. You can filter the list to include only files
of a particular type, as specified by the file extension.

64 Creo Object TOOLKIT JavaUser’s Guide


Starting with Pro/ENGINEER Wildfire 5.0 M040, the Windchillmethod
pfcSession.BaseSession.ListFiles can also list instance objects
when accessing Windchill workspaces or folders. A PDM location (for workspace
or commonspace) must be passed as the directory path. The following options
have been added in the FileListOpt enumerated type:
• FILE_LIST_ALL—Lists all the files. It may also include multiple versions
of the same file.
• FILE_LIST_LATEST—Lists only the latest version of each file.
• FILE_LIST_ALL_INST—Same as the FILE_LIST_ALL option. It returns
instances only for PDM locations.
• FILE_LIST_LATEST_INST—Same as the FILE_LIST_LATEST option.
It returns instances only for PDM locations.
The method pfcSession.BaseSession.ListSubdirectories returns
the subdirectories in a given directory location.
The method wfcSession.WSession.UIEditFile opens an edit window
for the specified text file. The editor used is the default editor for Creo. The
method returns a boolean value to indicate if the file was edited.
The file utility methods refer to files using a single wide character string, which
composes of the directory path, file name, extension, and version. The method
wfcSession.WSession.ParseFileName takes such a string as input, and
returns the four segments as a wfcParsedFileNameData object.
The method wfcSession.ParsedFileNameData.GetDirectoryPath
returns the directory path for the file.
The method wfcSession.ParsedFileNameData.GetName returns the
name of the file.
The method wfcSession.ParsedFileNameData.GetExtension
returns the extension of the file.
The method wfcSession.ParsedFileNameData.GetVersion returns
the version of the file.
The method wfcSession.WSession.DisplayInformationWindow
creates a window and displays the content of the specified file. The input
arguments are:
• FilePath—Specifies the name of the file.
• XOffest—Specifies the location of the window along the X-direction with
reference to the Creo main window. The valid range is from 0.0 to 1.0.
• YOffest—Specifies the location of the window along the Y-direction with
reference to the Creo main window. The valid range is from 0.0 to 1.0.

Session Objects 65
• Rows—Specifies the size of the window in terms of rows. The valid range is
from 6 to 33.
• Columns—Specifies the size of the window in terms of columns. The valid
range is from 8 to 80.

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.
Use the method pfcSession.BaseSession.GetConfigOptionValues
to retrieve the value of a specified configuration file option. Pass the Name of the
configuration file option as the input to this method. The method returns an array
of values that the configuration file option is set to. It returns a single value if the
configuration file option is not a multi-valued option. The method returns a null if
the specified configuration file option does not exist.
The method pfcSession.BaseSession.SetConfigOption is used to
set the value of a specified configuration file option. If the option is a multi-value
option, it adds a new value to the array of values that already exist.
The method pfcSession.BaseSession.LoadConfigFile loads an
entire configuration file into Creo application.

Registry File Data


Functions Introduced:
• wfcWSession.WSession.GetApplicationPath
• wfcWSession.WSession.GetApplicationTextPath
The method wfcWSession.WSession.GetApplicationPath returns the
path to the Creo Object TOOLKIT Java executable file, exec_file, from the
registry file.
The method wfcWSession.WSession.GetApplicationTextPath
returns the path to the directory containing the text folder for the application
from the registry file.

Macros
Method Introduced:

66 Creo Object TOOLKIT JavaUser’s Guide


• pfcSession.BaseSession.RunMacro
• wfcWSession.WSession.ExecuteMacro
The method pfcSession.BaseSession.RunMacro runs a macro string. A
Creo Object TOOLKIT Java macro string is equivalent to a Creo Parametric
mapkey minus the key sequence and the mapkey name. To generate a macro
string, create a mapkey in Creo Parametric. Refer to the Creo Parametric online
help for more information about creating a mapkey.
Copy the Value of the generated mapkey Option from the Tools ▶ Options dialog
box. An example Value is as follows:
$F2 @MAPKEY_LABELtest;
~ Activate `main_dlg_cur` `ProCmdModelNew.file`;
~ Activate `new` `OK`;
The key sequence is $F2. The mapkey name is @MAPKEY_LABELtest. The
remainder of the string following the first semicolon is the macro string that
should be passed to the method pfcSession.BaseSession.RunMacro.
In this case, it is as follows:
~ Activate `main_dlg_cur` `ProCmdModelNew.file`;
~ Activate `new` `OK`;

Note
Creating or editing the macro string manually is not supported as the mapkeys
are not a supported scripting language. The syntax is not defined for users and
is not guaranteed to remain constant across different datecodes of Creo
Parametric.

The method wfcWSession.WSession.ExecuteMacro executes the


macros previously loaded using the method
pfcSession.BaseSession.RunMacro.

Execution Rules
Consider the following rules about the execution of macros:
• In synchronous mode, the mapkey or the macro strings are pushed onto a stack
and are popped off and executed only when control returns to Creo Parametric
from the Creo Object TOOLKIT Java program. Macros in synchronous mode
are stored in reverse order, last in, first out. Due to the last in, first out nature
of the stack, macros that cannot be passed entirely in one

Session Objects 67
pfcSession.BaseSession.RunMacro call should have the strings
loaded in reverse order of required execution.
• To execute a macro from within Creo Object TOOLKIT Java, call the function
wfcSession.WSession.ExecuteMacro. The method runs the Creo
Parametric macro and returns the control to the Creo Object TOOLKIT Java
application. The function works only in the synchronous mode.
• Do not call the function wfcSession.WSession.ExecuteMacro
during the following operations:
○ Activating dialog boxes or setting the current model
○ Erasing the current model
○ Replaying a trail file
• While executing macros, if you click OK in the dialog box to complete the
command operation, the dialog box may be displayed momentarily without
completing the command operation.

Note
○ You can execute only the dialog boxes with built-in exit confirmation as
macros, by canceling the exit action.
○ It is possible that a macro may not be executed because a command
specified in the macro is currently inaccessible in the menus. The
functional success of wfcSession.WSession.ExecuteMacro
depends on the priority of the executed command against the current
context.

• If some of the commands require input to be specified from the keyboard


(such as a part name), the macro continues execution after you type the input
and press ENTER. However, if you must select something with the mouse
(such as selecting a sketching plane), the macro is interrupted and ignores the
remaining commands in the string.
This allows the application to create object-independent macros for long
sequences of repeating choices. Note that during execution of the macro the
user does not have to select any geometry.

Colors and Line Styles


Methods Introduced:

68 Creo Object TOOLKIT JavaUser’s Guide


• pfcSession.BaseSession.SetStdColorFromRGB
• pfcSession.BaseSession.GetRGBFromStdColor
• pfcSession.BaseSession.SetTextColor
• pfcSession.BaseSession.SetLineStyle
These methods control the general display of a Creo session.
Use the method pfcSession.BaseSession.SetStdColorFromRGB to
customize any of the Creo standard colors.
To change the color of any text in the window, use the method
pfcSession.BaseSession.SetTextColor.
To change the appearance of non solid lines (for example, datums) use the method
pfcSession.BaseSession.SetLineStyle.

Initializing Objects
The helper methods described in this section allow you to initialize session
objects.
Methods Introduced:
• wfcSession.wfcSession.CreateMatrix3D
• wfcSession.wfcSession.CreatePoint2D
• wfcSession.wfcSession.CreatePoint3D
• wfcSession.wfcSession.CreateOutline2D
• wfcSession.wfcSession.CreateOutline3D
• wfcSession.wfcSession.CreateVector2D
• wfcSession.wfcSession.CreateVector3D
The method wfcSession.wfcSession.CreateMatrix3D initializes a
three-dimensional matrix with the specified values.
Use the methods wfcSession.wfcSession.CreatePoint2D and
wfcSession.wfcSession.CreatePoint3D to initialize a two-
dimensional and three-dimensional point respectively with the specified values.
The methods wfcSession.wfcSession.CreateOutline2D and
wfcSession.wfcSession.CreateOutline3D initialize a two-
dimensional and three-dimensional line respectively with the specified values.
Use the methods wfcSession.wfcSession.CreateVector2D and
wfcSession.wfcSession.CreateVector3D to initialize a two-
dimensional and three-dimensional vector respectively with the specified values.

Session Objects 69
Accessing the Creo User Interface
The Session object has methods that work with the Creo user interface. These
methods provide access to the menu bar and message window. For more
information on accessing menus, refer to the chapter Menus, Commands, and Pop-
up Menus on page 101.

The Text Message File


A text message file is where you define strings that are displayed in the Creo user
interface. This includes the strings on the command buttons that you add to the
Creo number, the help string that displays when the user’s cursor is positioned
over such a command button, and text strings that you display in the Message
Window. You have the option of including a translation for each string in the text
message file.

Restrictions on the Text Message File


You must observe the following restrictions when you name your message file:
• The name of the file must be 30 characters or less, including the extension.
• The name of the file must contain lower case characters only.
• The file extension must be three characters.
• The version number must be in the range 1 to 9999.
• All message file names must be unique, and all message key strings must be
unique across all applications that run with Creo application. Duplicate
message file names or message key strings can cause Creo application to
exhibit unexpected behavior. To avoid conflicts with the names of Creo or
foreign application message files or message key strings, PTC recommends
that you choose a prefix unique to your application, and prepend that prefix to
each message file name and each message key string corresponding to that
application

Note
Message files are loaded into Creo application only once during a session. If
you make a change to the message file while Creo is running you must exit
and restart Creo application before the change will take effect.

70 Creo Object TOOLKIT JavaUser’s Guide


Contents of the Message File
The message file consists of groups of four lines, one group for each message you
want to write. The four lines are as follows:
1. A string that acts as the identifier for the message. This keyword must be
unique for all Creo messages.
2. The string that will be substituted for the identifier.
This string can include placeholders for run-time information stored in a
stringseq object (shown in Writing Messages to the Message Window).
3. The translation of the message into another language (can be blank).
4. An intentionally blank line reserved for future extensions.

Writing a Message Using a Message Pop-up Dialog


Box
Method Introduced:
• pfcSession.Session.UIShowMessageDialog
The method pfcSession.Session.UIShowMessageDialog displays the
UI message dialog. The input arguments to the method are:
• Message—The message text to be displayed in the dialog.
• Options—An instance of the pfcUI.MessageDialogOptions
containing other options for the resulting displayed message. If this is not
supplied, the dialog will show a default message dialog with an Info
classification and an OK button. If this is not to be null, create an instance of
this options type with pfcUI.pfcUI.MessageDialogOptions_
Create(). You can set the following options:
○ Buttons—Specifies an array of buttons to include in the dialog. If not
supplied, the dialog will include only the OK button. Use the method
pfcUI.MessageDialogOptions.SetButtons to set this option.
○ DefaultButton—Specifies the identifier of the default button for the
dialog box. This must match one of the available buttons. Use the method
pfcUI.MessageDialogOptions.SetDefaultButton to set this
option.
○ DialogLabel—The text to display as the title of the dialog box. If not
supplied, the label will be the english string Info. Use the method
pfcUI.MessageDialogOptions.SetDialogLabel to set this
option.
○ MessageDialogType—The type of icon to be displayed with the
dialog box (Info, Prompt, Warning, or Error). If not supplied, an Info icon is

Session Objects 71
used. Use the method
pfcUI.MessageDialogOptions.SetMessageDialogType to
set this option.

Accessing the Message Window


The following sections describe how to access the message window using Creo
Object TOOLKIT Java. The topics are as follows:
• Writing Messages to the Message Window on page 72
• Writing Messages to an Internal Buffer on page 72

Writing Messages to the Message Window


Methods Introduced:
• pfcSession.Session.UIDisplayMessage
• pfcSession.Session.UIDisplayLocalizedMessage
• pfcSession.Session.UIClearMessage
These methods enable you to display program information on the screen.
The input arguments to the methods
pfcSession.Session.UIDisplayMessage and
pfcSession.Session.UIDisplayLocalizedMessage include the
names of the message file, a message identifier, and (optionally) a stringseq
object that contains upto 10 pieces of run-time information. For
pfcSession.Session.UIDisplayMessage, the strings in the
stringseq are identified as%0s, %1s, ... %9s based on their location in the
sequence. For pfcSession.Session.UIDisplayLocalizedMessage,
the strings in the stringseq are identified as%0w, %1w, ... %9w based on their
location in the sequence. To include other types of run-time data (such as integers
or reals) you must first convert the data to strings and store it in the string
sequence.

Writing Messages to an Internal Buffer


Methods Introduced:
• pfcSession.BaseSession.GetMessageContents
• pfcSession.BaseSession.GetLocalizedMessageContents
The methods pfcSession.BaseSession.GetMessageContents and
pfcSession.BaseSession.GetLocalizedMessageContents enable
you to write a message to an internal buffer instead of the Creo message area.

72 Creo Object TOOLKIT JavaUser’s Guide


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
described in the previous section.

Message Classification
Messages displayed in Creo Object TOOLKIT Java 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.

Creo Object TOOLKIT Java applications can now display any or all of the
following message symbols:
• Prompt—This Creo Object TOOLKIT Java message is preceded by a green
arrow. The user must respond to this message type. Responding includes,
specifying input information, accepting the default value offered, or canceling
the application. If no action is taken, the progress of the application is halted.
A response may either be textual or a selection. The classification for Prompt
messages is %CP
• Info—This Creo Object TOOLKIT Java message is preceded by a blue dot.
Info message types contain information such as user requests or feedback from
Creo Object TOOLKIT Java or Creo applications. The classification for Info
messages is %CI

Note
Do not classify messages that display information regarding problems with
an operation or process as Info. These types of messages must be
classified as Warnings.

• Warning—This Creo Object TOOLKIT Java message is preceded by a


triangle containing an exclamation point. Warning message types contain
information to alert users to situations that could potentially lead to an error
during a later stage of the process. Examples of warnings could be a process

Session Objects 73
restriction or a suspected data problem. A Warning will not prevent or
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 Creo Object TOOLKIT Java 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 Creo Object TOOLKIT Java 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

Reading Data from the Message Window


Methods Introduced:
• pfcSession.Session.UIReadIntMessage
• pfcSession.Session.UIReadRealMessage
• pfcSession.Session.UIReadStringMessage
These methods enable a program to get data from the user. The methods obtain
keyboard input from a text box in the Creo Parametric user interface.

Note
When the user presses Esc or clicks Cancel in the Creo Parametric user
interface, these methods throw the exception
pfcExceptions.XToolkitMsgUserQuit.

The pfcSession.Session.UIReadIntMessage and


pfcSession.Session.UIReadRealMessage methods contain optional
arguments that can be used to limit the value of the data to a certain range.

74 Creo Object TOOLKIT JavaUser’s Guide


The method pfcSession.Session.UIReadStringMessage includes an
optional Boolean argument that specifies whether to echo characters entered onto
the screen. You would use this argument when prompting a user to enter a
password.

Note
A default value is displayed in the text box as input. When user presses the
Enter key as input in the user interface, the default value is not passed to the
Creo Object TOOLKIT Java method; instead, the method returns a constant
string use_default_string. When this string is returned, the application
must interpret that the user wants to use the default value.

Displaying Feature Parameters


Method Introduced:
• pfcSession.Session.UIDisplayFeatureParams
The methodpfcSession.Session.UIDisplayFeatureParams allows
Creo application to show dimensions or other parameters stored on a specific
feature. The displayed dimensions may then be interactively selected by the user.

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
• wfcSession.WSession.UIOpenFileType
• wfcSession.wfcSession.FiletypeOpenOptions_Create
• wfcSession.FiletypeOpenOptions.GetModelFiletypes
• wfcSession.FiletypeOpenOptions.SetModelFiletypes
• wfcSession.FiletypeOpenOptions.GetPreselectedItem
• wfcSession.FiletypeOpenOptions.SetPreselectedItem

Session Objects 75
• pfcUI.pfcUI.FileOpenShortcut_Create
• pfcUI.FileOpenShortcut.SetShortcutName
• pfcUI.FileOpenShortcut.SetShortcutPath
• pfcSession.Session.UISaveFile
• pfcUI.pfcUI.FileSaveOptions_Create
• wfcSession.WSession.UISaveFileType
• wfcSession.wfcSession.FiletypeSaveOptions_Create
• wfcSession.FiletypeSaveOptions.GetModelFiletypes
• wfcSession.FiletypeSaveOptions.SetModelFiletypes
• wfcSession.FiletypeSaveOptions.GetPreselectedItem
• wfcSession.FiletypeSaveOptions.SetPreselectedItem
• 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
The method pfcSession.Session.UIOpenFile opens the dialog box to
browse directories and open files. The method lets you specify options for the file
open dialog box using the objects pfcUI.FileOpenOptions and
pfcUI.FileUIOptions.
Use the method pfcUI.pfcUI.FileOpenOptions_Create to create a
new instance of the pfcUI.FileOpenOptions object. This object contains
the following options:
Use the method pfcUI.pfcUI.FileOpenOptions_Create to create a
new instance of the pfcUI.FileOpenOptions object. You can specify a filter
string to include only files of a particular type. The filter string is specified using

76 Creo Object TOOLKIT JavaUser’s Guide


file extension. In the input argument FilterString you can specify all types
of files extensions with wildcards separated by commas, for example, *.prt,
*.asm, *.txt, *.avi, and so on. Use the methods
pfcUI.FileOpenOptions.GetFilterString and
pfcUI.FileOpenOptions.SetFilterString to get and set the types of
file extensions.
Use the methods pfcUI.FileOpenOptions.GetPreselectedItem and
pfcUI.FileOpenOptions.SetPreselectedItem to get and set the
name of an item that must be preselected in the dialog box.
The pfcUI.FileUIOptions object contains the following options:
• DefaultPath—Specifies the name of the path to be opened by default in
the dialog box. Use the method
pfcUI.FileUIOptions.SetDefaultPath to set this option.
• DialogLabel—Specifies the title of the dialog box. Use the method
pfcUI.FileUIOptions.SetDialogLabel to set this option.
• Shortcuts—Specifies an array of file shortcuts of the type
pfcUI.FileOpenShortcut. Create this object using the method
pfcUI.FileOpenShortcut_Create. This object contains the following
attributes:
○ ShortcutName—Specifies the name of shortcut path to be made
available in the dialog box.
○ ShortcutPath—Specifies the string for the shortcut path.
Use the method pfcUI.FileUIOptions.SetShortcuts to set the
array of file shortcuts.
The method wfcSession.WSession.UIOpenFileType opens the dialog
box to browse directories and open files. The method lets you specify options for
the file open dialog box using the objects
wfcSession.FiletypeOpenOptions and pfcUI.FileUIOptions.
Use the method wfcSession.wfcSession.FiletypeOpenOptions_
Create to create a new instance of wfcSession.FiletypeOpenOptions
object. You can specify a filter string to include only files of a particular type in
the dialog box. In the input argument ModelFiletypes, you can specify an
array of file types using the enumerated data type wfcModel.MdlfileType.
Use the methods
wfcSession.FiletypeOpenOptions.GetModelFiletypes and
wfcSession.FiletypeOpenOptions.SetModelFiletypes to read
and set the file types. Use the methods
wfcSession.FiletypeOpenOptions.GetPreselectedItem and
wfcSession.FiletypeOpenOptions.SetPreselectedItem to get
and set the name of an item that must be preselected in the dialog box.

Session Objects 77
Note
The methods pfcSession.Session.UIOpenFile and
wfcSession.WSession.UIOpenFileType, do not actually open the
file, but return the file path of the selected file.

The method pfcSession.Session.UISaveFile opens the save dialog


box. 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 wfcSession.WSession.UISaveFileType opens the save
dialog box. The method accepts options similar to
wfcSession.WSession.UIOpenFileType. The method lets you specify
options for the save dialog box using the objects
wfcSession.FiletypeSaveOptions and pfcUI.FileUIOptions.
Use the method wfcSession.wfcSession.FiletypeSaveOptions_
Create to create a new instance of the
wfcSession.FiletypeSaveOptions object. You can specify a filter string
to include only files of a particular type. In the input argument
ModelFiletypes, you can use the specify an array of file types using the
enumerated data type wfcModel.MdlfileType. Use the methods
wfcSession.FiletypeSaveOptions.GetModelFiletypes and
wfcSession.FiletypeSaveOptions.SetModelFiletypes to read
and set the file types. Use the methods
wfcSession.FiletypeSaveOptions.GetPreselectedItem and
wfcSession.FiletypeSaveOptions.SetPreselectedItem to get
and set the name of an item that must be preselected in the dialog box.

Note
• The methods pfcSession.Session.UISaveFile and
wfcSession.WSession.UISaveFileType, do not actually save the
file, but return the file path of the selected file.
• For multi-CAD models, in a linked session of Creo Parametric with Windchill,
the methods pfcSession.Session.UISaveFile and
wfcSession.WSession.UISaveFileType do not support a file path
location on local disk.

78 Creo Object TOOLKIT JavaUser’s Guide


The method pfcSession.Session.UISelectDirectory prompts the
user to select a directory using the Creo dialog box for browsing directories. The
method accepts options through the pfcUI.DirectorySelectionOptions
object which is similar to the pfcUI.FileUIOptions object (described for
the method pfcSession.Session.UIOpenFile). Specify the default
directory path, the title of the dialog box, and a set of shortcuts to other directories
to start browsing. If the default path is specified as NULL, the current directory is
used. Use the method pfcUI.pfcUI.DirectorySelectionOptions_
Create to create a new instance of the
pfcUI.DirectorySelectionOptions object. The method
pfcSession.Session.UISelectDirectory returns the selected
directory path; the application must use other methods or techniques to perform
other relevant tasks with this selected path.
The method pfcSession.BaseSession.UIRegisterFileOpen
registers a new file type in the File ▶ Open dialog box in Creo application. This
method takes the pfcUI.FileOpenRegisterOptions and
pfcUI.FileOpenRegisterListener objects as its input arguments. These
objects are as follows:
• pfcUI.FileOpenRegisterOptions—This object contains the options
for registering an open operation. Use the method
pfcUI.pfcUI.FileOpenRegisterOptions_Create to create a new
instance of the object. It contains the following options:
○ FileDescription—Specifies the short description of the file type to
be opened. This description appears for the file type in the File ▶ Open
dialog box. Use the method
pfcUI.FileOpenRegisterOptions.SetFileDescription to
modify this option.
○ FileType—Specifies the file type to be opened. The file type appears as
the file extension in the File ▶ Open dialog box. Use the method
pfcUI.FileOpenRegisterOptions.SetFileType to modify
this option.
• pfcUI.FileOpenRegisterListener—This object provides the action
listener methods for the new file type to be registered. The method
pfcUI.FileOpenRegisterListener.FileOpenAccess is called to
determine whether the new file type can be opened using the File ▶ Open
dialog box. The method
pfcUI.FileOpenRegisterListener.OnFileOpenRegister is
called on clicking Open for the newly registered file type.

Session Objects 79
The method pfcSession.BaseSession.UIRegisterFileSave
registers a new file type in the Save a Copy dialog box in Creo application. This
method takes the pfcUI.FileSaveRegisterOptions and
pfcUI.FileSaveRegisterListener objects as its input arguments. These
objects are described as follows:
• pfcUI.FileSaveRegisterOptions—This object contains the options
for registering a save operation. Use the method
pfcUI.pfcUI.FileSaveRegisterOptions_Create to create a new
instance of the object. It contains the following options:
○ FileDescription—Specifies the short description of the file type to
be saved. This description appears for the file type in the Save a Copy
dialog box. Use the method
pfcUI.FileSaveRegisterOptions.SetFileDescription to
modify this option.
○ FileType—Specifies the file type to be saved. The file type appears as
the file extension in the Save a Copy dialog box. Use the method
pfcUI.FileSaveRegisterOptions.SetFileType to modify
this option.
• pfcUI.FileSaveRegisterListener—This object provides the action
listener methods for the new file type to be registered. The method
pfcUI.FileSaveRegisterListener.FileSaveAccess is called to
determine whether the new file type can be saved using the Save a Copy dialog
box. The method
pfcUI.FileSaveRegisterListener.OnFileSaveRegister is
called on clicking OK for the newly registered file type.

Customizing the Creo Navigation Area


The Creo navigation area includes the Model and Layer Tree pane, Folder browser
pane, and Favorites pane. The methods described in this section enable Creo
Object TOOLKIT Java applications to add custom panes that contain Web pages
to the Creo navigation area.

Adding Custom Web Pages


To add custom Web pages to the navigation area, the Creo Object TOOLKIT Java
application must:
1. Add a new pane to the navigation area.
2. Set an icon for this pane.
3. Set the URL of the location that will be displayed in the pane.
Methods Introduced:

80 Creo Object TOOLKIT JavaUser’s Guide


• 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:
• PaneName—Specify a unique name for the pane. Use this name in
susbsequent calls to
pfcSession.Session.NavigatorPaneBrowserIconSet and
pfcSession.Session.NavigatorPaneBrowserURLSet.
• IconFileName—Specify the name of the icon file, including the extension. A
valid format for the icon file is the PTC-proprietary format used by Creo
.BIF, .GIF, .JPG, or .PNG. The new pane is displayed with the icon
image. If you specify the value as NULL, the default Creo icon is used.
The default search paths for finding the icons are:
○ <creo_loadpoint>\<datecode>\Common Files\text\
resource
○ <Application text dir>\resource
○ <Application text dir>\<language>\resource
The location of the application text directory is specified in the registry file.
• URL—Specify the URL of the location to be accessed from the pane.
Use the method
pfcSession.Session.NavigatorPaneBrowserIconSet to set or
change the icon of a specified browser pane in the navigation area.
Use the method
pfcSession.Session.NavigatorPaneBrowserURLSet to change the
URL of the page displayed in the browser pane in the navigation area.

Session Objects 81
6
Selection
Interactive Selection ..................................................................................................83
Accessing Selection Data ..........................................................................................85
Programmatic Selection.............................................................................................87
Selection Buffer.........................................................................................................88

This chapter describes how to use Interactive Selection in Creo Object TOOLKIT
Java.

82 Creo Object TOOLKIT JavaUser’s Guide


Interactive Selection
Methods Introduced:
• pfcSession.BaseSession.Select
• pfcSelect.pfcSelect.SelectionOptions_Create
• pfcSelect.SelectionOptions.SetMaxNumSels
• pfcSelect.SelectionOptions.SetOptionKeywords
• wfcSelect.wfcSelect.WSelectionOptions_Create
• wfcSelect.WSelectionOptions.GetSelEnvOptions
• wfcSelect.WSelectionOptions.SetSelEnvOptions
• wfcSelect.wfcSelect.SelectionEnvironmentOption_Create
• wfcSelect.SelectionEnvironmentOption.GetAttribute
• wfcSelect.SelectionEnvironmentOption.SetAttribute
• wfcSelect.SelectionEnvironmentOption.GetAttributeValue
• wfcSelect.SelectionEnvironmentOption.SetAttributeValue
• wfcSelect.WSelection.Verify
• wfcSelect.WSelection.GetWindow
When you call the method pfcSession.BaseSession.Select, the Select
dialog box appears in Creo Parametric user interface 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.
In addition, you can pass in a pfcSelect.Selections sequence to the
method. The returned pfcSelect.Selections sequence will contain the
input sequence and any new objects.
The method pfcSelect.pfcSelect.SelectionOptions_Create
pfcSelect.SelectionOptions.SetOptionKeywords take a String
argument made up of one or more of the identifiers listed in the table below,
separated by commas.
For example, to allow the selection of features and axes, the arguments would be
feature, axis.
Creo Parametric Database String Identifier ModelItemType
Item
Datum point point ITEM_POINT
Datum axis axis ITEM_AXIS
Datum plane datum ITEM_SURFACE
Coordinate system datum csys ITEM_COORD_SYS
Feature feature ITEM_FEATURE

Selection 83
Creo Parametric Database String Identifier ModelItemType
Item
Edge (solid or datum surface) edge ITEM_EDGE
Edge (solid only) sldedge ITEM_EDGE
Edge (datum surface only) qltedge ITEM_EDGE
Datum curve curve ITEM_CURVE
Composite curve comp_crv ITEM_CURVE
Surface (solid or quilt) surface ITEM_SURFACE
Surface (solid) sldface ITEM_SURFACE
Surface (datum surface) qltface ITEM_SURFACE
Quilt dtmqlt ITEM_QUILT
Dimension dimension ITEM_DIMENSION
Reference dimension ref_dim ITEM_REF_DIMENSION
Integer parameter ipar ITEM_DIMENSION
Part part N/A
Part or subassembly prt_or_asm N/A
Assembly component model component N/A
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

When you specify the maximum number of selections, the argument to


pfcSelect.SelectionOptions.SetMaxNumSels must be an Integer.
The code will be as follows:
sel_options.setMaxNumSels (new Integer (10));
The default value assigned when creating a SelectionOptions object is –1,
which allows any number of selections by the user.
The method wfcSelect.wfcSelect.WSelectionOptions_Create
allows you to set options for selecting objects by specifying the selection attribute.
The input arguments are:
• OptionKeywords—Specifies the selection filter.
• MaxNumSels—Specifies the maximum number of selections.
• SelEnvOpts—Specifies the selection attribute set using the method
wfcSelect.WSelectionOptions.SetSelEnvOptions.
The method wfcSelect.WSelectionOptions.GetSelEnvOptions
retrieves the selection attribute.

84 Creo Object TOOLKIT JavaUser’s Guide


The method
wfcSelect.wfcSelect.SelectionEnvironmentOption_Create
creates a data object of type SelectionEnvironmentOption that contains
information about the attributes for the interactive selection in Creo Parametric
user interface. Use the method
wfcSelect.SelectionEnvironmentOption.SetAttribute to set
the selection attribute. The following attribute types are available:
• SELECT_DONE_REQUIRED—Specifies that user has to click OK in the
Select dialog box to get the selected items.
• SELECT_BY_MENU_ALLOWED—Specifies that search tool is available in the
method pfcSession.BaseSession.Select when the attribute value is
set to 1, which is the default value.
• SELECT_BY_BOX_ALLOWED—Specifies that user must draw a bounding
box to get the items selected within the box.
• SELECT_ACTIVE_COMPONENT_IGNORE—Specifies that user can select
items external to the activate component.
• SELECT_HIDE_SEL_DLG—Specifies that the Select dialog box must be
hidden.
The method
wfcSelect.SelectionEnvironmentOption.GetAttribute retrieves
the selection attribute.
Use the method
wfcSelect.SelectionEnvironmentOption.SetAttributeValue
to get the integer value of the attributes set in the selection object.
The method wfcSelect.WSelection.Verify verifies if the content of the
selection object is valid.
The method wfcSelect.WSelection.GetWindow retrieves the window
where the selection was made.

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

Selection 85
• pfcSelect.Selection.GetSelView2D
• pfcSelect.Selection.GetSelTableCell
• pfcSelect.Selection.GetSelTableSegment
• wfcSelect.WSelection.GetDrawingTable
• wfcSelect.WSelection.GetPipelineFeature
These methods return objects and data that make up the selection object. Using the
appropriate methods, you can access the following data:
• For a selected model or model item use
pfcSelect.Selection.GetSelModel or
pfcSelect.Selection.GetSelItem.
• For an assembly component use pfcSelect.Selection.GetPath.
• For UV parameters of the selection point on a surface use
pfcSelect.Selection.GetParams.
• For the T parameter of the selection point on an edge or curve use
pfcSelect.Selection.GetTParam.
• For a three-dimensional point object that contains the selected point use
pfcSelect.Selection.GetPoint.
• For selection depth, in screen coordinates use
pfcSelect.Selection.GetDepth.
• For the selected drawing view, if the selection was from a drawing, use
pfcSelect.Selection.GetSelView2D.
• For the selected table cell, if the selection was from a table, use
pfcSelect.Selection.GetSelTableCell.
• For the selected table segment, if the selection was from a table, use
pfcSelect.Selection.GetSelTableSegment.
• For the selected drawing table cell, if the selection was a drawing table, use
wfcSelect.WSelection.GetDrawingTable.
• For the selected pipeline to get the pipeline feature, use
wfcSelect.WSelection.GetPipelineFeature.

Controlling Selection Display


Methods Introduced:
• pfcSelect.Selection.Highlight
• pfcSelect.Selection.UnHighlight
• pfcSelect.Selection.Display

86 Creo Object TOOLKIT JavaUser’s Guide


These methods cause a specific selection to be highlighted or dimmed on the
screen using the color specified as an argument.
The method pfcSelect.Selection.Highlight highlights the selection in
the current window. This highlight is the same as the one used by Creo application
when selecting an item—it just repaints the wire-frame display in the new color.
The highlight is removed if you use the Repaint command or
pfcWindow.Window.Repaint; it is not removed if you use
pfcWindow.Window.Refresh.
The method pfcSelect.Selection.UnHighlight removes the highlight.
The method pfcSelect.Selection.Display causes a selected object to
be displayed on the screen, even if it is suppressed or hidden.

Note
This is a one-time action and the next repaint will erase this display.

Programmatic Selection
Creo Object TOOLKIT Java 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.
Methods Introduced:
• pfcSelect.pfcSelect.CreateModelItemSelection
• pfcSelect.pfcSelect.CreateComponentSelection
• pfcSelect.pfcSelect.CreateSelectionFromString
• pfcSelect.Selection.SetSelItem
• pfcSelect.Selection.SetPath
• pfcSelect.Selection.SetParams
• pfcSelect.Selection.SetTParam
• pfcSelect.Selection.SetPoint
• pfcSelect.Selection.SetSelTableCell
• pfcSelect.Selection.SetSelView2D

Selection 87
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.
The method pfcSelect.pfcSelect.CreateComponentSelection
creates a selection out of any component in an assembly. It takes a
pfcAssembly.ComponentPath object. For more information about
pfcAssembly.ComponentPath objects, see the section Getting a Solid
Object on page 213 in the Solid on page 212 chapter.
The method pfcSelect.pfcSelect.CreateSelectionFromString
creates a new selection object, based on a Web.Link style selection string
specified as the input.
Some Creo Object TOOLKIT Java methods require more information to be set in
the selection object. The methods allow you to set the following:
The selected item using the method pfcSelect.Selection.SetSelItem.
The selected component path using the method
pfcSelect.Selection.SetPath.
The selected UV parameters using the method
pfcSelect.Selection.SetParams.
The selected T parameter (for a curve or edge), using the method
pfcSelect.Selection.SetTParam.
The selected XYZ point using the method
pfcSelect.Selection.SetPoint.
The selected table cell using the method
pfcSelect.Selection.SetSelTableCell.
The selected drawing view using the method
pfcSelect.Selection.SetSelView2D.

Selection Buffer
Introduction to Selection Buffers
Selection is the process of choosing items on which you want to perform an
operation. In Creo application, 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.

88 Creo Object TOOLKIT JavaUser’s Guide


Depending on the situation, different selection buffers may be active at any one
time. In Part and Assembly mode, Creo offers the default selection buffer, the Edit
selection buffer, and other more specialized buffers. Other Creo modes offer
different selection buffers.
In the default Part and Assembly buffer there are two levels at which selection is
done:
• First Level Selection
Provides access to higher-level objects such as features or components. You
can make a second level selection only after you select the higher-level object.
• Second Level Selection
Provides access to geometric objects such as edges and faces.

Note
First-level and second-level objects are usually incompatible in the selection
buffer.

Creo Object TOOLKIT Java allows access to the contents of the currently active
selection buffer. The available methods allow your application to:
• Get the contents of the active selection buffer.
• Remove the contents of the active selection buffer.
• Add to the contents of the active selection buffer.

Reading the Contents of the Selection Buffer


Methods Introduced:
• 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.
Use the method pfcSelect.SelectionBuffer.GetContents to access
the contents of the current selection buffer. The method returns independent
copies of the selections in the selection buffer (if the buffer is cleared, this array is
still valid).

Selection 89
Removing the Items of the Selection Buffer
Methods Introduced:
• 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 was found in the call to the
method pfcSelect.SelectionBuffer.GetContents.
Use the method pfcSelect.SelectionBuffer.Clear to clear the
currently active selection buffer of all contents. After the buffer is cleared, all
contents are lost.

Adding Items to the Selection Buffer


Method Introduced:
• pfcSelect.SelectionBuffer.AddSelection
• wfcSession.WSession.AddCollectionToSelectionBuffer
• wfcSelect.WSelection.GetCollection
Use the method pfcSelect.SelectionBuffer.AddSelection to add
an item to the currently active selection buffer.

Note
The selected item must refer to an item that is in the current model such as its
owner, component path or drawing view.

This method may fail due to any of the following reasons:


• There is no current selection buffer active.
• The selection does not refer to the current model.
• The item is not currently displayed and so cannot be added to the buffer.
• The selection cannot be added to the buffer in combination with one or more
objects that are already in the buffer. For example: geometry and features
cannot be selected in the default buffer at the same time.
Use the method
wfcSession.WSession.AddCollectionToSelectionBuffer to add
collection to the current selection buffer.

90 Creo Object TOOLKIT JavaUser’s Guide


The method wfcSelect.WSelection.GetCollection to get collection
object that contains the items selected by the user.

Selection 91
7
Ribbon Tabs, Groups, and Menu
Items
Creating Ribbon Tabs, Groups, and Menu Items ..........................................................93
About the Ribbon Definition File..................................................................................95
Localizing the Ribbon User Interface Created by the Creo Object TOOLKIT Java
Applications...........................................................................................................99
Support for Legacy Creo Object TOOLKIT Java Applications ........................................99

This chapter describes the Creo Object TOOLKIT Java support for the Ribbon
User Interface (UI). It also describes the impact of the ribbon user interface on
legacy Creo Object TOOLKIT Java applications and the procedure to place the
commands, buttons, and menu items created by the legacy applications in the Creo
Parametric ribbon user interface. Refer to the Creo Parametric Help for more
information on the ribbon user interface and the procedure to customize the
ribbon.

92 Creo Object TOOLKIT JavaUser’s Guide


Creating Ribbon Tabs, Groups, and Menu
Items
Customizations to the ribbon user interface using the Creo Object TOOLKIT Java
applications are supported through the Customize Ribbon tab in the Creo
Parametric Options dialog box. You can specify the user interface layout for a
Creo Object TOOLKIT Java application and save the layout definition in a ribbon
definition file, toolkitribbonui.rbn. Set the configuration option tk_
enable_ribbon_custom_save to yes before customizing the ribbon user
interface using the Creo Object TOOLKIT Java application. When you run Creo
Parametric, the toolkitribbonui.rbn file is loaded along with the Creo
Object TOOLKIT Java application and the commands created by the Creo Object
TOOLKIT Java application appear in the ribbon user interface. Refer to the
section About the Ribbon Definition File on page 95 for more information on the
toolkitribbonui.rbn file.
You can customize the ribbon user interface only for a particular mode in Creo
Parametric. For example, if you customize the ribbon user interface and save it to
the toolkitribbonui.rbn file in the Part mode, then on loading Creo
Parametric the customized user interface will be visible only in the Part mode. To
view a particular tab or group in all the modes, you must customize the ribbon
user interface and save the toolkitribbonui.rbn file in each mode. Refer
to the Creo Parametric Fundamentals Help for more information on customizing
the ribbon.

Note
You can add a new group to an existing tab or create a new tab using the
Customize Ribbon tab in theCreo Parametric Options dialog box. You will not
be able to modify the tabs or groups that are defined by Creo Parametric.

Ribbon Tabs, Groups, and Menu Items 93


Workflow to Add Menu Items to the Ribbon User
Interface
Set the configuration option tk_enable_ribbon_custom_save to yes
before customizing the ribbon user interface. The steps to add commands to the
Creo Parametric ribbon user interface are as follows:
1. Create a Creo Object TOOLKIT Java application with complete command
definition, which includes specifying command label, help text, large icon
name, and small icon name. Designate the command using the
pfcCommand.UICommand.Designate.
2. Start the Creo Parametric application and load this Creo Object TOOLKIT
Java application. The commands created by the Creo Object TOOLKIT Java
application will be loaded in Creo Parametric.
3. Click File ▶ Options. The Creo Parametric Options dialog box opens.
4. Click Customize Ribbon.
5. In the Customize the Ribbon list, select a tab and create a new group in it or
create a new tab and a group in it.
6. In the Choose commands from list, select TOOLKIT Commands. The
commands created by the Creo Object TOOLKIT Java application are
displayed.
7. Click Add to add the commands to the new tab or group.
8. Click Import/Export ▶ Save the Auxilliary Application User Interface. The
changes are saved to the toolkitribbonui.rbn file. The
toolkitribbonui.rbn file is saved in the text folder specified in the
Creo Object TOOLKIT Java application registry file. For more information
refer to the section on About the Ribbon Definition File on page 95.

Note
The Save the Auxilliary Application User Interface button is enabled only if
you set the configuration option tk_enable_ribbon_custom_save
to yes.

9. Click Apply. The custom settings are saved to the toolkitribbonui.rbn


file.
10. Reload the Creo Object TOOLKIT Java application or restart Creo
Parametric. The toolkitribbonui.rbn file will be loaded along with the
Creo Object TOOLKIT Java application.

94 Creo Object TOOLKIT JavaUser’s Guide


If translated messages are available for the newly added tabs or groups, then Creo
Parametric displays the translated strings by searching for the same string from the
list of string based messages that are loaded. For more information refer to the
section on Localizing the Ribbon User Interface Created by the J-LinkVB API
Applications on page 99

About the Ribbon Definition File


A ribbon definition file is a file that is created through the Customize Ribbon
interface in Creo Parametric. This file defines the containers, that is, Tabs, Group,
or Cascade menus that are created by a particular Creo Object TOOLKIT Java
application. It contains information on whether to show an icon or label. It also
contains the size of the icon to be used, that is, a large icon (32X32) or a small
icon (16x16).
The ribbon user interface displays the commands referenced in the ribbon
definition file only if the commands are loaded and are visible in that particular
Creo Parametric mode. If translated messages are available for the newly added
tabs or groups, then Creo Parametric displays the translated strings by searching
for the same string from the list of string based messages that are loaded. For more
information refer to the section on Localizing the Ribbon User Interface Created
by the J-LinkVB API Applications on page 99.
Set the configuration option tk_enable_ribbon_custom_save to yes
before customizing the ribbon user interface. To save the ribbon user interface
layout definition to the toolkitribbonui.rbn file:
1. Click File ▶ Options. The Creo Parametric Options dialog box opens.
2. Click Customize Ribbon.
3. In the Customize the Ribbon list, select a tab and create a new group in it or
create a new tab and a group in it.
4. In the Choose commands from list, select TOOLKIT Commands. The
commands created by the Creo Object TOOLKIT Java application are
displayed.
5. Click Add to add the commands to the new tab or group.
6. Click Import/Export ▶ Save the Auxilliary Application User Interface. The
modified layout is saved to the toolkitribbonui.rbn file located in the
text folder within the Creo Object TOOLKIT Java application directory, that
is, <application_dir>/text

Ribbon Tabs, Groups, and Menu Items 95


Note
The Save the Auxilliary Application User Interface button is enabled only if
you set the configuration option tk_enable_ribbon_custom_save
to yes.

7. Click OK.

Note
You cannot edit the toolkitribbonui.rbn file manually.

To Specify the Path for the Ribbon Definition File


You can rename the toolkitribbonui.rbn to another filename with the
.rbn extension. To enable the Creo Object TOOLKIT Java application to read
the ribbon definition file having a name other than toolkitribbonui.rbn, it
must be available at the location <application_dir>/text/ribbon. The
method introduced in this section enables you to load the ribbon definition file
from within a Creo Object TOOLKIT Java application.
method Introduced:
• pfcSession.Session.RibbonDefinitionfileLoad
The method pfcSession.Session.RibbonDefinitionfileLoad
loads a specified ribbon definition file from a default path into the Creo
Parametric application. The input argument is as follows:
• file_name - Specify the name of the ribbon definition file including its
extension. The default search path for this file is:
○ The working directory from where Creo Parametric is loaded.
○ <application_text_dir>/ribbon
○ <application_text_dir>/language/ribbon

96 Creo Object TOOLKIT JavaUser’s Guide


Note
◆ The location of the application text directory is specified in the Creo
Object TOOLKIT Java registry file.
◆ A Creo Object TOOLKIT Java application can load a ribbon definition
file only once. After the application has loaded the ribbon, calls made
to the method
pfcSession.Session.RibbonDefinitionfileLoad to
load other ribbon definition files are ignored.

Loading Multiple Applications Using the Ribbon


Definition File
Creo Parametric supports loading of multiple .rbn files in the same session. You
can develop multiple Creo Object TOOLKIT Java applications that share the same
tabs or groups and each application will have its own ribbon definition file. As
each application is loaded, its .rbn file will be read and applied. When an
application is unloaded, the containers and command created by its .rbn file will
be removed.
For example, consider two Creo Object TOOLKIT Java applications, namely,
pt_geardesign and pt_examples that add commands to the same group on
a tab on the Ribbon user interface. The application pt_geardesign adds a
command Pro/TOOLKIT Gear Design to the Advanced Modeling group on the
Modeling tab and the application pt_examples adds a command TKPart to the
Advanced Modeling group on the Model tab. The ribbon definition file for each
application will contain an instruction to create the Advanced Modeling group and
if both the ribbon files are loaded, the group will be created only once and the two
ribbon customizations will be merged into the same group.
That is, if both the applications are running in the same Creo Parametric session,
then the commands, Pro/TOOLKIT Gear Design and TKPart will be available under
the Advanced Modeling group on the Model tab.

Note
The order in which the commands will be displayed within the group will
depend on the order of loading of the .rbn file for each application.

Ribbon Tabs, Groups, and Menu Items 97


The following image displays commands added by two applications to the same
group.

To save the customization when multiple applications are loaded:


1. Click File ▶ Options. The Creo Parametric Options dialog box opens.
2. Click Customize Ribbon.
3. In the Customize the Ribbon list, select a tab and create a new group in it or
create a new tab and a group in it.
4. In the Choose commands from list, select TOOLKIT Commands. The
commands created by the Creo Object TOOLKIT Java application are
displayed.
5. Click Add to add the commands to the new tab or group.
6. Click Import/Export ▶ Save the Auxilliary Application User Interface. The Save
UI Customization dialog box opens.
7. Select a Creo Object TOOLKIT Java application and Click Save. The
modified layout is saved to the .rbn file of the specified Creo Object
TOOLKIT Java application.
The Save UI Customization dialog box is shown in the following image:

98 Creo Object TOOLKIT JavaUser’s Guide


Localizing the Ribbon User Interface
Created by the Creo Object TOOLKIT
Java Applications
The labels for the custom tabs, groups, and cascade menus belonging to the Creo
Object TOOLKIT Java application can be translated in the languages supported by
Creo Parametric. To display localized labels, specify the translated labels in the
ribbonui.txt file and save this file at the location <application_text_
dir>/<language>. For example, the text file for German locale must be saved
at the location <application_text_dir>/german/ribbonui.txt.
Create a file containing translations for each of the languages in which the Creo
Object TOOLKIT Java application is localized. The Localized translation files
must use the UTF-8 encoding with BOM character for the translated text to be
displayed correctly in the user interface.
The format of the ribbonui.txt file is as shown below. Specify the following
lines for each label entry in the file:
1. A hash sign (#) followed by the label, as specified in the ribbon definition file.
2. The label as specified in the ribbon definition file and as displayed in the
ribbon user interface.
3. The translated label.
4. Add an empty line at the end of each label entry in the file.
For example, if the Creo Parametric application creates a tab with the name TK_
TAB having a group with the name TK_GROUP, then the translated file will
contain the following:
#TK_TAB
TK_TAB
<translation for TK_TAB>
<Empty_line>
#TK_GROUP
TK_GROUP
<translation for TK_GROUP>
<Empty_line>

Support for Legacy Creo Object TOOLKIT


Java Applications
The user interface for Creo Parametric 1.0 has been restructured to a ribbon user
interface. This may affect the behavior of existing Creo Object TOOLKIT Java
applications that were designed to add commands to specific Pro/ENGINEER
menus or toolbars. These menus or toolbars or both have been redesigned in Creo

Ribbon Tabs, Groups, and Menu Items 99


Parametric 1.0. The commands added by the Creo Object TOOLKIT Java
applications appear on the Creo Parametric ribbon in the Home tab under the Pro/
TK group. When you open a model, the Pro/TK group is on the Tools tab.
You can also arrange the commands added by the Creo Object TOOLKIT Java
applications under a new tab or an existing tab by customizing the ribbon using
the Customize Ribbon tab in the Creo Parametric Options dialog box. For a list of
all the commands added by the Creo Object TOOLKIT Java applications, follow
this procedure:
1. Click File ▶ Options. The Creo Parametric Options dialog box opens.
2. Click Customize Ribbon.
3. In the Choose commands from list, select TOOLKIT Commands. All the
commands added by legacy Creo Object TOOLKIT Java applications are
listed.

Note
Commands that have not been designated will not have an icon or will have a
generic icon.

Refer to the Creo Parametric Help for more information on customizing the
Ribbon.

100 Creo Object TOOLKIT JavaUser’s Guide


8
Menus, Commands, and Pop-up
Menus
Introduction............................................................................................................. 102
Menu Bar Definitions ............................................................................................... 102
Menus Buttons and Menus....................................................................................... 102
Designating Commands........................................................................................... 105
Pop-up Menus ........................................................................................................ 108

This chapter describes the methods provided by Creo Object TOOLKIT Java to
create and modify menus, buttons, and pop-up menus in the Creo Parametric user
interface.
Refer to the chapter Ribbon Tabs, Groups, and Menu Items on page 92 for more
information. Also, refer to the Creo Parametric Help for more information on
customizing the ribbon user interface.

101
Introduction
The Creo Object TOOLKIT Java classes enable you to supplement the Creo
Parametric ribbon user interface.
Once the Creo Object TOOLKIT Java application is loaded, you can add a new
group to an existing tab or create a new tab using the Customize Ribbon tab in the
Creo Parametric Options dialog box in Creo Parametric. You will not be able to
modify the groups that are defined by Creo Parametric. If the translated messages
are available for the newly added tabs or groups, then Creo Parametric will use
them by searching for the same string in the list of sting based messages loaded.
You can customize the ribbon user interface only for a particular mode in Creo
Parametric. For example, if you customize the ribbon user interface and save it to
the toolkitribbonui.rbn file in the Part mode, then on loading Creo
Parametric the customized user interface will be visible only in the Part mode. To
view a particular tab or group in all the modes, you must customize the ribbon
user interface and save the toolkitribbonui.rbn file in each mode. Refer
to the Creo Parametric Fundamentals Help for more information on customizing
the ribbon.

Menu Bar Definitions


• Menu—A menu, such as the File menu, or a sub-menu, such as the Manage
File menu under the File menu.
• Menu button—A named item in a group or menu that is used to launch a set of
instructions.
• Pop-up menu—A menu invoked by selection of an item in the Creo
Parametric graphics window.
• Command—A procedure in Creo Parametric that may be activated from a
button.

Menus Buttons and Menus


The following methods enable you to add new menu buttons in any location on
the Ribbon user interface.
Methods Introduced:
• pfcSession.Session.UICreateCommand
• pfcSession.Session.UICreateMaxPriorityCommand
• pfcCommand.UICommandActionListener.OnCommand

102 Creo Object TOOLKIT JavaUser’s Guide


The method pfcSession.Session.UICreateCommand creates a
pfcUICommand object that contains a
pfcCommand.UICommandActionListener. You should override the
pfcCommand.UICommandActionListener.OnCommand method with
the code that you want to execute when the user clicks a button.
The method pfcSession.Session.UICreateMaxPriorityCommand
creates a pfcUICommand object having maximum command priority. The
priority of the action refers to the level of precedence the added action takes over
other Creo Parametric actions.
Maximum command priority should be used only in commands that open and
activate a new model in a window. Create all other commands using the method
pfcSession.Session.UICreateCommand.
The listener method pfcCommand.UICommandListener.OnCommand is
called when the command is activated in Creo Parametric by pressing a button.
Designate the command using the function
pfcCommand.UICommand.Designate and add a button to the ribbon user
interface using the using the Customize Ribbon tab in the Creo Parametric Options
dialog box. This operation binds the command to the button.

Finding Creo Parametric Commands


This method enables you to find existing Creo Parametric commands in order to
modify their behavior.
Method Introduced:
• pfcSession.Session.UIGetCommand
The method pfcSession.Session.UIGetCommand returns a
pfcCommand.UICommand object representing an existing Creo Parametric
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.
To find the name of an action command, click the corresponding icon on the
ribbon user interface and then check the last entry in the trail file. For example, for
the Save icon, the trail file will have the corresponding entry:
~ Command `ProCmdModelSave`
The action name for the Save icon is ProCmdModelSave. This string can be
used as input to pfcSession.Session.UIGetCommand to get the
command ID.

Menus, Commands, and Pop-up Menus 103


You can determine a command ID string for an option without an icon by
searching through the resource files located in the <creo_loadpoint>\
<datecode>\Common Files\text\resource directory. If you search for
the menu button name, the line will contain the corresponding action command
for the button.

Access Listeners for Commands


These methods allow you to apply an access listener to a command. The access
listener determines whether or not the command is visible at the current time in
the current session.
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 Creo Parametric). This listener will
be called when buttons based on the command might be shown.
The listener method
pfcCommand.UICommandAccessListener.OnCommandAccess allows
you to impose an access function on a particular command. The method
determines if the action or command should be available, unavailable, or hidden.
The potential return values are listed in the enumerated type CommandAccess
and are as follows:
• 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 Creo Parametric 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.

104 Creo Object TOOLKIT JavaUser’s Guide


Bracket Listeners for Commands
These methods allow you to apply a bracket listener to a command. The bracket
listener is called before and after the command runs, which allows your
application to provide custom logic to execute whenever the command is selected.
Methods Introduced:
• pfcBase.ActionSource.AddActionListener
• pfcCommand.UICommandBracketListener.OnBeforeCommand
• pfcCommand.UICommandBracketListener.OnAfterCommand
Use the method pfcBase.ActionSource.AddActionListener to
register a new pfcCommand.UICommandBracketListener on any
command (created either by an application or Creo Parametric). This listener will
be called when the command is selected by the user.
The listener methods
pfcCommand.UICommandBracketListener.OnBeforeCommand and
pfcCommand.UICommandBracketListener.OnAfterCommand allow
the creation of functions that will be called immediately before and after execution
of a given command. These methods are used to add the business logic to the start
or end (or both) of an existing Creo Parametric command.
The method
pfcCommand.UICommandBracketListener.OnBeforeCommand 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.

Designating Commands
Using Creo Object TOOLKIT Java you can designate Creo Parametric commands.
These commands can later appear in the Creo Parametric ribbon user interface.
To add a command you must:
1. Define or add the command to be initiated on clicking the icon in the Creo
Object TOOLKIT Java application.
2. Optionally designate an icon button to be used with the command.
3. Designate the command to appear in the Customize Ribbon tab in the Creo
Parametric Options dialog box.

Menus, Commands, and Pop-up Menus 105


Note
Refer to the chapter on Ribbon Tabs, Groups, and Menu Items on page 92
for more information. Also, refer to the Creo Parametric Help for more
information on customizing the Ribbon User Interface.

4. Save the configuration in Creo Parametric so that changes to the ribbon user
interface appear when a new session of Creo Parametric is started.

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
Creo Parametric 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
a standard .GIF, .JPG, or.PNG. PTC recommends using .PNG format. All
icons in the Creo Parametric ribbon are either 16x16 (small) or 32x32 (large) size.
The naming convention for the icons is as follows:
• Small icon—<iconname.ext>
• Large icon—<iconname_large.ext>

Note
• The legacy naming convention for icons <icon_name_icon_size.ext>
will not be supported in future releases of Creo Parametric. The icon size was
added as a suffix to the name of the icon. For example, the legacy naming
convention for small icons was iconname16X16.ext. It is recommended
to use the standard naming conventions for icons, that is, iconname.ext or
iconname_large.ext.
• While specifying the name of the icon file, do not specify the full path to the
icon names.

The application searches for the icon files in the following locations:

106 Creo Object TOOLKIT JavaUser’s Guide


• <creo_loadpoint>\<datecode>\Common Files\text\
resource
• <Application text dir>\resource
• <Application text dir>\<language>\resource
The location of the application text directory is specified in the registry file.
Commands that do not have an icon assigned to them display the button label.
You may also use this method to assign a small icon to a button. The icon appears
to the left of the button label.

Designating the Command


Method Introduced:
• pfcCommand.UICommand.Designate
This method allows you designate the command as available in the Customize
Ribbon tab in the Creo Parametric Options dialog of Creo Parametric. After a Creo
Object TOOLKIT Java application has used the method
pfcCommand.UICommand.Designate on a command, can add the button
associated with this command into the Creo Parametric ribbon user interface.
If this method is not called, the button will not be visible in the Toolkit Commands
list in the Customize Ribbon tab in the Creo Parametric Options dialog of Creo
Parametric.
The arguments to this method are:
• Label—The message string that refers to the icon label. This label (stored in
the message file) identifies the text seen when the button is displayed. If the
command is not assigned an icon, the button label string appears on the toolbar
button by default.
• Help—The one-line Help for the icon. This label (stored in the message file)
identifies the help line seen when the mouse moves over the icon.
• Description—The message appears in the Customize Ribbon tab in the Creo
Parametric Options dialog box and also when Description is clicked in Creo
Parametric.
• MessageFile—The message file name. All the labels including the one-line
Help labels must be present in the message file.

Note
This file must be in the directory <text_path>/text or <text_
path>/text/<language>.

Menus, Commands, and Pop-up Menus 107


Placing the Button
Once the button has been created using the methods discussed, place the button on
the Creo Parametric ribbon user interface. Refer to the chapter on Ribbon Tabs,
Groups, and Menu Items on page 92 for more information. Also, refer to the Creo
Parametric Help for more information on customizing the Ribbon User Interface.

Pop-up Menus
Creo Parametric 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.

Adding a Pop-up Menu to the Graphics Window


You can activate different pop-up menus during a given session of Creo
Parametric. Every time the Creo Parametric context changes when you open a
different model type, enter different tools or special modes such as Edit, a different
pop-up menu is created. When Creo Parametric moves to the next context, the
pop-up menu may be destroyed.
As a result of this, Creo Object TOOLKIT Java applications must attach a button
to the pop-up menu during initialization of the pop-up menu. The Creo Object
TOOLKIT Java application is notified each time a particular pop-up menu is
created, which then allows the user to add to the pop-up menu.
Use the following procedure to add items to pop-up menus in the graphics
window:
1. Obtain the name of the existing pop-up menus to which you want to add a new
menu using the trail file.
2. Create commands for the new pop-up menu items.
3. Implement access listeners to provide visibility information for the items.
4. Add an action listener to the session to listen for pop-up menu initialization.
5. In the listener method, if the pop-up menu is the correct menu to which you
wish to add the button, then add it.

108 Creo Object TOOLKIT JavaUser’s Guide


The following sections describe each of these steps in detail. You can add push
buttons and cascade menus to the pop-up menus. You can add pop-up menu items
only in the active window. You cannot use this procedure to remove items from
existing menus.

Using the Trail File to Determine Existing Pop-up


Menu Names
The trail file in Creo Parametric contains a comment that identifies the name of
the pop-up menu if the configuration option, auxapp_popup_menu_info is
set to yes.
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'

Listening for Pop-up Menu Initialization


Methods Introduced:
• 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.
The method pfcUI.PopupmenuListener.OnPopupmenuCreate is
called after the pop-up menu is created internally in Creo Parametric and may be
used to assign application-owned buttons to the pop-up menu.

Accessing the Pop-up Menus


The method described in this section provides the name of the 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.

Menus, Commands, and Pop-up Menus 109


Adding Content to the Pop-up Menus
Methods Introduced:
• pfcUI.Popupmenu.AddButton
• pfcUI.Popupmenu.AddMenu
Use pfcUI.Popupmenu.AddButton to add a new item to a pop-up menu.
The input arguments are:
• Command—Specifies the command associated with the pop-up menu.
• Options – A pfcUI.PopupmenuOptions object containing other options
for the method. The options that may be included are:
○ PositionIndex—Specifies the position in the pop-up menu at which
to add the menu button. Pass null to add the button to the bottom of the
menu. Use the method
pfcUI.PopupmenuOptions.SetPositionIndex to set this
option.
○ Name—Specifies the name of the added button. The button name is placed
in the trail file when the user selects the menu button. Use the method
pfcUI.PopupmenuOptions.SetName to set this option.
○ SetLabel—Specifies the button label. This label identifies the text
displayed when the button is displayed. Use the method
pfcUI.PopupmenuOptions.SetLabel to set this option.
○ Helptext—Specifies the help message associated with the button. Use
the method pfcUI.PopupmenuOptions.SetHelptext to set this
option.
Use the method pfcUI.Popupmenu.AddMenu to add a new cascade menu to
an existing pop-up menu.
The argument for this method is a pfcUI.PopupmenuOptions object, whose
members have the same purpose as described for newly added buttons. This
method returns a new pfcUI.Popupmenu object to which you may add new
buttons.

110 Creo Object TOOLKIT JavaUser’s Guide


9
User Interface Foundation Classes
for Dialogs
Introduction............................................................................................................. 112

This chapter describes the classes provided by Creo Object TOOLKIT Java to
create and modify dialog boxes, menus, buttons, pop-up menus and so on.

111
Introduction
From Creo 3.0 onward, the Creo UI Editor allows you to interactively create and
edit dialog boxes for Creo Object TOOLKIT Java customizations. The Creo UI
Editor can be installed from the Creo Installer. The editor provides a library of
graphical user interface components such as buttons, lists, and so on. The UIFC
classes provide enhanced attributes and actions for the user interface components.
The UIFC framework is available in Creo Object TOOLKIT Java. You can
generate callbacks in Creo Object TOOLKIT Java. Refer to the Creo UI Editor
User’s Guide, for more information.
• uifcBrowserWindow
• uifcButtonBase
• uifcCheckButton
• uifcComponent
• uifcCore
• uifcDialog
• uifcDrawingArea
• uifcExternal_Containers
• uifcGlobals
• uifcGridContainer
• uifcHTMLWindow
• uifcInputPanel
• uifcLabel
• uifcLayout
• uifcList
• uifcMenuBar
• uifcMenuPane
• uifcNakedWindow
• uifcOptionMenu
• uifcPGLWindow
• uifcPHolder
• uifcProgressBar
• uifcPushButton
• uifcRadioGroup
• uifcRange_Controls
• uifcSash
• uifcScrollBar
• uifcScrolledLayout

112 Creo Object TOOLKIT JavaUser’s Guide


• uifcSelection
• uifcSeparator
• uifcSlider
• uifcSpinBox
• uifcTab
• uifcTable
• uifcText
• uifcTextArea
• uifcThumbWheel
• uifcToolBar
• uifcTree

User Interface Foundation Classes for Dialogs 113


10
Models
Overview of Model Objects....................................................................................... 115
Getting a Model Object ............................................................................................ 115
Model Descriptors ................................................................................................... 115
Retrieving Models ................................................................................................... 117
Model Information ................................................................................................... 117
Model Operations .................................................................................................... 121
Running Creo ModelCHECK .................................................................................... 123

This chapter describes how to program on the model level using Creo Object
TOOLKIT Java.

114 Creo Object TOOLKIT JavaUser’s Guide


Overview of Model Objects
Models can be any Creo file type, including parts, assemblies, drawings, sections,
and notebook. 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:
• Access information about a model.
• Open, copy, rename, and save a model.

Getting a Model Object


Methods Introduced:
• pfcFamily.FamilyTableRow.CreateInstance
• pfcSelect.Selection.GetSelModel
• pfcSession.BaseSession.GetModel
• pfcSession.BaseSession.GetCurrentModel
• pfcSession.BaseSession.GetActiveModel
• pfcSession.BaseSession.ListModels
• pfcSession.BaseSession.GetByRelationId
• pfcWindow.Window.GetModel
These methods get a model object that is already in session.
The method pfcSelect.Selection.GetSelModel returns the model that
was interactively selected.
The method pfcSession.BaseSession.GetModel returns a model based
on its name and type, whereas
pfcSession.BaseSession.GetByRelationId returns a model in an
assembly that has the specified integer identifier.
The method pfcSession.BaseSession.GetCurrentModel returns the
current active model.
The method pfcSession.BaseSession.GetActiveModel returns the
active Creo model.
Use the method pfcSession.BaseSession.ListModels to return a
sequence of all the models in session.
For more methods that return solid models, refer to the chapter Solid on page 212.

Model Descriptors
Methods Introduced:

Models 115
• pfcModel.pfcModel.ModelDescriptor_Create
• pfcModel.pfcModel.ModelDescriptor_CreateFromFileName
• pfcModel.ModelDescriptor.SetGenericName
• pfcModel.ModelDescriptor.SetInstanceName
• 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 Creo application to find the specific model you want.
The static utility method pfcModel.pfcModel.ModelDescriptor_
Create allows you to specify as data to be entered a model type, an instance
name, and a generic name. The model descriptor constructs the full name of the
model as a string, as follows:
String FullName = InstanceName+"<"+GenericName+">";
// As long as the
// generic name is
// not an empty
// string ("")
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.

Note
You are allowed to set other fields in the model descriptor object, but they may
be ignored by some methods.

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>.

116 Creo Object TOOLKIT JavaUser’s Guide


Retrieving Models
Methods Introduced:
• pfcSession.BaseSession.RetrieveModel
• pfcSession.BaseSession.RetrieveModelWithOpts
• pfcSession.BaseSession.OpenFile
• pfcSolid.Solid.HasRetrievalErrors
These methods enables Creo to retrieve the model that corresponds to the
ModelDescriptor argument.
The method pfcSession.BaseSession.RetrieveModel retrieves the
specified model into the Creo session given its model descriptor from a standard
directory. This method ignores the path argument specified in the model
descriptor. But this method does not create a window for it, nor does it display the
model anywhere.
The method pfcSession.BaseSession.RetrieveModelWithOpts
retrieves the specified model into the Creo session based on the path specified by
the model descriptor. The path can be a disk path, a workspace path, or a
commonspace path. The Opts argument (given by the
Session.RetrieveModelOptions object) provides the user with the
option to specify simplified representations.
The method pfcSession.BaseSession.OpenFile brings the model into
memory, opens a new window for it (or uses the base window, if it is empty), and
displays the model.

Note
pfcSession.BaseSession.OpenFile actually returns a handle to the
window it has created.

To get a handle to the model you need, use the method


pfcWindow.Window.GetModel.
The method pfcSolid.Solid.HasRetrievalErrors returns a true value
if the features in the solid model were suppressed during the RetrieveModel or
OpenFile operations. This method must be called immediately after the
pfcSession.BaseSession.RetrieveModel method or an equivalent
retrieval method.

Model Information
Methods Introduced:

Models 117
• pfcModel.Model.IsNativeModel
• pfcModel.Model.GetFileName
• pfcModel.Model.GetCommonName
• pfcModel.Model.IsCommonNameModifiable
• pfcModel.Model.GetFullName
• pfcModel.Model.GetGenericName
• pfcModel.Model.GetInstanceName
• wfcModel.WModel.GetDefaultName
• 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.CleanupDependencies
• pfcModel.Model.ListDeclaredModels
• pfcModel.Model.CheckIsModifiable
• pfcModel.Model.CheckIsSaveAllowed
• wfcModel.WModel.GetSubType
The method pfcModel::IsNativeModel returns true, if the specified
model is a native Creo model. It returns false, when the model is a non-native
part or assembly created in other CAD applications.
The method pfcModel.Model.GetFileName retrieves the model file name
in the "name"."type" format.
The method pfcModel.Model.GetCommonName retrieves the common
name for the model. This name is displayed for the model in Windchill PDMLink.

118 Creo Object TOOLKIT JavaUser’s Guide


Use the method pfcModel.Model.GetIsCommonNameModifiable to
identify if the common name of the model can be modified. You can modify the
name for models that are not yet owned by Windchill PDMLink, or in certain
situations if the configuration option let_proe_rename_pdm_objects is
set to yes.
The method pfcModel.Model.GetFullName retrieves the full name of the
model in the instance <generic> format.
The method pfcModel.Model.GetGenericName retrieves the name of the
generic model. If the model is not an instance, this name must be NULL or an
empty string.
The method pfcModel.Model.GetInstanceName retrieves the name of
the model. If the model is an instance, this method retrieves the instance name.
The method wfcModel.WModel.GetDefaultName gets the default name
assigned to the model by Creo application at the time of creation.
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.
The method pfcModel.Model.GetRelationId retrieves the relation
identifier of the specified model. It can be NULL.
The method pfcModel.Model.GetDescr returns the descriptor for the
specified model. Model descriptors can be used to represent models not currently
in session.

Note
From Pro/ENGINEER Wildfire 4.0 onwards, the methods
pfcModel.Model.GetFullName,
pfcModel.Model.GetGenericName, and
pfcModel.Model.GetDescr throw an exception
pfcExceptions.XtoolkitCantOpen if called on a model instance
whose immediate generic is not in session. Handle this exception and typecast
the model as pfcSolid.Solid, which in turn can be typecast as
pfcFamily.FamilyMember, and use the method
pfcFamily.FamilyMember.GetImmediateGenericInfo to get the
model descriptor of the immediate generic model. The model descriptor can be
used to derive the full name or generic name of the 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.

Models 119
The method pfcModel.Model.GetType returns the type of model in the
form of the pfcModel.ModelType object. The types of models are as follows:
• MDL_ASSEMBLY—Specifies an assembly.
• MDL_PART—Specifies a part.
• MDL_DRAWING—Specifies a drawing.
• MDL_2D_SECTION—Specifies a 2D section.
• MDL_LAYOUT—Specifies a notebook.
• 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
• MDL_CE_SOLID—Specifies a Layout model.

Note
Creo Object TOOLKIT Java methods will only be able to read models of
type Layout, but will not be able to pass Layout models as input to other
methods. PTC recommends that you review all Creo Object TOOLKIT
Java applications that use the enumerated type ModelType and modify
the code as appropriate to ensure that the applications work correctly.

The method pfcModel.Model.GetIsModified identifies whether the


model has been modified since it was last saved.
The method pfcModel.Model.GetVersion returns the version of the
specified model from the PDM system. It can be NULL, if not set.
The method pfcModel.Model.GetRevision returns the revision number of
the specified model from the PDM system. It can be NULL, if not set.
The method pfcModel.Model.GetBranch returns the branch of the
specified model from the PDM system. It can be NULL, if not set.
The method pfcModel.Model.GetReleaseLevel returns the release level
of the specified model from the PDM system. It can be NULL, if not set.
The method pfcModel.Model.GetVersionStamp returns the version
stamp of the specified model. The version stamp is a Creo specific identifier that
changes with each change made to the model.

120 Creo Object TOOLKIT JavaUser’s Guide


The method pfcModel.Model.ListDependencies returns a list of the
first-level dependencies for the specified model in the Creo workspace in the form
of the pfcModel.Dependencies object.
The method pfcModel.Model.ListDeclaredModels returns a list of all
the first-level objects declared for the specified model.
Use the method pfcModel.Model.CleanupDependencies to clean the
dependencies for an object in the Creo workspace.

Note
Do not call the method pfcModel.Model.CleanupDependencies
during operations that alter the dependencies, such as, restructuring
components and creating or redefining features.

The method pfcModel.Model.CheckIsModifiable identifies if a given


model can be modified without checking for any subordinate models. This method
takes a boolean argument ShowUI that determines whether the Creo conflict
resolution dialog box should be displayed to resolve conflicts, if detected. If this
argument is false, then the conflict resolution dialog box is not displayed, and the
model can be modified only if there are no conflicts that cannot be overridden, or
are resolved by default resolution actions. For a generic model, if ShowUI is true,
then all instances of the model are also checked.
The method pfcModel.Model.CheckIsSaveAllowed identifies if a given
model can be saved along with all of its subordinate models. The subordinate
models can be saved based on their modification status and the value of the
configuration option save_objects. This method also checks the current user
interface context to 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.
The method wfcModel.WModel.GetSubType returns the subtype of the
specified model using the enumerated object wfcModel.ModelSubType. This
is similar to selecting types and sub-types of models available in the Creo user
interface using the command File ▶ New.

Model Operations
Methods Introduced:
• pfcModel.Model.Backup
• pfcModel.Model.Copy
• pfcModel.Model.CopyAndRetrieve

Models 121
• pfcModel.Model.Rename
• pfcModel.Model.Save
• pfcModel.Model.Erase
• pfcModel.Model.EraseWithDependencies
• pfcModel.Model.Delete
• pfcModel.Model.Display
• pfcModel.Model.SetCommonName
• wfcModel.WModel.IsStandardLocation
These model operations duplicate most of the commands available in the Creo File
menu.
The method pfcModel.Model.Backup makes a backup of an object in
memory to a disk in a specified directory.
The method pfcModel.Model.Copy copies the specified model to another
file.
The method pfcModel.Model.CopyAndRetrieve copies the model to
another name, and retrieves that new model into session.
The method pfcModel.Model.Rename renames a specified model.
The method pfcModel.Model.Save stores the specified model to a disk.
The method pfcModel.Model.Erase erases the specified model from the
session. Models used by other models cannot be erased until the models
dependent upon them are erased.
The method pfcModel.Model.EraseWithDependencies erases the
specified model from the session and all the models on which the specified model
depends from disk, if the dependencies are not needed by other items in session.

Note
However, while erasing an active model, pfcModel.Model.Erase and
pfcModel.Model.EraseWithDependencies only clear the graphic
display immediately, they do not clear the data in the memory until the control
returns to Creo application from the Creo Object TOOLKIT Java application.
Therefore, after calling them the control must be returned to Creo before
calling any other function, otherwise the behavior of Creo may be
unpredictable.

The method pfcModel.Model.Delete removes the specified model from


memory and disk.

122 Creo Object TOOLKIT JavaUser’s Guide


The method pfcModel.Model.Display displays the specified model. You
must call this method if you create a new window for a model because the model
will not be displayed in the window until you call pfcModel.Display.
The method pfcModel.Model.SetCommonName modifies the common
name of the specified model. You can modify this name for models that are not yet
owned by Windchill PDMLink, or in certain situations if the configuration option
let_proe_rename_pdm_objects is set to yes.
The method wfcModel.WModel.IsStandardLocation checks if the
specified model was opened from a standard location. A standard file location can
be the local disk or a mapped drive on a remote computer. The Universal Naming
Convention (UNC) path for network drives is also considered as a standard path if
the value for DisableUNCCheck is set to True for the key HKEY_CURRENT_
USER\Software\Microsoft\Command Processor, in the registry file.
The method returns:
• True when the file is loaded from a standard file location.
• False when the file is loaded from a nonstandard file location, such as, http,
ftp, Design Exploration mode, and so on.

Running Creo ModelCHECK


Creo ModelCHECK is an integrated application that runs transparently within
Creo Parametric. Creo ModelCHECK uses a configurable list of company design
standards and best modeling practices. You can configure Creo 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
• pfcModelCheck.ModelCheckResults.GetNumberOfErrors
• pfcModelCheck.ModelCheckResults.GetNumberOfWarnings
• pfcModelCheck.ModelCheckResults.GetWasModelSaved

Models 123
You can run Creo ModelCHECK from an external application using the method
pfcSession.BaseSession.ExecuteModelCheck. This method takes
the model Model on which you want to run Creo ModelCHECK and instructions
in the form of the object ModelCheckInstructions as its input parameters.
This object contains the following parameters:
• ConfigDir—Specifies the location of the configuration files. If this
parameter is set to NULL, the default Creo ModelCHECK configuration files
are used.
• Mode—Specifies the mode in which you want to run Creo 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 Creo 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_
Create creates the ModelCheckInstructions object containing the Creo
ModelCHECK instructions described above.
Use the methods
pfcModelCheck.ModelCheckInstructions.SetConfigDir,
pfcModelCheck.ModelCheckInstructions.SetMode,
pfcModelCheck.ModelCheckInstructions.SetOutputDir, and
pfcModelCheck.ModelCheckInstructions.SetShowInBrowser to
modify the Creo ModelCHECK instructions.
The method pfcSession.BaseSession.ExecuteModelCheck returns
the results of the Creo ModelCHECK run in the form of the
ModelCheckResults object. This object contains the following parameters:
• NumberOfErrors—Specifies the number of errors detected.
• NumberOfWarnings—Specifies the number of warnings found.
• WasModelSaved—Specifies whether the model is saved with updates.
Use the
methodspfcModelCheck.ModelCheckResults.GetNumberOfErrors,
pfcModelCheck.ModelCheckResults.GetNumberOfWarning, and
pfcModelCheck.ModelCheckResults.GetWasModelSaved to access
the results obtained.

124 Creo Object TOOLKIT JavaUser’s Guide


Custom Checks
This section describes how to define custom checks in Creo ModelCHECK that
users can run using the standard Creo ModelCHECK interface in Creo Parametric.
To define and register a custom check:
1. Set the CUSTMTK_CHECKS_FILE configuration option in the start
configuration file to a text file that stores the check definition. For example:
CUSTMTK_CHECKS_FILE text/custmtk_checks.txt.
2. Set the contents of the CUSTMTK_CHECKS_FILE file to define the checks.
Each check should list the following items:
• DEF_<checkname>—Specifies the name of the check. The format must
be CHKTK_<checkname>_<mode>, where mode is PRT, ASM, or DRW.
• TAB_<checkname>—Specifies the tab category in the Creo
ModelCHECK report under which the check is classified. Valid tab values
are:
○ INFO
○ PARAMETER
○ LAYER
○ FEATURE
○ RELATION
○ DATUM
○ MISC
○ VDA
○ VIEWS
• MSG_<checkname>—Specifies the description of the check that appears
in the lower part of the Creo ModelCHECK report when you select the
name.
• DSC_<checkname>—Specifies the name of the check as it appears in
the Creo ModelCHECK report table.
• ERM_<checkname>—If set to INFO, the check is considered an INFO
check and the report table displays the text from the first item returned by
the check, instead of a count of the items. Otherwise, this value must be
included, but is ignored by Creo Parametric.
3. Add the check and its values to the Creo ModelCHECK configuration file.
4. Register the Creo ModelCHECK check from the Creo Object TOOLKIT Java
application.

Models 125
Note
Other than the requirements listed above, Creo Object TOOLKIT Java custom
checks do not have access to the rest of the values in the Creo 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 Creo ModelCHECK.

Registering Custom Checks


Methods Introduced:
• 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 Creo ModelCHECK run. This method
takes the instructions in the form of the CustomCheckInstructions object
as its input argument. This object contains the following parameters:
• CheckName—Specifies the name of the custom check.
• CheckLabel—Specifies the label of the custom check.
• Listener—Specifies the listener object containing the custom check methods.
Refer to the section Custom Check Listeners on page 127 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.

126 Creo Object TOOLKIT JavaUser’s Guide


Use the methods
pfcModelCheck.CustomCheckInstructions.SetCheckName,
pfcModelCheck.CustomCheckInstructions.SetCheckLabel,
pfcModelCheck.CustomCheckInstructions.SetListener,
pfcModelCheck.CustomCheckInstructions.SetActionButtonLa
bel, and
pfcModelCheck.CustomCheckInstructions.SetUpdateButtonLa
bel to modify the instructions.
The following figure illustrates how the results of some custom checks might be
displayed in the Creo ModelCHECK report.

Custom Check Listeners


Methods Introduced:
• pfcModelCheck.ModelCheckCustomCheckListener.OnCustomCheck
• pfcModelCheck.pfcModelCheck.CustomCheckResults_Create
• pfcModelCheck.CustomCheckResults.SetResultsCount
• pfcModelCheck.CustomCheckResults.SetResultsTable
• pfcModelCheck.CustomCheckResults.SetResultsUrl
• pfcModelCheck.ModelCheckCustomCheckListener.
OnCustomCheckAction
• pfcModelCheck.ModelCheckCustomCheckListener.
OnCustomCheckUpdate

Models 127
The interface pfcModelCheck.ModelCheckCustomCheckListener
provides the method signatures to implement a custom Creo ModelCHECK
check.
Each listener method takes the following input arguments:
• CheckName—The name of the custom check as defined in the original call to
the method
pfcSession.BaseSession.RegisterCustomModelCheck
• Mdl—The model being checked.
The application method that overrides
pfcModelCheck.ModelCheckCustomCheckListener.OnCustom
Check 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
• ResultsCount—Specifies an integer indicating the number of errors found by
the check. This value is displayed in the Creo ModelCHECK report generated.
• ResultsTable—Specifies a list of text descriptions of the problem encountered
for each error or warning.
• ResultsUrl—Specifies the link to an application-owned page that provides
information on the results of the custom check.
The method
pfcModelCheck.pfcModelCheck.CustomCheckResults_Create
creates the CustomCheckResults object containing the custom check results
described above.
Use the methods
pfcModelCheck.CustomCheckResults.SetResultsCount,
pfcModelCheck.CustomCheckResults.SetResultsTable, and
pfcModelCheck.CustomCheckResults.SetResultsUrl listed above
to modify the custom checks results obtained.
The method that overrides
pfcModelCheck.ModelCheckCustomCheckListener.OnCustom
CheckAction is called when the custom check’s Action button is pressed.
The input supplied includes the text selected by the user from the custom check
results.
The method that overrides
pfcModelCheck.ModelCheckCustomCheckListener.OnCustom
CheckUpdate is called when the custom check’s Update button is pressed.
The input supplied includes the text selected by the user from the custom check
results.
Custom Creo ModelCHECK checks can have an Action button to highlight the
problem, and possibly an Update button to fix it automatically.

128 Creo Object TOOLKIT JavaUser’s Guide


The following figure displays the Creo ModelCHECK report with an Action
button that invokes the
pfcModelCheck.ModelCheckCustomCheckListener.OnCustom
CheckAction

Notebook
The methods described in this section work with notebook (.lay) files.
Methods introduced:
• wfcModel.WLayout.Declare
• wfcModel.WLayout.Undeclare

Models 129
The method wfcModel.WLayout.Declare declares a notebook name to the
specified Creo Parametric model or notebook. You can resolve conflicts using the
enumerated type wfcModel.LayoutDeclareOption. It has the following
values:
• LAYOUT_DECLARE_INTERACTIVE— Resolves the conflict in interactive
mode.
• LAYOUT_DECLARE_OBJECT_SYMBOLS— Keep the symbols in the
specified Creo Parametric model or notebook object.
• LAYOUT_DECLARE_LAYOUT_SYMBOLS— Keep the symbols specified in
the notebook.
• LAYOUT_DECLARE_ABORT— abort the notebook declaration process and
return an error.
Use the function wfcModel.WLayout.Undeclare to undeclare the notebook
name to the specified Creo Parametric model or notebook. You can resolve
conflicts using the enumerated type wfcModel.LayoutUndeclareOption.
It has the following values:
• LAYOUT_UNDECLARE_FORCE— Continues to undeclare the notebook even
if references exist.
• LAYOUT_UNDECLARE_CANCEL— Does not undeclare the notebook if
references exist.

130 Creo Object TOOLKIT JavaUser’s Guide


11
Drawings
Overview of Drawings in Creo Object TOOLKIT Java ................................................. 132
Creating Drawings from Templates ........................................................................... 132
Obtaining Drawing Models ....................................................................................... 134
Drawing Information ................................................................................................ 135
Drawing Operations................................................................................................. 136
Merge Drawings ...................................................................................................... 137
Drawing Sheets....................................................................................................... 138
Drawing Views ........................................................................................................ 143
Drawing Dimensions................................................................................................ 150
Drawing Tables ....................................................................................................... 158
Drawing Views And Models...................................................................................... 167
View States............................................................................................................. 184
Drawing Models ...................................................................................................... 184
Drawing Edges........................................................................................................ 184
Detail Items............................................................................................................. 185
Detail Entities.......................................................................................................... 188
OLE Objects ........................................................................................................... 191
Detail Notes ............................................................................................................ 191
Detail Groups.......................................................................................................... 195
Detail Symbols ........................................................................................................ 197
Detail Attachments .................................................................................................. 208

This chapter describes how to program drawing functions using Creo Object
TOOLKIT Java.

131
Overview of Drawings in Creo Object
TOOLKIT Java
This section describes the functions that deal with drawings. You can create
drawings of allCreo models using the functions in Creo Object TOOLKIT Java.
You can annotate the drawing, manipulate dimensions, and use layers to manage
the display of different items.
Unless otherwise specified, Creo Object TOOLKIT Java functions that operate on
drawings use world units.

Creating Drawings from Templates


Drawing templates simplify the process of creating a drawing using Creo Object
TOOLKIT Java. Creo can create views, set the view display, create snap lines, and
show the model dimensions based on the template. Use templates to:
• Define layout views
• Set view display
• Place notes
• Place symbols
• Define tables
• Show dimensions
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:
• New drawing name
• Name of an existing template
• Name and type of the solid model to use while populating template views
• Sequence of options to create the drawing. The options are as follows:
○ DRAWINGCREATE_DISPLAY_DRAWING—display the new drawing.
○ DRAWINGCREATE_SHOW_ERROR_DIALOG—display the error dialog
box.
○ DRAWINGCREATE_WRITE_ERROR_FILE—write the errors to a file.
○ DRAWINGCREATE_PROMPT_UNKNOWN_PARAMS—prompt the user on
encountering unknown parameters

132 Creo Object TOOLKIT JavaUser’s Guide


Drawing Creation Errors
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.

Note
When this exception type is encountered, the drawing is actually created, but
some of the contents failed to generate correctly.

The error structure contains an array of drawing creation errors. Each error
message may have the following elements:
• Type—The type of error as follows:
○ DWGCREATE_ERR_SAVED_VIEW_DOESNT_EXIST—Saved view does
not exist.
○ DWGCREATE_ERR_X_SEC_DOESNT_EXIST—Specified cross section
does not exist.
○ DWGCREATE_ERR_EXPLODE_DOESNT_EXIST—Exploded state did
not exist.
○ DWGCREATE_ERR_MODEL_NOT_EXPLODABLE—Model cannot be
exploded.
○ DWGCREATE_ERR_SEC_NOT_PERP—Cross section view not
perpendicular to the given view.
○ 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.

Drawings 133
○ DWGCREATE_ERR_TEMPLATE_USED—The template does not exist.
○ DWGCREATE_ERR_NO_PARENT_VIEW_FOR_PROJ—There 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.

Obtaining Drawing Models


This section describes how to obtain drawing models.
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.
The method pfcSession.BaseSession.GetModel returns a drawing
based on its name and type, whereas
pfcSession.BaseSession.GetModelFromDescr returns a drawing
specified by the model descriptor. The model must be in session.
Use the method pfcSession.BaseSession.ListModels to return a
sequence of all the drawings in session.

134 Creo Object TOOLKIT JavaUser’s Guide


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.
The method pfcModel2D.Model2D.GetCurrentSolid returns the current
solid model of the drawing.
The method pfcModel2D.Model2D.ListSimplifiedReps returns the
simplified representations of a solid model that are assigned to the drawing.
The method pfcModel2D.Model2D.GetTextHeight returns the text
height of the drawing.

Access Drawing Location in Grid


Method introduced:
• wfcModel.WModel2D.GetLocationGridColumnFromPosition
• wfcModel.WModel2D.GetLocationGridRowFromPosition
Use the method
wfcModelD.WModel2D.GetLocationGridColumnFromPosition and
wfcModel.WModel2D.GetLocationGridRowFromPosition to find
the grid coordinates of a location in the drawing. The method specifies the
position of a point, expressed in screen coordinates. This method returns strings
representing the row and column containing the point.

Drawing Tree
A Drawing Tree enables to view a hierarchical representation of drawing items in
an active drawing sheet. A drawing tree facilitates selection and availability of
drawing operations for the represented drawing items. For more information, see
the Creo Parametric Help. Use the following functions to refresh, expand, and
collapse the drawing tree:
Methods introduced:
• wfcModel.WModel2D.CollapseTree
• wfcModel.WModel2D.ExpandTree
• wfcModel.WModel2D.RefreshTree

Drawings 135
Use the method wfcModel.WModel2D.CollapseTree to collapse all nodes
of the drawing tree in the Creo Parametric window and make its child nodes
invisible. The input argument WindowId returns the Id of the window which
contains the drawing. Use-1 to expand the drawing tree in the active window.
Use the method wfcModel.WModel2D.ExpandTree to expand the drawing
tree in the Creo Parametric window and make all drawing sheets and drawing
items in the active drawing sheet visible.
Use the method wfcModel.WModel2D.RefreshTree to rebuild the drawing
tree in the Creo Parametric window that contains the drawing. You can use this
function after adding a single drawing item or multiple drawing items to a
drawing.

Note
Specify the input argument WindowId as -1 to refresh, expand, or collapse the
drawing tree in the active window.

Drawing Operations
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.
The method pfcModel2D.Model2D.DeleteModel removes a model from
the drawing. The model to be deleted should not appear in any of the drawing
views.

136 Creo Object TOOLKIT JavaUser’s Guide


The method pfcModel2D.Model2D.ReplaceModel replaces a model in
the drawing with a related model (the relationship should be by family table or
interchange assembly). It allows you to replace models that are shown in drawing
views and regenerates the view.
The method pfcModel2D.Model2D.SetCurrentSolid assigns the
current solid model for the drawing. Before calling this method, the solid model
must be assigned to the drawing using the method
pfcModel2D.Model2D.AddModel. To see the changes to parameters and
fields reflecting the change of the current solid model, regenerate the drawing
using the method pfcSheet.SheetOwner.RegenerateSheet.
The method pfcModel2D.Model2D.AddSimplifiedRep associates the
drawing with the simplified representation of an assembly
The method pfcModel2D.Model2D.DeleteSimplifiedRep removes the
association of the drawing with an assembly simplified representation. The
simplified representation to be deleted should not appear in any of the drawing
views.
Use the method pfcModel2D.Model2D.Regenerate to regenerate the
drawing draft entities and appearance.
The method pfcModel2D.Model2D.SetTextHeight sets the value of the
text height of the drawing.
The method pfcModel2D.Model2D.CreateDrawingDimension creates
a new drawing dimension based on the data object that contains information about
the location of the dimension. This method returns the created dimension. Refer to
the section Drawing Dimensions on page 150.
The method pfcModel2D.Model2D.CreateView creates a new drawing
view based on the data object that contains information about how to create the
view. The method returns the created drawing view. Refer to the section Creating
Drawing Views on page 143.

Merge Drawings
You can merge two drawings to enhance the performance and management of
large drawings. Individual Creo Parametric users can work in parallel and then
merge their separate drawings into a single drawing file.
Methods Introduced:
• wfcWDrawing.WDrawing.Merge
Use the method wfcWDrawing.WDrawing.Merge to merge two drawings.

Drawings 137
Drawing Sheets
A drawing sheet is represented by its number. Drawing sheets in Creo Object
TOOLKIT Java are identified by the same sheet numbers seen by a Creo user.

Note
These identifiers may change if the sheets are moved as a consequence of
adding, removing or reordering sheets.

Drawing Sheet Information


Methods Introduced
• wfcWDrawing.WDrawing.GetSheetName
• pfcSheet.SheetOwner.GetSheetTransform
• pfcSheet.SheetOwner.GetSheetInfo
• pfcSheet.SheetOwner.GetSheetScale
• pfcSheet.SheetOwner.GetSheetFormat
• pfcSheet.SheetOwner.GetSheetFormatDescr
• wfcWDrawing.WDrawing.GetFormatSheet
• pfcSheet.SheetOwner.GetSheetBackgroundView
• pfcSheet.SheetOwner.GetNumberOfSheets
• pfcSheet.SheetOwner.GetCurrentSheetNumber
• pfcSheet.SheetOwner.GetSheetUnits
Superseded Method:
• pfcSheet.SheetOwner.GetSheetData
The method wfcWDrawing.WDrawing.GetSheetName retrieves the name
of the specified drawing sheet.
The method pfcSheet.SheetOwner.GetSheetTransform returns the
transformation matrix for the sheet specified by the sheet number. This
transformation matrix includes the scaling needed to convert screen coordinates to
drawing coordinates (which use the designated drawing units).
The method pfcSheet.SheetOwner.GetSheetInfo returns sheet data
including the size, orientation, and units of the sheet specified by the sheet
number.

138 Creo Object TOOLKIT JavaUser’s Guide


The method pfcSheet.SheetOwner.GetSheetData and the
interfacepfcSheet.SheetData have been deprecated. Use the method
pfcSheet.SheetOwner.GetSheetInfo and the
interfacepfcSheet.SheetInfo instead.
The method pfcSheet.SheetOwner.GetSheetScale returns the scale of
the drawing on a particular sheet based on the drawing model used to measure the
scale. If no models are used in the drawing then the default scale value is 1.0.
The method pfcSheet.SheetOwner.GetSheetFormat returns the
drawing format used for the sheet specified by the sheet number. It returns a null
value if no format is assigned to the sheet.
The method pfcSheet.SheetOwner.GetSheetFormatDescr returns the
model descriptor of the drawing format used for the specified drawing sheet.
The method wfcWDrawing.WDrawing.GetFormatSheet drawing format
for a specified drawing and sheet number within the drawing . A drawing format
file can have two sheets defining two formats. You can create drawings using
either of the sheets as drawing format. If such a drawing format file is used to
create the drawing, the method
wfcWDrawing.WDrawing.GetFormatSheet retrieves the sheet number of
the drawing format which was used to create the specified drawing.
The method pfcSheet.SheetOwner.GetSheetBackgroundView
returns the view object representing the background view of the sheet specified by
the sheet number.
The method pfcSheet.SheetOwner.GetNumberOfSheets returns the
number of sheets in the model.
The method pfcSheet.SheetOwner.GetCurrentSheetNumber returns
the current sheet number in the model.

Note
The sheet numbers range from 1 to n, where n is the number of sheets.

The method pfcSheet.SheetOwner.GetSheetUnits returns the units


used by the sheet specified by the sheet number.

Drawing Sheet Operations


Methods Introduced:
• pfcSheet.SheetOwner.AddSheet
• pfcSheet.SheetOwner.DeleteSheet
• pfcSheet.SheetOwner.ReorderSheet

Drawings 139
• pfcSheet.SheetOwner.RegenerateSheet
• pfcSheet.SheetOwner.SetSheetScale
• pfcSheet.SheetOwner.SetSheetFormat
• pfcSheet.SheetOwner.SetCurrentSheetNumber
• wfcModel.WModel2D.CopyDrawingSheet
• wfcModel.WModel2D.ShowSheetFormat
• wfcModel.WModel2D.GetToleranceStandard
• wfcModel.WModel2D.SetToleranceStandard
• wfcModel.WModel2D.IsSheetFormatBlanked
• wfcModel.WModel2D.IsSheetFormatShown
• wfcModel.WModel2D.CreateLeaderWithArrowTypeNote
The method pfcSheet.SheetOwner.AddSheet adds a new sheet to the
model and returns the number of the new sheet.
The method pfcSheet.SheetOwner.DeleteSheet removes the sheet
specified by the sheet number from the model.
Use the method pfcSheet.SheetOwner.ReorderSheet to reorder the
sheet from a specified sheet number to a new sheet number.

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.

Note
You can regenerate a sheet only if it is displayed.

Use the method pfcSheet.SheetOwner.SetSheetScale to set the scale


of a model on the sheet based on the drawing model to scale and the scale to be
used. Pass the value of the DrawingModel parameter as null to select the current
drawing model.
Use the method pfcSheet.SheetOwner.SetSheetFormat to apply the
specified format to a drawing sheet based on the drawing format, sheet number of
the format, and the drawing model.

140 Creo Object TOOLKIT JavaUser’s Guide


The sheet number of the format is specified by the FormatSheetNumber
parameter. This number ranges from 1 to the number of sheets in the format. Pass
the value of this parameter as null to use the first format sheet.
The drawing model is specified by the DrawingModel parameter. Pass the value
of this parameter as null to select the current drawing model.
The method pfcSheet.SheetOwner.SetCurrentSheetNumber sets the
current sheet to the sheet number specified.
The method wfcModel.WModel2D.CopyDrawingSheet creates a copy of
a specified drawing sheet. Specify the sheet number of the sheet to be copied in
the input argument sheet. Set it to a value less than 1 to create a copy of the
currently selected sheet.
Use the method wfcModel.WModel2D.ShowSheetFormat to display or
hide the drawing format for a specified drawing sheet. The input arguments are :
• show— Specifies if the drawing format must be displayed. Pass true to
display the drawing format.
• sheet—Specifies the sheet number of the sheet. Set it to a value less than 1 to
display or hide the drawing format of the currently selected sheet.
The method wfcModel.WModel2D.GetToleranceStandard returns the
tolerance standard that is assigned to the specified drawing.
Use the method wfcModel.WModel2D.SetToleranceStandard to set
the tolerance standard for a drawing.
The method wfcModel.WModel2D.IsSheetFormatBlanked checks if
the drawing format of a specified drawing sheet is blank. In case of the current
sheet, set the input argument sheet to a value less than 1.
The method wfcModel.WModel2D.IsSheetFormatShown checks if the
drawing format of a specified drawing sheet is shown. The output argument sheet
returns the value as True, if the drawing format is shown and returns the value as
False, if the drawing format is not shown.
The method
wfcModel.WModel2D.CreateLeaderWithArrowTypeNote enables
you to create a note with a leader and the specified arrow type in a specified
drawing. The input arguments are:
• TextLines—Specifies the text lines using the
pfcDetail.DetailTextLines object.
• NoteAttach—Specifies the details of the attachment of the note using the
pfcDetail.Attachment object.
• LeaderAttachs—Specifies the leaders attached to the note using the
pfcDetail.DetailLeaderAttachments object.
• Types—Specifies the types of arrowheads used for leaders attached to the note
using the wfcAnnotation.LeaderArrowTypes object.

Drawings 141
Drawing Format Files
The format of a drawing refers to the boundary lines, referencing marks and
graphic elements that appear on every sheet before any drawing elements are
shown or added. These usually include items such as tables for the company
name, detailers name, revision number and date. In a Creo Parametric drawing,
you can associate a format file (.frm) with the drawing. This file carries all the
format graphical information, and it can also carry some optional default attributes
like text size and draft scale. The functions described in this section allow you to
get and set the size of the drawing format.
Methods Introduced:
• wfcModel.WModel2D.GetFormatSize
• wfcModel.WModel2D.SetFormatSize
• wfcModel.FormatSizeData_Create
• wfcModel.FormatSizeData.GetPaperSize
• wfcModel.FormatSizeData.SetPaperSize
• wfcModel.FormatSizeData.GetWidth
• wfcModel.FormatSizeData.SetWidth
• wfcModel.FormatSizeData.GetHeight
• wfcModel.FormatSizeData.SetHeight
The methods wfcModel.WModel2D.GetFormatSize and
wfcModel.WModel2D.SetFormatSize retrieve and set the size of the
drawing format in the specified drawing as awfcModel.FormatSizeData
object. You can add a standard or customize size format in the drawing.
Use the method wfcModel.FormatSizeData_Create to create a drawing
format in a specified drawing. The input arguments are:
• PaperSize—Specifies the size of the drawing using the enumerated data type
pfcModel.PlotPaperSize.
• Width—Specifies the width of the drawing in inches, when PaperSize is set to
VARIABLESIZEPLOT.
It specifies the width of the drawing in millimeters, when size is set to
VARIABLESIZEPLOT.

Note
This argument is ignored for all the other sizes of the drawing except
pfcVARIABLESIZEPLOT and VARIABLESIZE_IN_MM_PLOT.

• Height—Specifies the height of the drawing in inches, when the size is set to
VARIABLESIZEPLOT.

142 Creo Object TOOLKIT JavaUser’s Guide


The methods wfcModel.FormatSizeData.GetPaperSize and
wfcModel.FormatSizeData.SetPaperSize get and set the size of the
drawing using the enumerated data type pfcModel.PlotPaperSize.
The methods wfcModel.FormatSizeData.GetWidth and
wfcModel.FormatSizeData.SetWidth get and set the width of the
drawing.
The methods wfcModel.FormatSizeData.GetHeight and
wfcModel.FormatSizeData.SetHeight get and set the height of the
drawing.

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, 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.

Creating Drawing Views


Method Introduced:
• 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.
The interfacepfcView2D.View2DCreateInstructions contains details
on how to create the view. The types of drawing views supported for creation are:
• DRAWVIEW_GENERAL—General drawing views
• DRAWVIEW_PROJECTION—Projected drawing views

General Drawing Views


The interface pfcView2D.GeneralViewCreateInstructions contains
details on how to create general drawing views.
Methods Introduced:
• pfcView2D.pfcView2D.GeneralViewCreateInstructions_Create
• pfcView2D.GeneralViewCreateInstructions.SetViewModel
• pfcView2D.GeneralViewCreateInstructions.SetLocation
• pfcView2D.GeneralViewCreateInstructions.SetSheetNumber
• pfcView2D.GeneralViewCreateInstructions.SetOrientation

Drawings 143
• pfcView2D.GeneralViewCreateInstructions.SetExploded
• pfcView2D.GeneralViewCreateInstructions.SetScale
The method
pfcView2D.pfcView2D.GeneralViewCreateInstructions_
Create creates the pfcView2D.GeneralViewCreateInstructions at
a object used for creating general drawing views.
Use the method
pfcView2D.GeneralViewCreateInstructions.SetViewModel to
assign the solid model to display in the created general drawing view.
Use the method
pfcView2D.GeneralViewCreateInstructions.SetLocation to
assign the location in a drawing sheet to place the created general drawing view.
Use the method
pfcView2D.GeneralViewCreateInstructions.SetSheetNumber
to set the number of the drawing sheet in which the general drawing view is
created.
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.
Use the method
pfcView2D.GeneralViewCreateInstructions.SetExploded to set
the created general drawing view to be an exploded view.
Use the method
pfcView2D.GeneralViewCreateInstructions.SetScale to assign
a scale to the created general drawing view. This value is optional, if not assigned,
the default drawing scale is used.

Projected Drawing Views


The interfacepfcView2D.ProjectionViewCreateInstructions
contains details on how to create general drawing views.
Methods Introduced:
• pfcView2D.pfcView2D.ProjectionViewCreateInstructions_Create
• pfcView2D.ProjectionViewCreateInstructions.SetParentView
• pfcView2D.ProjectionViewCreateInstructions.SetLocation
• pfcView2D.ProjectionViewCreateInstructions.SetExploded

144 Creo Object TOOLKIT JavaUser’s Guide


The method
pfcView2D.pfcView2D.ProjectionViewCreateInstructions_
Create creates the
pfcView2D.ProjectionViewCreateInstructions data object used
for creating projected drawing views.
Use the method
pfcView2D.ProjectionViewCreateInstructions.SetParent
View to assign the parent view for the projected drawing view.
Use the method
pfcView2D.ProjectionViewCreateInstructions.SetLocation
to assign the location of the projected drawing view. This location determines how
the drawing view will be oriented.
Use the method
pfcView2D.ProjectionViewCreateInstructions.SetExploded
to set the created projected drawing view to be an exploded view.

Obtaining Drawing Views


Methods Introduced:
• 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.
The method pfcModel2D.Model2D.List2DViews lists and returns the
drawing views found. This method does not include the drawing sheet background
views returned by the method
pfcSheet.SheetOwner.GetSheetBackgroundView.
The method pfcModel2D.Model2D.GetViewByName returns the drawing
view based on the name. This method returns a null value if the specified view
does not exist.
The method pfcModel2D.Model2D.GetViewDisplaying returns the
drawing view that displays a dimension. This method returns a null value if the
dimension is not displayed in the drawing.

Drawings 145
Note
This method works for solid and drawing dimensions.

The method pfcSheet.SheetOwner.GetSheetBackgroundView


returns the drawing sheet background views.

Drawing View Information


Methods Introduced:
• pfcObject.Child.GetDBParent
• pfcView2D.View2D.GetSheetNumber
• 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
• pfcView2D.View2D.GetSimpRep
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.

Note
The method pfcObject.Child.GetOId is reserved for internal use.

The method pfcView2D.View2D.GetSheetNumber returns the sheet


number of the sheet that contains the drawing view.
The method pfcView2D.View2D.GetIsBackground returns a value that
indicates whether the view is a background view or a model view.
The method pfcView2D.View2D.GetModel returns the solid model
displayed in the drawing view.

146 Creo Object TOOLKIT JavaUser’s Guide


The method pfcView2D.View2D.GetScale returns the scale of the drawing
view.
The method pfcView2D.View2D.GetIsScaleUserdefined specifies if
the drawing has a user-defined scale.
The methodpfcView2D.View2D.GetOutline returns the position of the
view in the sheet in world units.
The method pfcView2D.View2D.GetLayerDisplayStatus returns the
display status of the specified layer in the drawing view.
The method pfcView2D.View2D.GetDisplay returns an output structure
that describes the display settings of the drawing view. The fields in the structure
are as follows:
• Style—Whether to display as wireframe, hidden lines, no hidden lines, or
shaded
• TangentStyle—Linestyle used for tangent edges
• CableStyle—Linestyle used to display cables
• RemoveQuiltHiddenLines—Whether or not to apply hidden-line-removal to
quilts
• ShowConceptModel—Whether or not to display the skeleton
• ShowWeldXSection—Whether or not to include welds in the cross-section
The method pfcView2D.View2D.GetTransform returns a matrix that
describes the transform between 3D solid coordinates and 2D world units for that
drawing view. The transformation matrix is a combination of the following
factors:
• The location of the view origin with respect to the drawing origin.
• The scale of the view units with respect to the drawing units
• The rotation of the model with respect to the drawing coordinate system.
The method pfcView2D.View2D.GetName returns the name of the specified
view in the drawing.
The simplified representations of assembly and part can be used as drawing
models to create general views. Use the method
pfcView2D.View2D.GetSimpRep to retrieve the simplified representation
for the specified view in the drawing.

Drawing View Display Information


Methods Introduced:
• wfcQuickPrint.wfcQuickPrint.DrawingViewDisplay_Create
• wfcQuickPrint.DrawingViewDisplay.GetCableDisp

Drawings 147
• wfcQuickPrint.DrawingViewDisplay.SetCableDisp
• wfcQuickPrint.DrawingViewDisplay.GetConceptModel
• wfcQuickPrint.DrawingViewDisplay.SetConceptModel
• wfcQuickPrint.DrawingViewDisplay.GetDispStyle
• wfcQuickPrint.DrawingViewDisplay.SetDispStyle
• wfcQuickPrint.DrawingViewDisplay.GetQuiltHLR
• wfcQuickPrint.DrawingViewDisplay.SetQuiltHLR
• wfcQuickPrint.DrawingViewDisplay.GetTanEdgeDisplay
• wfcQuickPrint.DrawingViewDisplay.SetTanEdgeDisplay
• wfcQuickPrint.DrawingViewDisplay.GetWeldXSec
• wfcQuickPrint.DrawingViewDisplay.SetWeldXSec
The method
wfcQuickPrint.wfcQuickPrint.DrawingViewDisplay_Create
creates a new instance of the DrawingViewDisplay object that contains
information about the display styles being used in a view.
The methods wfcQuickPrint.DrawingViewDisplay.GetCableDisp
and wfcQuickPrint.DrawingViewDisplay.SetCableDisp get and
set the style used to display the cables. You can set the cable style using the object
wfcQuickPrint.CableDisplay:
• CABLEDISP_DEFAULT—Uses the display setting from Creo Parametric
Options dialog box, under Entity Display, Cable display settings.
• CABLEDISP_CENTERLINE—Displays centerlines of cables and wires.
• CABLEDISP_THICK—Displays cables and wires as a thick lines.
In a view, you can define whether to show or hide the skeleton model. The
methods wfcQuickPrint.DrawingViewDisplay.GetConceptModel
and wfcQuickPrint.DrawingViewDisplay.SetConceptModel get
and set the status of skeleton models. If you set the value as True, then the
skeleton model is displayed.
The methods wfcQuickPrint.DrawingViewDisplay.GetDispStyle
and wfcQuickPrint.DrawingViewDisplay.SetDispStyle get and
set the display style of the model geometry. You can set the display style using the
object pfcBase.DisplayStyle:
• DISPSTYLE_DEFAULT—When you import drawings from Pro/ENGINEER
Wildfire 2.0 or earlier releases that were saved with the Default option, this
option is retained for these drawings. Once you update these drawings in Pro/
ENGINEER Wildfire 3.0 and later releases, the DISPSTYLE_DEFAULT
option changes to DISPSTYLE_FOLLOW_ENVIRONMENT.
• DISPSTYLE_WIREFRAME—Shows all edges in wireframe style.

148 Creo Object TOOLKIT JavaUser’s Guide


• DISPSTYLE_HIDDEN_LINE—Shows all edges in hidden line style.
• DISPSTYLE_NO_HIDDEN—Removes all hidden edge from view display.
• DISPSTYLE_SHADED—Shows the view in shaded display mode.
• DISPSTYLE_FOLLOW_ENVIRONMENT—Uses the current configuration
settings for display.
• DISPSTYLE_SHADED_WITH_EDGES—Shows the model as a shaded solid
along with its edges.
You can remove the hidden lines in a quilt. The methods
wfcQuickPrint.DrawingViewDisplay.GetQuiltHLR and
wfcQuickPrint.DrawingViewDisplay.SetQuiltHLR get and set the
hidden line removal property in quilts.
The methods
wfcQuickPrint.DrawingViewDisplay.GetTanEdgeDisplay and
wfcQuickPrint.DrawingViewDisplay.SetTanEdgeDisplay get
and set the display style for tangent edges. You can set the tangent edge display
style using the object wfcQuickPrint.TangentEdgeDisplay:
• TANEDGE_DEFAULT—Uses the default settings.
• TANEDGE_NONE—Turns off the display of tangent edges
• TANEDGE_CENTERLINE—Displays tangent edges in centerline font.
• TANEDGE_PHANTOM—Displays tangent edges in phantom font.
• TANEDGE_DIMMED—Displays tangent edges in dimmed system color.
• TANEDGE_SOLID—Displays tangent edges as solid lines.
You can show and hide the weld cross-sections in a drawing. The methods
wfcQuickPrint.DrawingViewDisplay.GetWeldXSec and
wfcQuickPrint.DrawingViewDisplay.SetWeldXSec get and set the
display of weld cross-sections in a drawing.

Drawing Views Operations


Methods Introduced:
• 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 149
The method pfcView2D.View2D.Translate moves the drawing view by
the specified transformation vector.
The method pfcView2D.View2D.Delete deletes a specified drawing view.
Set the DeleteChildren parameter to true to delete the children of the view. Set
this parameter to false or null to prevent deletion of the view if it has children.
The method pfcView2D.View2D.Regenerate erases the displayed view of
the current object, regenerates the view from the current drawing, and redisplays
the view.
The method pfcView2D.View2D.SetLayerDisplayStatus sets the
display status for the layer in the drawing view.
The method pfcView2D.View2D.SetDisplay sets the value of the display
settings for the drawing view.

Drawing Dimensions
This section describes the Creo Object TOOLKIT Java 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.

Obtaining Drawing Dimensions


Methods Introduced:
• 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.

150 Creo Object TOOLKIT JavaUser’s Guide


The method pfcModelItem.ModelItemOwner.GetItemById returns a
drawing dimension based on the type and the integer identifier. The method
returns only those dimensions created in the drawing. It returns a null if a drawing
dimension with the specified attributes is not found.
The method pfcSelect.Selection.GetSelItem returns the value of the
selected drawing dimension.

Creating Drawing Dimensions


Methods Introduced:
• pfcDimension2D.pfcDimension2D.DrawingDimCreateInstructions_
Create
• pfcModel2D.Model2D.CreateDrawingDimension
• pfcDimension2D.pfcDimension2D.EmptyDimensionSense_Create
• pfcDimension2D.pfcDimension2D.PointDimensionSense_Create
• pfcDimension2D.pfcDimension2D.SplinePointDimensionSense_Create
• pfcDimension2D.pfcDimension2D.TangentIndexDimensionSense_Create
• pfcDimension2D.pfcDimension2D.LinAOCTangentDimensionSense_
Create
• pfcDimension2D.pfcDimension2D.AngleDimensionSense_Create
• pfcDimension2D.pfcDimension2D.PointToAngleDimensionSense_Create
The
methodpfcDimension2D.pfcDimension2D.DrawingDimCreateIn
structions
_Create creates an instructions object that describes how to create a drawing
dimension using the method
pfcModel2D.Model2D.CreateDrawingDimension.
The parameters of the instruction object are:
• Attachments—The entities that the dimension is attached to. The selections
should include the drawing model view.
• IsRefDimension—True if the dimension is a reference dimension, otherwise
null or false.
• OrientationHint—Describes the orientation of the dimensions in cases where
this cannot be deduced from the attachments themselves.
• Senses—Gives more information about how the dimension attaches to the
entity, i.e., to what part of the entity and in what direction the dimension runs.
The types of dimension senses are as follows:
○ DIMSENSE_NONE

Drawings 151
○ DIMSENSE_POINT
○ DIMSENSE_SPLINE_PT
○ DIMSENSE_TANGENT_INDEX
○ DIMSENSE_LINEAR_TO_ARC_OR_CIRCLE_TANGENT
○ DIMSENSE_ANGLE
○ 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_
Create 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_
Create 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 possible values of PointType are:
• DIMPOINT_END1— The first end of the entity
• DIMPOINT_END2—The second end of the entity
• DIMPOINT_CENTER—The center of an arc or circle
• DIMPOINT_NONE—No information such as location or direction of the
attachment is specified. This is similar to setting the PointType to DIMSENSE
NONE.
• DIMPOINT_MIDPOINT—The mid point of the entity
The method
pfcDimension2D.pfcDimension2D.SplinePointDimension
Sense_Create creates a dimension sense associated with the type

152 Creo Object TOOLKIT JavaUser’s Guide


DIMSENSE_SPLINE_PT. This means that the attachment is to a point on a
spline. The sense field is set to SplinePointIndex i.e., the index of the spline
point.
The method
pfcDimension2D.pfcDimension2D.TangentIndexDimension
Sense_Create creates a new dimension sense associated with the type
DIMSENSE_TANGENT_INDEX. The attachment is to a tangent of the entity,
which is an arc or a circle. The sense field is set to TangentIndex, i.e., the index
of the tangent of the entity.
The method
pfcDimension2D.pfcDimension2D.LinAOCTangentDimension
Sense_Create creates a new dimension sense associated with the 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.
The possible values of TangentType are:
• DIMLINAOCTANGENT_LEFT0—The tangent is to the left of the line, and is
on the same side, of the center of the arc or circle, as the line.
• DIMLINAOCTANGENT_RIGHT0—The tangent is to the right of the line, and
is on the same side, of the center of the arc or circle, as the line.
• DIMLINAOCTANGENT_LEFT1—The tangent is to the left of the line, and is
on the opposite side of the line.
• DIMLINAOCTANGENT_RIGHT1— The tangent is to the right of the line, and
is on the opposite side of the line.
The method
pfcDimension2D.pfcDimension2D.AngleDimensionSense_
Create creates a new dimension sense associated with the type DIMSENSE_
ANGLE. The dimension is the angle between two straight entities. The sense
field is set to the value of the parameter AngleOptions.
The possible values of AngleOptions are:
• IsFirst—Is set to TRUE if the angle dimension starts from the specified
entity in a counterclockwise direction. Is set to FALSE if the dimension ends
at the specified entity. The value is TRUE for one entity and FALSE for the
other entity forming the angle.
• 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

Drawings 153
of the angle. If the value of ShouldFlip is TRUE then the above cases are
reversed.
The method
pfcDimension2D.pfcDimension2D.PointToAngleDimension
Sense_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.

Drawing Dimensions Information


Methods Introduced:
• pfcDrawing.Drawing.IsDimensionAssociative
• pfcDimension2D.Dimension2D.GetIsReference
• pfcDrawing.Drawing.IsDimensionDisplayed
• pfcDrawing.Drawing.GetDimensionAttachPoints
• pfcDrawing.Drawing.GetDimensionSenses
• pfcDrawing.Drawing.GetDimensionOrientHint
• pfcDrawing.Drawing.GetBaselineDimension
• pfcDrawing.Drawing.GetDimensionLocation
• pfcDrawing.Drawing.GetDimensionView
• pfcDimension2D.Dimension2D.GetTolerance
• wfcDrawing.WDrawing.GetDimensionPath
• wfcDrawing.WDrawing.GetDualDimensionOptions
• wfcDrawing.DualDimensionGlobalOptions.GetDualDimensionType
• wfcDrawing.DualDimensionGlobalOptions.GetSecondaryUnit
• wfcDrawing.DualDimensionGlobalOptions.GetDigitsDifference
• wfcDrawing.DualDimensionGlobalOptions.AreBracketsAllowed
The method pfcDrawing.Drawing.IsDimensionAssociative checks
if the dimension or reference dimension is associative.
The method pfcDimension2D.Dimension2D.GetIsReference
determines whether the drawing dimension is a reference dimension.

154 Creo Object TOOLKIT JavaUser’s Guide


The method pfcDrawing.Drawing.IsDimensionDisplayed checks if
the dimension is displayed in the drawing or solid.
The method pfcDrawing.Drawing.GetDimensionAttachPoints
returns a sequence of attachment points for the dimension. The array of dimension
senses returned by the method
pfcDrawing.Drawing.GetDimensionSenses gives more information on
how these attachments are interpreted. It gives information about how the
dimension is attached to each attachment point of the model.
The method pfcDrawing.Drawing.GetDimensionSenses returns a
sequence of dimension senses, describing how the dimension is attached to each
attachment returned by the method
pfcDrawing.Drawing.GetDimensionAttachPoints.
The method pfcDrawing.Drawing.GetDimensionOrientHint returns
the orientation of the dimensions in case where this cannot be deduced from the
attachment themselves. The orientation of the dimensions is given by the
enumerated type pfcDimension.DimOrientationHint. The orientation
determines how Creo will orient the dimension with respect to the attachment
points.

Note
This methods described above are applicable only for dimensions created in
the drawing or the solid mode. It does not support dimensions created at
intersection points of entities.

The method pfcDrawing.Drawing.GetBaselineDimension returns an


ordinate baseline drawing dimension. It returns a null value if the dimension is not
an ordinate dimension.

Note
The method updates the display of the dimension only if it is currently
displayed.

The method pfcDrawing.Drawing.GetDimensionLocation returns the


placement location of the dimension.
The method pfcDrawing.Drawing.GetDimensionView returns the
drawing view in which the dimension is displayed. For dimensions created in
drawing mode and owned by a solid, which can be displayed only in the context
of that drawing, the method returns the drawing view. The method returns NULL if
the dimension is not attached to a drawing view.

Drawings 155
The method pfcDimension2D.Dimension2D.GetTolerance retrieves
the upper and lower tolerance limits of the drawing dimension in the form of the
pfcDimension.DimTolerance object. A null value indicates a nominal
tolerance.
The method
pfcDrawing.Drawing.IsDimensionToleranceDisplayed checks if
the dimension tolerance is displayed in the drawing or solid.
The method wfcWDrawing.WDrawing.GetDimensionPath extracts the
component path for a dimension displayed in a drawing.
The method wfcWDrawing.WDrawing.GetDualDimensionOptions
retrieves information about the various options of dual dimensioning in a drawing
as a wfcWDrawing.DualDimensionGlobalOptions object.
Use the method
wfcDrawing.DualDimensionGlobalOptions.GetDualDimension
Type to get the display style of dual dimensions. The display type is given by the
enumerated type wfcDrawing.DualDimensionDisplayType. The valid
values are:
• SECONDARY_DIM_DISPLAY_OFF— Turns off display of dual dimension.
• SECONDARY_DIM_DISPLAY_TOP—Displays the secondary dimension on
top of the primary dimension. The primary dimension is displayed in brackets.
• SECONDARY_DIM_DISPLAY_BOTTOM— Displays the secondary
dimension below the primary dimension. The secondary dimension is
displayed in brackets.
• SECONDARY_DIM_DISPLAY_LEFT— Displays the secondary dimension to
the left of the primary dimension. The primary dimension is displayed in
brackets.
• SECONDARY_DIM_DISPLAY_RIGHT— Displays the secondary dimension
to the right of the primary dimension. The secondary dimension is displayed in
brackets.
• SECONDARY_DIM_DISPLAY_ONLY— Displays only the secondary
dimension.
Use the method
wfcWDrawing.DualDimensionGlobalOptions.GetSecondaryUnit
to retrieve the type of units used for the secondary dimension.
The method
wfcWDrawing.DualDimensionGlobalOptions.GetDigitsDiffer
ence retrieves the number of decimal places that a secondary dimension contains
as compared to the primary dimension in a dual dimension.

156 Creo Object TOOLKIT JavaUser’s Guide


The method
wfcWDrawing.DualDimensionGlobalOptions.AreBracketsAl
lowed checks if one of the dimensions of a dual dimension is displayed in
brackets.

Drawing Dimensions Operations


Methods Introduced:
• pfcDrawing.Drawing.ConvertOrdinateDimensionToLinear
• pfcDrawing.Drawing.ConvertLinearDimensionToOrdinate
• pfcDimension2D.Dimension2D.SetLocation
• pfcDrawing.Drawing.SwitchDimensionView
• pfcDrawing.Drawing.EraseDimension
• pfcModel2D.Model2D.SetViewDisplaying
The method
pfcDrawing.Drawing.ConvertOrdinateDimensionToLinear
converts an ordinate dimension to a linear dimension. The drawing or solid
containing the dimension must be displayed.
The method
pfcDrawing.Drawing.ConvertLinearDimensionToOrdinate
converts a linear drawing dimension to an ordinate baseline dimension.
The method pfcDimension2D.Dimension2D.SetLocation sets the
placement location of a dimension or reference dimension in a drawing or solid.
The method pfcDrawing.Drawing.SwitchDimensionView changes the
view where a dimension created in the drawing or solid is displayed.
The method pfcDrawing.Drawing.EraseDimension permanently erases
the dimension from the drawing or solid.
The method pfcModel2D.Model2D.SetViewDisplaying changes the
view where a dimension created in a solid model is displayed.

Ordinate Dimensions
Methods Introduced:
• wfcSolid.WSolid.CreateOrdinateDimension
The method wfcSolid.WSolid.CreateOrdinateDimension creates a
new model ordinate driven dimension or a model ordinate reference dimension in
a solid model. It requires the input of a reference baseline annotation as well as a

Drawings 157
geometry reference. The annotation plane for the new dimension will be inherited
from the baseline. Once the reference dimension is created, use the method
wfcAnnotation.Annotation.ShowInDrawing to display it.

Drawing Tables
A drawing table in Creo Object TOOLKIT Java is represented by the interface
com.ptc.pfc.pfcTable.Table. It is a child of the ModelItem interface.
Some drawing table methods operate on specific rows or columns. The row and
column numbers in Creo Object TOOLKIT Java 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.

Creating Drawing Cells


Method Introduced:
• pfcTable.pfcTable.TableCell_Create
The method pfcTable.pfcTable.TableCell_Create creates the
TableCell object representing a cell in the drawing table.
Some drawing table methods operate on specific drawing segment. A
multisegmented drawing table contains 2 or more areas in the drawing. Inserting
or deleting rows in one segment of the table can affect the contents of other
segments. Table segments are numbered beginning with 0. If the table has only a
single segment, use 0 as the segment id in the relevant methods.

Selecting Drawing Tables and Cells


Methods Introduced:
• 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.
The method pfcSelect.Selection.GetSelItem returns the selected
table handle. It is a model item that can be cast to a Table object.

158 Creo Object TOOLKIT JavaUser’s Guide


The method pfcSelect.Selection.GetSelTableCell returns the row
and column indices of the selected table cell.
The method pfcSelect.Selection.GetSelTableSegment returns the
table segment identifier for the selected table cell. If the table consists of a single
segment, this method returns the identifier 0.

Creating Drawing Tables


Methods Introduced:
• pfcTable.pfcTable.TableCreateInstructions_Create
• pfcTable.TableOwner.CreateTable
The method pfcTable.pfcTable.TableCreateInstructions_
Create creates the TableCreateInstructions data object that describes
how to construct a new table using the method
pfcTable.TableOwner.CreateTable.
The parameters of the instructions data object are:
• Origin—This parameter stores a three dimensional point specifying the
location of the table origin. The origin is the position of the top left corner of
the table.
• RowHeights—Specifies the height of each row of the table.
• ColumnData—Specifies the width of each column of the table and its
justification.
• SizeTypes—Indicates the scale used to measure the column width and row
height of the table.
The method pfcTable.TableOwner.CreateTable creates a table in the
drawing specified by the TableCreateInstructions data object.

Retrieving Drawing Tables


Methods Introduced
• pfcTable.pfcTable.TableRetrieveInstructions_Create
• pfcTable.TableRetrieveInstructions.SetFileName
• pfcTable.TableRetrieveInstructions.SetPath
• pfcTable.TableRetrieveInstructions.SetVersion
• pfcTable.TableRetrieveInstructions.SetPosition
• pfcTable.TableRetrieveInstructions.SetReferenceSolid
• pfcTable.TableRetrieveInstructions.SetReferenceRep

Drawings 159
• pfcTable.TableOwner.RetrieveTable
• pfcTable.TableOwner.RetrieveTableByOrigin
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.
The method pfcTable.pfcTable.TableRetrieveInstructions_
Create creates the TableRetrieveInstructions data object that
describes how to retrieve a drawing table using the methods
pfcTable.TableOwner.RetrieveTable and
pfcTable.TableOwner.RetrieveTableByOrigin. The method returns
the created instructions data object.
The parameters of the instruction object are:
• FileName—Name of the file containing the drawing table.
• Position—Coordinates of the point on the drawing sheet, where the retrieved
table must be placed. You must specify the value in screen coordinates.
You can also set the parameters for TableRetrieveInstructions data
object using the following method:
• pfcTable.TableRetrieveInstructions.SetFileName—Sets
the name of the drawing table. You must not specify the extension.
• pfcTable.TableRetrieveInstructions.SetPath—Sets the path
to the drawing table file. The path must be specified relative to the working
directory.
• pfcTable.TableRetrieveInstructions.SetVersion—Sets the
version of the drawing table that must be retrieved. If you specify NULL rthe
latest version of the drawing table is retrieved.
• pfcTable.TableRetrieveInstructions.SetPosition—Sets
the coordinates of the point on the drawing sheet, where the table must be
placed. You must specify the value in screen coordinates.
• pfcTable.TableRetrieveInstructions.SetReferenceSol
id—Sets the model from which data must be copied into the drawing table. If
this argument is passed as NULL, an empty table is created.
• pfcTable.TableRetrieveInstructions.SetReferenceRep—
Sets the handle to the simplified representation in a solid, from which data
must be copied into the drawing table. If this argument is passed as NULL, and
the argument solid is not NULL, then data from the solid model is copied into
the drawing table

160 Creo Object TOOLKIT JavaUser’s Guide


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 upper-left corner of the table is placed
on the drawing sheet at the position specified by the
TableRetrieveInstructions data object.
The method pfcTable.TableOwner.RetrieveTableByOrigin also
retrieves a table specified by the TableRetrieveInstructions data object
from a file on the disk. The origin of the table is placed on the drawing sheet at the
position specified by the TableRetrieveInstructions data object. Tables
can be created with different origins by specifying the option Direction, in the
Insert Table dialog box.

Drawing Tables Information


Methods Introduced:
• 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.
The method pfcTable.TableOwner.GetTable returns a table specified by
the table identifier in the model. It returns a null value if the table is not found.
The method pfcTable.Table.GetRowCount returns the number of rows in
the table.
The method pfcTable.Table.GetColumnCount returns the number of
columns in the table.
The method pfcTable::CheckIfIsFromFormat checks if the drawing
table was created using the format. The method returns a true value if the table
was created by applying the drawing format.
The method pfcTable.Table.GetRowSize returns the height of the
drawing table row specified by the segment identifier and the row number.

Drawings 161
The method pfcTable.Table.GetColumnSize returns the width of the
drawing table column specified by the segment identifier and the column number.
The method pfcTable.Table.GetText returns the sequence of text in a
drawing table cell. Set the value of the parameter Mode to DWGTABLE_NORMAL
to get the text as displayed on the screen. Set it to DWGTABLE_FULL to get
symbolic text, which includes the names of parameter references in the table text.
The method pfcTable.Table.GetCellNote returns the detail note item
contained in the table cell.

Drawing Tables Operations


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
• wfcTable.WTable.GetGrowthDirection
• wfcTable.WTable.SetGrowthDirection
• wfcTable.WTable.GetRowHeightAutoAdjustType
• wfcTable.WTable.SetRowHeightAutoAdjustType
• wfcTable.WTable.Save
• wfcTable.WTable.SetColumnWidth
• wfcTable.WTable.SetRowHeight
• wfcTable.WTable.WrapCelltext
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.

162 Creo Object TOOLKIT JavaUser’s Guide


The method pfcTable.Table.RotateClockwise rotates a table clockwise
by the specified amount of rotation.
The method pfcTable.Table.InsertRow inserts a new row in the drawing
table. Set the value of the parameter RowHeight to specify the height of the row.
Set the value of the parameter InsertAfterRow to specify the row number after
which the new row has to be inserted. Specify 0 to insert a new first row.
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 method pfcTable.Table.MergeRegion merges table cells within a
specified range of rows and columns to form a single cell. The range is a
rectangular region specified by the table cell on the upper left of the region and
the table cell on the lower right of the region.
The method pfcTable.Table.SubdivideRegion removes merges from a
region of table cells that were previously merged. The region to remove merges is
specified by the table cell on the upper left of the region and the table cell on the
lower right of the region.
The methods pfcTable.Table.DeleteRow and
pfcTable.Table.DeleteColumn delete any specified row or column from
the table. The methods also remove the text from the affected cells.
The method pfcTable.Table.SetText sets text in the table cell.
Use the method pfcTable.TableOwner.DeleteTable to delete a
specified drawing table from the model permanently. The deleted table cannot be
displayed again.

Note
Many of the above methods provide a parameter Repaint If this is set to true
the table will be repainted after the change. If set to false or null Creo will
delay the repaint, allowing you to perform several operations before showing
changes on the screen.

The method wfcTable.WTable.GetGrowthDirection and


wfcTable.WTable.SetGrowthDirection gets and sets the growth
direction of the table using the enumerated type
wfcTable.TableGrowthDirType.

Drawings 163
The valid values for growth direction are defined in the enumerated data type
wfcTable.TableGrowthDirType:
• TABLEGROWTHDIR_DOWNRIGHT
• TABLEGROWTHDIR_DOWNLEFT
• TABLEGROWTHDIR_UPRIGHT
• TABLEGROWTHDIR_UPRIGHT
The methods wfcTable.WTable.GetRowHeightAutoAdjustType and
wfcTable.WTable.SetRowHeightAutoAdjustType get and set the
automatic row height adjustment property for a row of a drawing table. The type
of height adjustment property is defined in the enumerated data type
wfcTable.RowheightAutoadjustType:
• TBLROWHEIGHT_AUTOADJUST_FALSE— Specifies that the automatic row
height adjustment property is not set.
• TBLROWHEIGHT_AUTOADJUST_TRUE— Specifies that the automatic row
height adjustment property is set.
• TBLROWHEIGHT_AUTOADJUST_TRUE_LEGACY— Specifies a pre-Creo
Parametric 1.0 release behavior. In this behavior, sometimes the row height
may be automatically adjusting and sometimes may not be automatically
adjusting. To set an explicit row adjustment status use the method
wfcTable.WTable.SetRowHeightAutoAdjustType.
The method wfcTable.WTable.Save saves a drawing table in different
formats. The formats given by the enumerated type
wfcTable.TableFormatType can be of the following types:
• TABLEFORMAT_TBL—Specifies the tabular format.
• TABLEFORMAT_TBL—Specifies the tabular format.
• TABLEFORMAT_CSV—Specifies the CSV format.
The methods wfcTable.WTable.SetColumnWidth and
wfcTable.WTable.SetRowHeight assign the width of a specified column
and the height of a specified row depending upon the size of the drawing table.
The drawing table size given by the enumerated data type
pfcTable.TableSizeType:
• TABLESIZE_BY_NUM_CHARS—Specifies the size in characters. If the
specified value for width of a column or height of a row is a fraction,
TABLESIZE_BY_NUM_CHARS rounds down the fractional value to the
nearest whole number.
• TABLESIZE_BY_LENGTH—Specifies the size in screen coordinates.
The method wfcTable.WTable.WrapCelltext wraps the text in a cell.

164 Creo Object TOOLKIT JavaUser’s Guide


Drawing Table Segments
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
• wfcTable.WTable.SetSegmentOrigin
• wfcTable.WTable.GetSegmentExtentsGetSegmentExtents
• wfcTable.SegmentExtents.GetFirstColumn
• wfcTable.SegmentExtents.GetFirstRow
• wfcTable.SegmentExtents.GetLastColumn
• wfcTable.SegmentExtents.GetLastRow
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.
The method pfcTable.Table.GetSegmentCount returns the number of
segments in the table.
The method pfcTable.Table.GetSegmentSheet determines the sheet
number that contains a specified drawing table segment.
The method pfcTable.Table.MoveSegment moves a drawing table
segment to a new location. Pass the co-ordinates of the target position in the
format x, y, z=0.

Note
Set the value of the parameter Repaint to true to repaint the drawing with the
changes. Set it to false or null to delay the repaint.

To get information about a drawing table pass the value of the segment identifier
as input to the method pfcTable.Table.GetInfo. The method returns the
table information including the rotation, row and column information, and the 3D
outline.

Drawings 165
Use the method wfcTable.WTable.SetSegmentOrigin to set the origin
for a specified drawing table segment.
The method wfcTable.WTable.GetSegmentExtents returns the start and
end rows and columns of a specified table segment. The input argument
SegmentId is the table segment ID. Pass the value as -1 if you are referring to the
only segment of a one-segment table.
The methods wfcTable.SegmentExtents.GetFirstColumn and
wfcTable.SegmentExtents.GetFirstRow returns the first row and first
column of a table segment.
The methods wfcTable.SegmentExtents.GetLastColumn and
wfcTable.SegmentExtents.GetLastRow returns the last row and last
column of a table segment.

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.
The method pfcTable.Table.IsCommentCell tells you whether a cell in a
repeat region contains a comment.
The method pfcTable.Table.GetCellComponentModel returns the
path to the assembly component model that is being referenced by a cell in a
repeat region of a drawing table. It does not return a valid path if the cell attribute
is set to NO DUPLICATE or NO DUPLICATE/LEVEL.
The method pfcTable.Table.GetCellReferenceModel returns the
reference component that is being referred to by a cell in a repeat region of a
drawing table, even if cell attribute is set to NO DUPLICATE or NO
DUPLICATE/LEVEL.
The method pfcTable.Table.GetCellTopModel returns the top model
that is being referred to by a cell in a repeat region of a drawing table, even if cell
attribute is set to NO DUPLICATE or NO DUPLICATE/LEVEL.

166 Creo Object TOOLKIT JavaUser’s Guide


Use the method pfcTable.TableOwner.UpdateTables to update the
repeat regions in all the tables to account for changes to the model. It is equivalent
to the command Table, Repeat Region, Update.

Drawing Views And Models


Listing Drawing Views
Methods Introduced:
• wfcView2D.WView2D.GetParentView
• wfcView2D.WView2D.GetChildren
• wfcView2D.WView2D.GetProjectionArrow
• wfcView2D.WView2D.GetPerspectiveScaleEyePointDistance
• wfcView2D.WView2D.GetPerspectiveScaleViewDiameter
• wfcView2D.WView2D.GetColorSource
• wfcView2D.WView2D.GetZClippingReference
• wfcView2D.WView2D.GetViewType
• wfcView2D.WView2D.GetViewId
• wfcView2D.WView2D.IsErased
• wfcView2D.WView2D.GetAlignmentInstructions
• wfcView2D.WView2D.SetAlignmentInstructions
• wfcView2D.wfcView2D.ViewAlignmentInstructions_Create
• wfcView2D.ViewAlignmentInstructions.GetReferenceView
• wfcView2D.ViewAlignmentInstructions.SetReferenceView
• wfcView2D.ViewAlignmentInstructions.GetAlignmentStyle
• wfcView2D.ViewAlignmentInstructions.SetAlignmentStyle
• wfcView2D.ViewAlignmentInstructions.GetViewReference
• wfcView2D.ViewAlignmentInstructions.SetViewReference
• wfcView2D.ViewAlignmentInstructions.GetAlignedViewReference
• wfcView2D.ViewAlignmentInstructions.SetAlignedViewReference
• wfcView2D.WView2D.GetOriginSelectionRef
• wfcView2D.WView2D.GetOrigin
• wfcView2D.WView2D.GetDatumDisplayStatus
• wfcView2D.WView2D.GetPipingDisplay

Drawings 167
• wfcView2D.WView2D.GetErasedViewSheet
• wfcDrawing.WDrawing.NeedsRegen
• wfcDrawing.WDrawing.GetDrawingView
• wfcSession.WSession.OpenDrawingAsReadOnly
The method wfcView2D.WView2D.GetParentView retrieves the parent
view of a specified drawing view.
The method wfcView2D.WView2D.GetChildren retrieves the child views
of a drawing view.
The method wfcView2D.WView2D.GetProjectionArrow checks if the
projection arrow flag has been set for a projected or detailed drawing view.
The method
wfcView2D.WView2D.GetPerspectiveScaleEyePointDistance
retrieves the eye-point distance from model space for the perspective scale applied
to a drawing view. This scale option is available only for general views.
The method
wfcView2D.WView2D.GetPerspectiveScaleViewDiameter
specifies the view diameter in paper units such as mm for the perspective scale
applied to a drawing view. This scale option is available only for general views.
The method wfcView2D.WView2D.GetColorSource retrieves information
about color designation of the drawing view using the enumerated type
wfcView2D.DrawingViewColorSource. The valid values are:
• VIEW_MODEL_COLOR—Specifies that the drawing colors are determined by
the model settings.
• VIEW_DRAWING_COLOR—Specifies that the drawing colors are determined
by the drawing settings.
The method GetColorSource retrieves the reference of the Z-clipping on the
drawing view. The reference can be an edge, datum, or point on the surface that is
parallel to the view. Geometry contained in the Z-clipping plane and in front of the
plane appears, but geometry behind the plane does not appear. The system clips
geometry that intersects the plane.
The method wfcView2D.WView2D.GetViewType retrieves the type of a
specified drawing view using the enumerated data type
wfcView2D.ViewType. A drawing view can be of the following types:
• VIEW_GENERAL—Specifies a general drawing view.
• VIEW_PROJECTION—Specifies a projected drawing view.
• VIEW_AUXILIARY—Specifies an auxiliary drawing view.
• VIEW_DETAIL—Specifies a detailed drawing view.
• VIEW_REVOLVE—Specifies a revolved drawing view.

168 Creo Object TOOLKIT JavaUser’s Guide


• VIEW_COPY_AND_ALIGN—Specifies a copy and align drawing view.
• VIEW_OF_FLAT_TYPE—Specifies a flat type drawing view.
The method wfcView2D.WView2D.GetViewId retrieves the ID of the
drawing view.
The method wfcView2D.WView2D.IsErased checks if the drawing view is
erased or not. When you erase a view, it is removed from display in the drawing.
The view is not deleted from the drawing.
The methods wfcView2D.WView2D.GetAlignmentInstructions and
wfcView2D.WView2D.SetAlignmentInstructions retrieve and set the
alignment of a drawing view with respect to a reference view as a
wfcView2D.ViewAlignmentInstructions object.
The method wfcView2D.wfcView2D.ViewAlignmentInstructions_
Create creates a data object that contains information about view alignment.
The methods
wfcView2D.ViewAlignmentInstructions.GetReferenceView and
wfcView2D.ViewAlignmentInstructions.SetReferenceView
retrieve and set the reference view to which the drawing view is aligned.
The methods
wfcView2D.ViewAlignmentInstructions.GetAlignmentStyle
and
wfcView2D.ViewAlignmentInstructions.SetAlignmentStyle
get and set the alignment style using the enumerated type
wfcView2D.DrawingViewAlignStyle. The valid values are:
• VIEW_ALIGN_HORIZONTAL—Specifies a horizontal alignment for the
view. The drawing view and the reference view lie on the same horizontal line.
• VIEW_ALIGN_VERTICAL—Specifies a vertical alignment for the view. In
case of vertical alignment, the drawing view and the view are aligned to lie on
the same vertical line.
The methods
wfcView2D.ViewAlignmentInstructions.GetViewReference and
wfcView2D.ViewAlignmentInstructions.SetViewReference get
and set the geometry, such as an edge, on the reference view. The view is aligned
along this geometry. If no geometry is specified, the reference view is aligned
according to its view origin.
The methods
wfcView2D.ViewAlignmentInstructions.GetAlignedViewRefer
ence and
wwfcView2D.ViewAlignmentInstructions.SetAlignedViewRe
ference get and set the geometry, such as an edge, on the drawing view. If no
geometry is specified, the drawing view is aligned according to its view origin.

Drawings 169
The method wfcView2D.WView2D.GetOriginSelectionRef retrieves
the selection reference as a pfcSelect.Selection object for the drawing
view.
The method wfcView2D.WView2D.GetOrigin retrieves the location of the
origin as a pfcBase.Point3D object for the drawing view.
The method wfcView2D.WView2D.GetDatumDisplayStatus checks if a
solid model datum has been explicitly shown in a particular drawing view using
the enumerated type wfcView2D.ViewItemdisplayStatus. The valid
values are:
• VIEWDISP_NOT_SHOWN—Specifies that the solid model has never been
shown in a particular drawing.
• VIEWDISP_SHOWN—Specifies that the solid model has been shown in a
particular drawing.
• VIEWDISP_ERASED—Specifies that the solid model has been erased in a
particular drawing.
The method wfcView2D.WView2D.GetPipingDisplay retrieves the
piping display option for a drawing view using the enumerated type
wfcView2D.PipingDisplay. The valid values are:
• PIPINGDISP_DEFAULT—Displays the default appearance of pipes for the
piping assembly.
• PIPINGDISP_CENTERLINE—Displays pipes as centerlines without
insulation.
• PIPINGDISP_THICK_PIPES—Displays thick pipes without insulation.
• PIPINGDISP_THICK_PIPES_AND_INSULATION—Displays thick pipes
and insulation.
The method wfcView2D.WView2D.GetErasedViewSheet retrieves the
sheet number which contained the view that was erased. If the sheet that contained
the erased view is deleted, an exception is thrown.
The method wfcDrawing.WDrawing.NeedsRegen checks whether the
drawing or the specified drawing view needs to be regenerated.
The method wfcDrawing.WDrawing.GetDrawingView retrieves the
drawing view handle for the specified view ID.
The method wfcSession.WSession.OpenDrawingAsReadOnly opens a
drawing in the view only mode.

Modifying Views
Methods Introduced:

170 Creo Object TOOLKIT JavaUser’s Guide


• wfcView2D.WView2D.SetViewAsProjection
• wfcView2D.WView2D.SetProjectionArrow
• wfcView2D.WView2D.SetZClippingReference
• wfcView2D.WView2D.Erase
• wfcView2D.WView2D.Resume
• wfcView2D.WView2D.SetOrigin
• wfcView2D.WView2D.SetPipingDisplay
The method wfcView2D.WView2D.SetViewAsProjection assigns the
specified drawing view as a projection.
The method wfcView2D.WView2D.SetProjectionArrow sets the
projection arrow flag to true for a projected or detailed drawing view.
The method wfcView2D.WView2D.SetZClippingReference sets the Z-
clipping on the drawing view to reference a given edge, datum, or point on the
surface that is parallel to the view. Geometry contained in the Z-clipping plane
and in front of the plane appears, but geometry behind the plane does not appear.
The system clips geometry that intersects the plane.
The method wfcView2D.WView2D.Erase removes the specified drawing
view from display. To display the view back in the drawing, use the method
wfcView2D.WView2D.Resume.
The method wfcView2D.WView2D.SetOrigin assigns the location of the
origin as a pfcBase.Point3D object and the selection reference for a specified
drawing view as a pfcSelect.Selection object.
The method wfcView2D.WView2D.SetPipingDisplay assigns the piping
display option for a drawing view using the enumerated data type
wfcView2D.PipingDisplay.

Detailed Views
Methods Introduced:
• wfcDrawing.WDrawing.CreateDetailView
• wfcView2D.WView2D.GetDetailViewInstructions
• wfcView2D.WView2D.SetDetailViewInstructions
• wfcView2D.wfcView2D.DetailViewInstructions_Create
• wfcView2D.DetailViewInstructions.GetReference
• wfcView2D.DetailViewInstructions.SetReference
• wfcView2D.DetailViewInstructions.GetCurveData
• wfcView2D.DetailViewInstructions.SetCurveData

Drawings 171
• wfcView2D.DetailViewInstructions.GetBoundaryType
• wfcView2D.DetailViewInstructions.SetBoundaryType
• wfcView2D.DetailViewInstructions.ShowBoundary
• wfc2View2D.DetailViewInstructions.IsBoundaryShown
A detailed view is a small portion of a model shown enlarged in another view.
The method wfcDrawing.WDrawing.CreateDetailView creates a
detailed view given the reference point on the parent view, the spline curve data,
and location of the new view. A note with the detailed view name and the spline
curve border are included in the parent view for the created detailed view. The
input arguments are:
• Instructions— Specifies a wfcView2D.DetailViewInstructions
object which contains all the information needed to create a detailed view.
• Location— Specifies the centerpoint of the view as a pfcBase.Point3D
object.
Use the methods wfcView2D.WView2D.GetDetailViewInstructions
and wfcView2D.WView2D.SetDetailViewInstructions to get and set
the information related to detailed views as a
wfcView2D.DetailViewInstructions object.
The method wfcView2D.wfcView2D.DetailViewInstructions_
Create creates a data object that contains information about the detailed view.
Use the methods
wfcView2D.DetailViewInstructions.GetReference and
wfcView2D.DetailViewInstructions.SetReference to get and set
the reference point on the parent view for a specified detailed view.
Use the methods
wfcView2D.DetailViewInstructions.GetCurveData and
wfcView2D.DetailViewInstructions.SetCurveData to get and set
the spline curve data as a pfcGeometry.CurveDescriptor object for the
specified detailed view. The information about the curve geometry is returned
using the enumerated data type pfcGeometry.CurveType. The curve data
specifies the following:
• The X and Y coordinate directions match the screen space.
• The coordinate point (0,0) maps to the reference point.
• The scaling unit is of one inch relative to the top model of the view. If two
points in the spline are at a distance of '1' from each other, then in the actual
view, the points will be one inch distant from each other, if measured in the
scale of the top model. For example, if one of the points in the spline
definition has coordinates (0.5, 0.0, 0.0), then the position of that point is not
half an inch to the right of the reference point on the paper. Instead, when

172 Creo Object TOOLKIT JavaUser’s Guide


projected as a point in the space of the top model of the view, it is half an inch
to the right of the reference point when measured in the space of that model.
The methods
wfcView2D.DetailViewInstructions.GetBoundaryType and
wfcView2D.DetailViewInstructions.SetBoundaryType get and
set the boundary type for a detailed view in terms of the enumerated type
wfcView2d.ViewDetailBoundaryType. The types of boundaries are:
• DETAIL_BOUNDARY_CIRCLE—Draws a circle in the parent view.
• DETAIL_BOUNDARY_ELLIPSE—Draws an ellipse in the parent view.
• DETAIL_BOUNDARY_HORZ_VER_ELLIPSE—Draws an ellipse with
horizontal or vertical major axis.
• DETAIL_BOUNDARY_SPLINE—Displays the spline boundary drawn by the
user in the parent view.
• DETAIL_BOUNDARY_ASME_CIRCLE—Displays an ASME standard
compliant circle as an arc with arrows and the detailed view name.
The method wfcView2D.DetailViewInstructions.ShowBoundary
displays the boundary of the detailed view in the parent view.
The method
wfc2View2D.DetailViewInstructions.IsBoundaryShown checks
if the boundary of the detailed view is displayed in the parent view.

Auxiliary Views
Methods Introduced:
• wfcDrawing.WDrawing.CreateAuxiliaryView
• wfcView2D.WView2D.GetAuxiliaryViewInstructions
• wfcView2D.wfcView2D.AuxiliaryViewInstructions_Create
• wfcView2D.AuxiliaryViewInstructions.GetReference
• wfcView2D.AuxiliaryViewInstructions.SetReference
• wfcView2D.AuxiliaryViewInstructions.GetLocation
• wfcView2D.AuxiliaryViewInstructions.SetLocation
• wfcView2D.WView2D.SetViewAsAuxiliary
An auxiliary view is a type of projected view that projects at right angles to a
selected surface or axis. The selected surface or axis in the parent view must be
perpendicular to the plane of the screen.
The method wfcDrawing.WDrawing.CreateAuxiliaryView creates an
auxiliary view. Pass the information required to create the auxiliary view as a
wfcView2D.AuxiliaryViewInstructions object.

Drawings 173
The method wfcView2D.WView2D.GetAuxiliaryViewInstructions
retrieves information about the auxiliary view as a
wfcView2D.AuxiliaryViewInstructions object.
The method wfcView2D.wfcView2D.AuxiliaryViewInstructions_
Create creates a data object that contains information about the auxiliary view.
The methods
wfcView2D.AuxiliaryViewInstructions.GetReference and
wfcView2D.AuxiliaryViewInstructions.SetReference retrieve
and set the selection reference for the auxiliary view as a
pfcSelect.Selection object.
The methods
wfcView2D.AuxiliaryViewInstructions.GetLocation and
wfcView2D.AuxiliaryViewInstructions.SetLocation retrieve
and set the centerpoint of the auxiliary view as a pfcBase.Point3D object. By
default, the origin of a drawing view is in the center of its outline. You can reset
the origin of a drawing view by parametrically referencing model geometry or
defining a location on the drawing sheet.
The method wfcView2D.WView2D.SetViewAsAuxiliary sets a specified
drawing view as the auxiliary view.

Revolved Views
Methods Introduced:
• wfcDrawing.WDrawing.CreateRevolveView
• wfcView2D.WView2D.GetRevolveViewInstructions
• wfcView2D.wfcView2D.RevolveViewInstructions_Create
• wfcView2D.RevolveViewInstructions.GetReference
• wfcView2D.RevolveViewInstructions.SetReference
• wfcView2D.RevolveViewInstructions.GetXSec
• wfcView2D.RevolveViewInstructions.SetXSec
• wfcView2D.RevolveViewInstructions.GetLocation
• wfcView2D.RevolveViewInstructions.SetLocation
A revolved view is a cross section of an existing view, revolved 90 degrees around
a cutting plane projection.
The method wfcDrawing.WDrawing.CreateRevolveView creates a
revolved view given a cross section, the selection reference, and the point
location. Pass the information required to create the auxiliary view as a
wfcView2D.RevolveViewInstructions object.

174 Creo Object TOOLKIT JavaUser’s Guide


The method wfcView2D.WView2D.GetRevolveViewInstructions
retrieves information about the revolved view as a
wfcView2D.RevolveViewInstructions object.
The method wfcView2D.wfcView2D.RevolveViewInstructions_
Create creates a data object that contains information about the revolved view.
The methods wfcView2D.RevolveViewInstructions.GetReference
and wfcView2D.RevolveViewInstructions.SetReference retrieve
and set the selection reference for the revolved view as a
pfcSelect.Selection object.
The methods wfcView2D.RevolveViewInstructions.GetXSec and
wfcView2D.RevolveViewInstructions.SetXSec retrieve and set the
cross section of the revolved view as a pfcXSection.XSection object.
The methods wfcView2D.RevolveViewInstructions.GetLocation
and wfcView2D.RevolveViewInstructions.SetLocation retrieve
and set the centerpoint of the revolved view as a pfcBase.Point3D object. By
default, the origin of a drawing view is in the center of its outline. You can reset
the origin of a drawing view by parametrically referencing model geometry or
defining a location on the drawing sheet.

View Orientation
Methods Introduced:
• wfcView2D.WView2D.SetOrientation
• wfcView2D.WView2D.SetOrientationFromReference
• wfcView2D.WView2D.SetOrientationFromAngle

Note
The drawing view must be displayed before applying any orientation to it.

The method wfcView2D.WView2D.SetOrientation orients the specified


drawing view using saved views from the model. The input arguments are:
• MdlView—Specifies the name of the saved view in the model.
• Orientation—Specifies the orientation of the view using the enumerated data
type wfcView2D.DrawingViewOrientationType. The view types
are:
○ VIEW_ORIENTATION_ISOMETRIC—Sets the view orientation to
isometric.

Drawings 175
○ VIEW_ORIENTATION_TRIMETRIC—Sets the view orientation to
trimetric.
○ VIEW_ORIENTATION_USERDEFINED—Sets the view orientation to
user-defined.
• XAngle—This input argument is required when the Orientation type is
specified as VIEW_ORIENTATION_USERDEFINED. For all other
orientation types, this argument is ignored.
• YAngle—This input argument is required when the Orientation type is
specified as VIEW_ORIENTATION_USERDEFINED. For all other
orientation types, this argument is ignored.
The method wfcView2D.WView2D.SetOrientationFromReference
orients the view using geometric references.
• MdlOrient1—Specifies the orientation of the first geometric reference using
the enumerated data type
wfcView2D.DrawingViewOrientationRefType. The orientation
types are:
○ VIEW_ORIENTATION_REF_FRONT—Orients the view by using the
front surface as a reference.
○ VIEW_ORIENTATION_REF_BACK—Orients the view by using the back
surface as a reference.
○ VIEW_ORIENTATION_REF_LEFT—Orients the view by using the left
surface as a reference.
○ VIEW_ORIENTATION_REF_RIGHT—Orients the view by using the
right surface as a reference.
○ VIEW_ORIENTATION_REF_TOP—Orients the view by using the top
surface as a reference.
○ VIEW_ORIENTATION_REF_BOTTOM—Orients the view by using the
bottom surface as a reference.
○ VIEW_ORIENTATION_REF_VERTAXIS—Orients the view by using
the vertical axis as a reference.
○ VIEW_ORIENTATION_REF_HORIZAXIS—Orients the view by using
the horizontal axis as a reference.
• OrientRef1—Specifies the first reference selection on the model.
• MdlOrient2—Specifies the orientation of the second geometric reference
using the enumerated data type
wfcView2D.DrawingViewOrientationRefType.
• OrientRef2—Specifies the second reference selection on the model.

176 Creo Object TOOLKIT JavaUser’s Guide


The method wfcView2D.WView2D.SetOrientationFromAngle orients
the specified drawing view using angles of selected references or custom angles.
The input arguments are:
• RotationAngleRef—Specifies the angle reference using the enumerated data
type wfcView2D.DrawingViewOrientationAngleType. The angle
types are:
○ VIEW_ORIENTATION_ANGLE_NORMAL—Orients the model around an
axis through the view origin and normal to the drawing sheet.
○ VIEW_ORIENTATION_ANGLE_HORIZONTAL—Orients the model
around an axis through the view origin and horizontal to the drawing sheet.
○ VIEW_ORIENTATION_ANGLE_VERTICAL—Orients the model around
an axis through the view origin and vertical to the drawing sheet.
○ VIEW_ORIENTATION_ANGLE_EDGE_AXIS—Orients the model
around an axis through the view origin and according to the designated
angle to the drawing sheet.
• RefAngle—Specifies the angle in degrees with the selected reference.
• AxisSel—Specifies the reference selection. It can be an axis or NULL for other
type.

Sections of a View
Methods Introduced:
• wfcView2D.WView2D.GetDrawingViewSectionType
• wfcView2D.WView2D.GetSection2DInstructions
• wfcView2D.WView2D.SetSection2DInstructions
• wfcView2D.wfcView2D.Section2DInstructions_Create
• wfcView2D.Section2DInstructions.GetSectionAreaType
• wfcView2D.Section2DInstructions.SetSectionAreaType
• wfcView2D.Section2DInstructions.GetSectionName
• wfcView2D.Section2DInstructions.SetSectionName
• wfcView2D.Section2DInstructions.GetReference
• wfcView2D.Section2DInstructions.SetReference
• wfcView2D.Section2DInstructions.GetCurveData
• wfcView2D.Section2DInstructions.SetCurveData
• wfcView2D.Section2DInstructions.GetArrowDisplayView
• wfcView2D.Section2DInstructions.SetArrowDisplayView
• wfcView2D.WView2D.GetSinglePartSection

Drawings 177
• wfcView2D.WView2D.SetSinglePartSection
• wfcView2D.WView2D.Get3DSectionName
• wfcView2D.WView2D.Is3DSectionXHatchingShown
• wfcView2D.WView2D.Set3DSection
The method wfcView2D.WView2D.GetDrawingViewSectionType
retrieves the section type for a specified drawing view using the enumerated data
type wfcView2D.DrawingViewSectionType. A section can be of the
following types:
• VIEW_NO_SECTION—Specifies no section.
• VIEW_TOTAL_SECTION—Specifies the complete drawing view.
• VIEW_AREA_SECTION—Specifies a 2D cross section.
• VIEW_PART_SURF_SECTION—Specifies a 3D cross section.
• VIEW_3D_SECTION—Specifies a section created out of a solid surface or a
datum quilt in the model.
The methods wfcView2D.WView2D.GetSection2DInstructions and
wfcView2D.WView2D.SetSection2DInstructions retrieve and set the
2D cross section for a specified drawing view as a
wfcView2D.Section2DInstructions object.
The method wfcView2D.wfcView2D.Section2DInstructions_
Create creates a data object that contains information about the 2D cross
section.
The methods
wfcView2D.Section2DInstructions.GetSectionAreaType and
wfcView2D.Section2DInstructions.SetSectionAreaType
retrieve and set the type of section area. The section area is given by the
enumerated type wfcView2D.DrawingViewSectionAreaType and can be
of the following types:
• VIEW_SECTION_AREA_FULL—Sectioning is applied to the full drawing
view.
• VIEW_SECTION_AREA_HALF—Sectioning is applied to half drawing view
depending upon the inputs for half side.
• VIEW_SECTION_AREA_LOCAL—Specifies local sectioning.
• VIEW_SECTION_AREA_UNFOLD—Unfold the drawing view and section it.
• VIEW_SECTION_AREA_ALIGNED—Sectioning is as per the aligned views.
The methods wfcView2D.Section2DInstructions.GetSectionName
and wfcView2D.Section2DInstructions.SetSectionName retrieve
and set the name of the 2D cross section.

178 Creo Object TOOLKIT JavaUser’s Guide


The methods wfcView2D.Section2DInstructions.GetReference
and wfcView2D.Section2DInstructions.SetReference retrieve and
set the selection reference as a pfcSelection object.
The methods wfcView2D.Section2DInstructions.GetCurveData
and wfcView2D.Section2DInstructions.SetCurveData retrieve and
set the spline curve data as a pfcGeometry.CurveDescriptor object. The
information about curve geometry is given by the enumerated data type
pfcGeometry.CurveType.
The methods
wfcView2D.Section2DInstructions.GetArrowDisplayView and
wfcView2D.Section2DInstructions.SetArrowDisplayView
retrieve and set the drawing view, that is, either the parent or child view, where the
section arrow is to be displayed.
The method wfcView2D.WView2D.GetSinglePartSection retrieves the
section created out of a solid surface or a datum quilt in the model for a specified
drawing view.
The method wfcView2D.WView2D.SetSinglePartSection assigns the
reference selection as a pfcSelect.Selection object for the solid surface or
datum quilt that is used to create the section in the view.
The method wfcView2D.WView2D.Get3DSectionName retrieves the name
of the 3D cross section for the drawing view.
The method wfcView2D.WView2D.Is3DSectionXHatchingShown
checks if Xhatching is displayed in the 3D cross-sectional view.
The method wfcView2D.WView2D.Set3DSection assigns the following
arguments to define a 3D cross section for a view:
• SectionName—Specifies the name of the 3D cross section.
• ShowXHatch—Specifies a boolean value that determines whether the cross
section hatching must be displayed in the 3D cross-sectional view. Set this
argument to true to display the X-hatching

Visible Areas of Views


Methods Introduced:
• wfcView2D.WView2D.SetVisibleArea
• wfcView2D.WView2D.GetVisibleAreaInstructions
• wfcView2D.VisibleAreaInstruction.GetType
• wfcView2D.BreakAreaInstruction_Create
• wfcView2D.BreakAreaInstruction.GetCurveData
• wfcView2D.BreakAreaInstruction.SetCurveData
• wfcView2D.BreakAreaInstruction.GetFirstBreakLine

Drawings 179
• wfcView2D.BreakAreaInstruction.SetFirstBreakLine
• wfcView2D.BreakAreaInstruction.GetSecondBreakLine
• wfcView2D.BreakAreaInstruction.SetSecondBreakLine
• wfcView2D.BreakAreaInstruction.GetViewBrokenDir
• wfcView2D.BreakAreaInstruction.SetViewBrokenDir
• wfcView2D.BreakAreaInstruction.GetViewBrokenLineStyle
• wfcView2D.BreakAreaInstruction.SetViewBrokenLineStyle
• wfcView2D.BrokenAreaVisibility_Create
• wfcView2D.BrokenAreaVisibility.GetInstructions
• wfcView2D.BrokenAreaVisibility.SetInstructions
• wfcView2D.FullAreaVisibility_Create
• wfcView2D.HalfAreaVisibility_Create
• wfcView2D.HalfAreaVisibility.DisplayLeftSide
• wfcView2D.HalfAreaVisibility.IsLeftSideDisplayed
• wfcView2D.HalfAreaVisibility.GetLineType
• wfcView2D.HalfAreaVisibility.SetLineType
• wfcView2D.HalfAreaVisibility.GetReference
• wfcView2D.HalfAreaVisibility.SetReference
• wfcView2D.PartialAreaVisibility.Create
• wfcView2D.PartialAreaVisibility.GetCurveData
• wfcView2D.PartialAreaVisibility.SetCurveData
• wfcView2D.PartialAreaVisibility.GetReferencePoint
• wfcView2D.PartialAreaVisibility.SetReferencePoint
• wfcView2D.PartialAreaVisibility.IsBoundaryShown
• wfcView2D.PartialAreaVisibility.ShowBoundary
As you detail your model, certain portions of the model may be more relevant
than others or may be clearer if displayed from a different view point. You can
define the visible area of the view to determine which portion or portions to show
or hide.
The method wfcView2D.WView2D.SetVisibleArea assigns the type of
visible area for a specified drawing view using
wfcView2D.VisibleAreaInstruction object.
The method wfcView2D.WView2D.GetVisibleAreaInstructions
retrieves the type of visible area in terms of
wfcView2D.VisibleAreaInstruction object for a specified drawing
view.

180 Creo Object TOOLKIT JavaUser’s Guide


The method wfcView2D.VisibleAreaInstruction.GetType retrieves
the type of visible area for a specified drawing view using the
wfcView2D.DrawingViewVisibleareaType object. The visible area can
be of the following types:
• VIEW_FULL_AREA—The complete drawing view is retained as the visible
area.
• VIEW_HALF_AREA—A portion of the model from the view on one side of a
cutting plane is removed.
• VIEW_PARTIAL_AREA—A portion of the model in a view within a closed
boundary is displayed.
• VIEW_BROKEN_AREA—A portion of the model view from between two or
more selected points is removed, and the gap between the remaining two
portions is closed within a specified distance.

Note
A broken visible area can be created only for general and projected view
types.

The method wfcView2D.BreakAreaInstruction_Create enables you


to create the instructions for a break area in a drawing view. The input arguments
are:
• ViewBrokenDir—Specify the direction of the broken lines that define the
broken area to be removed in terms of the enumerated type
wfcView2D.ViewBrokenDir.
• FirstBreakLine—Specify the selection point in terms of the
pfcSelect.Selection object for the first break line.
• SecondBreakLine—Specify the selection point in terms of the
pfcSelect.Selection object for the second break line.
• ViewBrokenLineStyle—Specifies the line style for the broken lines in terms of
the enumerated type wfcView2D.ViewBrokenLineStyle.
The methods wfcView2D.BreakAreaInstruction.GetCurveData and
wfcView2D.BreakAreaInstruction.SetCurveData retrieve and set
the spline curve data in terms of the pfcGeometry.CurveDescriptor
object. These methods are applicable only for VIEW_BROKEN_LINE_S_
CURVE_GEOMETRY line style.
The methods
wfcView2D.BreakAreaInstruction.GetFirstBreakLine and
wfcView2D.BreakAreaInstruction.SetFirstBreakLine retrieve
and set the selection point in terms of the pfcSelect.Selection object for
the first break line.

Drawings 181
The methods
wfcView2D.BreakAreaInstruction.GetSecondBreakLine and
wfcView2D.BreakAreaInstruction.SetSecondBreakLine retrieve
and set the selection point in terms of the pfcSelect.Selection object for
the second break line.
The methods
wfcView2D.BreakAreaInstruction.GetViewBrokenDir and
wfcView2D.BreakAreaInstruction.SetViewBrokenDir retrieve
and set the direction of the broken lines that define the broken area to be removed.
The direction is given by the enumerated type wfcView2D.ViewBrokenDir
and it takes the following values:
• VIEW_BROKEN_DIR_HORIZONTAL—Specifies the horizontal direction.
• VIEW_BROKEN_DIR_VERTICAL—Specifies the vertical direction.
The methods
wfcView2D.BreakAreaInstruction.GetViewBrokenLineStyle
and
wfcView2D.BreakAreaInstruction.SetViewBrokenLineStyle
retrieve and set the line style for the broken lines in terms of the enumerated type
wfcView2D.ViewBrokenLineStyle. It can be one of the following types:
• VIEW_BROKEN_LINE_STRAIGHT—Specifies a straight broken line.
• VIEW_BROKEN_LINE_SKETCH—Specifies a random sketch drawn by the
user that defines the broken line.
• VIEW_BROKEN_LINE_S_CURVE_OUTLINE—Specifies a S-curve on the
view outline.
• VIEW_BROKEN_LINE_S_CURVE_GEOMETRY—Specifies a S-curve on the
geometry.
• VIEW_BROKEN_LINE_HEART_BEAT_OUTLINE—Specifies a heartbeat
type of curve on the view outline.
• VIEW_BROKEN_LINE_HEART_BEAT_GEOMETRY—Specifies a heartbeat
type of curve on the geometry.
The method wfcView2D.BrokenAreaVisibility_Create enables you
to create a broken visible area in a drawing view. The input argument is
instructions, which is a collection of objects to create the break area.
The methods wfcView2D.BrokenAreaVisibility.GetInstructions
and wfcView2D.BrokenAreaVisibility.SetInstructions retrieve
and set the instructions for a visible broken area in a drawing view.
The method wfcView2D.FullAreaVisibility_Create enables you to
create a full visible area in a drawing view.
The method wfcView2D.HalfAreaVisibility_Create enables you to
create a half visible area in a drawing view.

182 Creo Object TOOLKIT JavaUser’s Guide


The method wfcView2D.HalfAreaVisibility.DisplayLeftSide
displays the left side of the half visible area.
The method
wfcView2D.HalfAreaVisibility.IsLeftSideDisplayed identifies
if the left side of a half visible area is displayed.
The methods wfcView2D.HalfAreaVisibility.GetLineType and
wfcView2D.HalfAreaVisibility.SetLineType retrieve and set the
line type in a half visible area in terms of the enumerated type
wfcView2D.DrawingLineStandardType and it takes the following
values:
• HVL_NONE—Specifies no line.
• HVL_SOLID—Specifies a solid line.
• HVL_SYMMETRY—Specifies a symmetrical line.
• HVL_SYMMETRY_ISO—Specifies an ISO-standard symmetrical line.
• HVL_SYMMETRY_ASME—Specifies an ASME-standard symmetrical line.
The methods wfcView2D.HalfAreaVisibility.GetReference and
wfcView2D.HalfAreaVisibility.SetReference retrieve and set the
selection reference in terms of the pfcSelect.Selectionobject that divides
the drawing view. The cutting plane can be a planar surface or a datum, but it must
be perpendicular to the screen in the new view.
The method wfcView2D.PartialAreaVisibility.Create enables you
to create a partial visible area in a drawing view.
The methods wfcView2D.PartialAreaVisibility.GetCurveData
and wfcView2D.PartialAreaVisibility.SetCurveData retrieve and
set the spline curve data in a partial visible area in terms of the
pfcGeometry.CurveDescriptor object.
The methods
wfcView2D.PartialAreaVisibility.GetReferencePoint and
wfcView2D.PartialAreaVisibility.SetReferencePoint retrieve
and set the reference point in terms of the pfcSelect.Selection object.
The method
wfcView2D.PartialAreaVisibility.IsBoundaryShown identifies if
the boundary of the partial visible area contained within the spline is shown.
The method wfcView2D.PartialAreaVisibility.ShowBoundary
displays or shows the boundary of the partial visible area contained within the
spline.
Refer to the Detailed Drawings module from the Creo Parametric Help for more
information on Visible Area of the View.

Drawings 183
View States
Methods Introduced:
• wfcView2D.WView2D.SetExplodedState
• wfcView2D.WView2D.IsExplodedState
• wfcView2D.WView2D.SetSimpRep
In the method wfcView2D.WView2D.SetExplodedState set the input
argument ExplodedState as true, to display the specified drawing view in the
exploded state.
The method wfcView2D.WView2D.IsExplodedState checks if the
specified view is set to be displayed in the exploded state.
The method wfcView2D.WView2D.SetSimpRep retrieves the simplified
representation for a specified drawing view.

Drawing Models
Methods Introduced:
• wfcDrawing.WDrawing.VisitDrawingModels
The method wfcDrawing.WDrawing.VisitDrawingModels visits the
solids in the specified drawing.

Drawing Edges
The methods described in this section provide access to the display properties
such as color, line font, and thickness of model edges in drawing views. Model
edges can be regular edges, silhouette edges, or non-analytical silhouette edges.

Note
You can select model edges from detailed views for modification, but no
change will be applied. To modify the display of a model edge in a detailed
view, you must select the edge in the parent view.

Methods Introduced:
• wfcDrawing.WDrawing.GetEdgeDisplay
• wfcDrawing.WDrawing.SetEdgeDisplay
• wfcGeometry.wfcGeometry.EdgeDisplay_Create
• wfcGeometry.EdgeDisplay.GetColor

184 Creo Object TOOLKIT JavaUser’s Guide


• wfcGeometry.EdgeDisplay.SetColor
• wfcGeometry.EdgeDisplay.GetFont
• wfcGeometry.EdgeDisplay.SetFont
• wfcGeometry.EdgeDisplay.GetWidth
• wfcGeometry.EdgeDisplay.SetWidth
• wfcDrawing.WDrawing.IsEdgeDisplayGlobal
• wfcDrawing.WDrawing.SetEdgeDisplayGlobal
The methods wfcDrawing.WDrawing.GetEdgeDisplay and
wfcDrawing.WDrawing.SetEdgeDisplay retrieve and set the display
properties of a specified model edge in a drawing view as a
wfcGeometry.EdgeDisplay object. After assigning the properties, you must
repaint the drawing view to update the display.
The method wfcGeometry.wfcGeometry.EdgeDisplay_Create
creates a data object that contains information about the display properties of an
edge in a drawing view.
The methods wfcGeometry.EdgeDisplay.GetColor and
wfcGeometry.EdgeDisplay.SetColor retrieve and set the color to be
used for the display of a specified model edge.
The methods wfcGeometry.EdgeDisplay.GetFont and
wfcGeometry.EdgeDisplay.SetFont retrieve and set the line font to be
used for the display of a specified model edge.
The methods wfcGeometry.EdgeDisplay.GetWidth and
wfcGeometry.EdgeDisplay.SetWidth retrieve and set the width to be
used for the display of a specified model edge. You must pass a value less than
zero to use the default width.
The method wfcDrawing.WDrawing.IsEdgeDisplayGlobal checks if
the model edge display properties such as color, line font, and width have been
applied globally to all the drawing views in the drawing sheet.
The method wfcDrawing.WDrawing.SetEdgeDisplayGlobal sets the
flag that assigns the model edge display properties such as color, line font, and
width globally to all the drawing views in the drawing sheet.

Detail Items
The methods described in this section operate on detail items.
In Creo Object TOOLKIT Java 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 185
• Draft Entities—Contain graphical items created in Creo. The items are as
follows:
○ 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
Creo drawing file.

Listing Detail Items


Methods Introduced:
• 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.
The values of the parameter Type for detail items are:
• ITEM_DTL_ENTITY—Detail Entity
• 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.
The method pfcDetail.DetailItemOwner.ListDetailItems also
lists the detail items in the model. Pass the type of the detail item and the sheet
number that contains the specified detail items.

186 Creo Object TOOLKIT JavaUser’s Guide


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.
The method returns a sequence of detail items and returns a null if no items
matching the input values are found.
The method pfcModelItem.ModelItemOwner.GetItemById returns a
detail item based on the type of the detail item and its integer identifier. The
method returns a null if a detail item with the specified attributes is not found.

Creating a Detail Item


Methods Introduced:
• pfcDetail.DetailItemOwner.CreateDetailItem
• pfcDetail.pfcDetail.DetailGroupInstructions_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.pfcDetail.DetailGroupInstructions_
Create. The method returns the newly created detail item.

Detail Note Data


Methods Introduced:
• wfcDetail.WDetailNoteItem.CollectSymbolInstances
• pfcDetail.DetailNoteItem.GetNoteTextStyle
• pfcDetail.DetailNoteItem.SetNoteTextStyle
The method
wfcDetail.WDetailNoteItem.CollectSymbolInstances retrieves
a list of all the symbol instances that are declared in a detail note. The symbol
instances are returned in the order in which they are seen in the note text.
The methods pfcDetail.DetailNoteItem.GetNoteTextStyle and
pfcDetail.DetailNoteItem.SetNoteTextStyle retrieve and set the
text style for the specified note as a pfcDetail.AnnotationTextStyle
object. Refer to the section AnnotationTextStyles on page 253, for more
information on TextStyles.

Drawings 187
Cross-referencing 3D Notes and Drawing
Annotations
The methods described in this section provide access to the drawing object that
represents a shown 3D note, (if the 3D note is shown in the drawing), or vice-
versa
Methods Introduced:
• wfcGTol.GTOl.GetDetailNote
The method wfcGTol.GTOl.GetDetailNote returns the detail note that
represents a shown geometric tolerance.

Note
This method returns the first detail note that calls out the solid model note.
Creo Parametric does not restrict users to showing only a single version of a
solid model note callout.

Detail Entities
A detail entity in Creo Object TOOLKIT Java is represented by the interface
com.ptc.pfc.pfcDetail.DetailEntityItem. It is a child of the
DetailItem interface.
The interface
com.ptc.pfc.pfcDetail.DetailEntityInstructions contains
specific information used to describe a detail entity item.

Instructions
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

188 Creo Object TOOLKIT JavaUser’s Guide


• 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.
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 returns the created instructions object.

Note
Changes to the values of a pfcDetail.DetailEntityInstructions
object do not take effect until that instructions object is used to modify the
entity using pfcDetail.DetailEntityItem.Modify.

The method pfcDetail.DetailEntityInstructions.GetGeometry


returns the geometry of the detail entity item.
The method pfcDetail.DetailEntityInstructions.SetGeometry
sets the geometry of the detail entity item. For more information refer to Curve
Descriptors on page 398.
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.
The method pfcDetail.DetailEntityInstructions.GetColor
returns the color of the detail entity item.
The method pfcDetail.DetailEntityInstructions.SetColor sets
the color of the detail entity item. Pass null to use the default drawing color.

Drawings 189
The method pfcDetail.DetailEntityInstructions.GetFontName
returns the line style used to draw the entity. The method returns a null value if the
default line style is used.
The method pfcDetail.DetailEntityInstructions.SetFontName
sets the line style for the detail entity item. Pass null to use the default line style.
The method pfcDetail.DetailEntityInstructions.GetWidth
returns the value of the width of the entity line. The method returns a null value if
the default line width is used.
The method pfcDetail.DetailEntityInstructions.SetWidth
specifies the width of the entity line. Pass null to use the default line width.
The method pfcDetail.DetailEntityInstructions.GetView
returns the drawing view associated with the entity. The view can either be a
model view or a drawing sheet background view.
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.

Detail Entities Information


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.
The method pfcDetail.DetailEntityItem.GetSymbolDef returns the
symbol definition that contains the entity. This method returns a null value if the
entity is not a part of a symbol definition.

Detail Entities Operations


Methods Introduced:
• 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.
The method pfcDetail.DetailEntityItem.Erase undraws a detail
entity item temporarily, so that it is redrawn during the next draft regeneration.

190 Creo Object TOOLKIT JavaUser’s Guide


The method pfcDetail.DetailEntityItem.Modify modifies the
definition of an entity item using the specified instructions data object.

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 Creo. You can create
and insert supported OLE objects into a two-dimensional Creo file, such as a
drawing, report, format file, notebook, 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.
The method pfcDetail.DetailOLEObject.GetOutline returns the
extent of the OLE object embedded in the drawing.
The method pfcDetail.DetailOLEObject.GetPath returns the path to
the external file for each OLE object, if it is linked to an external file.
The method pfcDetail.DetailOLEObject.GetSheet returns the sheet
number for the OLE object.

Detail Notes
A detail note in Creo Object TOOLKIT Java is represented by the interface
com.ptc.pfc.pfcDetail.DetailNoteItem. It is a child of the
DetailItem interface.
The interface com.ptc.pfc.pfcDetail.DetailNoteInstructions
contains specific information that describes a detail note.

Instructions
Methods Introduced:
• pfcDetail.pfcDetail.DetailNoteInstructions_Create
• pfcDetail.DetailNoteInstructions.GetTextLines

Drawings 191
• pfcDetail.DetailNoteInstructions.SetTextLines
• pfcDetail.DetailNoteInstructions.GetIsDisplayed
• pfcDetail.DetailNoteInstructions.SetIsDisplayed
• pfcDetail.DetailNoteInstructions.GetIsReadOnly
• pfcDetail.DetailNoteInstructions.SetIsReadOnly
• pfcDetail.DetailNoteInstructions.GetIsMirrored
• 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.

Note
Changes to the values of a pfcDetail.DetailNoteInstructions
object do not take effect until that instructions object is used to modify the
note using pfcDetail.DetailNoteItem.Modify

The method pfcDetail.DetailNoteInstructions.GetTextLines


returns the description of text line contents in the note.
The method pfcDetail.DetailNoteInstructions.SetTextLines
sets the description of the text line contents in the note.

192 Creo Object TOOLKIT JavaUser’s Guide


The method
pfcDetail.DetailNoteInstructions.GetIsDisplayed returns a
boolean indicating if the note is currently displayed.
The method
pfcDetail.DetailNoteInstructions.SetIsDisplayed sets the
display flag for the note.
The method pfcDetail.DetailNoteInstructions.GetIsReadOnly
determines whether the note can be edited by the user, while the method
pfcDetail.DetailNoteInstructions.SetIsReadOnly toggles the
read only status of the note.
The method pfcDetail.DetailNoteInstructions.GetIsMirrored
determines whether the note is mirrored, while the method
pfcDetail.DetailNoteInstructions.SetIsMirrored toggles the
mirrored status of the note.
The method pfcDetail.DetailNoteInstructions.GetHorizontal
returns the value of the horizontal justification of the note, while the method
pfcDetail.DetailNoteInstructions.SetHorizontal sets the
value of the horizontal justification of the note.
The method pfcDetail.DetailNoteInstructions.GetVertical
returns the value of the vertical justification of the note, while the method
pfcDetail.DetailNoteInstructions.SetVertical sets the value
of the vertical justification of the note.
The method pfcDetail.DetailNoteInstructions.GetColor returns
the color of the detail note item. The method returns a null value to represent the
default drawing color.
Use the method pfcDetail.DetailNoteInstructions.SetColor to
set the color of the detail note item. Pass null to use the default drawing color.
The method pfcDetail.DetailNoteInstructions.GetLeader
returns the locations of the detail note item and information about the leaders.
The method pfcDetail.DetailNoteInstructions.SetLeader sets
the values of the location of the detail note item and the locations where the
leaders are attached to the drawing.
The method pfcDetail.DetailNoteInstructions.GetTextAngle
returns the value of the angle of the text used in the note. The method returns a
null value if the angle is 0.0.
The method pfcDetail.DetailNoteInstructions.SetTextAngle
sets the value of the angle of the text used in the note. Pass null to use the angle
0.0.

Drawings 193
Detail Notes Information
Methods Introduced:
• 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.

Note
Creo 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.
The method pfcDetail.DetailNoteItem.GetLineEnvelope
determines the screen coordinates of the envelope around the detail note. This
envelope is defined by four points. The following figure illustrates how the point
order is determined.

The ordering of the points is maintained even if the notes are mirrored or are at an
angle.
The method pfcDetail.DetailNoteItem.GetModelReference
returns the model referenced by the parameterized text in a note. The model is
referenced based on the line number and the text index where the parameterized
text appears.

194 Creo Object TOOLKIT JavaUser’s Guide


Details Notes Operations
Methods Introduced:
• pfcDetail.DetailNoteItem.Draw
• pfcDetail.DetailNoteItem.Show
• pfcDetail.DetailNoteItem.Erase
• pfcDetail.DetailNoteItem.Remove
• pfcDetail.DetailNoteItem.KeepArrowTypeAsIs
• pfcDetail.DetailNoteItem.Modify
The method pfcDetail.DetailNoteItem.Draw temporarily draws a
detail note item, so that it is removed during the next draft regeneration.
The method pfcDetail.DetailNoteItem.Show displays the note item,
such that it is repainted during the next draft regeneration.
The method pfcDetail.DetailNoteItem.Erase undraws a detail note
item temporarily, so that it is redrawn during the next draft regeneration.
The method pfcDetail.DetailNoteItem.Remove undraws a detail note
item permanently, so that it is not redrawn during the next draft regeneration.
The method pfcDetail.DetailNoteItem.KeepArrowTypeAsIs allows
you to keep arrow type of the leader note as it is, after a note is modified. You
must call this method before the method
pfcDetail.DetailNoteItem.Modify is called.
The method pfcDetail.DetailNoteItem.Modify modifies the definition
of an existing detail note item based on the instructions object that describes the
new detail note item.

Detail Groups
A detail group in Creo Object TOOLKIT Java is represented by the interface
com.ptc.pfc.pfcDetail.DetailGroupItem. It is a child of the
DetailItem interface .
The interface com.ptc.pfc.pfcDetail.DetailGroupInstructions
contains information used to describe a detail group item.

Instructions
Method Introduced:
• pfcDetail.pfcDetail.DetailGroupInstructions_Create
• pfcDetail.DetailGroupInstructions.GetName
• pfcDetail.DetailGroupInstructions.SetName

Drawings 195
• 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.

Note
Changes to the values of a pfcDetail.DetailGroupInstructions
object do not take effect until that instructions object is used to modify the
group using pfcDetail.DetailGroupItem.Modify.

The method pfcDetail.DetailGroupInstructions.GetName returns


the name of the detail group.
The method pfcDetail.DetailGroupInstructions.SetName sets the
name of the detail group.
The method pfcDetail.DetailGroupInstructions.GetElements
returns the sequence of the detail items(notes, groups and entities) contained in the
group.
The method pfcDetail.DetailGroupInstructions.SetElements
sets the sequence of the detail items contained in the 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.

Detail Groups Information


Method Introduced:
• 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.

196 Creo Object TOOLKIT JavaUser’s Guide


Detail Groups Operations
Methods Introduced:
• 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.
The method pfcDetail.DetailGroupItem.Erase temporarily undraws a
detail group item, so that it is redrawn during the next draft generation.
The method pfcDetail.DetailGroupItem.Modify changes the
definition of a detail group item based on the data object that describes how to
construct a detail group item.

Detail Symbols
Detail Symbol Definitions
A detail symbol definition in Creo Object TOOLKIT Java is represented by the
interfacepfcDetail.DetailSymbolDefItem. It is a child of the
DetailItem interface.
The interfacepfcDetail.DetailSymbolDefInstructions contains
information that describes a symbol definition. It can be used when creating
symbol definition entities or while accessing existing symbol definition entities.

Instructions
Methods Introduced:
• pfcDetail.pfcDetail.DetailSymbolDefInstructions_Create
• pfcDetail.DetailSymbolDefInstructions.GetSymbolHeight
• pfcDetail.DetailSymbolDefInstructions.SetSymbolHeight
• pfcDetail.DetailSymbolDefInstructions.GetHasElbow
• pfcDetail.DetailSymbolDefInstructions.SetHasElbow
• pfcDetail.DetailSymbolDefInstructions.GetIsTextAngleFixed
• pfcDetail.DetailSymbolDefInstructions.SetIsTextAngleFixed
• pfcDetail.DetailSymbolDefInstructions.GetScaledHeight
• pfcDetail.DetailSymbolDefInstructions.GetAttachments
• pfcDetail.DetailSymbolDefInstructions.SetAttachments
• pfcDetail.DetailSymbolDefInstructions.GetFullPath

Drawings 197
• 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.

Note
Changes to the values of a
pfcDetail.DetailSymbolDefInstructions object do not take
effect until that instructions object is used to modify the definition using the
method pfcDetail.DetailSymbolDefItem.Modify.

The method
pfcDetail.DetailSymbolDefInstructions.GetSymbolHeight
returns the value of the height type for the symbol definition. The symbol
definition height options are as follows:
• SYMDEF_FIXED—Symbol height is fixed.
• SYMDEF_VARIABLE—Symbol height is variable.
• SYMDEF_RELATIVE_TO_TEXT—Symbol height is determined relative to
the text height.
The method
pfcDetail.DetailSymbolDefInstructions.SetSymbolHeight
sets the value of the height type for the symbol definition.
The method
pfcDetail.DetailSymbolDefInstructions.GetHasElbow
determines whether the symbol definition includes an elbow.
The method
pfcDetail.DetailSymbolDefInstructions.SetHasElbow decides
if the symbol definition should include an elbow.
The method
pfcDetail.DetailSymbolDefInstructions.GetIsTextAngle
Fixed returns whether the text of the angle is fixed.
The method
pfcDetail.DetailSymbolDefInstructions.SetIsTextAngle
Fixed toggles the requirement that the text angle be fixed.

198 Creo Object TOOLKIT JavaUser’s Guide


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.

Detail Symbol Definitions Information


Methods Introduced:
• pfcDetail.DetailSymbolDefItem.ListDetailItems
• pfcDetail.DetailSymbolDefItem.GetInstructions
The method pfcDetail.DetailSymbolDefItem.ListDetailItems
lists the detail items in the symbol definition based on the type of the detail item.
The method pfcDetail.DetailSymbolDefItem.GetInstructions
returns an instruction data object that describes how to construct the symbol
definition.

Detail Symbol Definitions Operations


Methods Introduced:

Drawings 199
• 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.
The method pfcDetail.DetailSymbolDefItem.Modify modifies a
symbol definition based on the instructions data object that contains information
about the modifications to be made to the symbol definition.

Retrieving Symbol Definitions


Methods Introduced:
• pfcDetail.DetailItemOwner.RetrieveSymbolDefItem
From Creo 4.0 F000 onwards, the method
pfcDetail.DetailItemOwner.RetrieveSymbolDefinition has
been deprecated. Use the method
pfcDetail.DetailItemOwner.RetrieveSymbolDefItem instead.
Creo Parametric symbols exist in two different areas: the user-defined area and the
system symbols area.
The method
pfcDetail.DetailItemOwner.RetrieveSymbolDefItem retrieves a
symbol definition from the user-defined location designated by the configuration
option pro_symbol_dir. The symbol definition should have been previously
saved to a file using Creo Parametric.
The method
pfcDetail.DetailItemOwner.RetrieveSymbolDefItem also
retrieves a symbol definition from the system directory. The system area contains
symbols provided by Creo Parametric with the Detail module (such as the
Welding Symbols Library).
The input parameters of this method are:
• FileName—Name of the symbol definition file
• Source—Source of the symbol definition file. The input parameter Source is
defined by the enumerated type
pfcDetail.DetailSymbolDefItemSource. The valid values which
are supported are listed below:
○ DTLSYMDEF_SRC_SYSTEM—Specifies the system symbol definition
directory.
○ DTLSYMDEF_SRC_PATH—Specifies the absolute path to a directory
containing the symbol definition.

200 Creo Object TOOLKIT JavaUser’s Guide


• FilePath—Path to the symbol definition file. It is relative to the path specified
by the option "pro_symbol_dir" in the configuration file. A null value
indicates that the function should search the current directory.
• Version—Numerical version of the symbol definition file. A null value
retrieves the latest version.
• UpdateUnconditionally—True if Creo should update existing instances of this
symbol definition, or false to quit the operation if the definition exists in the
model.
The method returns the retrieved symbol definition.

Detail Symbol Instances


A detail symbol instance in Creo Object TOOLKIT Java is represented by the
interfacepfcDetail.DetailSymbolInstItem. It is a child of the
DetailItem interface .
The interfaceDetail.DetailSymbolInstInstructions contains
information that describes a symbol instance. It can be used when creating symbol
instances and while accessing existing groups.

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
• pfcDetail.DetailSymbolInstInstructions.GetScaledHeight
• pfcDetail.DetailSymbolInstInstructions.SetScaledHeight

Drawings 201
• pfcDetail.DetailSymbolInstInstructions.GetTextValues
• pfcDetail.DetailSymbolInstInstructions.SetTextValues
• pfcDetail.DetailSymbolInstInstructions.GetCurrentTransform
• pfcDetail.DetailSymbolInstInstructions.SetGroups
The method
pfcDetail.pfcDetail.DetailSymbolInstInstructions_Create
creates a data object that contains information about the placement of a symbol
instance.

Note
Changes to the values of a
pfcDetail.DetailSymbolInstInstructions object do not take
effect until that instructions object is used to modify the instance using
pfcDetail.DetailSymbolInstItem.Modify.

The method
pfcDetail.DetailSymbolInstInstructions.GetIsDisplayed
returns a value that specifies whether the instance of the symbol is displayed.
Use the method
pfcDetail.DetailSymbolInstInstructions.SetIsDisplayed to
switch the display of the 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.SetColor sets the
color of the detail symbol instance. Pass null to use the default drawing color.
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.
The method
pfcDetail.DetailSymbolInstInstructions.GetAttachOnDef
Type 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:

202 Creo Object TOOLKIT JavaUser’s Guide


• SYMDEFATTACH_FREE—Attachment on a free point.
• SYMDEFATTACH_LEFT_LEADER—Attachment via a leader on the left side
of the symbol.
• SYMDEFATTACH_RIGHT_LEADER— Attachment via a leader on the right
side of the symbol.
• SYMDEFATTACH_RADIAL_LEADER—Attachment via a leader at a radial
location.
• SYMDEFATTACH_ON_ITEM—Attachment on an item in the symbol
definition.
• SYMDEFATTACH_NORMAL_TO_ITEM—Attachment normal to an item in
the symbol definition.
The method
pfcDetail.DetailSymbolInstInstructions.SetAttachOnDef
Type sets the attachment type of the instance.
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.GetInstAttach
ment returns the value of the attachment of the instance that includes location and
leader information.
The method
pfcDetail.DetailSymbolInstInstructions.SetInstAttach
ment 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.SetAngle sets the
value of the angle at which the instance is placed.
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 Creo user interface.

Drawings 203
Note
The scaled height obtained using the above method is partially based on the
properties of the symbol definition assigned using the method
pfcDetail.DetailSymbolInstInstructions.GetSymbolDef.
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.GetCurrentTrans
form 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:
• 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.
• 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 on page 205 for more information on
detail symbol groups.

Detail Symbol Instances Information


Method Introduced:

204 Creo Object TOOLKIT JavaUser’s Guide


• 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.

Detail Symbol Instances Operations


Methods Introduced:
• 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.
The method pfcDetail.DetailSymbolInstItem.Erase undraws a
symbol instance temporarily from the display to be redrawn on the next draft
generation.
The method pfcDetail.DetailSymbolInstItem.Show displays a
symbol instance to be repainted on the next draft regeneration.
The method pfcDetail.DetailSymbolInstItem.Remove deletes a
symbol instance permanently.
The method pfcDetail.DetailSymbolInstItem.Modify modifies a
symbol instance based on the instructions data object that contains information
about the modifications to be made to the symbol instance.

Detail Symbol Groups


A detail symbol group in Creo Object TOOLKIT Java is represented by the
interfacepfcDetail.DetailSymbolGroup. It is a child of the
pfcObject.Object interface. A detail symbol group is accessible only as a
part of the contents of a detail symbol definition or instance.
The interface pfcDetail.DetailSymbolGroupInstructions contains
information that describes a symbol group. It can be used when creating new
symbol groups, or while accessing or modifying existing groups.

Drawings 205
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.

Note
Changes to the values of the
pfcDetail.DetailSymbolGroupInstructions data object do not
take effect until this object is used to modify the instance using the method
pfcDetail.DetailSymbolGroup.Modify.

The method
pfcDetail.DetailSymbolGroupInstructions.GetItems returns
the list of detail items included in the symbol group.
The method
pfcDetail.DetailSymbolGroupInstructions.SetItems sets 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.

Detail Symbol Group Information


Methods Introduced:
• pfcDetail.DetailSymbolGroup.GetInstructions
• pfcDetail.DetailSymbolGroup.GetParentGroup
• pfcDetail.DetailSymbolGroup.GetParentDefinition

206 Creo Object TOOLKIT JavaUser’s Guide


• 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.GetParentGroup
returns the parent symbol group to which a given symbol group belongs.
The method
pfcDetail.DetailSymbolGroup.GetParentDefinition returns the
symbol definition of a given symbol group.
The method pfcDetail.DetailSymbolGroup.ListChildren lists the
subgroups of a given symbol group.
The method pfcDetail.DetailSymbolDefItem.ListSubgroups lists
the subgroups of a given symbol group stored in the symbol definition at the
indicated level.
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.
The method pfcDetail.DetailSymbolInstItem.ListGroups lists the
symbol groups included in a symbol instance. The SymbolGroupFilter
argument determines the types of symbol groups that can be listed. It takes the
following values:
• DTLSYMINST_ALL_GROUPS—Retrieves all groups in the definition of the
symbol instance.
• DTLSYMINST_ACTIVE_GROUPS—Retrieves only those groups that are
actively shown in the symbol instance.
• DTLSYMINST_INACTIVE_GROUPS—Retrieves only those groups that are
not shown in the symbol instance.

Detail Symbol Group Operations


Methods Introduced:
• pfcDetail.DetailSymbolGroup.Delete
• pfcDetail.DetailSymbolGroup.Modify

Drawings 207
• 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.
The method pfcDetail.DetailSymbolGroup.Modify modifies the
specified symbol group based on the
pfcDetail.DetailSymbolGroupInstructions data object that
contains information about the modifications that can be made to the symbol
group.
The method pfcDetail.DetailSymbolDefItem.CreateSubgroup
creates a new subgroup in the symbol definition at the indicated level below the
parent group.
The method
pfcDetail.DetailSymbolDefItem.SetSubgroupLevelExclusive
makes the subgroups of a symbol group exclusive at the indicated level in the
symbol definition.

Note
After you set the subgroups of a symbol group as exclusive, only one of the
groups at the indicated level can be active in the model at any time.

The method
pfcDetail.DetailSymbolDefItem.SetSubgroupLevelIndepend
ent makes the subgroups of a symbol group independent at the indicated level in
the symbol definition.

Note
After you set the subgroups of a symbol group as independent, any number of
groups at the indicated level can be active in the model at any time.

Detail Attachments
A detail attachment in Creo Object TOOLKIT Java is represented by the
interfacepfcDetail.Attachment. It is used for the following tasks:

208 Creo Object TOOLKIT JavaUser’s Guide


• The way in which a drawing note or a symbol instance is placed in a drawing.
• The way in which a leader on a drawing note or symbol instance is attached.
Method Introduced:
• pfcDetail.Attachment.GetType
The method pfcDetail.Attachment.GetType returns the
pfcDetail.AttachmentTypeobject containing the types of detail
attachments. The detail attachment types are as follows:
• ATTACH_FREE—The attachment is at a free point possibly with respect to a
given drawing view.
• ATTACH_PARAMETRIC—The attachment is to a point on a surface or an
edge of a solid.
• ATTACH_OFFSET—The attachment is offset to another drawing view, to a
model item, or to a 3D model annotation.
• ATTACH_TYPE_UNSUPPORTED—The attachment is to an item that cannot
be represented in PFC at the current time. However, you can still retrieve the
location of the attachment.

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.
The method pfcDetail.FreeAttachment.SetAttachmentPoint sets
the attachment point.
The method pfcDetail.FreeAttachment.GetView returns the drawing
view to which the attachment is related. The attachment point is relative to the
drawing view, that is the attachment point moves when the drawing view is
moved. This method returns a NULL value, if the detail attachment is not related
to a drawing view, but is placed at the specified location in the drawing sheet, or if
the attachment is offset to a model item or to a 3D model annotation.

Drawings 209
The method pfcDetail.FreeAttachment.SetView sets the drawing
view.

Parametric Attachment
The ATTACH_PARAMETRIC detail attachment type is represented by the
interfacepfcDetail.ParametricAttachment. It is a child of the
pfcDetail.Attachment interface.
Methods Introduced:
• pfcDetail.ParametricAttachment.GetAttachedGeometry
• pfcDetail.ParametricAttachment.SetAttachedGeometry
The method
pfcDetail.ParametricAttachment.GetAttachedGeometry returns
the pfcSelect.Selection object representing the item to which the detail
attachment is attached. This includes the drawing view in which the attachment is
made.
The method
pfcDetail.ParametricAttachment.SetAttachedGeometry
assigns the pfcSelect.Selection object representing the item to which the
detail attachment is attached. This object must include 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.

210 Creo Object TOOLKIT JavaUser’s Guide


The method pfcDetail.OffsetAttachment.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 distance from the attachment point to the location of the
item to which the detail attachment is attached is saved as the offset distance.
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 interfacepfcDetail.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.

Drawings 211
12
Solid
Getting a Solid Object .............................................................................................. 213
Solid Information ..................................................................................................... 213
Displaying a Solid.................................................................................................... 214
Solid Operations...................................................................................................... 214
Regenerating a Solid ............................................................................................... 217
Combined States of a Solid ...................................................................................... 220
Solid Units .............................................................................................................. 224
Mass Properties ...................................................................................................... 230
Part Properties ........................................................................................................ 231
Annotations ............................................................................................................ 231
Materials................................................................................................................. 232

Most of the objects and methods in Creo Object TOOLKIT Java 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.

212 Creo Object TOOLKIT JavaUser’s Guide


Getting a Solid Object
Methods Introduced:
• pfcSession.BaseSession.CreatePart
• pfcSession.BaseSession.CreateAssembly
• pfcAssembly.ComponentPath.GetRoot
• pfcAssembly.ComponentPath.GetLeaf
• pfcMFG.MFG.GetSolid
• wfcSession.WSession.GetSolid
The methods pfcSession.BaseSession.CreatePart and
pfcSession.BaseSession.CreateAssembly create new solid models
with the names you specify.
The methods pfcAssembly.ComponentPath.GetRoot and
pfcAssembly.ComponentPath.GetLeaf specify the solid objects that
make up the component path of an assembly component model. You can get a
component path object from any component that has been interactively selected.
The method pfcMFG.MFG.GetSolid retrieves the storage solid in which the
manufacturing model’s features are placed. In order to create a UDF group in the
manufacturing model, call the method pfcSolid.Solid.CreateUDFGroup
on the storage solid.
The method wfcSession.WSession.GetSolid returns the handle to the
specified solid. You must specify the name of the solid and the solid type as the
input arguments.

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).

Solid 213
Note
For a change in accuracy to take effect, you must regenerate the model.

Displaying a Solid
Method Introduced:
• wfcSolid.WSolid.DisplaySolid
The method wfcSolid.WSolid.DisplaySolid displays the specified solid
in the current Creo window. This method does not make the solid as the current
object in the Creo application.

Solid Operations
Methods Introduced:
• pfcSolid.Solid.GetGeomOutline
• pfcSolid.Solid.EvalOutline
• pfcSolid.Solid.GetIsSkeleton
• pfcSolid.Solid.ListGroups
• wfcSolid.WSolid.GetSolidFeatureStatusFlags
• wfcSolid.WSolid.GetIsNoResolveMode
• wfcCombState.StyleState.IsStyleStateDefault
• wfcSolid.WSolid.GetStyleStateFromName
• wfcSolid.WSolid.GetStyleStateFromId
• wfcSolid.WSolid.GetActiveStyleState
• wfcSolid.WSolid.ActivateStyleState
• wfcSolid.WSolid.ListStyleStateItems
• wfcSolid.WSolid.GetDisplayOutline
• wfcSolid.WSolid.FindShellsAndVoids
• wfcSolid.ShellData.GetShellOrders
• wfcSolid.ShellOrder.GetOrientation
• wfcSolid.ShellOrder.GetFirstFace
• wfcSolid.ShellOrder.GetNumberOfFaces
• wfcSolid.ShellOrder.GetAmbientShell

214 Creo Object TOOLKIT JavaUser’s Guide


• wfcSolid.ShellData.GetShellFaces
• wfcSolid.ShellFace.GetSurfaceId
• wfcSolid.ShellFace.GetContour
• wfcSolid.WSolid.CheckFamilyTable
The method pfcSolid.Solid.GetGeomOutline returns the three-
dimensional bounding box for the specified solid.

Note
Do not use pfcSolid.Solid.GetGeomOutline to calculate the outline
of a solid as the dimensions of the boundary box could be slightly bigger than
the outline dimensions of the geometry. Use
pfcSolid.Solid.EvalOutline to compute an accurate outline of a
solid.

The method pfcSolid.Solid.EvalOutline also returns a three-


dimensional bounding box, but you can specify the coordinate system used to
compute the extents of the solid object.
The method pfcSolid.Solid.GetIsSkeleton determines whether the
part model is a skeleton or a concept model. It returns a true value if the model is
a skeleton, else it returns a false.
The method pfcSolid.Solid.ListGroups returns the list of groups
(including UDFs) in the solid.
The method wfcSolid.WSolid.GetSolidFeatureStatusFlags
returns a list of objects representing the status of each feature in the model.
The method wfcSolid.WSolid.GetIsNoResolveMode returns True if
the model regeneration is set to no resolve mode.
The method wfcCombState.StyleState.IsStyleStateDefault
determines if the display style of the solid component is the default style for the
owner model.
The method wfcSolid.WSolid.GetStyleStateFromName returns the
handle to the specified style state in the component with the style state name as
the input argument.
The method wfcSolid.WSolid.GetStyleStateFromId returns the
handle to the specified style state in the component with the style state ID as the
input argument.
Use the method wfcSolid.WSolid.GetActiveStyleState to get the
current active style state in the solid.

Solid 215
The method wfcSolid.WSolid.ActivateStyleState activates the
specified style state as current display style. The input arguments to this method
are:
• WStyleState—Specifies the handle to the style state.
• RedisplayFlag—Specifies if the assembly must be displayed to the set display
style in the call to the method. If set to True, user must call the required
methods to regenerate the assembly.
The method wfcSolid.WSolid.ListStyleStateItems returns a list of
style states in the solid.
The method wfcSolid.WSolid.GetDisplayOutline returns the
maximum and minimum values of x, y, and z coordinates for the display outline of
the solid, with respect to the default coordinate system.
The method wfcSolid.WSolid.FindShellsAndVoids returns a list of
surface-contour pairs for each shell and void in the solid as a ShellData object.
When a surface is split it has more than one external contour. In this case the
contours may belong to different shells.
The method wfcSolid.ShellData.GetShellOrders returns information
about the ordered list of surface-contour pairs in a solid.
The method wfcSolid.ShellOrder.GetOrientation returns an integer
value to indicate the orientation of the shell. 1 specifies that the shell is oriented
outward and -1 specifies that the shell is oriented inward, that is, it is a void.
The method wfcSolid.ShellOrder.GetFirstFace returns the index of
the first face for the specified shell or void.
The method wfcSolid.ShellOrder.GetNumberOfFaces returns the
number of faces in the shell.
A single shell or void can consist of many shells or voids within it. The method
wfcSolid.ShellOrder.GetAmbientShell returns the index of the
ambient shell, that is, the smallest shell inside which the specified shell is located.
The method returns -1 if the specified shell is external and is not located inside
any other shell.
The method wfcSolid.ShellData.GetShellFaces returns information
about the shell surface and contour.
The method wfcSolid.ShellFace.GetSurfaceId returns the ID of the
shell surface.
The method wfcSolid.ShellFace.GetContour returns the information
about the contour as a Contour object.
Use the method wfcSolid.WSolid.CheckFamilyTable to check if the
specified solid has a family table associated with it. The method also checks
whether the associated family table is empty.

216 Creo Object TOOLKIT JavaUser’s Guide


Regenerating a Solid
Methods Introduced:
• pfcSolid.Solid.Regenerate
• pfcSolid.pfcSolid.RegenInstructions_Create
• pfcSolid.RegenInstructions.SetAllowFixUI
• pfcSolid.RegenInstructions.SetForceRegen
• pfcSolid.RegenInstructions.SetFromFeat
• pfcSolid.RegenInstructions.SetRefreshModelTree
• pfcSolid.RegenInstructions.SetResumeExcludedComponents
• pfcSolid.RegenInstructions.SetUpdateAssemblyOnly
• pfcSolid.RegenInstructions.SetUpdateInstances
• wfcSolid.WSolid.WRegenerate
• wfcSolidInstructions.WRegenInstructions_Create
• wfcSolidInstructions.WRegenInstructions.GetNoResolveMode
• wfcSolidInstructions.WRegenInstructions.SetNoResolveMode
• wfcSolidInstructions.WRegenInstructions.GetResolveMode
• wfcSolidInstructions.WRegenInstructions.SetResolveMode
• wfcSolidInstructions.WRegenInstructions.GetAllowConfirm
• wfcSolidInstructions.WRegenInstructions.SetAllowConfirm
• wfcSolidInstructions.WRegenInstructions.GetUndoIfFail
• wfcSolidInstructions.WRegenInstructions.SetUndoIfFail
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.
In the No-Resolve mode, if a model and feature regeneration fails, failed features
and children of failed features are created and regeneration of other features
continues. However, Creo Object TOOLKIT Java does not support regeneration in
this mode. The method pfcSolid.Solid.Regenerate throws an exception
pfcExceptions.XToolkitBadContext, if Creo Parametric is running in
the No-Resolve mode. To continue with the Pro/ENGINEER Wildfire 4.0
behavior in the Resolve mode, set the configuration option regen_failure_
handling to resolve_mode in the Creo Parametric session.

Solid 217
Note
Setting the configuration option to switch to Resolve mode ensures the old
behavior as long as you do not retrieve the models saved under the No-
Resolve mode. To consistently preserve the old behavior, use Resolve mode
from the beginning and throughout your Creo Parametric session.

The pfcSolid.RegenInstructions object contains the following input


parameters:
• 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, Creo 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 Creo 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 Creo 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

218 Creo Object TOOLKIT JavaUser’s Guide


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.
• UpdateInstances—Updates the instances of the solid model in memory. This
may slow down the regeneration process. By default, this attribute is false.
Use the method
pfcSolid.RegenInstructions.SetUpdateInstances to modify
this parameter.
The method wfcSolid.WSolid.WRegenerate regenerates the model
according to the regeneration instructions provided in the form of the
WRegenInstructions object. The WRegenInstructions object contains
the following input parameters:
• NoResolveMode—Gets and sets the no resolve mode in a model using the
methods
wfcSolidInstructions.WRegenInstructions.GetNoResolve
Mode and
wfcSolidInstructions.WRegenInstructions.SetNoResolve
Mode
• ResolveMode—Gets and sets the resolve mode in a model using the methods
wfcSolidInstructions.WRegenInstructions.GetResolve
Mode and
wfcSolidInstructions.WRegenInstructions.SetResolve
Mode

Note
The NoResolveMode and ResolveMode temporarily override the default
settings, which control the regeneration behavior in a model.

AllowConfirm—This parameter has been deprecated from Creo Parametric 4.0


M030. Gets and sets the state of regeneration failure window in a model using
the methods
wfcSolidInstructions.WRegenInstructions.GetAllowCon

Solid 219
firm and
wfcSolidInstructions.WRegenInstructions.SetAllowCon
firm.

Note
The interactive dialog box which provided an option to retain failed
features and children of failed features, if regeneration fails is no longer
supported. Creo Parametric displays a warning message which gives
details of failed features.

• UndoIfFail—If possible, gets and sets the undo mode if the regeneration of the
model fails using the methods
wfcSolidInstructions.WRegenInstructions.GetUndoIf
Fail and
wfcSolidInstructions.WRegenInstructions.SetUndoIf
Fail

Note
The AllowConfirm and UndoIfFail cannot be used together and are
applicable only when the input parameter is NoResolveMode in a model.

The method wfcSolidInstructions.WRegenInstructions_Create


creates instructions for regenerating a model.

Combined States of a Solid


With a combined state, you can combine and apply multiple display states to a
Creo model. Combined states are composed of the following two or more display
states:
• Saved Views
• Layer state
• Annotations
• Cross section
• Exploded view
• Simplified representation
• Model style
Methods Introduced:

220 Creo Object TOOLKIT JavaUser’s Guide


• wfcSolid.WSolid.ListCombStates
• wfcCombState.CombState.GetCombStateData
• wfcCombState.wfcCombState.CombStateData_Create
• wfcCombState.CombStateData.GetCombStateName
• wfcCombState.CombStateData.GetReferences
• wfcCombState.CombStateData.SetReferences
• wfcCombState.CombStateData.GetClipOption
• wfcCombState.CombStateData.SetClipOption
• wfcCombState.CombStateData.GetIsExploded
• wfcCombState.CombStateData.SetIsExploded
• wfcSolid.WSolid.CreateCombState
• wfcCombState.CombState.RedefineCombState
• wfcSolid.WSolid.GetActiveCombState
• wfcSolid.WSolid.ActivateCombState
• wfcSolid.WSolid.DeleteCombState
• wfcCombState.CombState.GetAnnotations
• wfcCombState.wfcCombState.CombStateAnnotation_Create
• wfcCombState.CombStateAnnotation.GetAnnotation
• wfcCombState.CombStateAnnotation.SetAnnotation
• wfcCombState.CombStateAnnotation.GetOption
• wfcCombState.CombStateAnnotation.SetOption
• wfcCombState.CombState.AddAnnotations
• wfcCombState.CombState.RemoveAnnotations
• wfcCombState.CombState.EraseAnnotation
• wfcCombState.CombState.GetStateOfAnnotations
• wfcCombState.CombState.IsDefault
• wfcCombState.CombState.IsPublished
The method wfcSolid.WSolid.ListCombStates returns a list of
combined states in the specified solid.
The method wfcCombState.CombState.GetCombStateData returns
information for a specified combined state as a CombStateData object.
The method wfcCombState.wfcCombState.CombStateData_Create
creates a wfcCombState.CombStateData data object that contains
information about the specified combined state.

Solid 221
The method wfcCombState.CombStateData.GetCombStateName
returns the name of the combined state.
Use the methods wfcCombState.CombStateData.GetReferences and
wfcCombState.CombStateData.SetReferences get and set an array of
reference states of the type ModelItem.
The methods wfcCombState.CombStateData.GetClipOption and
wfcCombState.CombStateData.SetClipOption get and set the cross
section clip. This is applicable only in case of a valid reference of the type ITEM_
XSEC. The ITEM_XSEC item represents a wfcXSection object or a zone
feature. The values for the cross section clip are specified by the enumerated type
wfcCombState.CrossSectionClipOption. The valid values are as
follows:
• VIS_OPT_NONE—Specifies that the cross section or zone feature is not
clipped.
• VIS_OPT_FRONT—Specifies that the cross section or zone feature is clipped
by removing the material on the front side. The front side is where the positive
normals of the planes of the cross section or zone feature are directed.
• VIS_OPT_BACK—Specifies that the cross section or zone feature is clipped
by removing the material on the back side.
The method wfcCombState.CombStateData.GetIsExploded returns a
boolean value that specifies if the combined state is exploded. This value is
available only if when a valid pfcITEM_EXPLODED_STATE reference state is
retrieved. It is not available for Creo parts since an exploded state does not exist in
the part mode.
The method wfcSolid.WSolid.CreateCombState creates a new
combined state based on specified references. The input arguments of this method
are as follows:
• CombStateName—Specifies the name of the new combined state.
• CombStateData —Specifies the combined state data as
wfcCombStateData object.
Use the function wfcCombState.CombState.RedefineCombState to
redefine a created combined state. Pass the wfcCombStateData object as the
input argument.
In case, you do not want to redefine a reference state, pass the reference state with
the same value. While redefining, you must specify reference states. If you do not
pass reference states, the combined state is redefined to a NO_STATE state. NO_
STATE state means the display of the reference state is not changed on activation
of combined state.
The method wfcSolid.WSolid.GetActiveCombState retrieves the
active combined state in a specified solid model. The active combined state is the
default state when the model is opened.

222 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcSolid.WSolid.ActivateCombState to activate a
specified combined state.
Use the method wfcSolid.WSolid.DeleteCombState to delete a
specified combined state. The method fails if the specified combined state is the
default or active combined state.
The method wfcCombState.CombState.GetAnnotations retrieves
annotations and their status flags from a specified combined state item as a
wfcCombState.CombStateAnnotations object. The
wfcCombState.CombStateAnnotations object uses the methods of the
wfcCombState.CombStateAnnotation object to add and get annotations.
The method wfcCombState.wfcCombState.CombStateAnnotation_
Create creates a data object that contains information about annotations from a
combined state. The input arguments are:
• Annotation—Specifies the annotation as a wfcAnnotation.Annotation
object.
• Flag—Specifies if the annotation must be displayed in the combined state in
terms of the enumerated data type
wfcCombState.CombStateAnnotationOption. The valid values
are:
○ COMBSTATE_ANNOTATION_SHOW—Specifies that the annotation must
be shown in the combined state.
○ COMBSTATE_ANNOTATION_ERASE—Specifies that the annotation
must not be shown in the combined state.
The methods wfcCombState.CombStateAnnotation.GetAnnotation
and wfcCombState.CombStateAnnotation.SetAnnotation retrieve
and set the annotations for the combined state as a
wfcAnnotation.Annotation object.
Use the methods wfcCombState.CombStateAnnotation.GetOption
and wfcCombState.CombStateAnnotation.SetOption to retrieve and
specify if the displayed annotation is in the combined state in terms of the
enumerated data type wfcCombState.CombStateAnnotationOption.
The method wfcCombState.CombState.AddAnnotations adds
annotations to a specified combined state item.
Use the method wfcCombState.CombState.RemoveAnnotations to
remove the annotations from a specified combined state item.
The method wfcCombState.CombState.EraseAnnotation removes an
annotation from the display for the specified combined state.

Solid 223
The method wfcCombState.CombState.GetStateOfAnnotations
checks if the display of annotations is controlled by the specified combined state
or layers. The method returns TRUE when the display is controlled by combined
state.
The method wfcCombState.CombState.IsDefault checks if the
specified combined state is set as the default combined state for the model.
The method wfcCombState.CombState.IsPublished checks if the
specified combined state has been published to Creo View.

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.
The following types of quantities govern the definition of units of measurement:
• Basic Quantities—The basic units and dimensions of the system of units. For
example, consider the Centimeter GramSecond (CGS) system of unit.
The basic quantities for this system of units are:
○ Length—cm
○ Mass—g
○ Force—dyne
○ Time—sec
○ Temperature—K
• Derived Quantities—The derived units are those that are derived from the
basic quantities. For example, consider the Centimeter Gram Second
(CGS) system of unit. The derived quantities for this system of unit are as
follows:
○ Area—cm^2
○ Volume—cm^3
○ Velocity—cm/sec
In Creo Object TOOLKIT Java, individual units in the model are represented by
the interface pfcUnits.Unit.

Types of Unit Systems


The types of systems of units are as follows:

224 Creo Object TOOLKIT JavaUser’s Guide


• Pre-defined system of units—This system of unit is provided by default.
• Custom-defined system of units—This system of unit is defined by the user
only if the model does not contain standard metric or nonmetric units, or if the
material file contains units that cannot be derived from the predefined system
of units or both.
In Creo application, the system of units are categorized as follows:
• Mass Length Time (MLT)—The following systems of units belong to this
category:
○ CGS—Centimeter Gram Second
○ MKS—Meter Kilogram Second
○ mmKS—millimeter Kilogram Second
• Force Length Time (FLT)—The following systems of units belong to this
category:
○ Creo Default—Inch lbm Second. This is the default system followed
by Creo application.
○ FPS—Foot Pound Second
○ IPS—Inch Pound Second
○ mmNS—Millimeter Newton Second
In Creo Object TOOLKIT Java, the system of units followed by the model is
represented by the interface pfcUnits.UnitSystem.

Accessing Individual Units


Methods Introduced:
• pfcSolid.Solid.ListUnits
• pfcSolid.Solid.GetUnit
• pfcUnits.Unit.GetName
• pfcUnits.Unit.GetExpression
• pfcUnits.Unit.GetType
• pfcUnits.Unit.GetIsStandard
• pfcUnits.Unit.GetReferenceUnit
• pfcUnits.Unit.GetConversionFactor
• pfcUnits.UnitConversionFactor.GetOffset
• pfcUnits.UnitConversionFactor.GetScale

Solid 225
• wfcModel.WModel.CreateUnitByExpression
• wfcModel.WUnit.ModifyByExpression
The method pfcSolid.Solid.ListUnits returns the list of units available
to the specified model.
The method pfcSolid.Solid.GetUnit retrieves the unit, based on its name
or expression for the specified model in the form of the pfcUnits.Unit object.
The method pfcUnits.Unit.GetName returns the name of the unit.
The method pfcUnits.Unit.GetExpression returns a user-friendly unit
description in the form of the name (for example, ksi) for ordinary units and the
expression (for example, N/m^3) for system-generated units.
The method pfcUnits.Unit.GetType returns the type of quantity
represented by the unit in terms of the pfcBase.UnitType object. The types
of units are as follows:
• UNIT_LENGTH—Specifies length measurement units.
• UNIT_MASS—Specifies mass measurement units.
• UNIT_FORCE—Specifies force measurement units.
• UNIT_TIME—Specifies time measurement units.
• UNIT_TEMPERATURE—Specifies temperature measurement units.
• UNIT_ANGLE—Specifies angle measurement units.
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).
The method pfcUnits.Unit.GetReferenceUnit returns a reference unit
(one of the available system units) in terms of the pfcUnits.Unit object.
The method pfcUnits.Unit.GetConversionFactor identifies the
relation of the unit to its reference unit in terms of the
pfcUnits.UnitConversionFactor object. The unit conversion factors are
as follows:
• Offset—Specifies the offset value applied to the values in the reference
unit.
• Scale—Specifies the scale applied to the values in the reference unit to get
the value in the actual unit.
Example - Consider the formula to convert temperature from Centigrade
to Fahrenheit
F = a + (C * b)
where
F is the temperature in Fahrenheit
C is the temperature in Centigrade
a = 32 (constant signifying the offset value)

226 Creo Object TOOLKIT JavaUser’s Guide


b = 9/5 (ratio signifying the scale of the unit)

Note
Creo application scales the length dimensions of the model using the
factors listed above. If the scale is modified, the model is regenerated.
When you scale the model, the model units are not changed. Imported
geometry cannot be scaled.

Use the methods pfcUnits.UnitConversionFactor.GetOffset and


pfcUnits.UnitConversionFactor.GetScale to retrieve the unit
conversion factors listed above.
The method wfcModel.WModel.CreateUnitByExpression creates a
derived unit. Use the method wfcModel.WUnit.ModifyByExpression to
modify a derived unit.

Modifying Individual Units


Methods Introduced:
• pfcUnits.Unit.Modify
• pfcUnits.Unit.Delete
• pfcUnits.Unit.SetName
• pfcUnits.UnitConversionFactor.SetOffset
• pfcUnits.UnitConversionFactor.SetScale
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.
The method pfcUnits.Unit.Delete deletes the unit.

Note
You can delete only custom units and not standard units.

The method pfcUnits.Unit.SetName modifies the name of the unit.


Use the methods pfcUnits.UnitConversionFactor.SetOffset and
pfcUnits.UnitConversionFactor.SetScale to modify the unit
conversion factors.

Solid 227
Creating a New Unit
Methods Introduced:
• 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.
The method pfcUnits.pfcUnits.UnitConversionFactor_Create
creates the pfcUnits.UnitConversionFactor object containing the unit
conversion factors.

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.
The method pfcSolid.Solid.GetPrincipalUnits returns the system of
units assigned to the specified model in the form of the
pfcUnits.UnitSystem object.
The method pfcUnits.UnitSystem.GetUnit retrieves the unit of a
particular type used by the unit system.
The method pfcUnits.UnitSystem.GetName returns the name of the unit
system.
The method pfcUnits.UnitSystem.GetType returns the type of the unit
system in the form of the pfcUnitSystemType object. The types of unit
systems are as follows:
• Units.
• UNIT_SYSTEM_MASS_LENGTH_TIME—Specifies the Mass Length Time
(MLT) unit system.
• UNIT_SYSTEM_FORCE_LENGTH_TIME—Specifies the Force Length Time
(FLT) unit system.

228 Creo Object TOOLKIT JavaUser’s Guide


For more information on these unit systems listed above, refer to the section Types
of Unit Systems on page 224.
The method pfcUnits.UnitSystem.GetIsStandard identifies whether
the unit system is system-defined (if the property IsStandard is set to true) or user-
defined (if the property IsStandard is set to false).

Modifying Systems of Units


Method Introduced:
• pfcUnits.UnitSystem.Delete
• pfcUnits.UnitSystem.SetName
The method pfcUnits.UnitSystem.Delete deletes a custom-defined
system of units.

Note
You can delete only a custom-defined system of units and not a standard
system of units.

Use the method pfcUnits.UnitSystem.SetName to rename a custom-


defined system of units. Specify the new name for the system of units as an input
parameter for this function.

Creating a New System of Units


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).

Conversion to a New Unit System


Methods Introduced:
• wfcModel.WUnit.CalculateUnitConversion
• pfcSolid.Solid.SetPrincipalUnits
• pfcUnits.pfcUnits.UnitConversionOptions_Create

Solid 229
• pfcUnits.UnitConversionOptions.SetDimensionOption
• pfcUnits.UnitConversionOptions.SetIgnoreParamUnits
The method wfcModel.WUnit.CalculateUnitConversion calculate
the conversion factor between two units. These units can belong to the same
model or two different models.
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.
The types of unit conversion options are as follows:
• DimensionOption—Use the option while converting the dimensions of
the model.
Use the method
pfcUnits.UnitConversionOptions.SetDimensionOption to
modify this option.
This option can be of the following types:
○ UNITCONVERT_SAME_DIMS—Specifies that unit conversion occurs by
interpreting the unit value in the new unit system. For example, 1 inch will
equal to 1 millimeter.
○ UNITCONVERT_SAME_SIZE—Specifies that unit conversion will occur
by converting the unit value in the new unit system. For example, 1 inch
will equal to 25.4 millimeters.
• IgnoreParamUnits—This boolean attribute determines whether or not
ignore the parameter units. If it is null or true, parameter values and units do
not change when the unit system is changed. If it is false, parameter units are
converted according to the rule.
Use the
pfcUnitsmethod.UnitConversionOptions.SetIgnoreParamU
nits to modify this attribute.

Mass Properties
Method Introduced:

230 Creo Object TOOLKIT JavaUser’s Guide


• 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 class contains the following fields:
• The volume.
• The surface area.
• The density. The density value is 1.0, unless a material has been assigned.
• The mass.
• The center of gravity (COG).
• The inertia matrix.
• The inertia tensor.
• The inertia about the COG.
• The principal moments of inertia (the eigen values of the COG inertia).
• The principal axes (the eigenvectors of the COG inertia).

Part Properties
The methods described in this section get information about the part.
Methods Introduced:
• wfcPart.WPart.GetDensity
• wfcPart.WPart.SetDensity
The method wfcPart.WPart.GetDensity returns the density of the
specified part. Use the method wfcPart.WPart.SetDensity to set the
density of the part without assigning a material. If a material has been defined for
the part, then density is set for the material.

Annotations
Methods Introduced:
• pfcNote.Note.GetLines
• pfcNote.Note.SetLines
• pfcNote.Note.GetText
• pfcNote.Note.GetURL
• pfcNote.Note.SetURL

Solid 231
• pfcNote.Note.Display
• pfcNote.Note.Delete
• pfcNote.Note.GetOwner
• wfcSolid.WSolid.GetDefaultTextHeight
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.
The method pfcNote.Note.GetLines returns the text contained in the 3D
model note. The method pfcNote.Note.SetLines modifies the note text.
The method pfcNote.Note.GetText returns the the text of the solid model
note. If you set the parameter GiveParametersAsNames to TRUE, then the text
displays the parameter callouts with ampersands (&). If you set the parameter to
FALSE, then the text displays the parameter values with no callout information.
The method pfcNote.Note.GetURL returns the URL stored in the 3D model
note. The method pfcNote.Note.SetURL modifies the note URL.
The method pfcNote.Note.Display forces the display of the model note.
The method pfcNote.Note.Delete deletes a model note.
The method pfcNote.Note.GetOwner returns the solid model owner of the
note.
The method wfcSolid.WSolid.GetDefaultTextHeight returns the
default height of the annotations and dimensions in the specified solid model.

Materials
Creo Object TOOLKIT Java enables you to programmatically access the material
types and properties of parts. Using the methods and properties described in the
following sections, you can perform the following actions:
• Create or delete materials
• Set the current material
• Access and modify the material types and properties
Methods Introduced:
• pfcPart.Material.Save
• pfcPart.Material.Delete
• pfcPart.Part.GetCurrentMaterial
• pfcPart.Part.SetCurrentMaterial
• pfcPart.Part.ListMaterials

232 Creo Object TOOLKIT JavaUser’s Guide


• pfcPart.Part.CreateMaterial
• pfcPart.Part.RetrieveMaterial
The method pfcPart.Material.Save writes to a material file that can be
imported into any Creo part.
The method pfcPart.Material.Delete removes material from the part.
The method pfcPart.Part.GetCurrentMaterial returns the currently
assigned material for the part.
The methodpfcPart.Part.SetCurrentMaterial sets the material
assigned to the 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 methodpfcPart.Part.ListMaterials returns a list of the materials


available in the part.
The method pfcPart.Part.CreateMaterial creates a new empty
material in the specified part.
The method pfcPart.Part.RetrieveMaterial imports a material file
into the part. The name of the file read can be as either:
• <name>.mtl—Specifies the new material file format.
• <name>.mat—Specifies the material file format prior to Pro/ENGINEER
Wildfire 3.0.
If the material is not already in the part database,
pfcPart.Part.RetrieveMaterial adds the material to the database after
reading the material file. If the material is already in the database, the function
replaces the material properties in the database with those contained in the
material file.

Solid 233
Accessing Material Types
Methods Introduced:
• 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:
• MTL_ISOTROPIC—Specifies a 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.SetStructuralMaterialType to
set the material type for the structural properties of the material.
The method pfcPart.Material.GetThermalMaterialType returns the
material type for the thermal properties of the material. The material types are as
follows:
• 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.
The method pfcPart.Material.GetSubType returns the subtype for the
MTL_ISOTROPIC material type.

234 Creo Object TOOLKIT JavaUser’s Guide


Use the method pfcPart.Material.SetSubType to set the subtype for the
MTL_ISOTROPIC material type.
Use the method pfcPart.Material.GetPermittedSubTypes to retrieve
a list of the permitted string values for the material subtype.

Accessing Material Properties


The methods listed in this section enable you to access material properties.
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
• pfcPart.Material.GetPermittedFatigueTypes
• pfcPart.Material.GetFatigueMaterialType
• pfcPart.Material.SetFatigueMaterialType
• pfcPart.Material.GetPermittedFatigueMaterialTypes
• pfcPart.Material.GetFatigueMaterialFinish
• pfcPart.Material.SetFatigueMaterialFinish
• pfcPart.Material.GetPermittedFatigueMaterialFinishes
• 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

Solid 235
• 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
• wfcModelItem.MaterialItem.GetDescription
• wfcModelItem.MaterialItem.SetDescription
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.
The method pfcPart.Material.GetPropertyValue returns the value
and the units of the material property.
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.
Use the method pfcPart.Material.SetPropertyUnits to set the units
of the material property.
Use the method pfcPart.Material.RemoveProperty to remove the
material property.
Material properties that are non-numeric can be accessed via property-specific get
and set methods.
The methods pfcPart.Material.GetDescription and
pfcPart.Material.SetDescription return and set the description string
for the material respectively.
The methods pfcPart.Material.GetFatigueType and
pfcPart.Material.SetFatigueType return and set the valid fatigue type
for the material respectively.
Use the method pfcPart.Material.GetPermittedFatigueTypes to
get a list of the permitted string values for the fatigue type.
The methods pfcPart.Material.GetFatigueMaterialType and
pfcPart.Material.SetFatigueMaterialType return and set the class
of material when determining the effect of the fatigue respectively.

236 Creo Object TOOLKIT JavaUser’s Guide


Use the method
pfcPart.Material.GetPermittedFatigueMaterialTypes to
retrieve a list of the permitted string values for the fatigue material type.
The methods pfcPart.Material.GetFatigueMaterialFinish and
pfcPart.Material.SetFatigueMaterialFinish return and set the
type of surface finish for the fatigue material respectively.
Use the method
pfcPart.Material.GetPermittedFatigueMaterialFinishes to
retrieve a list of permitted string values for the fatigue material finish.
The method pfcPart.Material.GetFailureCriterion returns the
reduction factor for the failure strength of the material. This factor is used to
reduce the endurance limit of the material to account for unmodeled stress
concentrations, such as those found in welds. Use the method
pfcPart.Material.SetFailureCriterion to set the reduction factor
for the failure strength of the material.
Use the method pfcPart.Material.GetPermittedFailureCriteria
to retrieve a list of permitted string values for the material failure criterion.
The methods pfcPart.Material.GetHardness and
pfcPart.Material.SetHardness return and set the hardness for the
specified material respectively.
The methods pfcPart.Material.GetHardnessType and
pfcPart.Material.SetHardnessType return and set the hardness type
for the specified material respectively.
The methods pfcPart.Material.GetCondition and
pfcPart.Material.GetCondition return andset the condition for the
specified material respectively.
The methods pfcPart.Material.GetBendTable and
pfcPart.Material.SetBendTable return and set the bend table for the
specified material respectively.
The methods pfcPart.Material.GetCrossHatchFile and
pfcPart.Material.SetCrossHatchFile return and set the file
containing the crosshatch pattern for the specified material respectively.
The methods pfcPart.Material.GetMaterialModel and
pfcPart.Material.SetMaterialModel return and set the type of
hyperelastic isotropic material model respectively.
Use the method pfcPart.Material.GetPermittedMaterialModels
to retrieve a list of the permitted string values for the material model.
The methods pfcPart.Material.GetModelDefByTests determines
whether the hyperelastic isotropic material model has been defined using
experimental data for stress and strain.

Solid 237
Use the method pfcPart.Material.SetModelDefByTests to define the
hyperelastic isotropic material model using experimental data for stress and strain.
The methods wfcModelItem.MaterialItem.GetDescription and
wfcModelItem.MaterialItem.SetDescription get and set the
material description for the specified model item.

Accessing User-defined Material Properties


Materials permit assignment of user-defined parameters. These parameters allow
you to place non-standard properties on a given material. Therefore
pfcPart.Material is a child of pfcModelItem.ParameterOwner,
which provides access to user-defined parameters and properties of materials
through the methods in that interface.

238 Creo Object TOOLKIT JavaUser’s Guide


13
Annotations: Annotation Features
and Annotations
Overview of Annotation Features.............................................................................. 240
Creating Annotation Features................................................................................... 240
Redefining Annotation Features ............................................................................... 240
Accessing Annotations ............................................................................................ 242
Accessing and Modifying Annotation Elements .......................................................... 245
Automatic Propagation of Annotation Elements ......................................................... 252
Detail Tree .............................................................................................................. 253
Annotation Text Styles ............................................................................................. 253
Annotation Orientation ............................................................................................. 256
Annotation Associativity ........................................................................................... 261
Accessing Set Datum Tags ...................................................................................... 262
Designating Dimensions and Symbols ...................................................................... 263
Surface Finish Annotations ...................................................................................... 263
Symbol Annotations................................................................................................. 265
Notes ..................................................................................................................... 266

239
Overview of Annotation Features
An annotation feature is composed of one or more "annotation elements". Each
annotation element is composed of references, parameters and annotations (notes,
symbols, geometric tolerances, surface finishes, reference dimensions, driven
dimensions, and manufacturing template annotations). The annotation feature
allows annotation information to have the same benefits as geometry in Creo
Parametric models, that is, parameters can be assigned to these annotation
elements, and missing geometric references can cause features to fail in some
situations.
Annotation elements may belong to annotation features, or may also be found in
data-sharing features (features such as Copy Geometry, Publish Geometry, Merge,
Cutout, and Shrinkwrap features).
Creo Object TOOLKIT Java does not expose the feature element tree for
annotation features because some elements in the tree are used for non-standard
purposes. Instead, Creo Object TOOLKIT Java provides specific methods for
creating, redefining, and reading the properties of annotation features and
annotation elements.

Creating Annotation Features


Methods Introduced:
• wfcSelect.WSelection.CreateAnnotationFeature
The method wfcSelect.WSelection.CreateAnnotationFeature
creates a new annotation feature in the model as a
wfcFeature.AnnotationFeature object. InvokeUI specifies a boolean
flag that determines how the annotation features will be created. It can have the
following values:
• FALSE—Indicates that the feature will be a new empty annotation feature
with one general annotation element in it. Modify the new annotation element
and add others using subsequent steps.
• TRUE—Indicates that Creo Parametricwill invoke the annotation feature
creation user interface.

Redefining Annotation Features


Redefining an annotation feature involves creation of new annotation elements,
deletion of elements that are not required and modification of the feature
properties.

240 Creo Object TOOLKIT JavaUser’s Guide


Note
The methods in this section are shortcuts to redefining the feature containing
the annotation elements. Due to this, Creo Parametric must regenerate the
model after making the required changes to the annotation element. The
methods include a flag to optionally allow the Fix Model User Interface to
appear upon a regeneration failure.

Methods Introduced:
• wfcSelect.WSelection.AddAnnotationElement
• wfcSelect.WSelection.AddElementsInAnnotationFeature
• wfcSelect.WSelection.CopyAnnotationElement
• wfcSelect.WSelection.DeleteAnnotationElement
• wfcSelect.WSelection.DeleteElementsInAnnotationFeature
The method wfcSelect.WSelection.AddAnnotationElement adds a
new non-graphical annotation element to the feature as a
wfcAnnotation.AnnotationElement object.
The method
wfcSelect.WSelection.AddElementsInAnnotationFeature adds
a series of new annotation elements to the annotation feature as a
wfcAnnotation.AnnotationElements object. Each element may be
created as non-graphical or may be assigned a pre-existing annotation.

Note
In case of Datum Target Annotation Features (DTAFs), you can add only one
set datum tag annotation element using the method
wfcSelect.WSelection.AddElementsInAnnotationFeature.

The method wfcSelect.WSelection.CopyAnnotationElement copies


and adds an existing annotation element to the specified annotation feature.
The method wfcSelect.WSelection.DeleteAnnotationElement
deletes an annotation element from the feature. The method deletes the annotation
element, its annotations, parameters, references, and application data from the
feature.

Annotations: Annotation Features and Annotations 241


Note
In case of Datum Target Annotation Features (DTAFs), the method
wfcSelect.WSelection.DeleteAnnotationElement allows you
to delete only a Datum Target Annotation Element (DTAE) from a DTAF. This
method does not allow deletion of a set datum tag annotation element from the
DTAF.

The method
wfcSelect.WSelection.DeleteElementsInAnnotationFeature
deletes a series of annotation elements from the feature. The method deletes the
annotation element, its annotations, parameters, references, and application data
from the feature.

Note
In case of Datum Target Annotation Features (DTAFs), the method
wfcSelect.WSelection.DeleteElementsInAnnotationFea
ture allows you to delete only a Datum Target Annotation Element (DTAE)
from a DTAF. This method does not allow deletion of a set datum tag
annotation element from the DTAF.

Accessing Annotations
Methods Introduced:
• wfcAnnotation.Annotation.ShowInDrawing
• wfcAnnotation.Annotation.Display
• wfcAnnotation.Annotation.DisplayInDrawing
• wfcAnnotation.Annotation.Undisplay
• wfcAnnotation.Annotation.UndisplayInDrawing
• wfcAnnotation.Annotation.Update
• wfcAnnotation.Annotation.IsInactive
• wfcWDrawing.WDrawing.EraseAnnotation
• wfcSelect.WSelection.ShowAnnotations
• wfcSelect.WSelection.ShowAxes
• wfcSelect.WSelection.ShowDatumTargets
• wfcView2D.WView2D.ShowAnnotations

242 Creo Object TOOLKIT JavaUser’s Guide


• wfcView2D.WView2D.ShowAxes
• wfcView2D.WView2D.ShowDatumTargets
The method wfcAnnotation.Annotation.ShowInDrawing shows the
annotation in the current combined state. The annotation will be visible until it is
explicitly erased from the combined state. The method also adds the specified
annotation to the current combined state, if it has not been added. If the specified
annotation has been erased, then the method changes the display status of the
erased annotation and makes it visible in the combined state, that is, it unerases
the annotation. This function is also capable of showing an annotation in a
drawing view similar to the Creo Parametric command Show and Erase. The
input arguments are:
• DrawingView—Specifies the drawing view.
• CompPath—Specifies the assembly component path.
The methods wfcAnnotation.Annotation.Display and
wfcAnnotation.Annotation.Undisplay temporarily display and
remove an annotation from the display for the specified combined state .
Similarly, the methods
wfcAnnotation.Annotation.DisplayInDrawing and
wfcAnnotation.Annotation.UndisplayInDrawing temporarily
display and remove an annotation from the display for the specified drawing.
Specify the drawing in the input argument DrawingModel The undisplay and
display methods for combined state and drawing should be used together. To edit a
shown annotation, it must be first removed temporarily from display by using the
undisplay method, followed by editing the annotation. The annotation must be
redisplayed using the display method, so that the updated annotation is visible to
the user.
The method wfcAnnotation.Annotation.Update updates the display of
an annotation, but does not actually display it. If the annotation is not currently
displayed because it is hidden by layer status or inactive geometry, the text
extracted from the annotation may include callout symbols, instead of the text
shown to the user. The method wfcAnnotation.Annotation.Update
informs Creo Parametric to update the contents of the annotation in order to cross-
reference these callout values. This method supports 3D model notes and detail
notes.
The method wfcAnnotation.Annotation.IsInactive indicates
whether the annotation can be shown or not. An annotation becomes inactive if all
the weak references it points to have been lost or consumed.
The method wfcWDrawing.WDrawing.EraseAnnotation removes an
annotation from the display for the specified drawing. The annotation is not
shown in the specified drawing.

Annotations: Annotation Features and Annotations 243


Note
The annotation which was removed from the display using the method
wfcWDrawing.WDrawing.EraseAnnotation will become visible
again, only if the method
wfcAnnotation.Annotation.ShowInDrawing is called to explicitly
display the annotation.

The method wfcSelect.WSelection.ShowAnnotations displays the


annotation of the specified type for the selected feature or component.
The method wfcSelect.WSelection.ShowAxes displays the axes for the
selected feature and component.
The method wfcSelect.WSelection.ShowDatumTargets displays the
datum targets for the selected feature and component.

Note
In case of methods wfcSelect.WSelection.ShowAnnotations,
wfcSelect.WSelection.ShowAxes, and
wfcSelect.WSelection.ShowDatumTargets, for annotations
created in drawing mode and owned by a solid, which can be displayed only in
the context of that drawing, specify the name of the drawing in the input
argument drawing. You can specify the view in which the annotations for the
selected feature and component must be displayed. If you pass the input
argument DrawingView as NULL, the annotations are displayed in all the
views.

The method wfcView2D.WView2D.ShowAnnotations displays the


annotation of the specified type in the drawing view by using the enumerated data
type wfcAnnotation.AnnotationType.
The method wfcView2D.WView2D.ShowAxes displays the axes in the
drawing view.
The method wfcView2D.WView2D.ShowDatumTargets displays the
datum targets in the drawing view.

244 Creo Object TOOLKIT JavaUser’s Guide


Accessing and Modifying Annotation
Elements
The following methods provide access and modify the properties of an annotation
element.

Note
The methods in this section are shortcuts to redefining the feature containing
the annotation elements. Because of this, Creo Parametric must regenerate the
model after making the indicated changes to the annotation element. The
methods include a flag to optionally allow the Fix Model User Interface to
appear upon a regeneration failure.

Methods Introduced:
• wfcAnnotation.Annotation.GetAnnotationElement
• wfcAnnotation.AnnotationElement.GetAnnotationType
• wfcAnnotation.AnnotationElement.IsReadOnly
• wfcAnnotation.AnnotationElement.HasMissingReferences
• wfcAnnotation.AnnotationElement.IsIncomplete
• wfcAnnotation.AnnotationElement.GetCopyFlag
• wfcAnnotation.AnnotationElement.IsDependent
• wfcAnnotation.AnnotationElement.GetAnnotation
• wfcAnnotation.AnnotationElement.GetAnnotationFeature
• wfcAnnotation.AnnotationElement.IsReferenceStrong
• wfcAnnotation.AnnotationElement.CollectAnnotationReferences
• wfcAnnotation.AnnotationElement.CollectQuiltReferenceSurfaces
• wfcAnnotation.AnnotationElement.GetAnnotationReferenceDescription
• wfcAnnotation.AnnotationElement.SetAnnotationReferenceDescription
• wfcSelect.WSelection.SetAnnotationInAnnotationElement
• wfcSelect.WSelection.SetCopyFlagInAnnotationElement
• wfcSelect.WSelection.SetDependencyFlag
• wfcSelect.WSelection.GetAutoPropagateFlagInAnnotationElement
• wfcSelect.WSelection.SetAutoPropagateFlagInAnnotationElement
• wfcSelect.WSelection.AddAnnotationReferenceInAnnotationElement
• wfcSelect.WSelection.SetAnnotationReferencesInAnnotationElement
• wfcSelect.WSelection.RemoveAnnotationReferenceInAnnotationElement

Annotations: Annotation Features and Annotations 245


• wfcSelect.WSelection.StrengthenAnnotationElementReference
• wfcSelect.WSelection.WeakenAnnotationElementReference
• wfcAnnotation.AnnotationReferenceCurveCollectionObject_Create
• wfcAnnotation.AnnotationReferenceCurveCollectionObject.
GetCurveCollection
• wfcAnnotation.AnnotationReferenceCurveCollectionObject.
SetCurveCollection
• wfcAnnotation.AnnotationReferenceSelectionObject_Create
• wfcAnnotation.AnnotationReferenceSelectionObject.GetReference
• wfcAnnotation.AnnotationReferenceSelectionObject.SetReference
• wfcAnnotation.AnnotationReferenceSurfaceCollectionObject_Create
• wfcAnnotation.AnnotationReferenceSurfaceCollectionObject.
GetSurfaceCollection
• wfcAnnotation.AnnotationReferenceSurfaceCollectionObject.
SetSurfaceCollection
The method wfcAnnotation.Annotation.GetAnnotationElement
retrieves the annotation element that contains the annotation as a
wfcAnnotationElement object.
The method
wfcAnnotation.AnnotationElement.GetAnnotationType returns
the type of the annotation contained in the annotation element using the
enumerated data type wfcAnnotation.AnnotationType. The valid values
are:
• ANNOTATION_NOTE—Specifies a note.
• ANNOTATION_GTOL—Specifies a geometric tolerance.
• ANNOTATION_SURFACE_FINISH—Specifies a surface finish.
• ANNOTATION_SYMBOL_INSTANCE—Specifies a symbol.
• ANNOTATION_DIMENSION—Specifies a driven dimension.
• ANNOTATION_REF_DIMENSION—Specifies a reference dimension.
• ANNOTATION_SET_DATUM_TAG—Specifies a set datum tag.
The method wfcAnnotation.AnnotationElement.IsReadOnly
checks if the annotation element has read only or full access.
The method
wfcAnnotation.AnnotationElement.HasMissingReferences
checks if an annotation element has missing references. Use the input parameters
of this method to investigate specific types and sources of references, or to check
all references simultaneously. The input arguments are:
• ReferenceType—Specifies the type of reference by using the enumerated data
type wfcAnnotation.AnnotationRefFilter. The valid values are:

246 Creo Object TOOLKIT JavaUser’s Guide


○ ANNOTATION_REF_ALL—Specifies all references.
○ ANNOTATION_REF_WEAK—Specifies weak references.
○ ANNOTATION_REF_STRONG—Specifies strong references.
• ReferenceSource—Specifies the source of the references by using the
enumerated data type wfcAnnotation.AnnotationRefFromType.
The valid values are:
○ ANNOT_REF_FROM_ALL—Specifies all references.
○ ANNOT_REF_FROM_ANNOTATION—Specifies references from
annotations.
○ ANNOT_REF_FROM_USER—Specifies references from users.
• AtLeastOneMissingRef—Specifies if the annotation element has at least one
missing reference of the specified type and source.
Use the method wfcAnnotation.AnnotationElement.IsIncomplete
returns a true value if the annotation element is incomplete because of missing
strong references.
The method wfcAnnotation.AnnotationElement.GetCopyFlag
retrieves the copy flag of the annotation elements. This property is not supported
for elements in data sharing features. It returns true if the annotation element
contains copies of its references.
The method
wfcSelect.WSelection.SetCopyFlagInAnnotationElement sets
the copy flag of the annotation element. Set the input argumentInvokeUI to true to
allow theFix Model User Interface to appear upon a regeneration failure. This
property is not supported for annotations in data sharing features.
The method wfcAnnotation.AnnotationElement.IsDependent
retrieves the value of the dependency flag for the annotation element. This
property is supported only for the elements in data sharing features. It returns true
if the annotation element is dependent on its parent.
The method wfcSelect.WSelection.SetDependencyFlag sets the
dependency flag of the annotation element. This property is supported only for
annotations in data sharing features.
The method wfcAnnotation.AnnotationElement.GetAnnotation
returns the annotation contained in an annotation element.
The method
wfcAnnotation.AnnotationElement.GetAnnotationFeature
returns the feature that owns the annotation element as a
pfcFeature.Feature object.
The method
wfcAnnotation.AnnotationElement.IsReferenceStrong
identifies if a reference is weak or strong in a given annotation element.

Annotations: Annotation Features and Annotations 247


The method
wfcAnnotation.AnnotationElement.CollectAnnotationRefer
ences retrieves an array of references contained in the specified annotation
element as a wfcAnnotation.AnnotationReferences object. The input
arguments are:
• RefStrength—Specifies the type of reference by using the enumerated data
type wfcAnnotation.AnnotationRefFilter.
• RefSource—Specifies the source of the references by using the enumerated
data type wfcAnnotation.AnnotationRefFromType.
The method
wfcAnnotation.AnnotationElement.CollectQuiltReference
Surfaces returns the surfaces which make up a quilt surface collection
reference for the annotation element as a
wfcAnnotation.AnnotationReferences object.

Note
All the surfaces made inactive by features occurring after the annotation
element in the model regeneration are also returned.

The method
wfcAnnotation.AnnotationElement.GetAnnotationReference
Description retrieves the description property for a given annotation element
reference.

Note
The description string is the same as that of the tooltip text for the reference
name in the Annotation Feature UI.

The method
wfcAnnotation.AnnotationReference.GetAnnotationReferen
ceType retrieves the type of the annotation reference by using the enumerated
data type wfcAnnotation.AnnotationRefType. The valid values are:
• ANNOT_REF_SINGLE—Specifies a single reference.
• ANNOT_REF_CRV_COLLECTION—Specifies the collection of curves.
• ANNOT_REF_SRF_COLLECTION—Specifies the collection of surfaces.
The method
wfcAnnotation.AnnotationElement.SetAnnotationReference
Description sets the description property for a given annotation element
reference. The input arguments are:

248 Creo Object TOOLKIT JavaUser’s Guide


• Reference—Specifies the annotation reference as a
wfcAnnotation.AnnotationReference object.
• Description—Specifies the description for the annotation element reference.

Note
Creo Parametric must regenerate the model after making the indicated changes
to the annotation element.

Use the method


wfcSelect.WSelection.SetAnnotationInAnnotationElement to
modify the annotation contained in an annotation element. Pass the input
argument Annotation as NULL to modify the annotation element to be a non-
graphical annotation.

Note
The above method does not support Datum Target Annotation Elements
(DTAEs).

If you modify the annotation contained in the annotation element, the original
annotation is automatically removed from the element and is owned by the model.
The methods
wfcSelect.WSelection.GetAutoPropagateFlagInAnnotatio
nElement and
wfcSelect.WSelection.SetAutoPropagateFlagInAnnotatio
nElement get and set the autopropagate flag of the specified annotation element
reference.
The method
wfcSelect.WSelection.AddAnnotationReferenceInAnnotatio
nElement adds a strong user-defined reference to the annotation element.
The method
wfcSelect.WSelection.SetAnnotationReferencesInAnnotatio
nElement replaces all the user-defined references in the annotation element with
references that are specified in the input argument Reference.
The method
wfcSelect.WSelection.RemoveAnnotationReferenceInAnnota
tionElement removes the user-defined reference from the annotation element.
The method
wfcSelect.WSelection.StrengthenAnnotationElementRefer
ence converts a weak reference to a strong reference.

Annotations: Annotation Features and Annotations 249


The method
wfcSelect.WSelection.WeakenAnnotationElementReference
converts a strong reference to a weak reference.
The method
wfcAnnotation.AnnotationReferenceCurveCollectionObject_
Create creates a curve collection object for the specified user-defined
annotation references.
The methods
wfcAnnotation.AnnotationReferenceCurveCollectionObject.
GetCurveCollection and
wfcAnnotation.AnnotationReferenceCurveCollectionObject.
SetCurveCollection retrieves and sets the curve collections for the user-
defined set of annotation references using the wfcCollection.Collection
object.
The method
wfcAnnotation.AnnotationReferenceSelectionObject_Create
creates a selection object for the specified user-defined annotation references.
The methods
wfcAnnotation.AnnotationReferenceSelectionObject.GetRe
ference and
wfcAnnotation.AnnotationReferenceSelectionObject.SetRe
ference retrieves and sets the references for the user-defined annotation
references using the pfcSelect.Selection object.
The method
wfcAnnotation.AnnotationReferenceSurfaceCollectionOb
ject_Create creates a surface collection object for the specified user-defined
annotation references.
The methods
wfcAnnotation.AnnotationReferenceSurfaceCollectionOb
ject.GetSurfaceCollection and
wfcAnnotation.AnnotationReferenceSurfaceCollectionOb
ject.SetSurfaceCollection retrieves and sets the surface collections for
the user-defined annotation references using the
wfcCollection.Collection object.

Accessing Reference and Driven Dimensions


Methods Introduced:
• wfcSolid.WSolid.CreateDimension
The method wfcWSolid.Solid.CreateDimension creates a new driven
dimension. Specify the geometric references and parameters required to construct
the required dimension as the input parameters for this method. Once the

250 Creo Object TOOLKIT JavaUser’s Guide


reference dimension is created, use the method
wfcAnotation.Annotation.ShowInDrawing to display it. The input
arguments of this method are as follows:
• AnnotPlane—Specifies the annotation plane for the dimensions.
• DimAttachs—Specifies the points on the model where you want to attach the
dimension.

Note
The attachments structure is an array of two pfcSelection entities. It
is provided to support options such as intersect where two entities must be
passed as input. From Creo Parametric 3.0 onward, you can create
dimensions that have intersection type of reference. The intersection type
of reference is a reference that is derived from the intersection of two
entities. Refer to the Creo Parametric Detailed Drawings Help for more
information on intersection type of reference.

• Senses—Specifies more information about how the dimension attaches to each


attachment point of the model, that is, to what part of the entity.
• OrientHint—Specifies the orientation of the dimension and has one of the
following values:
○ pfcORIENTATION_HINT_HORIZONTAL—Specifies a horizontal
dimension.
○ pfcORIENTATION_HINT_VERTICAL—Specifies a vertical dimension.
○ pfcORIENTATION_HINT_SLANTED—Specifies the shortest distance
between two attachment points (available only when the dimension is
attached to points).
○ pfcORIENTATION_HINT_ELLIPSE_RADIUS1—Specifies the start
radius for a dimension on an ellipse.
○ pfcORIENTATION_HINT_ELLIPSE_RADIUS2—Specifies the end
radius for a dimension on an ellipse.
○ pfcORIENTATION_HINT_ARC_ANGLE—Specifies the angle of the arc
for a dimension of an arc.
○ pfcORIENTATION_HINT_ARC_LENGTH—Specifies the length of the
arc for a dimension of an arc.
○ pfcORIENTATION_HINT_LINE_TO_TANGENT_CURVE_ANGLE—
Specifies the value to dimension the angle between the line and the tangent
at a curve point (the point on the curve must be an endpoint).

Annotations: Annotation Features and Annotations 251


○ pfcORIENTATION_HINT_RADIAL_DIFF—Specifies the linear
dimension of the radial distance between two concentric arcs or circles.
• Location—Specifies the initial location of the dimension text.

Automatic Propagation of Annotation


Elements
Automatic local propagation of annotation elements can be done based on some
specified conditions, using a Creo Parametric TOOLKIT application.
When an appropriate event occurs during a Creo Parametric session, the
associated notification method can invoke a local propagation.
Methods Introduced:
• wfcSession.WSession.AutoPropagate
The method wfcSession.WSession.AutoPropagate causes the local and
automatic propagation of annotation elements to the currently selected feature
within the same model, after a supported feature has either been created or
modified. The propagation behavior is dependant on the standard Creo Parametric
algorithm and on the current contents of the selection buffer.
Following are the list of supported features:
• Draft
○ Surface
○ Solid
• Offset
○ Surface
○ With Draft
○ Expand
• Mirror Surface
• Copy Surface
• Move Surface
The Creo Parametric TOOLKIT application can be written so as to specify the
condition for the automatic propagation, based on created feature-type, subtype or
any other required properties.
The method propagates based on the current contents of the selection buffer.

252 Creo Object TOOLKIT JavaUser’s Guide


Note
The method wfcSession.WSession.AutoPropagate works
regardless of the current value for the configuration option, auto_
propagate_ae. PTC advises that the Creo Parametric TOOLKIT
application respect the current value of this configuration option; otherwise,
duplicate versions of the propagated annotations can result.

Detail Tree
Methods introduced:
• wfcSolid.WSolid.CollapseDetailTree
• wfcSolid.WSolid.ExpandDetailTree
• wfcSolid.WSolid.RefreshDetailTree
Use the method wfcSolid.WSolid.CollapseDetailTree to collapse all
nodes of the detail tree in the Creo Parametric window and make its child nodes
invisible.
Use the method wfcSolid.WSolid.ExpandDetailTree to expand the
detail tree in the Creo Parametricwindow.
Use the method wfcSolid.WSolid.RefreshDetailTree to rebuild the
detail tree in the Creo Parametric window that contains the model.
The input argument for the above three methods is SolidWindow. It is the window
containing the solid. By default, the detail tree in the active window is used.

Annotation Text Styles


Methods Introduced:
• wfcAnnotation.Annotation.GetTextStyle
• wfcAnnotation.Annotation.SetTextStyle
• wfcAnnotation.Annotation.GetTextStyleInDrawing
• wfcAnnotation.Annotation.SetTextStyleInDrawing
• pfcDetail.pfcDetail.AnnotationTextStyle_Create
• pfcDetail.AnnotationTextStyle.GetAngle
• pfcDetail.AnnotationTextStyle.SetAngle
• pfcDetail.AnnotationTextStyle.GetColor
• pfcDetail.AnnotationTextStyle.SetColor

Annotations: Annotation Features and Annotations 253


• pfcDetail.AnnotationTextStyle.GetFont
• pfcDetail.AnnotationTextStyle.SetFont
• pfcDetail.AnnotationTextStyle.GetHeight
• pfcDetail.AnnotationTextStyle.SetHeight
• pfcDetail.AnnotationTextStyle.GetWidth
• pfcDetail.AnnotationTextStyle.SetWidth
• pfcDetail.AnnotationTextStyle.GetThickness
• pfcDetail.AnnotationTextStyle.SetThickness
• pfcDetail.AnnotationTextStyle.GetHorizontalJustification
• pfcDetail.AnnotationTextStyle.SetHorizontalJustification
• pfcDetail.AnnotationTextStyle.GetVerticalJustification
• pfcDetail.AnnotationTextStyle.SetVerticalJustification
• pfcDetail.AnnotationTextStyle.GetSlantAngle
• pfcDetail.AnnotationTextStyle.SetSlantAngle
• pfcDetail.AnnotationTextStyle.IsHeightInModelUnits
• pfcDetail.AnnotationTextStyle.SetHeightInModelUnits
• pfcDetail.AnnotationTextStyle.IsTextMirrored
• pfcDetail.AnnotationTextStyle.MirrorText
• pfcDetail.AnnotationTextStyle.IsTextUnderlined
• pfcDetail.AnnotationTextStyle.UnderlineText
The methods wfcAnnotation.Annotation.GetTextStyle and
wfcAnnotation.Annotation.SetTextStyle retrieve and set the text
style for the specified annotation as a pfcDetail.AnnotationTextStyle
object.
The method wfcAnnotation.Annotation.GetTextStyleInDrawing
retrieves the text style for the specified annotation in a drawing as a
pfcDetail.AnnotationTextStyle object. The input arguments are:
• Drawing—Specifies a drawing only when the annotation is owned by the
solid, but is displayed in the drawing.
• CompPath—Specifies the component path to the solid that owns the
annotation as a pfcAssembly.ComponentPath object.
• View—This is reserved for future use. Pass NULL.
The method wfcAnnotation.Annotation.SetTextStyleInDrawing
sets the text style for the specified annotation in a drawing.
The method pfcDetail.pfcDetail.AnnotationTextStyle_Create
creates a data object that contains information about text style for a specified
annotation.

254 Creo Object TOOLKIT JavaUser’s Guide


The methods pfcDetail.AnnotationTextStyle.GetAngle and
pfcDetail.AnnotationTextStyle.SetAngle get and set the angle of
the text style.
The methods pfcDetail.AnnotationTextStyle.GetColor and
pfcDetail.AnnotationTextStyle.SetColor retrieve and set the color
of the text style as a pfcBase.ColorRGB object.
The methods pfcDetail.AnnotationTextStyle.GetFont and
pfcDetail.AnnotationTextStyle.SetFont get and set the font of the
text.
The methods pfcDetail.AnnotationTextStyle.GetHeight and
pfcDetail.AnnotationTextStyle.SetHeight get and set the height
of the text style.
The methods pfcDetail.AnnotationTextStyle.GetWidth and
pfcDetail.AnnotationTextStyle.SetWidth retrieve and set the
width of the text style.
The methods pfcDetail.AnnotationTextStyle.GetThickness and
pfcDetail.AnnotationTextStyle.SetThickness get and set the
thickness of the text style.
The methods
pfcDetail.AnnotationTextStyle.GetHorizontalJustifica
tion and
pfcDetail.AnnotationTextStyle.SetHorizontalJustifica
tion get and set the horizontal justification of the text style using the enumerated
data type pfcDetail.HorizontalJustification. The valid values are:
• H_JUSTIFY_LEFT—Aligns the text style object to the left.
• H_JUSTIFY_CENTER—Aligns the text style object in the center.
• H_JUSTIFY_RIGHT—Aligns the text style object to the right.
• H_JUSTIFY_DEFAULT—Aligns the text using the default justification. The
justification selected for the first note becomes the default for all successive
notes added during the current session.
The methods
pfcDetail.AnnotationTextStyle.GetVerticalJustification
and
pfcDetail.AnnotationTextStyle.SetVerticalJustification
get and set the vertical justification of the text style using the enumerated data
type pfcDetail.VerticalJustification. The valid values are:
• V_JUSTIFY_TOP—Aligns the text style object to the top.
• V_JUSTIFY_MIDDLE—Aligns the text style object to the middle.

Annotations: Annotation Features and Annotations 255


• V_JUSTIFY_BOTTOM—Aligns the text style object to the bottom.
• V_JUSTIFY_DEFAULT—Aligns the text using the default justification. The
justification selected for the first note becomes the default for all successive
notes added during the current session.
The methods pfcDetail.AnnotationTextStyle.GetSlantAngle and
pfcDetail.AnnotationTextStyle.SetSlantAngle get and set the
slant angle of the text style.
The method
pfcDetail.AnnotationTextStyle.IsHeightInModelUnits checks
if the text height is in relation to the model units or as a fraction of the screen size.
This method is applicable for flat-to-screen annotations only.
The methods pfcDetail.AnnotationTextStyle.IsTextMirrored
checks if the text style is mirrored.
The methods pfcDetail.AnnotationTextStyle.MirrorText
specifies the option to mirror the text style. Specify the input argument Mirror to
true to mirror the text style.
The methods pfcDetail.AnnotationTextStyle.IsTextUnderlined
checks if the text style is underlined.
The methods pfcDetail.AnnotationTextStyle.UnderlineText
specifies the option to underline the text style

Annotation Orientation
An annotation orientation refers to the annotation plane or the parallel plane in
which the annotation lies, the viewing direction, and the text rotation. You can
define the annotation orientation using a datum plane or flat surface, a named
view, or as flat to screen. If the orientation is defined by a datum plane, you can
set its reference to frozen or driven; where frozen indicates that the reference
to the datum plane or named view has been removed.
Methods Introduced:
• wfcAnnotation.Annotation.Rotate
• wfcSelect.WSelection.CreateAnnotationPlane
• wfcSolid.WSolid.CreateAnnotationPlaneFromView
• wfcSolid.WSolid.CreateFlatToScreenPlane
• wfcAnnotation.AnnotationPlane.GetReference
• wfcAnnotation.AnnotationPlane.GetPlaneData
• wfcAnnotation.AnnotationPlane.GetNormalVector
• wfcAnnotation.AnnotationPlane.GetViewName
• wfcAnnotation.AnnotationPlane.GetPlaneType

256 Creo Object TOOLKIT JavaUser’s Guide


• wfcAnnotation.AnnotationPlane.IsFrozen
• wfcAnnotation.AnnotationPlane.SetFrozen
• wfcAnnotation.AnnotationPlane.IsForceToPlane
• wfcAnnotation.AnnotationPlane.SetForceToPlane
• wfcAnnotation.AnnotationPlane.GetPlaneAngle
• wfcAnnotation.AnnotationPlane.GetPlaneOrientation
The method wfcAnnotaion.Annotation.Rotate rotates a given
annotation by the specified angle. This moves the annotation to a new annotation
plane with the appropriate rotation assigned. Other annotations on the annotation’s
current plane are unaffected by this method.

Note
You can only rotate annotations that belong to annotation elements using the
above method.

The method wfcSelect.WSelection.CreateAnnotationPlane


creates a new annotation plane from either a datum plane, a flat surface, or an
existing annotation that already contains an annotation plane .
The method wfcSolid.WSolid.CreateAnnotationPlaneFromView
creates a new annotation plane from a saved model view .
The method wfcSolid.WSolid.CreateFlatToScreenPlane returns an
annotation plane representing a flat-to-screen annotation in the model . This
method takes a boolean input argument ScreenOrMdlPoint, which identifies
whether the annotations on this plane are located by screen points, or by model
units.
The method wfcAnnotation.AnnotationPlane.GetReference
returns the planar surface used as the annotation plane.
The method wfcAnnotation.AnnotationPlane.GetPlaneData
returns the geometry of the annotation plane, the origin and orientation of the
annotation plane as a wfcGeometry.WPlaneData object.
The method wfcAnnotation.AnnotationPlane.GetNormalVector
returns the normal vector that determines the viewing direction of the annotation
plane .
The method wfcAnnotation.AnnotationPlane.GetViewName obtains
the name of the view that was originally used to determine the orientation of the
annotation plane.

Annotations: Annotation Features and Annotations 257


Note
If the named view orientation has been changed after the annotation plane was
created, the orientation of the plane will not match the current orientation of
the view.

Use the method wfcAnnotation.AnnotationPlane.GetPlaneType to


obtain the annotation plane type. the valid values of the enumerated data type
wfcAnnotation.AnnotationPlaneType:
• ANNOTATION_PLANE_REFERENCE—The annotation plane is created from
a datum plane or a flat surface, and can be frozen or be associative to the
reference.
• ANNOTATION_PLANE_NAMED_VIEW—The annotation plane is created
from a named view or a view in the drawing.
• ANNOTATION_PLANE_FLATTOSCREEN_BY_MODELPNT—The
annotation plane is flat-to-screen and annotations are located by model units.
• ANNOTATION_PLANE_FLATTOSCREEN_BY_SCREENPNT—The
annotation plane is flat-to-screen and annotations are located by screen points.
• ANNOTATION_PLANE_FLATTOSCREEN_LEGACY—The annotation uses a
legacy flat-to-screen format (located in model space).
The methods wfcAnnotation.AnnotationPlane.IsFrozen and
wfcAnnotation.AnnotationPlane.SetFrozen determine and assign,
respectively, whether the annotation orientation is frozen or driven by reference to
the plane geometry. These methods are applicable only for annotation planes
governed by references.
The methods wfcAnnotation.AnnotationPlane.IsForceToPlane
and wfcAnnotation.AnnotationPlane.SetForceToPlane check and
assign, respectively, the boolean value of the argument ForceToPlane for an
annotation plane. If this argument is set to true, then the annotations that
reference the annotation plane are placed on that plane. If the annotation
orientation is not frozen, that is, driven by the reference plane, and if the reference
plane is moved, then the annotations also move along with the plane.
The method wfcAnnotation.AnnotationPlane.GetPlaneAngle
returns the current rotation angle in degrees for a given annotation plane.
The method
wfcAnnotation.AnnotationPlane.GetPlaneOrientation returns
the text orientation of all annotations on that plane.

258 Creo Object TOOLKIT JavaUser’s Guide


Accessing Baseline and Ordinate Dimensions
The methods described in this section enable you to create 3D ordinate driven
dimensions in 3D models as model annotations or as annotation elements. They
also provide the ability to define a baseline annotation element, and then define
model ordinate dimension annotations and ordinate dimension annotation
elements that reference the baseline annotation element.

Baseline Dimensions
Methods Introduced:
• wfcDimension.WDimension.IsBaseline
• wfcDimension.WDimension.GetBaselineDimension
• wfcSelect.WSelection.CreateAnnotationFeatBaseline
The method wfcDimension.WDimension.IsBaseline identifies whether
a dimension is a baseline dimension.
The method wfcDimension.WDimension.GetBaselineDimension
obtains the baseline dimension in a drawing.
The method
wfcSelect.WSelection.CreateAnnotationFeatBaseline creates
an ordinate baseline annotation element and corresponding dimension as a
wfcAnnotation.AnnotationElement object. The input arguments are:
• Reference—Specifies the reference geometry for the ordinate baseline
dimension as a pfcSelect.Selection object.
• Plane—Specifies the annotation plane for the baseline dimension and all its
related dimensions as a wfcAnnotation.AnnotationPlane. Refer to
the section Annotation Orientation on page 256 for more information on the
wfcAnnotation.AnnotationPlane object.
• DirReference—Specifies the direction of the dimension witness lines.

Ordinate Dimensions
Methods Introduced:
• wfcDimension.WDimension.IsOrdinate
• wfcDimension.WDimension.GetOrdinateStandard
• wfcDimension.WDimension.SetOrdinateStandard
• wfcDimension.WDimension.SetOrdinateReferences
• wfcDrawing.WDrawing.CreateAutoOrdinateDimensions
• wfcDimension.WDimension.OrdinateDimensionToLinear
• wfcDimension.WDimension.LinearDimensionToOrdinate

Annotations: Annotation Features and Annotations 259


The method wfcDimension.WDimension.IsOrdinate identifies if a
dimension is ordinate.
The method wfcDimension.WDimension.GetOrdinateStandard
returns the display standard for the ordinate dimensions in the drawing using the
enumerated type wfcDimension.DimOrdinateStandard. The valid
values for display standards are as follows:
• DIM_ORDSTD_DEFAULT—Specifies the default style for the ordinate
dimensions.
• DIM_ORDSTD_ANSI—Specifies the American National Standard style for
the ordinate dimension. It places the related ordinate dimensions without a
connecting line.
• DIM_ORDSTD_JIS—Specifies the Japanese Industrial Standard style for the
ordinate dimension. It places the ordinate dimensions along a connecting line
that is perpendicular to the baseline and starts with an open circle.
• DIM_ORDSTD_ISO—Specifies the International Standard of Organization
style for the ordinate dimension.
• DIM_ORDSTD_DIN—Specifies the German Institute for Standardization style
for the ordinate dimension.
• DIM_ORDSTD_SAME_AS_3D—Specifies the ordinate dimension style for
2D drawings. Not used in 3D ordinate dimensions.
The method wfcDimension.WDimension.SetOrdinateStandard sets
the style for the specified ordinate dimension or a set of ordinate dimensions.
Use the method
wfcDimension.WDimension.SetOrdinateReferences to set the
dimension attachments and dimension senses.
The method
wfcDrawing.WDrawing.CreateAutoOrdinateDimensions creates
ordinate dimensions automatically for the selected surfaces. The input arguments
are:
• Surfaces—Specifies a set of parallel surfaces for which the ordinate
dimensions must be created as a pfcSelect.Selections object.
• Baseline—Specifies a reference element used to create the baseline dimension
as a pfcSelect.Selection object. The reference element can be an
edge, a curve, or a datum plane.
The method
wfcDimension.WDimension.OrdinateDimensionToLinear converts
an existing ordinate dimension to a linear dimension in a solid.
The method
wfcDimension.WDimension.LinearDimensionToOrdinate converts
a linear dimension to an ordinate dimension.

260 Creo Object TOOLKIT JavaUser’s Guide


Note
The dimension must be first created as an ordinate dimension and then
converted to a linear dimension. This method does not work on dimensions
which were first created as linear dimensions.

Annotation Associativity
The methods described in this section allow you to ensure associativity between
shown annotations in drawings and 3D models. You can independently control the
position associativity and attachment associativity of a drawing annotation.

Note
• Drawing annotations can have only uni-directional associativity, that is,
changes to the position and attachment of the annotation in the 3D model
are reflected for the annotation in the drawing view, but not vice-versa.
• You cannot modify the position associativity and attachment associativity
of a drawing annotation from the 3D model.
• You cannot make free, flat-to-screen annotations in a drawing view
associative to the annotations in the 3D model.
• Annotation properties such as text, jogs, breaks, skew, witness line
clippings, and flip arrow states are not associative.

Methods Introduced:
• wfcAnnotation.Annotation.IsAssociative
• wfcAnnotation.Annotation.GetAttachmentAssociativity
• wfcAnnotation.Annotation.UpdatePosition
• wfcAnnotation.Annotation.UpdateAttachment
The method wfcAnnotation.Annotation.IsAssociative checks if a
given annotation in a drawing view is associative to the annotation in the 3D
model.
The method
wfcAnnotation.Annotation.GetAttachmentAssociativity
retrieves the associativity of the attachment using the enumerated data type
wfcAnnotation.AnnotationAttachmentAssociativity. The valid
values are as follows:

Annotations: Annotation Features and Annotations 261


• ANNOTATTACH_ASSOCIATIVITY_NONE—Specifies that the drawing
annotation is not associative.
• ANNOTATTACH_ASSOCIATIVITY_PARTIAL—Specifies that the drawing
annotation is partially associative.
• ANNOTATTACH_ASSOCIATIVITY_FULL— Specifies that the drawing
annotation is fully associative.
The method wfcAnnotation.Annotation.UpdatePosition updates
the position of the drawing annotation, and makes it associative to the position of
the annotation in the 3D model.

Note
You can update the associative position only for drawing annotations that have
their placement based on model coordinates.

The method wfcAnnotation.Annotation.UpdateAttachment updates


the attachment of the drawing annotation, and makes it associative to the
attachment of the annotation in the 3D model. Associative attachment of an
annotation refers to both – its references and its attachment point on its references.
t.

Note
You can update the associative attachment only for drawing annotations that
are attached to the geometry.

Accessing Set Datum Tags


The methods described in this section provide the ability to access and display set
datum tag annotations in 3D models.
Methods Introduced:
• wfcAnnotation.SetDatumTag.GetAttachment
• wfcAnnotation.SetDatumTag.SetAttachment
• wfcAnnotation.SetDatumTag.GetAnnotationPlane
• wfcAnnotation.SetDatumTag.SetAnnotationPlane
• wfcAnnotation.SetDatumTag.Show

262 Creo Object TOOLKIT JavaUser’s Guide


The methods wfcAnnotation.SetDatumTag.GetAttachment and
wfcAnnotation.SetDatumTag.SetAttachment get and set the item on
which the datum tag .

Note
To specify the datum plane or datum axis as the attachment option, pass the
input argument Reference as NULL in the method
wfcAnnotation.SetDatumTag.SetAttachment. The datum tag is
attached to the datum axis at the default location.

The methods wfcAnnotation.SetDatumTag.GetAnnotationPlane


and wfcAnnotation.SetDatumTag.SetAnnotationPlane get and set
the annotation plane for the specified set datum tag .
Once the set datum tag annotation is created, use the method
wfcAnnotation.SetDatumTag.Show to display it.

Designating Dimensions and Symbols


Methods Introduced:
• wfcModel.WModel.DesignateSymbol
• wfcModel.WModel.IsDesignatedSymbol
• wfcModel.WModel.UndesignateSymbol
The method wfcModel.WModel.DesignateSymbol designates a
dimension, dimension tolerance, geometric tolerance or surface finish symbol to
the specified model.
The method wfcModel.WModel.IsDesignatedSymbol determines if a
dimension, dimension tolerance, geometric tolerance or surface finish symbol has
been designated to a model.
The method wfcModel.WModel.UndesignateSymbol undesignates the
dimension, dimension tolerance, geometric tolerance or surface finish symbol
from the specified model.

Surface Finish Annotations


The methods described in this section provide read access to the properties of the
surface finish object. They also allow you to create and modify surface finishes.
The style of surface finishes for releases previous to Pro/ENGINEER Wildfire 2.0
was a flat-to-screen symbol attached to a single surface. From Pro/ENGINEER
Wildfire 2.0 onwards, the method for construction of surface finishes has been

Annotations: Annotation Features and Annotations 263


modified. The new style of surface finish is a symbol instance that may be
attached on a surface or with a leader. The following methods support both the old
and new surface finish annotations, except where specified.
Methods Introduced:
• wfcAnnotation.SurfaceFinish.GetValue
• wfcAnnotation.SurfaceFinish.SetValue
• wfcAnnotation.SurfaceFinish.GetReferences
• wfcAnnotation.SurfaceFinish.GetSurfaceCollection
• wfcAnnotation.SurfaceFinish.SetSurfaceCollection
• wfcAnnotation.SurfaceFinish.Modify
• wfcAnnotation.SurfaceFinish.GetSymbolInstructions
• wfcAnnotation.SurfaceFinish.Delete
• wfcAnnotation.SurfaceFinish.Show
• wfcModel.WModel.CreateSurfaceFinish
The methods wfcAnnotation.SurfaceFinish.GetValue and
wfcAnnotation.SurfaceFinish.SetValue get and set the value of a
surface finish annotation.
The method wfcAnnotation.SurfaceFinish.GetReferences returns
the surface or surfaces referenced by the surface finish.
The method
wfcAnnotation.SurfaceFinish.GetSurfaceCollection obtains a
surface collection which contains the references of the surface finish .
The method
wfcAnnotation.SurfaceFinish.GetSurfaceCollection assigns a
surface collection to be the references of the surface finish. This overwrites all
current surface finish references. The following types of surface collections are
supported:
• One by one surface set
• Intent surface set
• Excluded surface set
• Seed and Boundary surface set
• Loop surface set
• Solid surface set
• Quilt surface set
The method wfcAnnotation.SurfaceFinish.Modify modifies the
symbol instance data for the specified surface finish. This method supports new
symbol-based surface finishes only.

264 Creo Object TOOLKIT JavaUser’s Guide


The method
wfcAnnotation.SurfaceFinish.GetSymbolInstructions returns
the symbol instance data for the surface finish
The method wfcAnnotation.SurfaceFinish.Delete deletes the
specified surface finish.
Once the surface finish annotation is created, use the method
wfcAnnotation.SurfaceFinish.Show to display it.
The method wfcModel.WModel.CreateSurfaceFinish creates a new
symbol-based surface finish annotation. The method requires a symbol instance
data structure for creation. Once the surface finish annotation is created, use the
method wfcAnnotation.Annotation.ShowInDrawing to display it.

Symbol Annotations
The methods described in this section provide support for 3D mode symbols. Creo
Object TOOLKIT C++methods for symbol instances are used in both 2D and 3D
modes. Symbols for a particular mode must conform to the requirements for that
mode.

Creating, Reading and Modifying 3D Symbols


Methods Introduced:
• wfcDetail.WDetailSymbolInstItem.GetAnnotationPlane
• wfcDetail.WDetailSymbolInstItem.SetAnnotationPlane
The methods
wfcDetail.WDetailSymbolInstItem.GetAnnotationPlane and
wfcDetail.WDetailSymbolInstItem.SetAnnotationPlane
retrieve and set the annotation plane for 3D symbol data . Annotation planes are
required for 3D symbol instances but are not applicable for 2D symbol instances.

Locating and Collecting 3D Symbols and Symbol


Definitions
Methods Introduced:
• wfcDetail.WDetailSymbolDefItem.VisitNotes
• wfcDetail.WDetailSymbolDefItem.VisitEntities
• wfcSolid.WSolid.RetrieveSymbolDefItem
The method wfcDetail.WDetailSymbolDefItem.VisitNotes visits
the notes contained in a symbol definition stored in a solid model or a drawing.

Annotations: Annotation Features and Annotations 265


The method wfcDetail.WDetailSymbolDefItem.VisitEntities
visits the entities contained in a symbol definition stored in a solid model.
The method wfcSolid.WSolid.RetrieveSymbolDefItem allows
retrieval of a symbol definition into a given solid model. The input arguments for
this method are as follows:
• FileName— The name of the symbol definition file.
• Source — The location to search for the symbol definition file.
• FilePath— The path to the file with a symbol definition. If not given, then the
symbol definition is located in the designated directory.
• Version— The version of the symbol definition file. Pass -1 to get the latest
version.
• UpdateUnconditionally— Update flag.
○ xtrue - Update the existing symbol definition unconditionally.
○ xfalse- Do not load new definition if the same symbol exist in the
drawing.

Notes
The methods in this section enable you to access the notes created in Creo.

Note
These methods are applicable to solids (parts and assemblies) only.

Note Properties
Methods Introduced:
• wfcDetail.WDetailNoteItem.GetElbowDirection
• wfcDetail.WDetailNoteItem.GetLeaderStyle
• wfcDetail.WDetailNoteItem.SetLeaderStyle
• wfcDetail.WDetailNoteItem.Get3DLineEnvelope
• wfcDetail.WDetailNoteItem.GetLegacyLeaderNoteLength
• wfcDetail.WDetailNoteItem.GetLegacyLeaderNoteDirection
The method wfcDetail.WDetailNoteItem.GetElbowDirection
retrieves the direction of elbow in a note in model coordinate system . For flat-to-
screen notes, the method retrieves the elbow direction in the screen coordinate
system.

266 Creo Object TOOLKIT JavaUser’s Guide


The methods wfcDetail.WDetailNoteItem.GetLeaderStyle and
wfcDetail.WDetailNoteItem.SetLeaderStyle retrieve and set the
leader style used for the note. The valid values of the leader style are specified by
the enumerated data type wfcAnnotation.LeaderStyle:
• LEADER_STYLE_STANDARD—Specifies that the leader style used for the
note is standard.
• LEADER_STYLE_ISO—Specifies that the leader style used for the note is
ISO.
The method wfcDetail.WDetailNoteItem.Get3DLineEnvelope
retrieves the envelope of a line for a specified note .
The method
wfcDetail.WDetailNoteItem.GetLegacyLeaderNoteLength
retrieves the length of a leader line in a note .
The method
wfcDetail.WDetailNoteItem.GetLegacyLeaderNoteDirection
retrieves the direction of a leader line in a note .

Note
Creoadds hard line breaks to the multiple lines drawing notes created in Creo
Elements/Pro during retrieval. The hard line breaks display the text of the note
on separate lines in the Note Properties dialog box as they actually appear in
the drawing note.

Accessing Note Placement


The methods described in this section provide access to the properties of a 3D
note.
Methods Introduced:
• wfcDetail.WDetailNoteItem.GetLeaderArrowTypes
• wfcDetail.WDetailNoteItem.GetAnnotationPlane
The method wfcDetail.WDetailNoteItem.GetLeaderArrowTypes
retrieves the type of arrowhead used for leaders attached to note .
The method wfcDetail.WDetailNoteItem.GetAnnotationPlane
retrieves the annotation plane assigned to the note attachment data .

Annotations: Annotation Features and Annotations 267


Modifying 3D Note Attachments
The actual note created in Creo Parametric will not be modified until the note
attachment is assigned to the note.
Methods Introduced:
• wfcDetail.WDetailNoteItem.AddLeader
• wfcDetail.WDetailNoteItem.AddLeaderWithArrowType
• pfcDetail.DetailLeaderAttachment.GetLeaderAttachment
• pfcDetail.DetailLeaderAttachment.SetLeaderAttachment
• pfcDetail.DetailLeaderAttachment.GetType
• wfcDetail.WDetailNoteItem.SetLeadersWithArrowType
• wfcDetail.WDetailNoteItem.RemoveLeader
• wfcDetail.WDetailNoteItem.SetAnnotationPlane
• wfcSolid.WSolid.CreateOnItemNote
• wfcSolid.WSolid.CreateFreeNote
The method wfcDetail.WDetailNoteItem.AddLeader adds a new
leader to the end of the array of current leaders on a note. .
Use the method
wfcDetail.WDetailNoteItem.AddLeaderWithArrowType to add a
new leader to the end of the array of current leaders on a note . The method takes
as input a DetailLeaderAttachment object and the type of arrowhead to be
used for the leader.
The methods
pfcDetail.DetailLeaderAttachment.GetLeaderAttachment and
pfcDetail.DetailLeaderAttachment.SetLeaderAttachment
retrieve and set the leader attachment as a pfcDetail.Attachment object.
The method pfcDetail.DetailLeaderAttachment.GetType retrieves
the type of attachment using the enumerated data type
pfcDetail.DetailLeaderAttachmentType. It determines the precise
attachment point for the note leader.
The valid values are:
• LEADER_ATTACH_NONE—Specifies regular leader attachment.
• LEADER_ATTACH_NORMAL—Specifies a normal attachment.
• LEADER_ATTACH_TANGENT—Specifies a tangent attachment.
The method
wfcDetail.WDetailNoteItem.SetLeadersWithArrowType sets a
new leader to the end of the array of current leaders on a note and specifies the
type of arrowhead that is to be used for the attached leader.

268 Creo Object TOOLKIT JavaUser’s Guide


The method wfcDetail.WDetailNoteItem.RemoveLeader removes a
leader from the note .
The method wfcDetail.WDetailNoteItem.SetAnnotationPlane
sets the annotation plane for the note..
The method wfcSolid.WSolid.CreateOnItemNote sets the location of
an "On Item" note placement. Using this method removes any leaders currently
assigned to the note attachment.
The method wfcSolid.WSolid.CreateFreeNote sets the location of the
note text. The input arguments to this method are TextLines and Attach. The note
text is stored in relative model coordinates, where {0.5, 0.5, 0.5} indicates the
exact center of the model's display bounding box obtained from
wfcWSolid::GetDisplayOutline, and {0.0, 0.0, 0.0} and {1.0, 1.0, 1.0}
represent the corners of the box.

Text Style Properties


Methods Introduced:
• pfcbase.TextStyle.GetAngle
• pfcbase.TextStyle.SetAngle
• pfcbase.TextStyle.GetFontName
• pfcbase.TextStyle.SetFontName
• pfcbase.TextStyle.GetHeight
• pfcbase.TextStyle.SetHeight
• pfcbase.TextStyle.GetIsMirrored
• pfcbase.TextStyle.SetIsMirrored
• pfcbase.TextStyle.GetSlantAngle
• pfcbase.TextStyle.SetSlantAngle
• pfcbase.TextStyle.GetThickness
• pfcbase.TextStyle.SetThickness
• pfcbase.TextStyle.GetWidthFactor
• pfcbase.TextStyle.SetWidthFactor
• pfcbase.TextStyle.GetIsUnderlined
• pfcbase.TextStyle.SetIsUnderlined
The functions pfcbase.TextStyle.GetAngle and
pfcbase.TextStyle.SetAngle get and set the angle of rotation for the text
style object.. If you do not call pfcbase.TextStyle.SetAngle when
creating the text style, the rotation defaults to 0.0.

Annotations: Annotation Features and Annotations 269


The methods pfcbase.TextStyle.GetFontName and
pfcbase.TextStyle.SetFontName get and set the font used to display the
text style object.
The methods pfcbase.TextStyle.GetHeight and
pfcbase.TextStyle.SetHeight get and set the height of the text style
object. The value -1.0 means that the text has the default height for text
currently specified for the drawing.
The methods pfcbase.TextStyle.GetIsMirrored and
pfcbase.TextStyle.SetIsMirrored get and set the mirroring option
specified for the text style object.
The methods pfcbase.TextStyle.GetSlantAngle and
pfcbase.TextStyle.SetSlantAngle get and set the slant angle of the
text style object.
The methods pfcbase.TextStyle.GetThickness and
pfcbase.TextStyle.SetThickness get and set the line thickness of the
text style object. The value -1.0 means that the text has the default thickness for
text currently specified for the drawing.
The methods pfcbase.TextStyle.GetWidthFactor and
pfcbase.TextStyle.SetWidthFactor get and set the width factor of the
text style object. The width factor is the ratio of the width of each character to the
height. The value -1.0 means that the width factor has the default value for text
currently specified for the drawing.
The methods pfcbase.TextStyle.GetIsUnderlined and
pfcbase.TextStyle.SetIsUnderlined get and set the underline option
for the text style object.

270 Creo Object TOOLKIT JavaUser’s Guide


14
Annotations: Geometric
Tolerances
Reading Geometric Tolerances ................................................................................ 272
Deleting a Geometric Tolerance................................................................................ 273
Validating a Geometric Tolerance ............................................................................. 273
Geometric Tolerance Layout..................................................................................... 273
Additional Text for Geometric Tolerances................................................................... 274
Geometric Tolerance Text Style ................................................................................ 275
Creating a Geometric Tolerance ............................................................................... 276
Attaching the Geometric Tolerances.......................................................................... 280

The methods in this chapter allow a Creo Object TOOLKIT C++ application to
read, modify, and create geometric tolerances (gtols) in a solid or drawing. We
recommend that you study the Creo Parametric documentation on geometric
tolerances, and develop experience with manipulating geometric tolerances using
the Creo Parametric commands before attempting to use these methods.

271
Reading Geometric Tolerances
Methods Introduced:
• wfcGTol.GTol.GetGTolName
• wfcGTol.GTol.GetTopModel
• wfcGTol.GTol.GetCompositeSharedReference
• wfcGTol.GTol.GetComposite
• wfcGTol.GTol.GetDatumReferences
• wfcGTol.GTol.GetIndicators
• wfcGTol.GTol.GetReferences
• wfcGTol.GTol.GetGTolType
• wfcGTol.GTol.IsBoundaryDisplay
• wfcGTol.GTol.GetUnilateralModifier
• wfcGTol.GTol.GetValueString
• wfcGTol.GTol.IsAllAround
• wfcGTol.GTol.IsAllOver
• wfcGTol.GTol.IsAddlTextBoxed
The method wfcGTol.GTol.GetGTolName retrieves the name of the
geometric tolerance (gtol).
The method wfcGTol.GTol.GetTopModel retrieves the top model that owns
the specified gtol. This will usually be the model that contains the gtol; but if the
gtol was created in drawing mode and added to a solid in a drawing view, the
owner will be the drawing, while the model is the solid.
The method wfcGTol.GTol.GetComposite retrieves the value and the
datum references, that is, the primary, secondary, and tertiary references for the
specified composite gtol.
The method wfcGTol.GTol.GetCompositeSharedReference checks if
the datum references are shared between all the rows defined in the composite
gtol.
The method wfcGTol.GTol.GetDatumReferences retrieves the primary,
secondary, and tertiary datum references for a gtol.
The method wfcGTol.GTol.GetIndicators retrieves all the indicators
assigned to the specified gtol.
The method wfcGTol.GTol.GetReferences retrieves a sequence of
geometric entities referenced by the specified gtol. The entities are additional
references used to create the gtol. This method supports only gtols that are not
created as Annotation Elements.

272 Creo Object TOOLKIT JavaUser’s Guide


The method wfcGTol.GTol.GetGTolType retrieves the type of gtol using
the class wfcGTol.GTolType. The various types of gtol, are straightness,
flatness, and so on.
The method wfcGTol.GTol.IsBoundaryDisplay checks if the boundary
modifier has been set for the specified gtol.
Use the method wfcGTol.GTol.GetUnilateralModifier to check if the
profile boundary has been set to unilateral in the specified gtol. If set to unilateral,
the method also checks if the tolerance disposition is in the outward direction of
the profile.
The method wfcGTol.GTol.GetValueString retrieves the value specified
in the gtol as a wchar_t* string.
The method wfcGTol.GTol.IsAllAround checks if the All Around symbol
has been set for the specified gtol.
The method wfcGTol.GTol.IsAllOver checks if the All Over symbol has
been set for the specified gtol. The All Over symbol and All Around symbol
specifies that the profile tolerance must be applied to all the three dimensional
profile of the part.
The method wfcGTol.GTol.IsAddlTextBoxed checks if a box has been
created around the specified additional text in a geometric tolerance.

Deleting a Geometric Tolerance


Methods Introduced:
• wfcGTol.GTol.Delete
The method wfcGTol.GTol.Delete permanently removes a gtol.

Validating a Geometric Tolerance


Methods Introduced:
• wfcGTol.GTol.Validate
The method wfcGTol.GTol.Validate checks if the specified geometric
tolerance is syntactically correct. For example, when a string is specified instead
of a number for a tolerance value, it is considered as syntactically incorrect. The
input argument Type is specified using the class
wfcGTol.GTolValidityCheckType.

Geometric Tolerance Layout


The methods described in this section provide access to the layout for the text and
symbols in a geometric tolerance.

Annotations: Geometric Tolerances 273


Methods Introduced:
• wfcGTol.GTol.GetElbow
• wfcGTol.GTol.GetRightTextEnvelope
• wfcGTol.GTol.Get3DLineEnvelope
The method wfcGTol.GTol.GetElbow retrieves the length and direction of
the geometric tolerance leader elbow.
The method wfcGTol.GTol.GetRightTextEnvelope retrieves the
bounding box coordinates for the right text in a specified geometric tolerance.
The method wfcGTol.GTol.Get3DLineEnvelope retrieves the bounding
box coordinates for one line from the geometric tolerance. The input argument
LineNumber is the line number for which the bounding box coordinates are to be
returned.

Note
The above methods support only gtols that are placed on an annotation plane.

Additional Text for Geometric Tolerances


You can place multi-line additional text to the right, left, bottom, and above a
geometric tolerance control frame while creating and editing a gtol in both
drawing and model modes.
Methods Introduced:
• wfcGTol.GTol.GetBottomText
• wfcGTol.GTol.SetBottomText
• wfcGTol.GTol.GetLeftText
• wfcGTol.GTol.SetLeftText
• wfcGTol.GTol.GetRightText
• wfcGTol.GTol.SetRightText
• wfcGTol.GTol.GetTopText
• wfcGTol.GTol.SetTopText
The method wfcGTol.GTol.GetBottomText retrieves the text added to the
bottom of the specified geometric tolerance.
Use the method wfcGTol.GTol.SetBottomText to set the text to be added
to the bottom of the specified geometric tolerance.
The method wfcGTol.GTol.GetLeftText retrieves the text added to the left
of the specified geometric tolerance.

274 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcGTol.GTol.SetLeftText to set the text to be added to
the left of the specified geometric tolerance.
The method wfcGTol.GTol.GetRightText retrieves the text added to the
right of the specified geometric tolerance.
Use the method wfcGTol.GTol.SetRightText to set the text to be added to
the right of the specified geometric tolerance.
The method wfcGTol.GTol.GetTopText retrieves the text added to the top
of the specified geometric tolerance.
Use the method wfcGTol.GTol.SetTopText to set the text to be added to
the top of the specified geometric tolerance.

Geometric Tolerance Text Style


The methods described in this section access the text style properties of a
geometric tolerance.
Methods Introduced:
• wfcGTol.GTol.GetBottomTextHorizJustification
• wfcGTol.GTol.SetBottomTextHorizJustification
• wfcGTol.GTol.GetTopTextHorizJustification
• wfcGTol.GTol.SetTopTextHorizJustification
• wfcGTol.GTol.GetAdditionaltextTextStyle
• wfcGTol.GTol.SetGTolAdditionaltextTextStyle
The method wfcGTol.GTol.GetBottomTextHorizJustification
retrieves the horizontal justification for the additional text applied to the specified
geometric tolerance at the bottom.
The method wfcGTol.GTol.SetBottomTextHorizJustification
sets the horizontal justification for the additional text applied to the specified
geometric tolerance at the bottom. The input argument
BottomTextHorizJustification is specified using the enumerated type
pfcDetail.HorizontalJustification and the valid values are:
• H_JUSTIFY_LEFT
• H_JUSTIFY_CENTER
• H_JUSTIFY_RIGHT
• H_JUSTIFY_DEFAULT
The method wfcGTol.GTol.GetTopTextHorizJustification
retrieves the horizontal justification for the additional text applied to the specified
geometric tolerance at the top.

Annotations: Geometric Tolerances 275


The method wfcGTol.GTol.SetTopTextHorizJustification sets the
horizontal justification for the additional text applied to the specified geometric
tolerance at the top. The input argument TopTextHorizJustification is specified
using the class pfcDetail.HorizontalJustification.
The method wfcGTol.GTol.GetAdditionaltextTextStyle retrieves
the text style of the additional text applied to the specified geometric tolerance.
The method wfcGTol.GTol.SetGTolAdditionaltextTextStyle
assigns the text style of the additional text applied to the specified geometric
tolerance. The input parameters are:
• Type—Specifies the text type of the additional text using the class
wfcGTol.GTolTextType.
• TextStyle—Specify the text style using the class
pfcDetail.AnnotationTextStyle.

Creating a Geometric Tolerance


Methods Introduced:
• wfcGTol.GTol.SetGTolType
• wfcGTol.GTol.SetBoundaryDisplay
• wfcGTol.GTol.SetUnilateralModifier
• wfcGTol.wfcGTol.GTolUnilateralModifier_Create
• wfcGTol.GTolUnilateralModifier.GetOutside
• wfcGTol.GTolUnilateralModifier.SetOutside
• wfcGTol.GTolUnilateralModifier.GetUnilateral
• wfcGTol.GTolUnilateralModifier.SetUnilateral
• wfcGTol.GTol.SetValueString
• wfcGTol.GTol.AddReferences
• wfcGTol.GTol.DeleteReference
• wfcGTol.GTol.SetIndicators
• wfcGTol.wfcGTol.GTolIndicator_Create
• wfcGTol.GTolIndicator.GetDFS
• wfcGTol.GTolIndicator.SetDFS
• wfcGTol.GTolIndicator.GetSymbol
• wfcGTol.GTolIndicator.SetSymbol
• wfcGTol.GTolIndicator.GetType
• wfcGTol.GTolIndicator.SetType
• wfcGTol.GTol.SetElbow

276 Creo Object TOOLKIT JavaUser’s Guide


• wfcGTol.wfcGTol.GTolElbow_Create
• wfcGTol.GTolElbow.GetDirection
• wfcGTol.GTolElbow.SetDirection
• wfcGTol.GTolElbow.GetLength
• wfcGTol.GTolElbow.SetLength
• wfcGTol.GTol.SetDatumReferences
• wfcGTol.wfcGTol.GTolDatumReferences_Create
• wfcGTol.GTolDatumReferences.GetPrimary
• wfcGTol.GTolDatumReferences.SetPrimary
• wfcGTol.GTolDatumReferences.GetSecondary
• wfcGTol.GTolDatumReferences.SetSecondary
• wfcGTol.GTolDatumReferences.GetTertiary
• wfcGTol.GTolDatumReferences.SetTertiary
• wfcGTol.GTol.SetCompositeSharedReference
• wfcGTol.GTol.SetComposite
• wfcGTol.wfcGTol.GTolComposite_Create
• wfcGTol.GTolComposite.GetPrimary
• wfcGTol.GTolComposite.SetPrimary
• wfcGTol.GTolComposite.GetSecondary
• wfcGTol.GTolComposite.SetSecondary
• wfcGTol.GTolComposite.GetTertiary
• wfcGTol.GTolComposite.SetTertiary
• wfcGTol.GTolComposite.GetValue
• wfcGTol.GTolComposite.SetValue
• wfcGTol.GTol.SetAllAround
• wfcGTol.GTol.SetAllOver
• wfcGTol.GTol.SetAddlTextBoxed
The method wfcGTol.GTol.SetGTolType sets the type of geometric
tolerance using the class wfcGTol.GTolType.
The method wfcGTol.GTol.SetBoundaryDisplay sets the boundary
modifier for the specified gtol.
Use the method wfcGTol.GTol.SetUnilateralModifier to set the
profile boundary as unilateral in the specified gtol using the class
wfcGTol.GTolUnilateralModifier.
The method wfcGTol.wfcGTol.GTolUnilateralModifier_Create
creates a unilateral modifier for a specified gtol.

Annotations: Geometric Tolerances 277


Use the methods wfcGTol.GTolUnilateralModifier.GetOutside
and wfcGTol.GTolUnilateralModifier.SetOutside to get and set
the tolerance disposition to outward direction for the specified gtol.
Use the methods
wfcGTol.GTolUnilateralModifier.GetUnilateral and
wfcGTol.GTolUnilateralModifier.SetUnilateral to get and set
the boundary modifier as unilateral for the specified gtol.
The method wfcGTol.GTol.SetValueString sets the specified value
string for a gtol.
Use the method wfcGTol.GTol.AddReferences to add datum references to
the specified gtol.
Use the method wfcGTol.GTol.DeleteReference to delete the datum
references from the specified gtol.
The method wfcGTol.GTol.SetIndicators sets the indicators for the
specified gtol. Specify the input argument indicators using the class
wfcGTol.GTolIndicators.
Use the method wfcGTol.wfcGTol.GTolIndicator_Create to create an
indicator for a specified gtol. The input arguments are:
• Type—Specify a sequence of indicator types.
• Symbol—Specifies a sequence of strings for indicator symbols.
• Df—Specifies a sequence of strings for datum feature symbols.
Use the methods wfcGTol.GTolIndicator.GetDFS and
wfcGTol.GTolIndicator.SetDFS to get and set the strings for datum
feature symbol.
Use the methods wfcGTol.GTolIndicator.GetSymbol and
wfcGTol.GTolIndicator.SetSymbol to get and set the strings for
indicator symbols.
Use the methods wfcGTol.GTolIndicator.GetType and
wfcGTol.GTolIndicator.SetType to get and set the type of indicators
using the class wfcGTol.GTolIndicatorType and the valid values are:
• GTOL_INDICATOR_DIRECTION_FEAT
• GTOL_INDICATOR_COLLECTION_PLANE
• GTOL_INDICATOR_INTERSECTION_PLANE
• GTOL_INDICATOR_ORIENTATION_PLANE
The method wfcGTol.GTol.SetElbow sets the elbow along with its
properties for a leader type of gtol. This method is supported for leader type gtols
which are placed on the annotation plane. The input argument elbowLength
specifies the length of the elbow in model coordinates.

278 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcGTol.wfcGTol.GTolElbow_Create to create an
elbow for a specified gtol. The input arguments are:
• Length—Specifies the length of the elbow.
• Direction—Specifies the direction of the elbow.
The methods wfcGTol.GTolElbow.GetDirection and
wfcGTol.GTolElbow.SetDirection get and set the direction of the elbow
in a specified gtol.
The methods wfcGTol.GTolElbow.GetLength and
wfcGTol.GTolElbow.SetLength get and set the length of the elbow in a
specified gtol.
Use the method wfcGTol.GTol.SetDatumReferences to set the datum
references for the specified gtol using the class
wfcGTol.GTolDatumReferences. The datum references are set as
wchar_t* strings.
Use the method wfcGTol.wfcGTol.GTolDatumReferences_Create to
create a datum reference for a specified gtol.
Use the methods wfcGTol.GTolDatumReferences.GetPrimary and
wfcGTol.GTolDatumReferences.SetPrimary to get and set the
primary datum references of the gtol.
Use the methods wfcGTol.GTolDatumReferences.GetSecondary and
wfcGTol.GTolDatumReferences.SetSecondary to get and set the
secondary datum references of the gtol.
Use the methods wfcGTol.GTolDatumReferences.GetTertiary and
wfcGTol.GTolDatumReferences.SetTertiary to get and set the
tertiary datum references of the gtol.
Use the method wfcGTol.GTol.SetCompositeSharedReference to
specify if datum references in a composite gtol must be shared between all the
defined rows.
The method wfcGTol.GTol.SetComposite sets the value and datum
references for the specified composite gtol using the class
wfcGTol.GTolComposite.
Use the method wfcGTol.wfcGTol.GTolComposite_Create to create a
composite tolerance for a specified gtol.
Use the methods wfcGTol.GTolComposite.GetPrimary and
wfcGTol.GTolComposite.SetPrimary to get and set the primary datum
strings of the composite tolerance.
Use the methods wfcGTol.GTolComposite.GetSecondary and
wfcGTol.GTolComposite.SetSecondary to get and set the secondary
datum strings of the composite tolerance.

Annotations: Geometric Tolerances 279


Use the methods wfcGTol.GTolDatumReferences.GetTertiary and
wfcGTol.GTolDatumReferences.SetTertiary to get and set the
tertiary datum strings of the composite tolerance.
Use the methods wfcGTol.GTolComposite.GetValue and
wfcGTol.GTolComposite.SetValue to get and set the value datum strings
of the composite tolerance.
The method wfcGTol.GTol.SetAllAround sets the All Around symbol for
the specified geometric tolerance.
The method wfcGTol.GTol.SetAllOver sets the All Over symbol for the
specified geometric tolerance.
The method wfcGTol.GTol.SetAddlTextBoxed creates a box around the
specified additional text in a geometric tolerance. Boxes can be created around
additional text added above and below the frame of the geometric tolerance. The
input arguments are:
• Type—Specifies the instance of additional text to access using the enumerated
type wfcGTol.GTolTextType.
• IsBoxed—Specifies if the additional text is boxed.

Attaching the Geometric Tolerances


Methods Introduced:
• wfcGTol.GTol.GetGTolAttach
• wfcGTol.GTolAttach.GetType
• wfcGTol.GTol.SetAttachFree
• wfcGTol.wfcGTol.GTolAttachFree_Create
• wfcGTol.GTolAttachFree.GetLocation
• wfcGTol.GTolAttachFree.SetLocation
• wfcGTol.GTolAttachFree.GetAnnotationPlane
• wfcGTol.GTolAttachFree.SetAnnotationPlane
• wfcGTol.GTol.SetAttachLeader
• wfcGTol.wfcGTol.GTolAttachLeader_Create
• wfcGTol.GTolAttachLeader.GetLocation
• wfcGTol.GTolAttachLeader.SetLocation
• wfcGTol.GTolAttachLeader.GetLeaders
• wfcGTol.GTolAttachLeader.SetLeaders
• wfcGTol.GTolAttachLeader.GetLeaderAttachType
• wfcGTol.GTolAttachLeader.SetLeaderAttachType
• wfcGTol.GTolAttachLeader.GetAnnotationPlane

280 Creo Object TOOLKIT JavaUser’s Guide


• wfcGTol.GTolAttachLeader.SetAnnotationPlane
• wfcGTol.wfcGTol.GTolLeaderInstructions_Create
• wfcGTol.GTolLeaderInstructions.GetSelection
• wfcGTol.GTolLeaderInstructions.SetSelection
• wfcGTol.GTolLeaderInstructions.GetType
• wfcGTol.GTolLeaderInstructions.SetType
• wfcGTol.GTol.SetAttachDatum
• wfcGTol.wfcGTol.GTolAttachDatum_Create
• wfcGTol.GTolAttachDatum.GetDatum
• wfcGTol.GTolAttachDatum.SetDatum
• wfcGTol.GTol.SetAttachAnnotation
• wfcGTol.wfcGTol.GTolAttachAnnotation_Create
• wfcGTol.GTolAttachAnnotation.GetAnnotation
• wfcGTol.GTolAttachAnnotation.SetAnnotation
• wfcGTol.GTol.SetAttachOffset
• wfcGTol.wfcGTol.AttachOffset_Create
• wfcGTol.GTol.AttachOffset.GetOffset
• wfcGTol.GTol.AttachOffset.SetOffset
• wfcGTol.GTol.AttachOffset.GetOffsetRef
• wfcGTol.GTol.AttachOffset.SetOffsetRef
• wfcGTol.GTol.SetAttachMakeDimension
• wfcGTol.wfcGTol.AttachMakeDimension_Create
• wfcGTol.GTol.AttachMakeDimension.GetLocation
• wfcGTol.GTol.AttachMakeDimension.SetLocation
• wfcGTol.GTol.AttachMakeDimension.GetOrientHint
• wfcGTol.GTol.AttachMakeDimension.SetOrientHint
• wfcGTol.GTol.AttachMakeDimension.GetDimSenses
• wfcGTol.GTol.AttachMakeDimension.SetDimSenses
• wfcGTol.GTol.AttachMakeDimension.GetDimAttachments
• wfcGTol.GTol.AttachMakeDimension.SetDimAttachments
• wfcGTol.GTol.AttachMakeDimension.GetAnnotationPlane
• wfcGTol.GTol.AttachMakeDimension.SetAnnotationPlane
The method wfcGTol.GTol.GetGTolAttach retrieves all the attachment
related information for a gtol using the class wfcGTolAttach.

Annotations: Geometric Tolerances 281


The method wfcGTol.GTol.GetType retrieves the type of attachment for a
specified gtol. It uses the enumerated data type wfcGTol.GTolAttachType
to provide information about the placement of the gtol and has one of the
following values:
• GTOLATTACH_DATUM—Specifies that the gtol is placed on its reference
datum.
• GTOLATTACH_ANNOTATION—Specifies that the gtol is attached to an
annotation.
• GTOLATTACH_ANNOTATION_ELBOW—Specifies that the gtol is attached to
the elbow of an annotation.
• GTOLATTACH_FREE—Specifies that the gtol is placed as free. It is
unattached to the model or drawing.
• GTOLATTACH_LEADERS—Specifies that the gtol is attached with one or
more leader to geometry such as, edge, dimension witness line, coordinate
system, axis center, axis lines, curves, or surface points, vertices, section
entities, draft entities, and so on. The leaders are represented using an opaque
handle, wfcGTolAttachLeader.
• GTOLATTACH_OFFSET—Specifies that the gtol frame can be placed at an
offset from the following drawing objects: dimension, dimension arrow, gtol,
note, and symbol.
• GTOLATTACH_MAKE_DIM—Specifies that the gtol frame is attached to a
dimension line.

Use the method wfcGTol.GTol.SetAttachFree to set the attachment


options for free type of gtol. The input argument Attach is specified using the class
wfcGTol.GTolAttachFree.
Use the method wfcGTol.wfcGTol.GTolAttachFree_Create to create
an attachment for a gtol that is placed free. The input arguments are:
• Location—Specifies the location of the gtol text in model coordinates.
• AnnotationPlane—Specifies the annotation plane in model coordinates.
Use the methods wfcGTol.GTolAttachFree.GetLocation and
wfcGTol.GTolAttachFree.SetLocation to get and set the location of
the gtol text in a specified gtol using the class pfcBase.Point3D.
Use the methods wfcGTol.GTolAttachFree.GetAnnotationPlane
and wfcGTol.GTolAttachFree.SetAnnotationPlane to get and set
the annotation plane in a specified gtol using the class
wfcAnnotation.AnnotationPlane.
Use the method wfcGTol.GTol.SetAttachLeader to set the attachment
options for leader type of gtol. The input argument Attach is specified using the
class wfcGTol.GTolAttachLeader.

282 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcGTol.wfcGTol.GTolAttachLeader_Create to
create an attachment for leader type of gtol. The input arguments are:
• LeaderAttachType—Specifies the attachment type for the leader.
• Leaders—Specifies a sequence of gtol leaders.
• Location—Specifies the location of gtol text in model coordinates.
• AnnotationPlane—Specifies the annotation plane. For gtols defined in
drawing, it returns NULL.
Use the methods wfcGTol.GTolAttachLeader.GetLocation and
wfcGTol.GTolAttachLeader.SetLocation to get and set the location
of the gtol text in a specified gtol using the class pfcBase.Point3D.
Use the methods wfcGTol.GTolAttachLeader.GetLeaders and
wfcGTol.GTolAttachLeader.SetLeaders to get and set the leaders in a
specified gtol using the class wfcGTol.GTolLeaderInstructionsSeq.
Use the methods
wfcGTol.GTolAttachLeader.GetLeaderAttachType and
wfcGTol.GTolAttachLeader.SetLeaderAttachType to get and set
the type of leaders that can be attached in a specified gtol. The type of leaders is
specified using the enumerated type wfcGTol.GTolLeaderAttachType
and one of the valid values are:
• GTOL_LEADER
• GTOL_NORMAL_LEADER
• GTOL_TANGENT_LEADER
Use the methods wfcGTol.GTolAttachLeader.GetAnnotationPlane
and wfcGTol.GTolAttachLeader.SetAnnotationPlane to get and set
the annotation plane on which the leader is attached to the specified gtol. The
plane is specified using the class wfcAnnotation.AnnotationPlane.
Use the method wfcGTol.wfcGTol.GTolLeaderInstructions_
Create to create instructions for a leader type of gtol.
The methods wfcGTol.GTolLeaderInstructions.GetSelection and
wfcGTol.GTolLeaderInstructions.SetSelection get and set the
selection of instructions for a leader type of gtol using the class
pfcSelect.Selection.
The methods wfcGTol.GTolLeaderInstructions.GetType and
wfcGTol.GTolLeaderInstructions.SetType get and set the type of
instructions for a leader type of gtol.
Use the method wfcGTol.GTol.SetAttachDatum to set the attachment
options for datum symbol type of gtol. The input argument Attach is specified
using the class wfcGTol.GTolAttachDatum.

Annotations: Geometric Tolerances 283


Use the method wfcGTol.wfcGTol.GTolAttachDatum_Create to create
an attachment for a specified datum inside a gtol. The input argument Datum is
specified using the pfcModelItem.ModelItem class.
The methods wfcGTol.GTolAttachDatum.GetDatum and
wfcGTol.GTolAttachDatum.SetDatum get and set the attachments for
datum type of gtol.
From Creo Parametric 4.0 F000 onward, datum symbols are defined using datum
feature symbol. The methods work with the new datum feature symbol along with
the legacy datum tag annotations.
Use the method wfcGTol.GTol.SetAttachAnnotation to set the
attachment options for annotation type of gtol. The input argument Attach is
specified using the class wfcGTol.GTolAttachAnnotation.
Use the method wfcGTol.wfcGTol.GTolAttachAnnotation_Create
to create an attachment for a specified annotation inside a gtol. The input
argument Annotation is specified using the wfcAnnotation.Annotation
class.
The methods wfcGTol.GTolAttachAnnotation.GetAnnotation and
wfcGTol.GTolAttachAnnotation.SetAnnotation get and set the
attachments for annotation type of gtol.
Use the method wfcGTol.GTol.SetAttachOffset to set the offset
references for the geometric tolerance. The input argument Attach is specified
using the class wfcGTol.GTolAttachOffset.
Use the method wfcGTol.wfcGTol.AttachOffset_Create to create an
attachment for a gtol with offset references. The input arguments are:
• OffsetRef—Specifies the offset reference.
• Offset—Specifies the position of the offset reference as model coordinates.
The methods wfcGTol.GTol.AttachOffset.GetOffset and
wfcGTol.GTol.AttachOffset.SetOffset get and set the position of the
offset reference as model coordinates using the class pfcBase.Vector3D.
The methods wfcGTol.GTol.AttachOffset.GetOffsetRef and
wfcGTol.GTol.AttachOffset.SetOffsetRef get and set the offset
reference using the class pfcSelect.Selection. The reference can be a
dimension, arrow of a dimension, another geometric tolerance, note, or a symbol
instance. If there are no offset references, the output argument returns NULL.
Use the method wfcGTol.GTol.SetAttachMakeDimension to set all the
attachments options to create a geometric tolerance with Make Dim type of
reference. The input argument Attach is specified using the class
wfcGTol.GTolAttachMakeDimension.
Use the method wfcGTol.wfcGTol.AttachMakeDimension_Create to
create an attachment for a gtol with Make Dim type of reference.

284 Creo Object TOOLKIT JavaUser’s Guide


Use the methods
wfcGTol.GTol.AttachMakeDimension.GetLocation and
wfcGTol.GTol.AttachMakeDimension.SetLocation to get and set
the location of the gtol text in a specified gtol using the class pfcPoint3D.
Use the methods
wfcGTol.GTol.AttachMakeDimension.GetOrientHint and
wfcGTol.GTol.AttachMakeDimension.SetOrientHint to get and
set the orientation of the gtol using the enumerated type
pfcDimension.DimOrientationHint and one of the valid values are:
• ORIENTATION_HINT_HORIZONTAL
• ORIENTATION_HINT_VERTICAL
• ORIENTATION_HINT_SLANTED
• ORIENTATION_HINT_ELLIPSE_RADIUS1
• ORIENTATION_HINT_ELLIPSE_RADIUS2
• ORIENTATION_HINT_ARC_ANGLE
• ORIENTATION_HINT_ARC_LENGTH
• ORIENTATION_HINT_LINE_TO_TANGENT_CURVE_ANGLE
• ORIENTATION_HINT_RADIAL_DIFF
Use the methods
wfcGTol.GTol.AttachMakeDimension.GetDimSenses and
wfcGTol.GTol.AttachMakeDimension.SetDimSenses to get and set
the information about how the gtol attaches to each attachment point of the model
or drawing. The input argument value is specified using the class
pfcDimension.DimSenses.
Use the methods
wfcGTol.GTol.AttachMakeDimension.GetDimAttachments and
wfcGTol.GTol.AttachMakeDimension.SetDimAttachments to get
and set the points on the model or drawing where the gtol is attached. The input
argument value is specified using the class
pfcSelect.DimensionAttachments.
Use the methods
wfcGTol.GTol.AttachMakeDimension.GetAnnotationPlane and
wfcGTol.GTol.AttachMakeDimension.SetAnnotationPlane to get
and set the annotation plane in a specified gtol using the class
wfcAnnotation.AnnotationPlane.

Annotations: Geometric Tolerances 285


15
Windows and Views
Windows................................................................................................................. 287
Embedded Browser ................................................................................................. 290
Views ..................................................................................................................... 291
Coordinate Systems and Transformations ................................................................. 292

Creo Object TOOLKIT Java provides access to Creo windows and saved views.
This chapter describes the methods that provide this access.

286 Creo Object TOOLKIT JavaUser’s Guide


Windows
This section describes the Creo Object TOOLKIT Java methods that access
Window objects. The topics are as follows:
• Getting a Window Object on page 287
• Window Operations on page 289

Getting a Window Object


Methods Introduced:
• 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 Creo application.
The method pfcSession.BaseSession.CreateModelWindow creates a
new window that contains the model that was passed as an argument.

Note
You must call the method pfcModel.Model.Display for the model
geometry to be displayed in the window.

Use the method pfcSession.BaseSession.ListWindows to get a list of


all the current windows in session.
The method pfcSession.BaseSession.GetWindow gets the handle to a
window given its integer identifier.
The method pfcSession.BaseSession.OpenFile returns the handle to a
newly created window that contains the opened model.

Windows and Views 287


Note
If a model is already open in a window the method returns a handle to the
window.

The method pfcSession.BaseSession.GetModelWindow returns the


handle to the window that contains the opened model, if it is displayed.

Creating Windows
Method Introduced:
• wfcSession.WSession.CreateAccessorywindowWithTree
• wfcSession.WSession.CreateBarewindow
In Creo application, when the main window is active, you can open an accessory
window for operations such as editing an inserted component or a feature,
previewing an object, selecting a reference, and so on. The model tree associated
with this Creo object is also displayed in the accessory window.
Use the method
wfcSession.WSession.CreateAccessorywindowWithTree to open
an accessory window containing the specified object. If a window is already open
with the specified object, the method returns the identifier of that window. If an
empty window is already open, the method uses this window to open the object.
The input argument EnableTree controls the display of the model tree in the
accessory window. If set to true the model tree is displayed in the accessory
window.

Note
The accessory window has limited menu options and does not have any
toolbar.

288 Creo Object TOOLKIT JavaUser’s Guide


The method wfcSession.WSession.CreateBarewindow opens a
window containing the specified object. If a window is already open with the
specified object, the method returns the identifier of that window. If an empty
window is already open, the method uses this window to open the object.

Note
The window does not have any menus or toolbar. All the mouse capabilities
for a view such as, zoom, rotate and pan are available.

Window Operations
Methods Introduced:
• pfcWindow.Window.GetHeight
• pfcWindow.Window.GetWidth
• pfcWindow.Window.GetXPos
• pfcWindow.Window.GetYPos
• pfcWindow.Window.GetGraphicsAreaHeight
• pfcWindow.Window.GetGraphicsAreaWidth
• pfcWindow.Window.Clear
• pfcWindow.Window.Repaint
• pfcWindow.Window.Refresh
• pfcWindow.Window.Close
• wfcDisplay.WWindow.Refit
• pfcWindow.Window.Activate
• pfcWindow.Window.GetId
• pfcSession.BaseSession.FlushCurrentWindow
The methods pfcWindow.Window.GetHeight,
pfcWindow.Window.GetWidth, pfcWindow.Window.GetXPos, and
pfcWindow.Window.GetYPos retrieve the height, width, x-position, and y-
position of the window respectively. The values of these parameters are
normalized from 0 to 1.
The methods pfcWindow.Window.GetGraphicsAreaHeight and
pfcWindow.Window.GetGraphicsAreaWidth retrieve the height and
width of the Creo graphics area window without the border respectively. The
values of these parameters are normalized from 0 to 1. For both the window and
graphics area sizes, if the object occupies the whole screen, the window size

Windows and Views 289


returned is 1. For example, if the screen is 1024 pixels wide and the graphics
area is 512 pixels, then the width of the graphics area window is returned as
0.5.
The method pfcWindow.Window.Clear removes geometry from the
window.
Both pfcWindow.Window.Repaint and pfcWindow.Window.Refresh
repaint solid geometry. However, the Refresh method does not remove
highlights from the screen and is used primarily to remove temporary geometry
entities from the screen.
Use the method pfcWindow.Window.Close to close the window. If the
current window is the original window created when Creo application started, this
method clears the window. Otherwise, it removes the window from the screen.
Use the method wfcDisplay.WWindow.Refit to refit the model in the
specified window so that the entire model can be viewed.
The method pfcWindow.Window.Activate activates a window. This
method is available only in the asynchronous mode. The support for asynchronous
mode in Creo Object TOOLKIT Java, which will be added in future releases.
The method pfcWindow.Window.GetId retrieves the ID of the Creo
window.
The method pfcSession.BaseSession.FlushCurrentWindow flushes
the pending display commands on the current window.

Note
It is recommended to call this method only after completing all the display
operations. Excessive use of this method will cause major slow down of
systems running on Windows Vista and Windows 7.

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 Creo window.

290 Creo Object TOOLKIT JavaUser’s Guide


The methods pfcWindow.Window.GetBrowserSize and
pfcWindow.Window.SetBrowserSize enables you to find and change the
size of the embedded browser in the Creo window.

Note
The methods pfcWindow.Window.GetBrowserSize and
pfcWindow.Window.SetBrowserSize are not supported if the browser
is open in a separate window.

Views
This section describes the Creo Object TOOLKIT Java methods that access View
objects. The topics are as follows:
• Getting a View Object on page 291
• View Operations on page 292

Getting a View Object


Methods Introduced:
• pfcView.ViewOwner.RetrieveView
• pfcView.ViewOwner.GetView
• pfcView.ViewOwner.ListViews
• pfcView.ViewOwner.GetCurrentView
Any solid model inherits from the interface ViewOwner. This will enable you to
use these methods on any solid object.
The method pfcView.ViewOwner.RetrieveView sets the current view to
the orientation previously saved with a specified name.
Use the method pfcView.ViewOwner.GetView to get a handle to a named
view without making any modifications.
The method pfcView.ViewOwner.ListViews returns a list of all the views
previously saved in the model.
The method pfcViewOwner::GetCurrentView has been deprecated The
method returns a view handle that represents the current orientation. Although this
view does not have a name, you can use this view to find or modify the current
orientation.

Windows and Views 291


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.
The method pfcView.View.GetIsCurrent determines if the View object
represents the current view.
The pfcView.View.Reset method restores the current view to the default
view.
To store the current view under the specified name, call the method
pfcView.ViewOwner.SaveView.

Coordinate Systems and Transformations


This section describes the various coordinate systems used by Creo application,
which are accessible from Creo Object TOOLKIT Java. It also explains how to
transform from one coordinate system to another.

Coordinate Systems
Creo applications and Creo Object TOOLKIT Java use the following coordinate
systems:
• Solid Coordinate System on page 293
• Screen Coordinate System on page 293
• Window Coordinate System on page 293
• Drawing Coordinate System on page 293
• Drawing View Coordinate System on page 294
• Assembly Coordinate System on page 294
• Datum Coordinate System on page 294
• Section Coordinate System on page 294
The following sections describe each of these coordinate systems.

292 Creo Object TOOLKIT JavaUser’s Guide


Solid Coordinate System
The solid coordinate system is the three-dimensional, Cartesian coordinate system
used to describe the geometry of a Creo solid model. In a part, the solid coordinate
system describes the geometry of the surfaces and edges. In an assembly, the solid
coordinate system also describes the locations and orientations of the assembly
members.
You can visualize the solid coordinate system in Creo application by creating a
coordinate system datum with the option Default. Distances measured in solid
coordinates correspond to the values of dimensions as seen by the Creo user.
Solid coordinates are used by Creo Object TOOLKIT Java for all the methods that
look at geometry and most of the methods that draw three-dimensional graphics.

Screen Coordinate System


The screen coordinate system is two-dimensional coordinate system that describes
locations in a Creo window. This is an intermediate coordinate system after which
the screen points are transformed to screen pixels. All the models are first mapped
to the screen coordinate system. When the user zooms or pans the view, the screen
coordinate system follows the display of the solid, so a particular point on the
solid always maps to the same screen coordinate. The mapping changes only
when the view orientation is changed.
Screen coordinates are used by some of the graphics methods, the mouse input
methods, and all methods that draw graphics or manipulate items on a drawing.

Window Coordinate System


The window coordinate system is similar to the screen coordinate system. After
mapping the models to the screen coordinate system, they are mapped to the
window coordinate before being drawn to screen pixels based on screen
resolution. When pan or zoom values are applied to the coordinates in the screen
coordinate system, they result in window coordinates. When an object is first
displayed in a window, or the option View ▶ Refit is used, the screen and window
coordinates are the same.
Window coordinates are needed only if you need to take account of zoom and pan
—for example, to find out whether a point on the solid is visible in the window, or
to draw two-dimensional text in a particular window location, regardless of pan
and zoom.

Drawing Coordinate System


The drawing coordinate system is a two-dimensional system that describes the
location on a drawing relative to the bottom, left corner, and measured in drawing
units. For example, on a U.S. letter-sized, landscape-format drawing sheet that
uses inches, the top, right-corner is (11, 8.5) in drawing coordinates.

Windows and Views 293


The Creo Object TOOLKIT Java methods and properties that manipulate
drawings generally use screen coordinates.

Drawing View Coordinate System


The drawing view coordinate system is used to describe the locations of entities in
a drawing view.

Assembly Coordinate System


An assembly has its own coordinate system that describes the positions and
orientations of the member parts, subassemblies, and the geometry of datum
features created in the assembly.
When an assembly is retrieved into memory each member is also loaded and
continues to use its own solid coordinate system to describe its geometry.
This is important when you are analyzing the geometry of a subassembly and
want to extract or display the results relative to the coordinate system of the parent
assembly.

Datum Coordinate System


A coordinate system datum can be created anywhere in any part or assembly, and
represents a user-defined coordinate system. It is often a requirement in a Creo
Object TOOLKIT Java application to describe geometry relative to such a datum.

Section Coordinate System


Every sketch has a coordinate system used to locate entities in that sketch.
Sketches used in features will use a coordinate system different from that of the
solid model.

Transformations
Methods Introduced:
• pfcBase.Transform3D.Invert
• pfcBase.Transform3D.TransformPoint
• pfcBase.Transform3D.TransformVector
• pfcBase.Transform3D.GetMatrix
• pfcBase.Transform3D.SetMatrix
• pfcBase.Transform3D.GetOrigin
• pfcBase.Transform3D.GetXAxis

294 Creo Object TOOLKIT JavaUser’s Guide


• pfcBase.Transform3D.GetYAxis
• pfcBase.Transform3D.GetZAxis
All coordinate systems are treated in Creo Object TOOLKIT Java as if they were
three-dimensional. Therefore, a point in any of the coordinate systems is always
represented by the pfcBase.Point3D class:
Vectors store the same data but are represented for clarity by the
pfcBase.Vector3D class.
Screen coordinates contain a z-value whose positive direction is outwards from
the screen. The value of z is not generally important when specifying a screen
location as an input to a method, but it is useful in other situations. For example, if
you select a datum plane, you can find the direction of the plane by calculating the
normal to the plane, transforming to screen coordinates, then looking at the sign of
the z-coordinate.
A transformation between two coordinate systems is represented by the
IpfcBase.Transform3D class. This class contains a 4x4 matrix that
combines the conventional 3x3 matrix that describes the relative orientation of the
two systems, and the vector that describes the shift between them.
The 4x4 matrix used for transformations is as follows:

The utility method ptcBase.Transform3D.Invert inverts a transformation


matrix so that it can be used to transform points in the opposite direction.
Creo Object TOOLKIT Java provides two utilities for performing coordinate
transformations. The method ptcBase.Transform3D.TransformPoint
transforms a three-dimensional point and
ptcBase.Transform3D.TransformVector transforms a three-
dimensional vector.
The following diagram summarizes the coordinate transformations needed when
using Creo Object TOOLKIT Java and specifies the Creo Object TOOLKIT Java
methods that provide the transformation matrix.

Windows and Views 295


Transforming to Screen Coordinates
Methods Introduced:
• pfcView.View.GetTransform
• pfcView.View.SetTransform
• pfcView.View.Rotate
• pfcView.ViewOwner.GetCurrentViewTransform
• pfcView.ViewOwner.SetCurrentViewTransform
• pfcView.ViewOwner.CurrentViewRotate
• pfcBase.Transform3D.Invert
The view matrix describes the transformation from solid to screen coordinates.
The method pfcView.View.GetTransform provides the view matrix for a
model in the view. The method pfcView.View.SetTransform allows you
to specify the transformation matrix for a model in the view.
To get and set the transformation matrix for a model in the current view, use the
methods pfcView.ViewOwner.GetCurrentViewTransform and
pfcView.ViewOwner.SetCurrentViewTransform.
The method pfcView.View.Rotate rotates an object, relative to the X, Y, or
Z axis for the specified rotation angle.

296 Creo Object TOOLKIT JavaUser’s Guide


To rotate an object in the current view, use the method
pfcView.ViewOwner.CurrentViewRotate.
To transform from screen to solid coordinates, invert the transformation matrix
using the method pfcBase.Transform3D.Invert.

Transforming to Coordinate System Datum Coordinates


Method Introduced:
• 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 terms of the directions of the three
axes and the position of the origin.

Transforming Window Coordinates


Methods Introduced
• 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.

Transforming Coordinates of an Assembly Member


Method Introduced:
• 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.

Windows and Views 297


16
ModelItem
Solid Geometry Traversal......................................................................................... 299
Getting ModelItem Objects....................................................................................... 299
ModelItem Information ............................................................................................. 300
Duplicating ModelItems............................................................................................ 301
Layer Objects.......................................................................................................... 302

This chapter describes the Creo Object TOOLKIT Java methods that enable you
to access and manipulate ModelItems.

298 Creo Object TOOLKIT JavaUser’s Guide


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.

Getting ModelItem Objects


Methods Introduced:
• pfcModelItem.ModelItemOwner.ListItems
• pfcFeature.Feature.ListSubItems
• pfcLayer.Layer.ListItems
• pfcModelItem.ModelItemOwner.GetItemById
• pfcModelItem.ModelItemOwner.GetItemByName
• pfcFamily.FamColModelItem.GetRefItem
• pfcSelect.Selection.GetSelItem
• wfcSelect.WSelection.EvaluateAngle
All models inherit from the interfaceModelItemOwner. The method
pfcModelItem.ModelItemOwner.ListItems returns a sequence of
ModelItems contained in the model. You can specify which type of
ModelItem to collect by passing in one of the enumerated ModelItemType
objects, or you can collect all ModelItems by passing null as the model item
type.

ModelItem 299
Note
The part modeling features introduced in Creo Parametric 1.0 will be excluded
from the list of features returned by the method
pfcModelItem.ModelItemOwner.ListItems if the model item type
is specified asITEM_FEATURE. For example edit round features, flexible
modeling features, and so on will be excluded from the list.

The methods pfcFeature.Feature.ListSubItems and


pfcLayer.Layer.ListItems produce similar results for specific features
and layers. These methods return a list of subitems in the feature or items in the
layer.
To access specific model items, call the method
pfcModelItem.ModelItemOwner.GetItemById. This methods enables
you to access the model item by identifier.
To access specific model items, call the method
pfcModelItem.ModelItemOwner.GetItemByName. This methods
enables you to access the model item by name.
The method pfcFamily.FamColModelItem.GetRefItem returns the
dimension or feature used as a header for a family table.
The method pfcSelect.Selection.GetSelItem returns the item selected
interactively by the user.
The method wfcSelect.WSelection.EvaluateAngle measures the
angle between two geometry items selected in the selection object
wfcWSelection by the user. Both objects must be straight, solid edges.

ModelItem Information
Methods Introduced:
• pfcModelItem.ModelItem.GetName
• pfcModelItem.ModelItem.SetName
• wfcModelItem.WModelItem.GetDefaultName
• wfcModelItem.WModelItem.IsNameReadOnly
• wfcModelItem.WModelItem.DeleteUserDefinedName
• pfcModelItem.ModelItem.GetId
• pfcModelItem.ModelItem.GetType
• wfcModelItem.WModelItem.Hide
• wfcModelItem.WModelItem.Unhide

300 Creo Object TOOLKIT JavaUser’s Guide


• wfcModelItem.WModelItem.IsHidden
• wfcModelItem.WModelItem.IsZoneFeature
• wfcModelItem.WView.GetModelItemFromView
• wfcModelItem.ViewModelitem.GetViewFromModelItem
Certain ModelItems also have a string name that can be changed at any time.
The methods GetName and SetName access this name.
The method wfcModelItem.WModelItem.GetDefaultName gets the
default name assigned to the model item by Creo application at the time of
creation.
The method wfcModelItem.WModelItem.IsNameReadOnly identifies if
you can modify the name of the model item.
The method wfcModelItem.WModelItem.DeleteUserDefinedName
deletes the user-defined name of the model item from the Creo database.
The methodpfcModelItem.ModelItem.GetId returns the unique integer
identifier for the ModelItem.
The pfcModelItem.ModelItem.GetType returns an enumeration object
that indicates the model item type of the specified ModelItem. See the section
Solid Geometry Traversal on page 299 for the list of possible model item types.
The method wfcModelItem.WModelItem.Hide hides the specified model
item in the model tree. Use the method
wfcModelItem.WModelItem.Unhide to unhide the model item in the
model tree. Using these methods is equivalent to using the commands Hide and
Unhide in the Creo user interface.
The method wfcModelItem.WModelItem.IsHidden identifies if the
specified model item is hidden.
The method wfcModelItem.WModelItem.IsZoneFeature checks if the
specified model item is a zone feature.
The method wfcModelItem.WView.GetModelItemFromView returns the
handle to the model item pfcModelItem for the specified view.
The method
wfcModelItem.ViewModelitem.GetViewFromModelItem returns the
handle to the view pfcView for the specified model item.

Duplicating ModelItems
Methods Introduced:

ModelItem 301
• pfcSession.BaseSession.AllowDuplicateModelItems
You can control the creation of ModelItems more than twice for the same Creo
item. The method
pfcSession.BaseSession.AllowDuplicateModelItems allows you
to turn ON or OFF the option to duplicate model items. By default, this option is
OFF. To turn the option ON, set the boolean value to FALSE.

Note
If this option is not handled properly on the application side, it can cause
memory corruption. Thus, althought you can turn ON and OFF this option as
many times as you want, PTC recommends turning ON and OFF this option
only once, right after the session is obtained.

Layer Objects
In Creo Object TOOLKIT Java, layers are instances of ModelItem. The
following sections describe how to get layer objects and the operations you can
perform on them.

Getting Layer Objects


Method Introduced:
• pfcModel.Model.CreateLayer
The method pfcModel.Model.CreateLayer returns a new layer with the
name you specify.
See the section Getting ModelItem Objects on page 299 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

302 Creo Object TOOLKIT JavaUser’s Guide


• pfcLayer.Layer.CountUnsupportedItems
• wfcLayerState.LayerItem.GetLayers
• wfcLayerState.LayerItem.IsLayerItemVisible
• wfcLayerState.LayerItem.RemoveNoUpdate
• wfcLayerState.LayerItem.AddNoUpdate
• wfcModel.WModel.ExecuteLayerRules
• wfcModel.WModel.CopyLayerRules
• wfcModel.WModel.MatchLayerRules
The methods pfcLayer.Layer.GetStatus and
pfcLayer.Layer.SetStatus enables 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.
Use the methods pfcLayer.Layer.ListItems,
pfcLayer.Layer.AddItem, and pfcLayer.Layer.RemoveItem to
control the contents of a layer.

Note
You cannot add the following items to a layer:
• ITEM_SURFACE,
• ITEM_EDGE,
• ITEM_COORD_SYS,
• ITEM_AXIS,
• ITEM_SIMPREP,
• ITEM_DTL_SYM_DEFINITION,
• ITEM_DTL_OLE_OBJECT,
• ITEM_EXPLODED_STATE.

For these items the method will throw the exception


pfcExceptions.XToolkitInvalidType.

The method pfcLayer.Layer.Delete removes the layer (but not the items it
contains) from the model.
The method pfcLayer.Layer.CountUnsupportedItems returns the
number of item types not supported as a pfcModelItem object in the specified
layer.

ModelItem 303
Use the method wfcLayerState.LayerItem.GetLayers to find all the
layers containing in a given layer item . This method supports layers in solid
models and in drawings.
The method wfcLayerState.LayerItem.IsLayerItemVisible
returns the visibility status for the specified item.
Use the methods wfcLayerState.LayerItem.RemoveNoUpdate and
wfcLayerState.LayerItem.AddNoUpdate to remove and add a
specified item from the layer, respectively, without updating the model tree.
Use the method wfcModel.WModel.ExecuteLayerRules to execute the
layer rules on the specified model. The rules must be enabled in the layers to be
executed.
The method wfcModel.WModel.CopyLayerRules copies the rules from
the reference model to the current model for the specified layer. The input
arguments are:
• LayerName—Specifies the name of an existing layer in both the models. To
copy the layer rules, the name of the layer LayerName in both the models must
be the same.
• RefModel— Specifies the reference model from which the layer rules must be
copied.
Use the method wfcModel.WModel.MatchLayerRules to compare the
rules between the current and reference model for the specified layer. The name of
the layer LayerName in both the models must be the same, for comparing the
layer rules.

Layer State
A layer state stores the display state of existing layers and all the hidden layers of
the top-level assembly. You can create and save one or more layer states and
switch between them to change the assembly display.
Methods Introduced:
• wfcLayerState.LayerState.ActivateLayerState
• wfcLayerState.LayerState.AddLayer
• wfcLayerState.LayerState.DeleteLayerState
• wfcLayerState.LayerState.GetDefaultLayer
• wfcLayerState.LayerState.SetDefaultLayer
• wfcLayerState.LayerState.GetLayerData
• wfcLayerState.LayerState.GetLayerStateName
• wfcLayerState.LayerState.HideLayerItem
• wfcLayerState.LayerState.IsLayerItemHidden

304 Creo Object TOOLKIT JavaUser’s Guide


• wfcLayerState.LayerState.RemoveLayer
• wfcLayerState.LayerState.UnhideLayerItem
• wfcLayerState.wfcLayerState.LayerStateData_Create
• wfcLayerState.LayerStateData.GetDisplayStatuses
• wfcLayerState.LayerStateData.GetLayerItems
• wfcLayerState.LayerStateData.SetLayerItems
• wfcLayerState.LayerStateData.GetLayerStateName
• wfcLayerState.LayerStateData.SetDisplayStatuses
• wfcLayerState.LayerStateData.SetLayerStateName
• wfcLayerState.LayerStateData.GetLayers
• wfcLayerState.LayerStateData.SetLayers
• wfcModel.WModel.ListLayers
• wfcModel.WModel.SaveLayerDisplayStatus
• wfcSolid.WSolid.ListLayerStates
• wfcSolid.WSolid.CreateLayerState
• wfcSolid.WSolid.GetActiveLayerState
• wfcModel.WModel.GetLayerItem
• wfcSolid.WSolid.UpdateActiveLayerState
Use the method wfcLayerState.LayerState.ActivateLayerState
to activate the specified layer state. The model of the layer state must be the top
model in the active window.
The method wfcLayerState.LayerState.AddLayer adds a new layer to
an existing layer state. Specify the new layer and its display state as input
arguments to this method.
Use the method wfcLayerState.LayerState.DeleteLayerState to
delete a specified layer state.
Use the methods wfcLayerState.LayerState.GetDefaultLayer and
wfcLayerState.LayerState.SetDefaultLayer to set up a default
layer with a specified name and type respectively. The method
wfcLayerState.LayerState.SetDefaultLayer requires the default
layer type, which is defined in the enumerated
typewfcLayerState.DefLayerType.
The method wfcLayerState.LayerState.GetLayerData retrieves the
reference data for a specified layer state.
The method wfcLayerState.LayerState.GetLayerStateName
retrieves the name of a specified layer state.

ModelItem 305
Use the method wfcLayerState.LayerState.HideLayerItem to hide a
specific item on the specified layer state.
Use the method wfcLayerState.LayerState.UnhideLayerItem to
remove a specific item from the list of hidden items on a layer state.
Use the method wfcLayerState.LayerState.IsLayerItemHidden to
check if an item is hidden on a layer state.
The method wfcLayerState.LayerState.RemoveLayer removes a
specific layer from a specified layer state.
Use the method wfcLayerState.wfcLayerState.LayerStateData_
Create to create a new instance of the wfcLayerState object. This object
contains information about layer state data.
The methods
wfcLayerState.LayerStateData.GetDisplayStatuses and
wfcLayerState.LayerStateData.SetDisplayStatuses get and set,
respectively, the display statuses for the layers in the layer state. The number of
display statuses is equal to the number of layers present in the layer state.
The method wfcModel.WModel.SaveLayerDisplayStatus saves the
changes to the display status of the layers in the specified model and its sub
models. For drawings, the display status is saved in the views contained in the
drawing.
The methods wfcLayerState.LayerStateData.GetLayerItems and
wfcLayerState.LayerStateData.SetLayerItems get and set the
value of the specified layer item.
The methods wfcLayerState.LayerStateData.GetLayerStateName
and wfcLayerState.LayerStateData.SetLayerStateName get and
set the name of the new layer state. The name must only consist of alphanumeric,
underscore, and hypen characters.
The methods wfcLayerState.LayerStateData.GetLayers and
wfcLayerState.LayerStateData.SetLayers get and set the layer
state for an array of layers.
The methodwfcModel.WModel.ListLayers returns an array containing the
layers in the model.
The method wfcSolid.WSolid.ListLayerStates returns an array of
layer states in the specified model.
The method wfcSolid.WSolid.CreateLayerState creates a new layer
state.
The method wfcSolid.WSolid.GetActiveLayerState retrieves the
active layer state in a specified solid model.

306 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcModel.WModel.GetLayerItem to initialize a layer item
structure. The valid layer item types are defined by the enumerated type
wfcLayerType. Do not use this function if the layer item owner is a drawing.
The method wfcSolid.WSolid.UpdateActiveLayerState updates the
layer state, which is active in the specified model. If the display statues of layers
have changed, then calling this function ensures that the active layer state in the
model is updated with the new display statuses of the layers.

ModelItem 307
17
Feature Element Tree
Overview of Feature Creation................................................................................... 309
Feature Element Values........................................................................................... 311
Feature Element Special Values ............................................................................... 312
Feature Element Paths ............................................................................................ 312
Feature Element Tree .............................................................................................. 313
Creating FET Using WCreateFeature........................................................................ 314
Feature Elements .................................................................................................... 315
Creating Patterns .................................................................................................... 317
Redefining Features ................................................................................................ 318
Element Diagnostics................................................................................................ 318

This chapter explains feature creation in Creo Object TOOLKIT Java.

308 Creo Object TOOLKIT JavaUser’s Guide


Overview of Feature Creation
There are many kinds of features in Creo Parametric and each feature can contain
a large and varied amount of information. All this information must be complete
and consistent before a feature can be used in regeneration and create the
geometry.
You must build all the information needed by a feature into a data structure before
passing that whole structure to Creo Parametric. This structure is called Feature
Element Tree (FET). The FET structure is in the form of a tree containing the data
elements. Creo Object TOOLKIT Java defines this structure as an object that can
be allocated and filled using special classes.
You must use the following steps to create a feature in Creo Parametric:
1. Allocate the FET structure as wfcElementTree.
2. Fill the FET structure by creating Element objects.
3. Pass the FET structure to Creo Parametric to create the feature by calling the
function wfcSolid.WSolid.WCreateFeature.
The feature is created in a sequence of manageable steps with the error checking
along the way.
The full FET is represented by a ElementTree object. The root and branch
points in FET are called “elements”. Each element is modeled by Element class.
FET contains all the information required to define the feature. It includes the
following information:
• All the options and attributes. For example, the material side and depth type
for an extrusion or slot, placement method for a hole, and so on.
• All the references to existing geometry items. For example, the placement
references, up to surfaces, sketching planes, and so on.
• All the references to Sketcher models used for sections in the feature.
• All dimension values.
The values of dimensions used by the feature are in the FET. However, there are
no descriptions or references to the dimension objects themselves.
Each element in the FET is assigned an element ID. The element ID is an unique
to every element. No two elements at the same level in the tree can have the same
identifier, unless they belong to an array element.
You cannot create all feature types using Creo Object TOOLKIT Java, but the
FET structure is capable of defining any feature type. This allows you to extend
the range of features.

Feature Element Tree 309


Note
The Creo Object TOOLKIT Java is based on the same toolkit that is used to
build Creo Parametric. Changes in Creo Parametric may require the definition
of the element tree to be altered for some features. PTC will support upward
compatibility in most of the cases. However, there may be cases where the old
application will not run with the new version of Creo Parametric. You must
rewrite the application's code to conform to the new definition of the feature
tree.

The Creo Object TOOLKIT Java and Creo Parametric TOOLKIT share the same
definitions of FET element IDs and values. To use a specific element, you must
refer to the header files in <creo_toolkit_loadpoint>/includes for
feature-specific element trees, and then insert the actual integer value of the
constant which defines the element ID or the element value.
• PRO_E_FEATURE_TYPE
• PRO_E_FEATURE_FORM
• PRO_E_EXT_DEPTH
• PRO_E_THICKNESS
• PRO_E_4AXIS_PLANE

Element Tree Types


There are four different element types:
• Single-valued
• Multi-valued
• Compound
• Array
A single-valued element can contain various types of value, for example integer,
string, double, and so on. The simplest is an integer. An integer can be used to
define the type of the feature, or one of the option choices, such as, the material
side for a thin protrusion. The wide string can be used define the name of the
feature, and a double can be used to define the depth of a blind extrusion. If the
element defines a reference to an existing geometry item in the solid, its value
contains an entire Selection object that allows it to refer to anything in an
entire assembly. If the element represents a collection, its values contain an entire
wfcCollection object. The collection can be a curve collection or a surface
collection.
A multi-valued element contains several values of one of the mentioned types.
Multi-valued elements occur at the lowest level of the element tree at the “leaves”.

310 Creo Object TOOLKIT JavaUser’s Guide


A compound element is the one that acts as a branch point in the tree. It does not
have a value of its own, but acts as a container for elements further down in the
hierarchy.
An array element is also a branch point, but one that contains many child elements
with the same element ID.

Building Features Using Element Trees


The feature element tree allows you to build a complex feature in stages, with
only a small set of functions. However, the form of the tree required for a
particular feature needs to be clearly defined. This helps you identify what
elements and values must be added. This also helps Creo Object TOOLKIT Java
can check for errors each time you add a new element to the tree.
The header files in <creo_toolkit_loadpoint>/includes describe the
Feature Element Trees with the following two types of description:
• Feature element tree
• Feature element table

The feature element tree defines the structure of the tree, specifying the element
ID (or role) for the elements at all levels in the tree. It also defines which elements
are optional. The feature element table defines the following for each of the
element IDs in the tree:
• A description of its role in the feature
• The value type it has (that is, whether it is single value or compound; or an
array of integer, double, or string)
• The range of values valid for it in this context

Feature Element Values


Methods Introduced:
• wfcElementTree.Element.GetValue
• wfcElementTree.Element.SetValue
The element values are represented by ArgValue objects. They can be set and
obtained using the methods wfcElementTree.Element.GetValue and
wfcElementTree.Element.SetValue methods. For more information on
pfcArgValue objects, refer to the section Managing Application Arguments on
page 587 in Task Based Application Libraries on page 586.

Feature Element Tree 311


Feature Element Special Values
Methods Introduced:
• wfcElementTree.SpecialValue_Create
• wfcElementTree.SpecialValue.GetComponentModel
• wfcElementTree.SpecialValue.SetComponentModel
• wfcElementTree.SpecialValue.GetSectionValue
• wfcElementTree.SpecialValue.SetSectionValue
The method wfcElementTree.SpecialValue_Create enables you to
create a special value for a specified feature element.
The method wfcElementTree.SpecialValue.GetComponentModel
returns the value of the element PRO_E_COMPONENT_MODEL for the specified
feature. Use the method
wfcElementTree.SpecialValue.SetComponentModel to set the
value for the element PRO_E_COMPONENT_MODEL.
The method wfcElementTree.SpecialValue.GetSectionValue
returns the value of the element PRO_E_SKETCHER for the specified feature. Use
the method wfcElementTree.SpecialValue.SetSectionValue to set
the value for the element PRO_E_SKETCHER. This value is a object of type
Section.

Feature Element Paths


Methods Introduced:
• wfcElementTree.ElementPath_Create
• wfcElementTree.ElementPath.GetItems
• wfcElementTree.ElementPath.SetItems
• wfcElemPathItem.ElemPathItem_Create
• wfcElementTree.ElemPathItem.GetId
• wfcElementTree.ElemPathItem.SetId
• wfcElementTree.ElemPathItem.GetType
• wfcElementTree.ElemPathItem.SetType
An element path is used to describe the location of an element in an element tree.
Use the method wfcElementTree.ElementPath_Create to create an
element path in an element tree and the input argument to this method is items.
The full path is represented by the class ElementPath, which contains the list
of ElemPathItem objects. Each ElemPathItem provides the element ID and
its ElemPathItemType. The element path from an array element to one of its

312 Creo Object TOOLKIT JavaUser’s Guide


member arrays contains the array index of that element. The enumerated type
ElemPathItemType gives the array index. To get the path length, use the
method wfcElementTree.ElementPath.GetItems, and then use
wfcElementTree.ElemPathItems.getarraysize. Use to set path
length using the method wfcElementTree.ElementPath.SetItems path
length.
Use the method wfcElemPathItem.ElemPathItem_Create to create an
element path item. The input arguments to create an element path item are type
and Id.
The methods wfcElementTree.ElemPathItem.GetId and
wfcElementTree.ElemPathItem.SetId retrieve and set the element IDs
of the element path item.
The methods wfcElementTree.ElemPathItem.GetType and
wfcElementTree.ElemPathItem.SetType retrieve and set the type of
the element path item using the enumerated type
wfcElementTree.ElemPathItemType.

Feature Element Tree


Methods Introduced:
• wfcElementTree.ElementTree.ListTreeElements
• wfcElementTree.ElementTree.GetElement
• wfcElementTree.ElementTree.IsElementArray
• wfcElementTree.ElementTree.IsElementCompound
• wfcElementTree.ElementTree.IsElementMultiVal
• wfcElementTree.ElementTree.CreateDtmCsysElemTreeFromFile
• wfcElementTree.ElementTree.WriteElementTreeToFile
• wfcSession.WSession.CreateElementTreeFromXML
• wfcSession.WSession.CreateElementTree
• wfcFeature.WFeature.GetElementTree

Feature Element Tree 313


The Feature Element Tree (FET) is represented by wfcElementTree object.
This class has methods that can obtain the list of elements in the element tree or
obtain a specific feature element by its path, as well as querying element type
(array, compound, and multi-valued).

Note
This type is not stored within Element object. It is the property of
wfcElementTree.

The method
wfcElementTree.ElementTree.CreateDtmCsysElemTreeFrom
File allocates required steps of the element tree to create coordinate system from
a transformation file.
The input argument filename should be name of the file with the extension .trf.
The name must be in lowercase only. The file should contain a coordinate
transform such as:
X1 X2 X3 Tx
Y1 Y2 Y3 Ty
Z1 Z2 Z3 Tz
where
• X1 Y1 Z1 is the X-axis direction,
• X2 Y2 Z2 is the Y-axis direction,
• X3 Y3 Z3 is not used (the right hand rule determines the Z direction),
• Tx Ty Tz is the origin of the coordinate system.
Use the method
wfcElementTree.ElementTree.WriteElementTreeToFile to save
the full FET to a file.
Use the method wfcSession.WSession.CreateElementTreeFromXML
to build the FET from an XML file. The method
wfcSession.WSession.CreateElementTree builds the element tree
from start. If the FET is built from start, all the mandatory elements in the element
tree must to be populated and added sequentially in the sequence Elements.
The method wfcFeature.WFeature.GetElementTree creates a copy of
the feature element tree that describes the contents of a specified feature. The
specified feature can be a regular feature or a pattern.

Creating FET Using WCreateFeature


Methods Introduced:

314 Creo Object TOOLKIT JavaUser’s Guide


• wfcSolid.WSolid.WCreateFeature
The WSolid object identifies the solid that is to contain the new feature. The
method wfcSolid.WSolid.WCreateFeature creates a feature from the
FET.
When using the method wfcSolid.WSolid.WCreateFeature while
working with a multi-CAD model, the following scenarios are possible depending
on the value of the configuration option confirm_on_edit_foreign_
models. The default value of the configuration option confirm_on_edit_
foreign_models is yes.
• If the configuration option confirm_on_edit_foreign_models is set
to no, the non-Creo model is modified without any notification.
• If the configuration option confirm_on_edit_foreign_models is set
to yes, or the option is not defined in the configuration file, then in batch mode
the application will throw the exception
pfcExceptions.XToolkitGeneralError.
• In some situations you may need to provide input in the interactive mode with
Creo. Refer to the Creo Parametric Data Exchange online help, for more
information.

Feature Elements
Methods Introduced:
• wfcFeature.WFeature.GetDimensionId
• wfcSession.WSession.GetElemWstrOption
• wfcSession.WSession.SetElemWstrOption
• wfcSession.ElementWstringOption_Create
• wfcSession.ElementWstringOption.GetExpression
• wfcSession.ElementWstringOption.SetExpression
• wfcSession.ElementWstringOption.GetPositive
• wfcSession.ElementWstringOption.SetPositive
• wfcSession.ElementWstringOption.GetSign
• wfcSession.ElementWstringOption.SetSign
• wfcElementTree.wfcElementTree.Element_Create
• wfcElementTree.Element.GetIdAsString
• wfcElementTree.Element.GetIsArray
• wfcElementTree.Element.GetIsCompound
• wfcElementTree.Element.GetIsMultival

Feature Element Tree 315


• wfcElementTree.Element.GetChildren
• wfcElementTree.Element.GetValueAsString
• wfcElementTree.Element.SetValueAsString
• wfcElementTree.Element.GetId
• wfcElementTree.Element.SetId
• wfcElementTree.Element.GetLevel
• wfcElementTree.Element.SetLevel
• wfcElementTree.Element.GetDecimals
• wfcElementTree.Element.SetDecimals
• wfcElementTree.Element.GetSpecialValueElem
• wfcElementTree.Element.SetSpecialValueElem
• wfcElementTree.Element.GetElemCollection
• wfcElementTree.Element.SetElemCollection
The method wfcFeature.WFeature.GetDimensionId returns the integer
identifier of the dimension in the Creo Parametric database used to define the
value of the specified single-valued element.
The methods wfcSession.WSession.GetElemWstrOption and
wfcSession.WSession.SetElemWstrOption get and set the options
used to retrieve the string values of elements. The options set in this method are
used by the method wfcElementTree.Element.GetValueAsString to
display the string representation of elements.
The method wfcSession.ElementWstringOption_Create creates a
string value of a specified element in a tree.
The method wfcSession.ElementWstringOption.SetExpression
sets the option to retrieve values as expressions or relations, if they exist, instead
of string representations of the actual value. This method is applicable only to
double value elements.
The method wfcSession.ElementWstringOption.SetPositive sets
the option to retrieve the values as positive. This method is applicable to double
and integer value elements.
The method wfcSession.ElementWstringOption.SetSign sets the
option to retrieve values with special sign formatting (+/-), etc. This method is
applicable to both double and integer value elements.
The method wfcElementTree.wfcElementTree.Element_Create
creates a new instance of the Element object that contains information about the
parameters of the element.
The method wfcElementTree.Element.GetIdAsString returns the
string representation of the specified element ID.

316 Creo Object TOOLKIT JavaUser’s Guide


The methods wfcElementTree.Element.GetIsArray,
wfcElementTree.Element.GetIsCompound, and
wfcElementTree.Element.GetIsMultival are used to determine the
type of the specified element in a tree. The methods
wfcElementTree.Element.GetIsArray and
wfcElementTree.Element.GetIsCompound determine if the specified
element contains an array of elements, or is a compound. The method
wfcElementTree.Element.GetIsMultival determines whether the
input element can have multiple values.
The method wfcElementTree.Element.GetChildren populates an array
of children elements, if the specified element is a compound element, or an array.
The method wfcElementTree.Element.GetValueAsString returns a
string value representation for double and integer elements. The options set in the
object wfcElementWstringOption decide the format of the output.
Use the methods wfcElementTree.Element.GetId and
wfcElementTree.Element.SetId to get and set the element identifier for
the specified element.
Use the methods wfcElementTree.Element.GetLevel and
wfcElementTree.Element.SetLevel to get and set the location of the
element in the element tree with respect to the root element.
Use the methods wfcElementTree.Element.GetDecimals and
wfcElementTree.Element.SetDecimals obtain and set the number of
decimal places to be used for the double value of an element in the feature.
Use the method wfcElementTree.Element.GetSpecialValueElem to
obtain the pointer representation for the specified element. The method
wfcElementTree.Element.SetSpecialValueElem sets the pointer
representation for the specified element.
Use the method wfcElementTree.Element.GetElemCollection to
extract a collection object from an element of a feature element tree of the
following types:
• CurveCollection
• SurfaceCollection
Use the method wfcElementTree.Element.SetElemCollection to
assign a collection object to an element of a feature element tree of the type
CurveCollection and SurfaceCollection.

Creating Patterns
Methods Introduced:

Feature Element Tree 317


• wfcFeature.WFeature.CreatePattern
You can create patterns by calling the method
wfcFeature.WFeature.CreatePattern on the feature.

Redefining Features
Method Introduced:
• wfcFeature.WFeature.RedefineFeature
You can use the method wfcFeature.WFeature.RedefineFeature to
redefine features.

Element Diagnostics
Methods Introduced:
• wfcElementTree.Element.GetDiagnostics
• wfcElementTree.ElementDiagnostic_Create
• wfcElementTree.ElementDiagnostic.GetDiagnosticMessage
• wfcElementTree.ElementDiagnostic.SetDiagnosticMessage
• wfcElementTree.ElementDiagnostic.GetSeverity
• wfcElementTree.ElementDiagnostic.SetSeverity
The method wfcElementTree.Element.GetDiagnostics collects the
element diagnostics. The diagnostics include warnings and errors about the value
of the element within the context of the feature and the remainder of the element
tree.
Use the method wfcElementTree.ElementDiagnostic_Create to
create an element diagnostic in an element tree.
The methods
wfcElementTree.ElementDiagnostic.GetDiagnosticMessage
and wfcElementTree.ElementDiagnostic.GetSeverity get the
message and severity of the diagnostic item of the element.

318 Creo Object TOOLKIT JavaUser’s Guide


18
Features
Access to Features.................................................................................................. 320
Feature Information ................................................................................................. 321
Feature Operations ................................................................................................. 325
Feature Groups and Patterns ................................................................................... 328
User Defined Features............................................................................................. 331
Creating Features from UDFs................................................................................... 332

All Creo solid models are made up of features. This chapter describes how to
program on the feature level using Creo Object TOOLKIT Java.
The actual type of pfcSolid objects is wfcWSolid and pfcFeature object
is wfcWFeature. Therefore, the methods from wfcWFeature and
wfcWSolid become available to these objects only after you cast Feature to
wfcWFeature and Solid to wfcWSolid.

319
Access to Features
Methods Introduced:
• pfcFeature.Feature.ListChildren
• pfcFeature.Feature.ListParents
• pfcFeature.FeatureGroup.GetGroupLeader
• pfcFeature.FeaturePattern.GetPatternLeader
• pfcFeature.FeaturePattern.ListMembers
• pfcSolid.Solid.ListFailedFeatures
• wfcSolid.WSolid.ListChildOfExternalFailedFeatures
• wfcSolid.WSolid.ListChildOfFailedFeatures
• pfcSolid.Solid.ListFeaturesByType
• pfcSolid.Solid.GetFeatureById
• pfcSession.BaseSession.QueryFeatureEdit
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.
The methods pfcFeature.FeaturePattern.GetPatternLeader and
the method pfcFeature.FeaturePattern.ListMembers return features
that make up the specified feature pattern. See the section Feature Groups and
Patterns on page 328 for more information on feature patterns.
The method pfcSolid.Solid.ListFailedFeatures returns a sequence
that contains all the features that failed regeneration.
The method
wfcSolid.WSolid.ListChildOfExternalFailedFeatures returns
a list of elements, where each element is a child of an external failed feature.
The method wfcSolid.WSolid.ListChildOfFailedFeatures returns
a list of elements, where each element is a child of a failed feature.
The method pfcSolid.Solid.ListFeaturesByType returns a sequence
of features contained in the model. You can specify which type of feature to
collect by passing in one of the FeatureType enumeration objects, or you can
collect all features by passing void null as the type. If you list all features, the
resulting sequence will include invisible features that Creo creates internally.
Internal features are invisible features used internally for construction purposes.
Use the method’s VisibleOnly argument to exclude them. If the argument
VisibleOnly is True, the method lists the public features only. If the argument is
False, the method lists both public and internal features.

320 Creo Object TOOLKIT JavaUser’s Guide


The method pfcSolid.Solid.GetFeatureById returns the feature object
with the corresponding integer identifier.
A feature can be edited with the Edit Definition command in Creo Parametric. The
method pfcSession.BaseSession.QueryFeatureEdit returns a list of
all the features that are currently being edited by the Edit Definition command.

Feature Information
Methods Introduced:
• pfcFeature.Feature.GetFeatType
• pfcFeature.Feature.GetStatus
• pfcFeature.Feature.GetIsVisible
• pfcFeature.Feature.GetIsReadonly
• pfcFeature.Feature.GetIsEmbedded
• pfcFeature.Feature.GetNumber
• pfcFeature.Feature.GetFeatTypeName
• pfcFeature.Feature.GetFeatSubType
• pfcRoundFeat.RoundFeat.GetIsAutoRoundMember
• wfcElementTree.WFeature.IsElementVisible
• wfcElementTree.WFeature.IsElementIncomplete
• wfcElementTree.WFeature.GetStatusFlag
• wfcSolid.WSolid.CreateZoneSectionFeature
• wfcFeature.wfcFeature.ZoneFeatureReference_Create
• wfcFeature.ZoneFeatureReference.GetPlaneId
• wfcFeature.ZoneFeatureReference.SetPlaneId
• wfcFeature.ZoneFeatureReference.GetOperation
• wfcFeature.ZoneFeatureReference.SetOperation
• wfcFeature.ZoneFeatureReference.GetMemberIdTable
• wfcFeature.ZoneFeatureReference.SetMemberIdTable
• wfcFeature.ZoneFeatureReference.GetFlip
• wfcFeature.ZoneFeatureReference.SetFlip
• wfcFeature.WFeature.GetZoneFeatureReferences
• wfcFeature.WFeature.GetZoneFeaturePlaneData
• wfcFeature.WFeature.GetZoneXSectionGeometry
• wfcFeature.WFeature.IsInFooter

Features 321
• wfcFeature.WFeature.MoveToFooter
• wfcFeature.WFeature.MoveFromFooter
The enumeration classes FeatureType and FeatureStatus provide
information for a specified feature. The following methods specify this
information:
• pfcFeature.Feature.GetFeatType—Returns the type of a feature.
• pfcFeature.Feature.GetStatus—Returns whether the feature is
suppressed, active, or failed regeneration.
The other methods that gather feature information include the following:
• pfcFeature.Feature.GetIsVisible—Identifies whether the
specified feature will be visible on the screen. The method distinguishes
visible features from internal features. Internal features are invisible features
used for construction purposes.
• pfcFeature.Feature.GetIsReadonly—Identifies whether the
specified feature can be modified.
• pfcFeature.Feature.GetIsEmbedded—Specifies whether the
specified feature is an embedded datum.
• pfcFeature.Feature.GetNumber—Returns the feature regeneration
number. This method returns void null if the feature is suppressed.
The method pfcFeature.Feature.GetFeatTypeName returns a string
representation of the feature type.
The method pfcFeature.Feature.GetFeatSubType returns a string
representation of the feature subtype, for example, "Extrude" for a protrusion
feature.
The method pfcRoundFeat.RoundFeat.GetIsAutoRoundMember
determines whether the specified round feature is a member of an Auto Round
feature.
The method wfcElementTree.WFeature.IsElementVisible
determines whether the specified element is visible.
The method wfcElementTree.WFeature.IsElementIncomplete
determines whether the specified element is incomplete. If a feature is incomplete,
you can use this method to find out which element in the tree is incomplete.
The method wfcElementTree.WFeature.GetStatusFlag retrieves the
bit status flag object of the feature.
The method wfcSolid.WSolid.CreateZoneSectionFeature creates a
zone feature. The input arguments are:
• RefData—The references to create the zone feature.
• ZoneName—The name of the zone feature.

322 Creo Object TOOLKIT JavaUser’s Guide


The method wfcFeature.wfcFeature.ZoneFeatureReference_
Create creates an object of type ZoneFeatureReference that contains
information about the zone references for the specified feature.
Use the method wfcFeature.ZoneFeatureReference.GetPlaneId to
retrieve the geometric ID of the reference zone plane. The method
wfcFeature.ZoneFeatureReference.SetPlaneId sets the geometric
ID for the reference zone plane.
The method wfcFeature.ZoneFeatureReference.GetOperation
gets the value of the operation, where 0 specifies intersection of half spaces that is,
the AND operator and 1 specifies union of half spaces that is, the OR operator.
Use the method wfcFeature.ZoneFeatureReference.SetOperation
to set the value of the operation.
The method
wfcFeature.ZoneFeatureReference.GetMemberIdTable returns a
sequence of component identifiers that form the path to the part to which the
reference plane belongs.
Use the method
wfcFeature.ZoneFeatureReference.SetMemberIdTable to set the
path to the part for the reference plane.

Note
When the feature is owned by a part, pass the value NULL.

The methods wfcFeature.ZoneFeatureReference.GetFlip and


wfcFeature.ZoneFeatureReference.SetFlip retrieve and set the side
of the plane where the model is kept. True indicates positive normal of the plane
and false indicates the opposite side.
The method wfcFeature.WFeature.GetZoneFeatureReferences
returns the references used to create the zone feature.
The method wfcFeature.WFeature.GetZoneFeaturePlaneData
returns the planes used to create the zone feature.
Use the method wfcFeature.WFeature.GetZoneXSectionGeometry
to retrieve the array of cross sections in the specified zone feature.
The method wfcFeature.WFeature.IsInFooter checks if the specified
feature is currently located in the model tree footer.The footer is a section of the
model tree that lists certain types of features such as, component interfaces,
annotation features, zones, reference features, publish geometry, and analysis
feature. The features in the footer are always regenerated at the end of the feature
list. You can move features, such as, reference features, annotation features, and
so on, to the footer. Some features, such as, component interfaces, zones, and so

Features 323
on, are automatically placed in the footer. Refer to the Creo Parametric online
Help for more information on footer. Refer to the Creo Parametric online Help for
more information on footer.
Use the method wfcFeature.WFeature.MoveToFooter to move the
specified feature into the model tree footer.
Use the method wfcFeature.WFeature.MoveFromFooter to move the
specified feature out of the model tree footer.

Feature Inquiry
Methods Introduced:
• wfcFeature.FeatureStatusFlag.GetFeatureId
• wfcFeature.FeatureStatusFlag.GetIsActive
• wfcFeature.FeatureStatusFlag.GetIsInactive
• wfcFeature.FeatureStatusFlag.GetIsChildOfExternalFailed
• wfcFeature.FeatureStatusFlag.GetIsChildOfFailed
• wfcFeature.FeatureStatusFlag.GetIsFailed
• wfcFeature.FeatureStatusFlag.GetIsFamtabSuppressed
• wfcFeature.FeatureStatusFlag.GetIsInvalid
• wfcFeature.FeatureStatusFlag.GetIsProgramSuppressed
• wfcFeature.FeatureStatusFlag.GetIsSimprepSuppressed
• wfcFeature.FeatureStatusFlag.GetIsSuppressed
• wfcFeature.FeatureStatusFlag.GetIsUnregenerated
The method wfcFeature.FeatureStatusFlag.GetFeatureId
retrieves the feature id of the feature in a part or an assembly.
The method wfcFeature.FeatureStatusFlag.GetIsActive returns
true if the feature is active in a part or an assembly.
The method wfcFeature.FeatureStatusFlag.GetIsInactive
returns true if the feature is inactive in a part or an assembly. If it returns false, it is
an active feature.
The method
wfcFeature.FeatureStatusFlag.GetIsChildOfExternalFailed
returns true if the feature is a child of an external failed feature in a part or an
assembly.
The method
wfcFeature.FeatureStatusFlag.GetIsChildOfFailed returns true
if the feature is a child of a failed feature in a part or an assembly.

324 Creo Object TOOLKIT JavaUser’s Guide


The method wfcFeature.FeatureStatusFlag.GetIsFailed returns
true if the feature failed regeneration in a part or an assembly.
The method
wfcFeature.FeatureStatusFlag.GetIsFamtabSuppressed returns
true if the feature failed regeneration in a part or an assembly.
The method wfcFeature.FeatureStatusFlag.GetIsInvalid returns
true if the feature status could not be retrieved.
The method
wfcFeature.FeatureStatusFlag.GetIsProgramSuppressed
returns true if the feature is suppressed due to a Pro/PROGRAM functionality.
The method
wfcFeature.FeatureStatusFlag.GetIsSimprepSuppressed
returns true if the feature is suppressed due to a simplified representation.
The method wfcFeature.FeatureStatusFlag.GetIsSuppressed
returns true if the feature is suppressed.
The method
wfcFeature.FeatureStatusFlag.GetIsUnregenerated returns true
if the feature is active and which has not yet been regenerated. This is due to a
regeneration failure or if the status is obtained during the regeneration process.

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

Features 325
• pfcFeature.Feature.CreateReorderAfterOp
• pfcFeature.ReorderAfterOperation.SetAfterFeat
• pfcFeature.FeatureOperations.create
• wfcSolid.WSolid.DeleteFeatures
• wfcSolid.WSolid.SuppressFeatures
• wfcSolid.WSolid.ResumeFeatures
• wfcSolid.WSolid.ReorderFeatures
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.

Note
The method pfcSolid.Solid.ExecuteFeatureOps is not supported
in the No-Resolve mode, introduced in Pro/ENGINEER Wildfire 5.0. It throws
an exception pfcExceptions.XToolkitBadContext. To continue
with the Pro/ENGINEER Wildfire 4.0 behavior in the Resolve mode, set the
configuration option regen_failure_handling to resolve_mode in
the Creo Parametric session. Refer to the Solid Operations on page 214 section
in the Solid on page 212 chapter for more information on the No-Resolve
mode.

You can create an operation that will delete, suppress, reorder, or resume certain
features using the methods in the interface pfcFeature.Feature. Each
created operation must be passed as a member of the FeatureOperations
object to the method pfcSolid.Solid.ExecuteFeatureOps. You can
create a sequence 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:
• Clip—Specifies whether to delete or suppress all features after the selected
feature. By default, this option is false.
Use the methods pfcFeature.DeleteOperation.SetClip and
pfcFeature.SuppressOperation.SetClip to modify this option.
• AllowGroupMembers—If this option is set to true and if the feature to be
deleted or suppressed is a member of a group, then the feature will be deleted
or suppressed out of the group. If this option is set to false, then the entire

326 Creo Object TOOLKIT JavaUser’s Guide


group containing the feature is deleted or suppressed. By default, this option is
false. It can be set to true only if the option Clip is set to true.
Use the methods
pfcFeature.SuppressOperation.SetAllowGroupMembers and
pfcFeature.DeleteOperation.SetAllowGroupMembers to
modify this option.
• AllowChildGroupMembers—If this option is set to true and if the
children of the feature to be deleted or suppressed are members of a group,
then the children of the feature will be individually deleted or suppressed out
of the group. If this option is set to false, then the entire group containing the
feature and its children is deleted or suppressed. By default, this option is
false. It can be set to true only if the options Clip and
AllowGroupMembers are set to true.
Use the methods
pfcFeature.SuppressOperation.SetAllowChildGroupMem
bers and
pfcFeature.DeleteOperation.SetAllowChildGroupMembers
to modify this option.
• 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 method
pfcFeature.ReorderBeforeOperation.SetBeforeFeat to
modify this option.
• AfterFeat—Specifies the feature after which you want to reorder the
features.
Use the method

Features 327
pfcFeature.ReorderAfterOperation.SetAfterFeat to modify
this option.
• Use the methods wfcSolid.WSolid.DeleteFeatures,
wfcSolid.WSolid.SuppressFeatures,
wfcSolid.WSolid.ResumeFeatures and
wfcSolid.WSolid.ReorderFeatures to delete, suppress, resume and
reorder a list of features. The input parameters for all the methods are:
○ FeatIDs—The list of IDs for the features to be deleted, suppressed,
reordered or resumed.
○ Options—The list of options to be used. This input argument is not
applicable to the method wfcSolid.WSolid.ReorderFeatures.
○ Instrs—Regeneration instructions to be used.
The reorder method takes its second input parameter as:
○ NewFeatNum—The intended location of the first feature in the specified
list.

Feature Groups and Patterns


Patterns are treated as features in Creo applications. A feature type, FEATTYPE_
PATTERN_HEAD, is used for the pattern header feature.
The result of the pattern header feature for users of previous versions of Creo
Object TOOLKIT Java is as follows:
• Models that contain patterns get one extra feature of type FEATTYPE_
PATTERN_HEAD in the regeneration list. This changes the feature numbers of
all subsequent features, including those in the pattern.

Note
The pattern header feature is not treated as a leader or a member of the pattern
by the methods described in the following section.

Methods Introduced:
• pfcFeature.Feature.GetGroup
• pfcFeature.Feature.GetPattern
• pfcSolid.Solid.CreateLocalGroup
• pfcFeature.FeatureGroup.GetPattern
• pfcFeature.FeatureGroup.GetGroupLeader

328 Creo Object TOOLKIT JavaUser’s Guide


• pfcFeature.FeaturePattern.GetPatternLeader
• 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.
The methods pfcFeature.FeaturePattern.GetPatternLeader and
pfcFeature.FeaturePattern.ListMembers return features that make
up the specified feature pattern.
A pattern is composed of a pattern header feature and a number of member
features. You can pattern only a single feature. To pattern several features, create a
local group and pattern this group.
You can also create a pattern of pattern. This creates a multiple level pattern. From
Creo Parametric 2.0 M170 onward, for a pattern of pattern, the method
pfcFeature.FeaturePattern.ListMembers returns all the pattern
header features created at the first level.

Features 329
For example, consider a model where a pattern of pattern has been created. The
model tree is as shown below:

The method pfcFeature.FeaturePattern.ListMembers returns the


pattern header features with following IDs for a pattern of pattern:
• 119
• 177
• 221
• 265
The methods pfcFeature.Feature.GetPattern and
pfcFeature.FeatureGroup.GetPattern return the
FeaturePattern object that contains the corresponding Feature or
FeatureGroup. Use the method pfcSolid.Solid.CreateLocalGroup

330 Creo Object TOOLKIT JavaUser’s Guide


to take a sequence of features and create a local group with the specified name. To
delete a FeaturePattern object, call the method
pfcFeature.FeaturePattern.Delete.

Changes To Feature Groups


Beginning in Revision 2000i2, the structure of feature groups is different than in
previous releases. Feature groups now have a group header feature, which shows
up in the model information and feature list for the model. This feature will be
inserted in the regeneration list to a position just before the first feature in the
group. Existing models, when retrieved into Revision 2000i2, will have their
groups automatically updated to this structure upon retrieval.
The results of these changes are as follows:
• 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.

User Defined Features


Groups in Creo represent sets of contiguous features that act as a single feature for
specific operations. Individual features are affected by most operations while
some operations apply to an entire group:
• 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.

Features 331
Note
All methods in this section can be used for UDFs and local groups.

Read Access to Groups and User Defined Features


Methods Introduced:
• pfcFeature.FeatureGroup.GetUDFName
• pfcFeature.FeatureGroup.GetUDFInstanceName
• pfcFeature.FeatureGroup.ListUDFDimensions
• pfcUDFGroup.UDFDimension.GetUDFDimensionName
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 pfcFeature.FeatureGroup.GetUDFName provides the name
of the group for the specified group instance. A particular group definition can be
used more than once in a particular model.
If the group is a family table instance, the method
pfcFeature.FeatureGroup.GetUDFInstanceName supplies the
instance name.
The method pfcFeature.FeatureGroup.ListUDFDimensions
traverses the dimensions that belong to the UDF. These dimensions correspond to
the dimensions specified as variables when the UDF was created. Dimensions of
the original features that were not variables in the UDF are not included unless the
UDF was placed using the Independent option.
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.

Creating Features from UDFs


Method Introduced:
• 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 Creo command Feature, Create, User Defined.

332 Creo Object TOOLKIT JavaUser’s Guide


To understand the following explanation of this method, you must have a good
knowledge and understanding of the use of UDF’s in Creo applications. PTC
recommends that you read about UDF’s in the Creo online help, and practice
defining and using UDF’s in Creo application before you attempt to use this
method.
When you create a UDF interactively, Creo application prompts you for the
information it needs to fix the properties of the resulting features. When you
create a UDF from Creo Object TOOLKIT Java, you can provide some or all of
this information programmatically by filling several compact data classes that are
inputs to the method pfcSolid.Solid.CreateUDFGroup.
During the call to pfcSolid.Solid.CreateUDFGroup, Creo application
prompts you for the following:
• Information required by the UDF that was not provided in the input data
structures.
• Correct information to replace erroneous information
Such prompts are a useful way of diagnosing errors when you develop your
application. This also means that, in addition to creating UDF’s programmatically
to provide automatic synthesis of model geometry, you can also use
pfcSolid.Solid.CreateUDFGroup to create UDF’s semi-interactively.
This can simplify the interactions needed to place a complex UDF making it
easier for the user and less prone to error.

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.
• References—The geometrical elements that the UDF needs in order to relate
the features it contains to the existing models features. The elements
correspond to the picks that Creo application prompts you for when you create
a UDF interactively using the prompts defined when the UDF was created.
You cannot select an embedded datum as the UDF reference.

Features 333
• Parts Intersection—When a UDF that is being created in an assembly contains
features that modify the existing geometry you must define which parts are
affected or intersected. You 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
with respect to a datum plane Creo must know what direction the new feature
will point to. When you create such a UDF interactively, Creo application
prompts 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,Creo application
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.
Creo Object TOOLKIT Java uses a special class that prepares and sets all the
options and passes them to Creo application.

Creating Interactively Defined UDFs


Method Introduced:
• 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.

Creating a Custom UDF


Method Introduced:
• pfcUDFCreate.pfcUDFCreate.UDFCustomCreateInstructions_Create
• wfcUDFCreate.wfcUDFCreate.WUDFCustomCreateInstructions_Create
The method
pfcUDFCreate.pfcUDFCreate.UDFCustomCreateInstructions_
Create 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
Creo gives you when you create a UDF interactively. PTC recommends that you
experiment with creating the UDF interactively using Creo application before you
write the Creo Object TOOLKIT Java code to fill the structure.

334 Creo Object TOOLKIT JavaUser’s Guide


The method
wfcUDFCreate.wfcUDFCreate.WUDFCustomCreateInstructions_
Create creates a WUDFCustomCreateInstructions object with a
specified name.

Setting the Family Table Instance Name


Methods Introduced:
• 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.

Setting Dependency Type


Methods Introduced:
• 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.

Setting Scale and Scale Type


Methods Introduced:
• pfcUDFCreate.UDFCustomCreateInstructions.SetScaleType
• pfcUDFCreate.UDFCustomCreateInstructions.GetScaleType
• pfcUDFCreate.UDFCustomCreateInstructions.SetScale
• pfcUDFCreate.UDFCustomCreateInstructions.GetScale
ScaleType specifies the length units of the UDF in the form of the
UDFScaleType object. This enumerated type takes the following values:

Features 335
• UDFSCALE_SAME_SIZE
• UDFSCALE_SAME_DIMS
• UDFSCALE_CUSTOM
• UDFSCALE_nil

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.

Setting the Appearance of the Non UDF Dimensions


Methods Introduced:
• pfcUDFCreate.UDFCustomCreateInstructions.SetDimDisplayType
• pfcUDFCreate.UDFCustomCreateInstructions.GetDimDisplayType
The pfcUDFCreate.UDFDimensionDisplayType object sets the options
in Creo 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.

Setting the Variable Dimensions and Parameters


Methods Introduced:
• pfcUDFCreate.UDFCustomCreateInstructions.SetVariantValues
• pfcUDFCreate.UDFVariantValues.create
• pfcUDFCreate.UDFVariantValues.insert
• pfcUDFCreate.pfcUDFCreate.UDFVariantDimension_Create

336 Creo Object TOOLKIT JavaUser’s Guide


• pfcUDFCreate.pfcUDFCreate.UDFVariantPatternParam_Create
• wfcSession.WSession.GetUDFDataDefaultVariableParameters
• wfcUDFCreate.wfcUDFCreate.UDFVariableParameter_Create
• wfcUDFCreate.UDFVariableParameter.GetName
• wfcUDFCreate.UDFVariableParameter.SetName
• wfcUDFCreate.UDFVariableParameter.GetItemType
• wfcUDFCreate.UDFVariableParameter.SetItemType
• wfcUDFCreate.UDFVariableParameter.GetItemId
• wfcUDFCreate.UDFVariableParameter.SetItemId
• wfcUDFCreate.UDFVariableParameter.GetValue
• wfcUDFCreate.UDFVariableParameter.SetValue
• wfcUDFCreate.WUDFCustomCreateInstructions.SetVariableParameters
• wfcUDFCreate.WUDFCustomCreateInstructions.GetVariableParameters
pfcUDFVariantValues class represents an array of variable dimensions and
pattern parameters.
Use pfcUDFCreate.UDFVariantValues.create to create an empty
object and then use pfcUDFCreate.UDFVariantValues.insert to add
pfcUDFCreate.UDFVariantPatternParam or
pfcUDFCreate.UDFVariantDimension objects one by one.
pfcUDFCreate.pfcUDFCreate.UDFVariantDimension_Create is a
static method creating a pfcUDFCreate.UDFVariantDimension. It
accepts the following 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 Creo Object TOOLKIT Java, 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.

Features 337
pfcUDFCreate.pfcUDFCreate.UDFVariantPatternParam_Create
is a static method which creates a
pfcUDFCreate.UDFVariantPatternParam. It accepts the following
parameters:
• name—The string name that the pattern parameter had when the UDF was
originally defined
• number—The new value.
After the pfcUDFCreate.UDFVariantValues object has been compiled,
use
pfcUDFCreate.UDFCustomCreateInstructions.SetVariantVal
ues to add the variable dimensions and parameters to the instructions.
Use the method
wfcSession.WSession.GetUDFDataDefaultVariableParameters
to obtain an array of available variant parameters and/or annotation values that can
optionally be set when placing this UDF. The input arguments to this method are:
• name
• instance
The method
wfcUDFCreate.wfcUDFCreate.UDFVariableParameter_Create
enables you to create a variable parameter object using the UDF data. The input
arguments are:
• Name—Specify the name of the variable parameter.
• ItemType—Specify the item type of the parameter using the enumerated type
pfcModelItem.ModelItemType.
• ItemId—Specify the item ID of the variable parameter.
The methods wfcUDFCreate.UDFVariableParameter.GetName and
wfcUDFCreate.UDFVariableParameter.SetName—get and set the
name or the symbol of the variant parameter or annotation value.
The methods wfcUDFCreate.UDFVariableParameter.GetItemType
and wfcUDFCreate.UDFVariableParameter.SetItemType—get and
set the item type of the variant parameter or annotation value.
The methods wfcUDFCreate.UDFVariableParameter.GetItemId and
wfcUDFCreate.UDFVariableParameter.SetItemId—get and set the
item id of the variant parameter or annotation value.
The methods wfcUDFCreate.UDFVariableParameter.GetValue and
wfcUDFCreate.UDFVariableParameter.SetValue—get and set the
default value for the variant parameter or annotation value.
Use the method
wfcUDFCreate.WUDFCustomCreateInstructions.SetVariable
Parameters to set the variable parameter sequence for a UDF feature.

338 Creo Object TOOLKIT JavaUser’s Guide


Use the method
wfcUDFCreate.WUDFCustomCreateInstructions.GetVariable
Parameters to retrieve the variable parameter sequence.

Setting the User Defined References


Methods Introduced:
• pfcUDFCreate.UDFReferences.create
• pfcUDFCreate.UDFReferences.insert
• pfcUDFCreate.pfcUDFCreate.UDFReference_Create
• pfcUDFCreate.UDFReference.SetIsExternal
• pfcUDFCreate.UDFReference.SetReferenceItem
• pfcUDFCreate.UDFCustomCreateInstructions.SetReferences
UDF References 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:
• PromptForReference—The prompt defined for this reference when the UDF
was originally set up. It indicates which reference this structure is providing. If
you get the prompt wrong, pfcSolid.Solid.CreateUDFGroup will not
recognize it and prompts the user for the reference in the usual way.
• ReferenceItem—Specifies the pfcSelect.Selection object representing
the referenced element. You can set Selection programmatically or prompt
the user for a selection separately. You cannot set an embedded datum as the
UDF refereence.
There are two types of reference:
○ Internal—The referenced element belongs directly to the model that will
contain the UDF. For an assembly, this means that the element belongs to
the top level.
○ External—The referenced element belongs to an assembly member other
than the placement member.
To set the reference type, use the method
pfcUDFCreate.UDFReference.SetIsExternal.
To set the item to be used for reference, use the method
pfcUDFCreate.UDFReference.SetReferenceItem.

Features 339
After the UDFReferences object has been set, use
pfcUDFCreate.UDFCustomCreateInstructions.SetReferences
to add the program-defined references.

Setting the Assembly Intersections


Methods Introduced:
• 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.UDFAssemblyIntersection
s.create to create an empty object and then use
pfcUDFCreate.UDFAssemblyIntersections.insert to add
pfcUDFCreate.UDFAssemblyIntersection objects one by one.
pfcUDFCreate.pfcUDFCreate.UDFAssemblyIntersection_
Create is a static method creating a pfcUDFCreate.UDFReference
object. It accepts the following parameters:
• ComponentPath—Is an com.ptc.cipjava.intseq type object
representing the component path of the part to be intersected.
• Visibility level—The number that corresponds to the visibility level of the
intersected part in the assembly. If the number is equal to the length of the
component path the feature is visible in the part that it intersects. If Visibility
level is 0, the feature is visible at the level of the assembly containing the
UDF.
pfcUDFCreate.UDFAssemblyIntersection.SetInstanceNames
sets an array of names for the new instances of parts created to represent the
intersection geometry. This method accepts the following parameters:
• instance names—is a com.ptc.cipjava.stringseq type object
representing the array of new instance names.
After the pfcUDFCreate.UDFAssemblyIntersections object has been
set, use
pfcUDFCreate.UDFCustomCreateInstructions.SetIntersec
tions to add the assembly intersections.

340 Creo Object TOOLKIT JavaUser’s Guide


External Symbol: Parameters
The data object for external symbol parameters is
wfcUDFCreate.UDFExternalParameter.
Methods Introduced:
• wfcUDFCreate.wfcUDFCreate.UDFExternalParameter_Create
• wfcUDFCreate.UDFExternalParameter.GetParameter
• wfcUDFCreate.UDFExternalParameter.SetParameter
• wfcUDFCreate.UDFExternalParameter.GetPrompt
• wfcUDFCreate.UDFExternalParameter.SetPrompt
• wfcUDFCreate.WUDFCustomCreateInstructions.SetExternalParameters
• wfcUDFCreate.WUDFCustomCreateInstructions.GetExternalParameters
The method
wfcUDFCreate.wfcUDFCreate.UDFExternalParameter_Create
enables you to create an external parameter symbol object required by a UDF. The
input arguments are:
• name—Specify the name of the external parameter symbol.
• parameter—Specify the parameter that is used to resolve this external symbol
in the placement model.
The methods wfcUDFCreate.UDFExternalParameter.GetParameter
and wfcUDFCreate.UDFExternalParameter.SetParameter retrieve
and set the parameter used to resolve the external symbol.
The methods wfcUDFCreate.UDFExternalParameter.GetPrompt and
wfcUDFCreate.UDFExternalParameter.SetPrompt retrieve and set
the prompt for the external parameter symbol.
Use the method
wfcUDFCreate.WUDFCustomCreateInstructions.SetExternal
Parameters to set the external parameters for a UDF feature.
Use the method
wfcUDFCreate.WUDFCustomCreateInstructions.GetExternal
Parameters to retrieve the external parameters.

External Symbol: Dimensions


The data object for external symbol parameters is
wfcUDFCreate.UDFExternalDimension.
Methods Introduced:
• wfcUDFCreate.wfcUDFCreate.UDFExternalDimension_Create
• wfcUDFCreate.UDFExternalDimension.GetDimension
• wfcUDFCreate.UDFExternalDimension.SetDimension

Features 341
• wfcUDFCreate.UDFExternalDimension.GetPrompt
• wfcUDFCreate.UDFExternalDimension.SetPrompt
• wfcUDFCreate.WUDFCustomCreateInstructions.SetExternalDimensions
• wfcUDFCreate.WUDFCustomCreateInstructions.GetExternalDimensions
The method
wfcUDFCreate.wfcUDFCreate.UDFExternalDimension_Create
enables you to create an external dimension symbol object required by a UDF.
The input arguments are:
• name—Specify the name of the external dimension symbol.
• dimension—Specify the dimension that is used to resolve this external symbol
in the placement model.
The methods wfcUDFCreate.UDFExternalDimension.GetDimension
and wfcUDFCreate.UDFExternalDimension.SetDimension retrieve
and set the dimension used to resolve the external symbol.
The methods wfcUDFCreate.UDFExternalDimension.GetPrompt and
wfcUDFCreate.UDFExternalDimension.SetPrompt retrieve and set
the prompt used for the external dimension symbol.
Use the method
wfcUDFCreate.WUDFCustomCreateInstructions.SetExternalDi
mensions to set the external dimensions for a UDF feature.
Use the method
wfcUDFCreate.WUDFCustomCreateInstructions.GetExternalDi
mensions to retrieve the external dimensions.

Setting Orientations
Methods Introduced:
• pfcUDFCreate.UDFCustomCreateInstructions.SetOrientations
• pfcUDFCreate.UDFOrientations.create
• pfcUDFCreate.UDFOrientations.insert
pfcUDFCreate.UDFOrientations class represents an array of orientations
that provide the answers to Creo application prompts that use a flip arrow. Each
term is a pfcUDFCreate.UDFOrientation object that takes the following
values:
• UDFORIENT_INTERACTIVE—Prompt for the orientation using a flip arrow.
• UDFORIENT_NO_FLIP—Accept the default flip orientation.
• UDFORIENT_FLIP—Invert the orientation from the default orientation.

342 Creo Object TOOLKIT JavaUser’s Guide


Use pfcUDFCreate.UDFOrientations.create to create an empty object
and then use pfcUDFCreate.UDFOrientations.insert to add
pfcUDFCreate.UDFOrientation objects one by one.
The order of orientations should correspond to the order in which Creo prompts
for them when the UDF is created interactively. If you do not provide an
orientation the default value NO_FLIP.
After the pfcUDFCreate.UDFOrientations object has been set use
pfcUDFCreate.UDFCustomCreateInstructions.SetOrienta
tions to add the orientations.

Setting Quadrants
Methods Introduced:
• pfcUDFCreate.UDFCustomCreateInstructions.SetQuadrants
The method
pfcUDFCreate.UDFCustomCreateInstructions.SetQuadrants
sets an array of points, which provide the X, Y, and Z coordinates that correspond
to the picks answering the Creo prompts for the feature positions. The order of
quadrants should correspond to the order in which Creo prompts for them when
the UDF is created interactively.

Setting the External References


Methods Introduced:
• pfcUDFCreate.UDFCustomCreateInstructions.SetExtReferences
The method
pfcUDFCreate.UDFCustomCreateInstructions.SetExtReferenc
es 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.

Features 343
19
Datum Features
Datum Plane Features ............................................................................................. 345
Datum Axis Features ............................................................................................... 347
General Datum Point Features ................................................................................. 348
Datum Coordinate System Features ......................................................................... 350

This chapter describes the Creo Object TOOLKIT Java methods that provide read
access to the properties of datum features.

344 Creo Object TOOLKIT JavaUser’s Guide


Datum Plane Features
The properties of the Datum Plane feature are defined in the
pfcDatumPlaneFeat.DatumPlaneFeatdata object.
Methods Introduced:
• pfcDatumPlaneFeat.DatumPlaneFeat.GetFlip
• pfcDatumPlaneFeat.DatumPlaneFeat.GetConstraints
• pfcDatumPlaneFeat.DatumPlaneConstraint.GetConstraintType
• pfcDatumPlaneFeat.DatumPlaneThroughConstraint.GetThroughRef
• pfcDatumPlaneFeat.DatumPlaneNormalConstraint.GetNormalRef
• pfcDatumPlaneFeat.DatumPlaneParallelConstraint.GetParallelRef
• pfcDatumPlaneFeat.DatumPlaneTangentConstraint.GetTangentRef
• pfcDatumPlaneFeat.DatumPlaneOffsetConstraint.GetOffsetRef
• pfcDatumPlaneFeat.DatumPlaneOffsetConstraint.GetOffsetValue
• pfcDatumPlaneFeat.DatumPlaneOffsetCoordSysConstraint.GetCsysAxis
• pfcDatumPlaneFeat.DatumPlaneAngleConstraint.GetAngleRef
• pfcDatumPlaneFeat.DatumPlaneAngleConstraint.GetAngleValue
• pfcDatumPlaneFeat.DatumPlaneSectionConstraint.GetSectionRef
• pfcDatumPlaneFeat.DatumPlaneSectionConstraint.GetSectionIndex
The properties of the pfcDatumPlaneFeat.DatumPlaneFeat object are
described as follows:
• Flip—Specifies whether the datum plane was flipped during 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:
• DTMPLN_THRU—Specifies the Through constraint. The
pfcDatumPlaneFeat.DatumPlaneThroughConstraint object
specifies this constraint. Use the method
pfcDatumPlaneFeat.DatumPlaneThroughConstraint.

Datum Features 345


GetThroughRef to get the reference selection handle for the Through
constraint.
• DTMPLN_NORM—Specifies the Normal constraint. The
pfcDatumPlaneFeat.DatumPlaneNormalConstraint object
specifies this constraint. Use the method
pfcDatumPlaneFeat.DatumPlaneNormalConstraint.GetNor
malRef to get the reference selection handle for the Normal constraint.
• DTMPLN_PRL—Specifies the Parallel constraint.
The pfcDatumPlaneFeat.DatumPlaneParallelConstraint
object specifies this constraint. Use the method
pfcDatumPlaneFeat.DatumPlaneParallelConstraint
.GetParallelRef to get the reference selection handle for the Parallel
constraint.
• DTMPLN_TANG—Specifies the Tangent constraint. The
pfcDatumPlaneFeat.DatumPlaneTangentConstraint object
specifies this constraint. Use the method
pfcDatumPlaneFeat.DatumPlaneTangentConstraint
.GetTangentRef 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.DatumPlaneOffsetConstraint
.GetOffsetRef to get the reference selection handle for the Offset
constraint. Use the method
pfcDatumPlaneFeat.DatumPlaneOffsetConstraint.GetOff
setValue to get the offset value.
An Offset constraint where the offset reference is a coordinate system is given
by the
pfcDatumPlaneFeat.DatumPlaneOffsetCoordSysConstraint
object. Use the method
pfcDatumPlaneFeat.DatumPlaneOffsetCoordSysConstraint
.GetCsysAxis to get the reference coordinate axis.
• DTMPLN_ANG—Specifies the Angle constraint. The
pfcDatumPlaneFeat.
DatumPlaneAngleConstraint object specifies this constraint. Use the
method
pfcDatumPlaneFeat.DatumPlaneAngleConstraint
.GetAngleRef to get the reference selection handle for the Angle
constraint. Use the method
pfcDatumPlaneFeat.DatumPlaneAngleConstraint

346 Creo Object TOOLKIT JavaUser’s Guide


.GetAngleValue to get the angle value.
• DTMPLN_SEC—Specifies the Section constraint. The
pfcDatumPlaneFeat.
DatumPlaneSectionConstraint object specifies this constraint. Use
the method
pfcDatumPlaneFeat.DatumPlaneSectionConstraint.
GetSectionRef to get the reference selection for the Section constraint.
Use the method
pfcDatumPlaneFeat.DatumPlaneSectionConstraint
.GetSectionIndex to get the section index.

Datum Axis Features


The properties of the Datum Axis feature are defined in the
pfcDatumAxisFeat.DatumAxisFeat data object.
Methods Introduced:
• pfcDatumAxisFeat.DatumAxisFeat.GetConstraints
• pfcDatumAxisFeat.DatumAxisConstraint.GetConstraintType
• pfcDatumAxisFeat.DatumAxisConstraint.GetConstraintRef
• pfcDatumAxisFeat.DatumAxisFeat.GetDimConstraints
• pfcDatumAxisFeat.DatumAxisDimensionConstraint.GetDimOffset
• pfcDatumAxisFeat.DatumAxisDimensionConstraint.GetDimRef
The properties of the pfcDatumAxisFeat.DatumAxisFeat object are
described as follows:
• Constraints—Specifies a collection of constraints given by the
pfcDatumAxisFeat.DatumAxisConstraint object. The method
pfcDatumAxisFeat.DatumAxisFeat.GetConstraints obtains the
collection of constraints applied to the Datum Axis feature.
This object contains the following attributes:
○ ConstraintType—Specifies the type of constraint in terms of the
pfcDatumAxisFeat.DatumAxisConstraintType enumerated
type. The constraint type determines the type of datum axis. The constraint
types are:
◆ DTMAXIS_NORMAL—Specifies the Normal datum constraint.
◆ DTMAXIS_THRU—Specifies the Through datum constraint.
◆ DTMAXIS_TANGENT—Specifies the Tangent datum constraint.
◆ DTMAXIS_CENTER—Specifies the Center datum constraint.

Datum Features 347


Use the method
pfcDatumAxisFeat.DatumAxisConstraint.GetConstraint
Type to get the constraint type.
○ ConstraintRef—Specifies the reference selection for the constraint.
Use the method
pfcDatumAxisFeat.DatumAxisConstraint.GetConstrain
tRef 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.
This pfcDatumAxisFeat.DatumAxisDimensionConstraint
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.Get
DimRef to get the reference selection handle.

General Datum Point Features


The properties of the General Datum Point feature are defined in the
pfcDatumPointFeat.DatumPointFeat data object.
Methods Introduced:
• pfcDatumPointFeat.DatumPointFeat.GetFeatName
• pfcDatumPointFeat.DatumPointFeat.GetPoints
• pfcDatumPointFeat.GeneralDatumPoint.GetName
• pfcDatumPointFeat.GeneralDatumPoint.GetPlaceConstraints
• pfcDatumPointFeat.GeneralDatumPoint.GetDimConstraints
• pfcDatumPointFeat.DatumPointConstraint.GetConstraintRef
• pfcDatumPointFeat.DatumPointConstraint.GetConstraintType
• pfcDatumPointFeat.DatumPointConstraint.GetValue

348 Creo Object TOOLKIT JavaUser’s Guide


The properties of the pfcDatumPointFeat.DatumPointFeat object are
described as follows:
• FeatName—Specifies the name of the General Datum Point feature. Use the
method pfcDatumPointFeat.DatumPointFeat.GetFeatName to
get the name.
• GeneralDatumPoints—Specifies a collection of general datum points
given by the pfcDatumPointFeat.GeneralDatumPoint object. Use
the method pfcDatumPointFeat.DatumPointFeat.GetPoints to
obtain the collection of general datum points. The
pfcDatumPointFeat.GeneralDatumPoint object consists of the
following attributes:
○ Name—Specifies the name of the general datum point. Use the method
pfcDatumPointFeat.GeneralDatumPoint.GetName to get the
name.
○ PlaceConstraints—Specifies a collection of placement constraints
given by the
pfcDatumPointFeat.DatumPointPlacementConstraint
object. Use the method
pfcDatumPointFeat.GeneralDatumPoint.
GetPlaceConstraints to obtain the collection of placement
constraints.
○ DimConstraints—Specifies a collection of dimension constraints
given by the
pfcDatumPointFeat.DatumPointDimensionConstraint
object. Use the method
pfcDatumPointFeat.GeneralDatumPoint.GetDimCon
straints to obtain the collection of dimension constraints.
The constraints for a datum point are given by the
pfcDatumPointFeat.DatumPoint
Constraint object. This object contains the following attributes:
• ConstraintRef—Specifies the reference selection for the datum point
constraint. Use the method
pfcDatumPointFeat.DatumPointConstraint.GetConstrain
tRef to get the reference selection handle.
• ConstraintType—Specifies the type of datum point constraint. in terms
of the pfcDatumPointFeat.DatumPointConstraintType
enumerated type. Use the method

Datum Features 349


pfcDatumPointFeat.DatumPointConstraint.GetConstraint
Type to get the constraint type.
• Value—Specifies the constraint reference value with respect to the datum
point. Use the method
pfcDatumPointFeat.DatumPointConstraint.GetValue to get
the value of the constraint reference with respect to the datum point.
The pfcDatumPointFeat.DatumPointPlacementConstraint and
pfcDatumPointFeat.DatumPointDimensionConstraint objects
inherit from the pfcDatumPointFeat.DatumPointConstraint object.
Use the methods of the pfcDatumPointFeat.DatumPointConstraint
object for the inherited objects.

Datum Coordinate System Features


The properties of the Datum Coordinate System feature are defined in the
pfcCoordSysFeat.CoordSysFeat object.
Methods Introduced:
• pfcCoordSysFeat.CoordSysFeat.GetOriginConstraints
• pfcCoordSysFeat.DatumCsysOriginConstraint.GetOriginRef
• pfcCoordSysFeat.CoordSysFeat.GetDimensionConstraints
• pfcCoordSysFeat.DatumCsysDimensionConstraint.GetDimRef
• pfcCoordSysFeat.DatumCsysDimensionConstraint.GetDimValue
• pfcCoordSysFeat.DatumCsysDimensionConstraint.
GetDimConstraintType
• pfcCoordSysFeat.CoordSysFeat.GetOrientationConstraints
• pfcCoordSysFeat.DatumCsysOrientMoveConstraint.
GetOrientMoveConstraintType
• 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:
• OriginConstraints—Specifies a collection of origin constraints given
by the pfcCoordSysFeat.DatumCsysOriginConstraint object.

350 Creo Object TOOLKIT JavaUser’s Guide


Use the method
pfcCoordSysFeat.CoordSysFeat.GetOriginConstraints to
obtain the collection of origin constraints for the coordinate system. This
object contains the following attribute:
○ OriginRef—Specifies the selection reference for the origin. Use the
method
pfcCoordSysFeat.DatumCsysOriginConstraint.GetOri
ginRef to get the selection reference handle.
• DimensionConstraints—Specifies a collection of dimension
constraints given by the pfcDatumCsysDimensionConstraint object.
Use the method
CoordSysFeat.pfcCoordSysFeat.CoordSysFeat.GetDimen
sionConstraints to obtain the collection of dimension constraints for the
coordinate system. This object contains the following attributes:
○ DimRef—Specifies the reference selection for the dimension constraint.
Use the method
pfcCoordSysFeat.DatumCsysDimensionConstraint.Get
DimRef to get the reference selection handle.
○ DimValue—Specifies the value of the reference. Use the method
pfcCoordSysFeat.DatumCsysDimensionConstraint.Get
DimValue to get the value.
○ DimConstraintType—Specifies the type of dimension constraint in
terms of the
pfcCoordSysFeat.DatumCsysDimConstraintType enumerated
type. Use the method
pfcCoordSysFeat.DatumCsysDimensionConstraint.
GetDimConstraintType 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.GetOrientationCon
straints to obtain the collection of orientation constraints for the
coordinate system. This object contains the following attributes:
○ OrientMoveConstraintType—Specifies the type of orientation for
the constraint. The orientation type is given by the

Datum Features 351


pfcCoordSysFeat.DatumCsysOrientMoveConstraintType
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.
• OnSurfaceType—Specifies the on surface type for the coordinate system
in terms of the pfcCoordSysFeat.DatumCsysOffsetType
enumerated type. Use the method
pfcCoordSysFeat.CoordSysFeat.GetOnSurfaceType to get the
on surface type property of the coordinate system. The on surface types are:
○ DTMCSYS_ONSURF_LINEAR—Specifies a coordinate 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.

352 Creo Object TOOLKIT JavaUser’s Guide


○ 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.

Datum Features 353


20
Cross Sections
Listing Cross Sections ............................................................................................. 355
Extracting Cross-Sectional Geometry ....................................................................... 356
Creating and Modifying Cross Sections..................................................................... 358
Mass Properties of Cross Sections ........................................................................... 360
Line Patterns of Cross Section Components.............................................................. 360

The methods in this chapter enable you to create, access, modify, and delete cross
sections.

354 Creo Object TOOLKIT JavaUser’s Guide


Listing Cross Sections
Methods Introduced:
• pfcSolid.Solid.ListCrossSections
• pfcSolid.Solid.GetCrossSection
• pfcXSection.XSection.GetName
• pfcXSection.XSection.SetName
• pfcXSection.XSection.GetXSecType
• pfcXSection.XSecType.GetType
• pfcXSection.XSecType.GetObjectType
• 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.
The method pfcXSection.XSection.GetName returns the name of the
cross section in the Creo application. The method
pfcXSection.XSection.SetName modifies the cross section name.
The method pfcXSection.XSection.GetXSecType returns the type of
cross section as a XSecCutType object, that is planar or offset, and the type of
item intersected by the cross section.
The method pfcXSection.XSecType.GetType returns the type of
intersection for the cross section using the enumerated type XSecCutType. The
valid values are:
• XSEC_PLANAR
• XSEC_OFFSET
The method pfcXSection.XSecType.GetObjectType returns the type of
item intersected by the cross section using the enumerated type
XSecCutobjType. The valid values are:
• XSECTYPE_MODEL—Specifies that the cross section was created on solid
geometry.
• XSECTYPE_QUILTS—Specifies that the cross section was created on one
quilt surface.

Cross Sections 355


• XSECTYPE_MODELQUILTS—Specifies that the cross section was created on
solid geometry and all quilt surfaces.
• XSECTYPE_ONEPART—Specifies that the cross section was created on one
component in the assembly.
The method pfcXSection.XSection.Delete deletes a cross section.
The method pfcXSection.XSection.Display forces a display of the
cross section in the window.
The method pfcXSection.XSection.Regenerate regenerates a cross
section.

Extracting Cross-Sectional Geometry


Methods Introduced:
• wfcXSection.WXSection.CollectGeometry
• wfcXSection.XSectionGeometry.GetGeometry
• wfcXSection.XSectionGeometry.GetMemberIdTable
• wfcXSection.XSectionGeometry.GetQuiltId
• wfcXSection.WXSection.GetPlane
• wfcXSection.WXSection.GetOffsetXSectionData
• wfcXSection.WXSection.GetFlip
• wfcXSection.WXSection.GetComponents
• wfcXSection.WXSection.GetName
• wfcXSection.WXSection.SetName
• wfcXSection.XSectionComponents.GetExclude
• wfcXSection.XSectionComponents.SetExclude
• wfcXSection.XSectionComponents.GetComponents
• wfcXSection.XSectionComponents.SetComponents
• wfcXSection.ZoneXSectionGeometry.GetGeometries
• wfcXSection.OffsetXSectionData.GetXSectionLines
• wfcXSection.OffsetXSectionData.GetPlaneData
• wfcXSection.OffsetXSectionData.GetOneSided
• wfcXSection.OffsetXSectionData.GetFlip

356 Creo Object TOOLKIT JavaUser’s Guide


The geometry of a cross section in an assembly is divided into components. Each
component corresponds to one of the parts in the assembly that is intersected by
the cross section, and describes the geometry of that intersection. A component
can have disjoint geometry if the cross section intersects a given part instance in
more than one place.
A cross section in a part has a single component.
The components of a cross section are identified by consecutive integer identifiers
that always start at 0.
The method wfcXSection.WXSection.CollectGeometry returns the
object XSectionGeometries that contains the geometry of all components in
the specified cross section. XSectionGeometries retrieves information from
the XSectionGeometry object.
The method wfcXSection.XSectionGeometry.GetGeometry returns
the geometry of all components in the specified cross section as Surface object.
Use the methods
wfcXSection.XSectionGeometry.GetMemberIdTable and
wfcXSection.XSectionGeometry.GetQuiltId to get the component
and quilt identifiers in the specified cross section.
The method wfcXSection.WXSection.GetPlane returns the plane
geometry for a specified cross section.
The method wfcXSection.WXSection.GetOffsetXSectionData
returns the parameters for a specified offset cross section.
The method wfcXSection.WXSection.GetFlip returns a boolean value
that indicates the direction in which the cross section has been clipped. The value
Falseindicates that the cross section has been clipped in the direction of the
positive normal to the cross section plane. True indicates that the cross section
has been clipped in the opposite direction of the positive normal.
The method wfcXSection.WXSection.GetComponents returns an array
of paths to the assembly components that have been included or excluded for the
specified cross section.
The methods wfcXSection.WXSection.GetName and
wfcXSection.WXSection.SetName enable you to retrieve and rename the
name of a cross section in an assembly, respectively.
The method wfcXSection.XSectionComponents.GetExclude
specifies if the assembly components were excluded or not.
The method wfcXSection.XSectionComponents.SetExclude
specifies if the assembly components are to be excluded or not.
The methods wfcXSection.XSectionComponents.GetComponents
and wfcXSection.XSectionComponents.SetComponents get and set
the sequence of components that have been included or excluded for the specified
cross section definition.

Cross Sections 357


The method wfcXSection.ZoneXSectionGeometry.GetGeometries
returns the geometry information of a zone feature in the specified cross section as
wfcXSection.XSectionGeometries object.
The method
wfcXSection.OffsetXSectionData.GetXSectionLines returns
information about the line segment entities in the cross section as a
wfcSectionEntityLine object.
The method wfcXSection.OffsetXSectionData.GetPlaneData
returns information about the entity datum plane.
The method wfcXSection.OffsetXSectionData.GetOneSided
returns true if the cross section lies on one side of the entity plane. The method
returns false if the cross section is both-sided.
If the output argument of the method
wfcXSection.OffsetXSectionData.GetFlip is False, the Creo
application removes material from the left of the cross section entities if the
viewing direction is from the positive side of the entity plane and if
wfcXSection.OffsetXSectionData.GetOneSided is true, the Creo
application removes only the material from positive side of the entity plane.

Creating and Modifying Cross Sections


Methods Introduced:
• wfcSolid.WSolid.CreateParallelXSection
• wfcSolid.WSolid.CreatePlanarXSection
• wfcModel.WModel.CanCreateSectionFeature
• wfcModel.WModel.ConvertOldXSectionsToNew
• wfcXSection.WXSection.IsFeature
• wfcXSection.WXSection.GetFeature
• wfcXSection.XSectionComponents_Create
The method wfcSolid.WSolid.CreateParallelXSection creates a
cross section feature parallel to a given plane.
The method wfcSolid.WSolid.CreatePlanarXSection creates a cross
section feature through a datum plane. The input arguments are:
• Name —Specifies the name of the cross section.
• PlaneId —Specifies the ID of the cutting plane. The cutting plane must belong
to the model.
• CutObjectType—Specifies the type of object that will be cut by the cross
section. It is specified by the enumerated type XSecCutobjType.

358 Creo Object TOOLKIT JavaUser’s Guide


• MemberIdTable—Specifies the path to the assembly component being cut. If
the CutObjectType is XSECTYPE_QUILTS, then only the quilt with
specified QuiltId is cut in this component. If the CutObjectType is
XSECTYPE_ONEPART, then only solid geometry of this component is cut.
• QuiltId—Specifies the ID of the quilt when CutObjectType is
XSECTYPE_QUILTS. The quilt must belong to the top assembly or any of its
sub-assemblies and parts. When the object to be cut is not a quilt specify the
value as false.

Note
• The legacy cross sections, that is, the cross sections created in Pro/
ENGINEER, Creo Elements/Pro, and in releases prior to Creo Parametric 2.0
are not supported.
• The methods wfcSolid.WSolid.CreateParallelXSection and
wfcSolid.WSolid.CreatePlanarXSection automatically convert
the legacy cross sections to new cross section features as defined in Creo
Parametric 2.0 onward, before creating any new cross section feature.

Use the method wfcModel.WModel.CanCreateSectionFeature to


check if new cross section features can be created in the specified model. The
method returns false if the specified model has legacy cross sections.
The method wfcModel.WModel.ConvertOldXSectionsToNew converts
the legacy cross sections to new cross section features as defined in Creo
Parametric2.0 onward for the specified model.
Use the method wfcXSection.WXSection.IsFeature to check whether
the cross section is a feature.
The method wfcXSection.WXSection.GetFeature returns a Feature
object representing the cross section feature. You must use this method only if
wfcModel.WModel.CanCreateSectionFeature returns true.
Use the method wfcXSection.XSectionComponents_Create to create
the object wfcXSection.XSectionComponents that contains interface for
excluding or including components from a specified cross section. Pass the
following values to this object:
• Components—Specify the sequence of components to exclude or include
from a cross section definition.
• Exclude—Specify the value as true to exclude components and false to
include.

Cross Sections 359


Mass Properties of Cross Sections
Method Introduced:
• wfcXSection.WXSection.GetMassProperty
The method wfcXSection.WXSection.GetMassProperty calculates the
mass properties of the cross-section in the specified coordinate system. The
method needs the name of a coordinate system datum whose X- and Y-axes are
parallel to the cross section. The output from this method also refers to the
coordinate system datum.

Note
• The method wfcXSection.WXSection.GetMassProperty is not
supported for offset and quilt type of cross-sections.
• The following methods can be called on MassProperty object returned
by wfcXSection.WXSection.GetMassProperty:
○ pfcSolid.Solid.MassProperty
○ pfcSolid.MassProperty.GetSurfaceArea
○ pfcSolid.MassProperty.SetSurfaceArea
○ pfcSolid.MassProperty.GetGravityCenter
○ pfcSolid.MassProperty.SetGravityCenter
○ pfcSolid.MassProperty.GetCoordSysInertia
○ pfcSolid.MassProperty.SetCoordSysInertia

Line Patterns of Cross Section


Components
Methods Introduced:
• wfcXSection.WXSection.GetCompXSectionHatches
• wfcXSection.WXSection.SetCompXSectionHatches
• wfcXSection.wfcXSection.XSectionHatch_Create
• wfcXSection.XSectionHatch.GetAngle
• wfcXSection.XSectionHatch.SetAngle
• wfcXSection.XSectionHatch.GetSpacing
• wfcXSection.XSectionHatch.SetSpacing

360 Creo Object TOOLKIT JavaUser’s Guide


• wfcXSection.XSectionHatch.GetOffset
• wfcXSection.XSectionHatch.SetOffset
The method wfcXSection.WXSection.GetCompXSectionHatches
returns the line patterns of a cross section as a XSectionHatches object. The
input arguments to the method are the ID of the cross section component and the
drawing view containing the cross section component. The information related to
line patterns is obtained from XSectionHatch. Use the method
wfcXSection.WXSection.SetCompXSectionHatches to set the line
patterns for a cross section.
The method wfcXSection.wfcXSection.XSectionHatch_Create
creates a data object that contains information about the line patterns.
Use the methods wfcXSection.XSectionHatch.GetAngle and
wfcXSection.XSectionHatch.SetAngle to get and set the angle in the
line patterns.
The methods wfcXSection.XSectionHatch.GetSpacing and
wfcXSection.XSectionHatch.SetSpacing get and set the distance
between the line patterns.
The methods wfcXSection.XSectionHatch.GetOffset and
wfcXSection.XSectionHatch.SetOffset get and set the offset of the
first line in the pattern.

Cross Sections 361


21
External Objects
Summary of External Objects ................................................................................... 363
External Objects and Object Classes ........................................................................ 364
External Object Data ............................................................................................... 365
External Object References ..................................................................................... 371

This chapter describes the Creo Object TOOLKIT C++ methods that enable you
to create and manipulate external objects.

362 Creo Object TOOLKIT JavaUser’s Guide


Summary of External Objects
External objects are objects created by an application that is external to Creo
Parametric. Although these objects can be displayed and selected within a Creo
Parametric session, they can not be independently created by Creo Parametric.
Using Creo Object TOOLKIT Java methods, you can define and manipulate
external objects, which are then stored in a model database.

Note
External objects are limited to text and wireframe entities. In addition, external
objects can be created for parts and assemblies only. That is, external objects
can be stored in a part or assembly database only.

In Creo Object TOOLKIT Java application, an external object is defined by a


wfcExternalObject object. This DHandle identifies an external object in the
Creo Parametric database, which contains the following information for the
object:
• Object class—A class of external objects is a group that contains objects with
similar characteristics. All external objects must belong to a class. Object class
is contained in the wfcExternalObject.ExternalObjectClass
object.
• Object data—The object data contains information about the display and
selection of an external object. Object data is contained in the
wfcExternalObject.ExternalObjectData object.
• Object parameters—External objects can own parameters. You can use the
wfcModelItem.WParameter API to get, set, and modify external object
parameters.
• Object references—External objects can reference any Creo object. This
functionality is useful when changes to Creo objects need to instigate changes
in the external objects. The changes are communicated back to your Creo
Object TOOLKIT Java application via the callback methods.
• Callback methods—Creo Object TOOLKIT Java enables you to specify
callback methods for a class of external objects. These methods are called
whenever the external object owner or reference is deleted, suppressed, or
modified. In this manner, the appearance and behavior of your external objects
can depend on the object owner or reference.

External Objects 363


External Objects and Object Classes
This section describes the Creo Object TOOLKIT Java methods that relate to the
creation and manipulation of external objects and object classes.

Note
This description does not address the display or selection of the external
object. For more information see External Object Data on page 365.

Creating External Objects


Methods introduced:
• wfcExternalObjectClass.ExternalObjectClass.CreateObject
• wfcExternalObjectClass.ExternalObjectClass.GetName
• wfcExternalObjectClass.ExternalObjectClass.GetType
After the object class is registered, you can create the external object by calling
the method
wfcExternalObjectClass.ExternalObjectClass.CreateOb
ject. The input arguments to this method is owner. (Currently, the owner of the
external object can be a part or an assembly only.) To get the information of the
newly created object, pass the data handle
wfcExternalObject.ExternalObject to the method
wfcExternalObjectClass.ExternalObjectClass.CreateOb
ject.
When the external object is created, it is assigned an integer identifier that is
persistent from session to session. The external object is saved as part of the
model database and will be available when the model is retrieved next.
Use the method
wfcExternalObjectClass.ExternalObjectClass.GetName to
retrieve the name of the external object class.
Use the method
wfcExternalObjectClass.ExternalObjectClass.GetType to
retrieve the type of the external object class.

External Object Owners


Methods introduced:

364 Creo Object TOOLKIT JavaUser’s Guide


• wfcExternalObject.ExternalObject.GetOwner
The owner of an external object is set during the call to
wfcExternalObjectClass.ExternalObjectClass.CreateOb
ject. For example, the “owner” would be the part or assembly where the
external object resides.
The method wfcExternalObject.ExternalObject.GetOwner
retrieves the owner of an existing external object. To get the owner to an external
object, pass the data handle pfcModelItem.ModelItem to the method
wfcExternalObject.ExternalObject.GetOwner.

External Object Data


Simply creating an external object does not allow the object to be displayed or
selected in Creo Parametric. For this, you must supply external object data that is
used, stored, and retrieved by Creo. The data is removed from the model database
when the external object is deleted.
External object data is described by the opaque workspace handle
wfcExternalObject.ExternalObjectData. The methods required to
initialize and modify this object are specific to the type of data being created. That
is, creating display data requires one set of methods, whereas creating selection
data requires another.
Once you have created a wfcExternalObject.ExternalObjectData
object, the manipulation of the external object data is independent of its contents:
the methods required to add or remove data are the same for both display and
selection data.

Display Data for External Objects


Display data gives information to Creo Parametric about how the external object
is to appear in the model window. This data must include the color, scale, line
type, and transformation of the external object. In addition, display data can
include settings that override the user’s ability to zoom and spin the external
object.

Note
Setting the display data does not result in the external object being displayed.
To see the object, you must repaint the model window using the method
pfcWindow.Window.Repaint.

Methods introduced:

External Objects 365


• wfcExternalObject.ExternalObjectDisplayData_Create
Use the method wfcExternalObject.ExternalObjectDisplayData_
Create to create a display data information for an external object. The input
arguments are as follows:
• Ents—Specify the entities in the pfcGeometry.CurveDescriptors
object in the specified display data.
• EntityColors—Specify the entities in the pfcBase.StdColors object in
the specified display data.
The method wfcExternalObject.ExternalObjectDisplayData_
Create returns the display properties of the external object in the
wfcExternalObject.ExternalObjectDisplayData object.

Creating the External Object Entity


Methods introduced:
• wfcExternalObject.ExternalObjectDisplayData.GetEntities
• wfcExternalObject.ExternalObjectDisplayData.SetEntities
• wfcExternalObject.ExternalObjectDisplayData.GetEntityColors
• wfcExternalObject.ExternalObjectDisplayData.SetEntityColors
External objects are currently limited to text and wireframe entities. You can
specify the entities to be displayed by creating an array of
pfcGeometry.CurveDescriptors objects that contain that necessary
information. pfcGeometry.CurveDescriptors is a union of specific
entity structures, such as line, arrow, arc, circle, spline, and text. Note that when
you specify the entities in the pfcGeometry.CurveDescriptors array, the
coordinate system used is the default model coordinate system.
Use the method
wfcExternalObject.ExternalObjectDisplayData.GetEntities
to retrieve the entities that make up an external object in a specified display data.
After you have created the array of pfcGeometry.CurveDescriptors
objects, you can add entities to the display data by calling the method
wfcExternalObject.ExternalObjectDisplayData.SetEnti

366 Creo Object TOOLKIT JavaUser’s Guide


ties. The input argument to the method
wfcExternalObject.ExternalObjectDisplayData.SetEntities
are the entities in the pfcGeometry.CurveDescriptors object.

Note
The method
wfcExternalObject.ExternalObjectDisplayData.SetEnti
ties supports only wfcENTITY_LINE and wfcENTITY_ARC entities.
However, you can draw polygons as multiple lines, and circles as arcs of
extent 2 pi.

The methods
wfcExternalObject.ExternalObjectDisplayData.GetEntity
Colors and
wfcExternalObject.ExternalObjectDisplayData.SetEntity
Colors retrieve and set the display data for a list of entities and the color for
each entity. The input argument to the method
wfcExternalObject.ExternalObjectDisplayData.SetEntity
Colors are the list of entities in the pfcBase.StdColors object.

External Object Display Properties


Methods introduced:
• wfcExternalObject.ExternalObjectData.GetType
• wfcExternalObject.ExternalObjectDisplayData.GetProperties
• wfcExternalObject.ExternalObjectDisplayData.SetProperties
By default, when users spin or zoom in on a model, external objects are subjected
to the same spin and zoom scale as the model. In addition, by default external
objects are always displayed, even if the owner or reference objects are
suppressed. Setting external object display properties within display data enables
you to change these default behaviors.
The method wfcExternalObject.ExternalObjectData.GetType
retrieves the type of property in specified external object data. To specify which
type of property you want to retrieve, pass one of the values in the enumerated
type wfcExternalObject.ExternalObjectDataType to this method.
The methods
wfcExternalObject.ExternalObjectDisplayData.GetProper
ties and
wfcExternalObject.ExternalObjectDisplayData.SetProper
ties retrieve and set the display properties in the specified display data. The

External Objects 367


input argument to the method
wfcExternalObject.ExternalObjectDisplayData.SetProper
ties are the display properties in the
wfcExternalObject.ExternalObjectDisplayDataProperties
object.

External Object Color


Methods introduced:
• wfcExternalObject.ExternalObjectDisplayData.GetDisplayColor
• wfcExternalObject.ExternalObjectDisplayData.SetDisplayColor
The enumerated type pfcBase.StdColor specifies the colors available for
external objects.
The methods
wfcExternalObject.ExternalObjectDisplayData.GetDisplay
Color and
wfcExternalObject.ExternalObjectDisplayData.SetDisplay
Color retrieve and set the object color in the specified display data.

Line Styles for External Objects


Methods introduced:
• wfcExternalObject.ExternalObjectDisplayData.GetLineStyle
• wfcExternalObject.ExternalObjectDisplayData.SetLineStyle
The enumerated type pfcBase.StdLineStyle specifies the line styles
available for specifies the line styles available for external objects.
The methods
wfcExternalObject.ExternalObjectDisplayData.GetLineS
tyle and v retrieve and set the object line style in the specified display data.

External Object Scale


Methods introduced:
• wfcExternalObject.ExternalObjectDisplayData.GetScale
• wfcExternalObject.ExternalObjectDisplayData.SetScale
To vary the size of your external object without altering the entities themselves,
you must specify an object scale factor as part of the display data.
The methods
wfcExternalObject.ExternalObjectDisplayData.GetScale and
wfcExternalObject.ExternalObjectDisplayData.SetScale
retrieve and set the scale factor in the specified display data.

368 Creo Object TOOLKIT JavaUser’s Guide


Transformation of the External Object
Methods introduced:
• wfcExternalObject.ExternalObjectDisplayData.GetTransormationMatrix
• wfcExternalObject.ExternalObjectDisplayData.SetTransormationMatrix
You can transform the local coordinates from model coordinates using the three-
dimensional transformational matrix.
The method
wfcExternalObject.ExternalObjectDisplayData.GetTransor
mationMatrix retrieve the transformation matrix contained in a particular set
of display data.
To a perform a coordinate transformation on an external object, use the method
wfcExternalObject.ExternalObjectDisplayData.SetTransor
mationMatrix to set the transformation matrix within the associated display
data. The input argument to the method
wfcExternalObject.ExternalObjectDisplayData.SetTransor
mationMatrix is the transformation matrix in the pfcBase.Matrix3D
object.

Selection Data for External Objects


Methods introduced:
• wfcExternalObject.ExternalObjectSelectionBoxData_Create
• wfcExternalObject.ExternalObjectSelectionBoxData.GetBoxes
• wfcExternalObject.ExternalObjectSelectionBoxData.SetBoxes
Use the method
wfcExternalObject.ExternalObjectSelectionBoxData_Create
to create a selection data information for the specified external object. This
method returns the selection data for the external object as a
wfcExternalObject.ExternalObjectSelectionBoxData object.
Selection boxes are specified as part of the external object selection data. These
selection boxes indicate locations in which mouse selections will cause the
external object to be selected. For the selection to be possible, you must designate
a set of “hot spots,” or selection boxes for the object.
A selection box is defined by the pair of points contained in a
wfcExternalObject.SelectionBoxes object. The coordinates of the
points are specified in the external object's coordinate system (the default
coordinates). The line between the points forms the diagonal of the selection box;
the edges of the box lie parallel to the coordinate axes of the external object.

External Objects 369


Note
PTC recommends that the size and arrangement of the selection boxes be
dependent on the size and shape of the external object. If the external object is
compact and uniformly distributed in all coordinate directions, one selection
box will probably suffice.
However, if the external object is distributed nonuniformly, or is interfering
with other objects, you must designate more specific locations at which
selection should occur.

The method
wfcExternalObject.ExternalObjectSelectionBoxData.GetBox
es retrieves the list of selection boxes in a given selection data.
To set the selection boxes within the selection data, call the method
wfcExternalObject.ExternalObjectSelectionBoxData.SetBox
es and pass as input a pointer to a list of
wfcExternalObject.SelectionBoxes objects. This enables your
external object to have more than one associated selection box.

Manipulating External Object Data


Methods introduced:
• wfcExternalObject.ExternalObject.AddData
• wfcExternalObject.ExternalObject.ModifyData
• wfcExternalObject.ExternalObject.GetData
• wfcExternalObject.ExternalObject.RemoveData
• wfcExternalObject.ExternalObject.GetClass
The methods in this section enable you to manipulate how the external object data
relates to the object itself.
To add new data to an external object, pass the data handle
wfcExternalObject.ExternalObjectData to the method
wfcExternalObject.ExternalObject.AddData.
The method wfcExternalObject.ExternalObject.ModifyData sets
the contents of existing object data.
The method wfcExternalObject.ExternalObject.GetData retrieve
the handle for the display or selection data associated with an external object. To
specify which type of data you want to retrieve, pass one of the values in the
enumerated type wfcExternalObject.ExternalObjectDataType to
this method.

370 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcExternalObject.ExternalObject.RemoveData
to remove data from an external object.
Use the method wfcExternalObject.ExternalObject.GetClass to
retrieve the class of an external object.

External Object References


You can use external object references to make external objects dependent on
model geometry. For example, consider an external object that is modeled as the
outward-pointing normal of a surface. Defining the surface as a reference enables
the external object to behave appropriately when the surface is modified, deleted,
or suppressed.
In general, an external object can reference any of the geometry that belongs to its
owner. In addition, if the owner belongs to an assembly, the external object can
also reference the geometry of other assembly components, provided that you
supply a valid component path. In general, an external object can reference any of
the geometry that belongs to its owner. In addition, if the owner belongs to an
assembly, the external object can also reference the geometry of other assembly
components, provided that you supply a valid component path.

Note
Setting up the references for an external object does not fully define the
dependency between the object and the reference. You must also specify the
callback method to be called when some action is taken on the reference.

Creating External Object References


Methods introduced:
• wfcExternalObject.ExternalReferenceInfo_Create
• wfcExternalObject.ExternalReferenceInfo.GetType
• wfcExternalObject.ExternalReferenceInfo.SetType
• wfcExternalObject.ExternalReferenceInfo.GetExtRefs
• wfcExternalObject.ExternalReferenceInfo.SetExtRefs
The method wfcExternalObject.ExternalReferenceInfo_Create
creates an external reference information object. The input arguments are as
follows:
• type—Specify the type of the external reference.
• extRefs—Specify the sequence of external feature references.

External Objects 371


You might need to use “reference types” to differentiate among the references of
an external object.
The method
wfcExternalObject.ExternalReferenceInfo.GetType retrieve the
reference type of the specified reference in an external reference information
object. To specify which type of external reference to want to retrieve, pass one of
the values in the enumerated type
wfcExternalObject.ExternalReferenceType to this method.
Use the method
wfcExternalObject.ExternalReferenceInfo.GetType to set a
reference type.
The method
wfcExternalObject.ExternalReferenceInfo.GetExtRefs
retrieves the sequence of external feature references in an external reference
information object.
Use the method
wfcExternalObject.ExternalReferenceInfo.SetExtRefs to set
the external feature reference. The input argument are the external feature
references in the
wfcExternalObject.WExternalFeatureReferences object.

372 Creo Object TOOLKIT JavaUser’s Guide


22
Element Trees: Sections
Overview ................................................................................................................ 374
Creating Section Models .......................................................................................... 374

A section is a parametric two-dimensional cross section used to define the shape


of three-dimensional features, such as extrusions. In the Creo application, you
create a section interactively using Sketcher mode. In a Creo Object TOOLKIT
Java application, you can create sections completely programmatically using the
methods described in this section.

373
Overview
Sections fall into two types: 2D and 3D. Both types are represented by the
wfcSection object and manipulated by the same methods.
The difference between the types arises out of the context in which the section is
being used, and affects the requirements for the contents of the section and also of
the feature element tree in which it is placed when creating a sketched feature.
Put simply, a 2D section is self-contained, whereas a 3D section contains
references to 3D geometry in a parent part or assembly.
You can add section entities programmatically using the Intent Manager mode.
This corresponds to creating sections within the Intent Manager mode in the Creo
application.
This chapter is concerned with 2D. The extra steps required to construct a 3D
section are described in the chapter Element Trees: Sketched Features on page
386.

Creating Section Models


A 2D section, because it is self-contained, can be stored as a Creo model file. It
then has the extension .sec.
The steps required to create and save a section model using Creo Object
TOOLKIT Java follow closely those used in creating a section interactively using
Sketcher mode in the Creo application.

Setting the Intent Manager Mode of a Section


Methods Introduced:
• wfcSection.Section.GetIntentManagerMode
• wfcSection.Section.SetIntentManagerMode
The Creo Object TOOLKIT Java methods for 2D and 3D sections work only
when the Intent Manager mode is set to ON. Use the method
wfcSection.Section.GetIntentManagerMode to check if the Intent
Manager mode is ON for the specified section. The mode is set to OFF by default.
Use the method wfcSection.Section.SetIntentManagerMode to set
the Intent Manager mode to ON for the specified section. Call this method before
using the other Creo Object TOOLKIT Java methods that access the sections.

374 Creo Object TOOLKIT JavaUser’s Guide


To Create and Save a Section Model
1. Allocate the two-dimensional section and define its name.
2. Set the Intent manager mode to ON using the method
wfcSection.Section.SetIntentManagerMode.
3. Add section entities (lines, arcs, splines, and so on) to define the section
geometry, in section coordinates.
4. Save the section.
When you are creating a section that is to be used in a sketched feature, Steps 1
and 4 will be replaced by different techniques. These techniques are described
fully in the chapter on Element Trees: Sketched Features on page 386.
The steps are described in more detail in the following sections.

Allocating a Two-Dimensional Section


Methods Introduced:
• wfcSession.WSession.CreateSection2D
• wfcSection.Section.GetName
• wfcSection.Section.SetName
The method wfcSession.WSession.CreateSection2D allocates
memory for a new, standalone two dimensional section and outputs a section
handle to identify it.
The method wfcSection.Section.SetName enables you to set the name of
a section. Calling this method places the section in the Creo application namelist
and enables it to be recognized by Creo as a section model in the database.
Such sections created programmatically have the Intent Manager mode OFF by
default.

Copying the Current Section


Methods Introduced:
• wfcSession.WSession.GetActiveSection
• wfcSection.Section.SetActive
The method wfcSession.WSession.GetActiveSection creates a copy
of the section that you are using currently. This copy is created within the same
Sketcher session. To set the Intent Manager mode to ON, call the method
wfcSection.Section.SetIntentManagerMode after this method.

Element Trees: Sections 375


Use the method wfcSection.Section.SetActive to set the specified
section as the current active Sketcher section. The Intent Manager mode must be
set to ON when you call this method.

Note
The call to the method wfcSection.Section.SetActive makes the
Undo and Redo menu options available in Creo Parametric.

Epsilon Value in Sections


Methods Introduced:
• wfcSection.Section.GetEpsilon
• wfcSection.Section.SetEpsilon
Epsilon is the tolerance value, which is used to set the proximity for automatic
finding of constraints. Use the function
wfcSection.Section.SetEpsilon to set the value for epsilon. For
example, if your section has two lines that differ in length by 0.5, set the epsilon to
a value less than 0.5 to ensure that the two lines are not constrained as same
length. To get the current epsilon value for the section, use the function
wfcSection.Section.GetEpsilon.
Please note the following important points related to epsilon:
• Epsilon determines the smallest possible entity in a section. If an entity is
smaller than epsilon, then the entity is considered to be a degenerate entity.
Degenerate entity is an entity which cannot be solved. It causes solving and
regenerating of the section to fail. For example, a circle with radius 0 or line
with length 0 are considered as degenerate entities.
• There are many types of constraints, and epsilon has a different meaning for
each type. For example, consider two points. In case of constraint for
coincident points, , epsilon is the minimum distance between the two points
beyond which the points will be treated as separate points. If the distance
between the two points is within the epsilon value, the two points are treated
as coincident points.
• Creo Parametric has a default value set for epsilon. This value is also used in
the Sketcher user interface.
• If the input geometry is accurate and the user does not want the solver to
change it by adding constraints, then set the value of epsilon to 1E-9.

376 Creo Object TOOLKIT JavaUser’s Guide


• If the input geometry is nearly accurate and the user wants the solver to guess
the intent by adding constraints and further aligning the geometry, then in this
case epsilon should reflect the maximal proximity between geometry to be
constrained.
• You cannot set the value of epsilon to zero.

Section Entities
Methods Introduced:
• wfcSection.Section.AddEntity
• wfcSection.Section.DeleteEntity
• wfcSection.Section.GetEntity
• wfcSection.Section.ListSectionEntities
• wfcSection.Section.GetEntityIds
• wfcSection.SectionEntity.GetSectionEntityType
The method wfcSection.Section.AddEntity takes as input the
wfcSectionEntity object that defines the section entity type using the
enumerated class wfcSection.Section2dEntType. The following types of
entities are defined:
• SEC_ENTITY_2D_POINT
• SEC_ENTITY_2D_LINE
• SEC_ENTITY_2D_CENTER_LINE
• SEC_ENTITY_2D_ARC
• SEC_ENTITY_2D_CIRCLE
• SEC_ENTITY_2D_COORD_SYS
• SEC_ENTITY_2D_POLYLINE
• SEC_ENTITY_2D_SPLINE
• SEC_ENTITY_2D_TEXT
• SEC_ENTITY_2D_CONSTR_CIRCLE
• SEC_ENTITY_2D_BLEND_VERTEX
• SEC_ENTITY_2D_ELLIPSE
• SEC_ENTITY_2D_CONIC
• SEC_ENTITY_2D_SEC_GROUP

Element Trees: Sections 377


Some classes in Creo Object TOOLKIT Java allow you to create and modify
various types of section entities. The class wfcSection.SectionEntity is
the parent class for the following entity classes:
• wfcSection.SectionEntityArc
• wfcSection.SectionEntityBlendVertex
• wfcSection.SectionEntityCSys
• wfcSection.SectionEntityCenterLine
• wfcSection.SectionEntityCircle
• wfcSection.SectionEntityConic
• wfcSection.SectionEntityEllipse
• wfcSection.SectionEntityLine
• wfcSection.SectionEntityPoint
• wfcSection.SectionEntityPolyline
• wfcSection.SectionEntitySpline
• wfcSection.SectionEntityText
The method wfcSection.Section.AddEntity outputs an integer that is
the identifier of the new entity within the section. The Creo Object TOOLKIT
Java application needs these values because they are used to refer to entities when
adding dimensions.
The method wfcSection.Section.DeleteEntity enables you to delete a
section entity from the specified section.
The method wfcSection.Section.GetEntity takes as input the integer
identifier for a section entity and outputs a copy of the section entity object.
Use the method wfcSection.Section.ListSectionEntities to
retrieve the list of entities present in the specified section.
The method wfcSection.Section.GetEntityIds returns the array of
integer identifiers for the all the entities in the specified section.
The method wfcSection.SectionEntity.GetSectionEntityType
returns the section entity type using the enumerated class
wfcSection.Section2dEntType.

Section Entity Arc


Methods Introduced:
• wfcSection.wfcSection.SectionEntityArc_Create
• wfcSection.SectionEntityArc.GetCenter
• wfcSection.SectionEntityArc.SetCenter
• wfcSection.SectionEntityArc.GetEndAngle

378 Creo Object TOOLKIT JavaUser’s Guide


• wfcSection.SectionEntityArc.SetEndAngle
• wfcSection.SectionEntityArc.GetRadius
• wfcSection.SectionEntityArc.SetRadius
• wfcSection.SectionEntityArc.GetStartAngle
• wfcSection.SectionEntityArc.SetStartAngle
The method wfcSection.wfcSection.SectionEntityArc_Create
creates an arc entity in a specified section using the center, start and end angles,
and radius of the arc as inputs.
The methods wfcSection.SectionEntityArc.GetCenter and
wfcSection.SectionEntityArc.SetCenter retrieve and set the center
of the arc using the pfcBase.Point2D object.
The methods wfcSection.SectionEntityArc.GetEndAngle and
wfcSection.SectionEntityArc.SetEndAngle retrieve and set the end
angle of the arc.
The methods wfcSection.SectionEntityArc.GetRadius and
wfcSection.SectionEntityArc.SetRadius retrieve and set the radius
of the arc.
The methods wfcSection.SectionEntityArc.GetStartAngle and
wfcSection.SectionEntityArc.SetStartAngle retrieve and set the
start angle of the arc.

Section Entity Blend Vertex


Methods Introduced:
• wfcSection.wfcSection.SectionEntityBlendVertex_Create
• wfcSection.SectionEntityBlendVertex.GetDepthLevel
• wfcSection.SectionEntityBlendVertex.SetDepthLevel
• wfcSection.SectionEntityBlendVertex.GetPoint
• wfcSection.SectionEntityBlendVertex.SetPoint
The method
wfcSection.wfcSection.SectionEntityBlendVertex_Create
creates a blend vertex entity in a specified section using the point and depth level
of the blend vertex as inputs.
The methods
wfcSection.SectionEntityBlendVertex.GetDepthLevel and
wfcSection.SectionEntityBlendVertex.SetDepthLevel retrieve
and set the depth level of the blend.
The methods wfcSection.SectionEntityBlendVertex.GetPoint
and wfcSection.SectionEntityBlendVertex.SetPoint retrieve and
set the points of the blend vertices using the pfcBase.Point2D object.

Element Trees: Sections 379


Section Entity Coordinate System
Methods Introduced:
• wfcSection.wfcSection.SectionEntityCSys_Create
• wfcSection.SectionEntityCSys.GetCSysPoint
• wfcSection.SectionEntityCSys.SetCSysPoint
The method wfcSection.wfcSection.SectionEntityCSys_Create
creates a coordinate system entity in a specified section using the center point of
the coordinate system as input.
The method wfcSection.SectionEntityCSys.GetCSysPoint and
wfcSection.SectionEntityCSys.SetCSysPoint retrieve and set the
center point for the coordinate system using the pfcBase.Point2D object.

Section Entity CenterLine


Methods Introduced:
• wfcSection.wfcSection.SectionEntityCenterLine_Create
• wfcSection.SectionEntityCenterLine.GetCenterLine
• wfcSection.SectionEntityCenterLine.SetCenterLine
The method wfcSection.wfcSection.SectionEntityCenterLine_
Create creates a centerline entity in a specified section.
The methods
wfcSection.SectionEntityCenterLine.GetCenterLine and
wfcSection.SectionEntityCenterLine.SetCenterLine retrieve
and set centerline using the pfcBase.Outline2D object.

Section Entity Circle


Methods Introduced:
• wfcSection.wfcSection.SectionEntityCircle_Create
• wfcSection.SectionEntityCircle.GetCenter
• wfcSection.SectionEntityCircle.SetCenter
• wfcSection.SectionEntityCircle.GetRadius
• wfcSection.SectionEntityCircle.SetRadius
The method wfcSection.wfcSection.SectionEntityCircle_
Create creates a circle entity in a specified section using the center and radius of
the circle as inputs.
The methods wfcSectionEntityCircle::GetCenter and
wfcSectionEntityCircle::SetCenter retrieve and set the center of the
circle using the pfcPoint2D object.

380 Creo Object TOOLKIT JavaUser’s Guide


The methods wfcSectionEntityCircle::GetRadius and
wfcSectionEntityCircle::SetRadius retrieve and set the radius of the
circle.

Section Entity Ellipse


Methods Introduced:
• wfcSection.wfcSection.SectionEntityEllipse_Create
• wfcSection.SectionEntityEllipse.GetCenter
• wfcSection.SectionEntityEllipse.SetCenter
• wfcSection.SectionEntityEllipse.GetXRadius
• wfcSection.SectionEntityEllipse.SetXRadius
• wfcSection.SectionEntityEllipse.GetYRadius
• wfcSection.SectionEntityEllipse.SetYRadius
The method wfcSection.wfcSection.SectionEntityEllipse_
Create creates an ellipse entity in a specified section using the center, X-axis
and Y-axis radii of the eclipse as inputs.
The methods wfcSection.SectionEntityEllipse.GetCenter and
wfcSection.SectionEntityEllipse.SetCenter retrieve and set the
center of the ellipse.
The methods wfcSection.SectionEntityEllipse.GetXRadius and
wfcSection.SectionEntityEllipse.SetXRadius retrieve and set the
XRadius of the ellipse.
The methods wfcSection.SectionEntityEllipse.GetYRadius and
wfcSection.SectionEntityEllipse.SetYRadius retrieve and set the
YRadius of the ellipse.

Section Entity Conic


Methods Introduced:
• wfcSection.wfcSection.SectionEntityConic_Create
• wfcSection.SectionEntityConic.GetFirstEndPoint
• wfcSection.SectionEntityConic.SetFirstEndPoint
• wfcSection.SectionEntityConic.GetSecondEndPoint
• wfcSection.SectionEntityConic.SetSecondEndPoint
• wfcSection.SectionEntityConic.GetParameter
• wfcSection.SectionEntityConic.SetParameter
• wfcSection.SectionEntityConic.GetShoulderEndPoint
• wfcSection.SectionEntityConic.SetShoulderEndPoint

Element Trees: Sections 381


The method wfcSection.wfcSection.SectionEntityConic_
Create creates a conic entity in a specified section using the first, second, and
shoulder endpoints and parameter of the cone as inputs.
The methods wfcSection.SectionEntityConic.GetFirstEndPoint
and wfcSection.SectionEntityConic.SetFirstEndPoint retrieve
and set the first endpoint of the conic entity.
The methods
wfcSection.SectionEntityConic.GetSecondEndPoint and
wfcSection.SectionEntityConic.SetSecondEndPoint retrieve
and set the second endpoint of the conic entity.
The methods wfcSection.SectionEntityConic.GetParameter and
wfcSection.SectionEntityConic.SetParameter retrieve and set the
parameter of the conic entity.
The methods
wfcSection.SectionEntityConic.GetShoulderEndPoint and
wfcSection.SectionEntityConic.SetShoulderEndPoint retrieve
and set the shoulder endpoint of the conic entity.

Section Entity Line


Methods Introduced:
• wfcSection.wfcSection.SectionEntityLine_Create
• wfcSection.SectionEntityLine.GetLine
• wfcSection.SectionEntityLine.SetLine
The method wfcSection.wfcSection.SectionEntityLine_Create
creates a line entity in a specified section.
The methods wfcSection.SectionEntityLine.GetLine and
wfcSection.SectionEntityLine.SetLine retrieve and set the lines in
a specified section using the pfcBase.Outline2D object.

Section Entity Point


Methods Introduced:
• wfcSection.wfcSection.SectionEntityPoint_Create
• wfcSection.SectionEntityPoint.GetPoint
• wfcSection.SectionEntityPoint.SetPoint
The method wfcSection.wfcSection.SectionEntityPoint_
Create creates a point entity in a section.

382 Creo Object TOOLKIT JavaUser’s Guide


The methods wfcSection.SectionEntityPoint.GetPoint and
wfcSection.SectionEntityPoint.SetPoint retrieve and set the
points in a specified section using the pfcBase.Point2D object.

Section Entity Polyline


Methods Introduced:
• wfcSection.wfcSection.SectionEntityPolyline_Create
• wfcSection.SectionEntityPolyline.GetPoints
• wfcSection.SectionEntityPolyline.SetPoints
The method wfcSection.wfcSection.SectionEntityPolyline_
Create creates a polyline entity in a specified section.
The methods wfcSection.SectionEntityPolyline.GetPoints and
wfcSection.SectionEntityPolyline.SetPoints retrieve and set the
points using the pfcBase.Point2Ds object.

Section Entity Spline


Methods Introduced:
• wfcSection.wfcSection.SectionEntitySpline_Create
• wfcSection.SectionEntitySpline.GetTangentType
• wfcSection.SectionEntitySpline.SetTangentType
• wfcSection.SectionEntitySpline.GetPoints
• wfcSection.SectionEntitySpline.SetPoints
• wfcSection.SectionEntitySpline.GetStartTangentAngle
• wfcSection.SectionEntitySpline.SetStartTangentAngle
• wfcSection.SectionEntitySpline.GetEndTangentAngle
• wfcSection.SectionEntitySpline.SetEndTangentAngle
The method wfcSection.wfcSection.SectionEntitySpline_
Create creates a spline entity in a specified section using the tangent type,
points, and start and end angles of the tangent of the spline as inputs.
The methods wfcSection.SectionEntitySpline.GetTangentType
and wfcSection.SectionEntitySpline.SetTangentType retrieve
and set the type of tangent in the spline using the
wfcSection.SplineTangentType object.
The methods wfcSection.SectionEntitySpline.GetPoints and
wfcSection.SectionEntitySpline.SetPoints retrieve and set the
points in the spline using the pfcBase.Point2Ds object.

Element Trees: Sections 383


The methods
wfcSection.SectionEntitySpline.GetStartTangentAngle and
wfcSection.SectionEntitySpline.SetStartTangentAngle
retrieve and set the start angle of a tangent in the spline.
The methods
wfcSection.SectionEntitySpline.GetEndTangentAngle and
wfcSection.SectionEntitySpline.SetEndTangentAngle retrieve
and set the end angle of a tangent in the spline.

Section Entity Text


Methods Introduced:
• wfcSection.wfcSection.SectionEntityText_Create
• wfcSection.SectionEntityText.GetFirstCorner
• wfcSection.SectionEntityText.SetFirstCorner
• wfcSection.SectionEntityText.GetSecondCorner
• wfcSection.SectionEntityText.SetSecondCorner
• wfcSection.SectionEntityText.GetFontName
• wfcSection.SectionEntityText.SetFontName
• wfcSection.SectionEntityText.GetComment
• wfcSection.SectionEntityText.SetComment
The method wfcSection.wfcSection.SectionEntityText_Create
creates a text entity in a specified section using the first and second corner of the
text box and the text to be entered inside the text box as inputs.
The methods wfcSection.SectionEntityText.GetFirstCorner and
wfcSection.SectionEntityText.SetFirstCorner retrieve and set
the first corner of the text box using the pfcBase.Point2D class.
The methods wfcSection.SectionEntityText.GetSecondCorner
and wfcSection.SectionEntityText.SetSecondCorner retrieve and
set the second corner of the text box using the pfcBase.Point2D class.
The methods wfcSection.SectionEntityText.GetFontName and
wfcSection.SectionEntityText.SetFontName retrieve and set the
font of the text to be entered.
The methods wfcSection.SectionEntityText.GetComment and
wfcSection.SectionEntityText.SetComment retrieve and set the
comment or text to be entered inside the text box.

Retrieving a Section
Method Introduced:

384 Creo Object TOOLKIT JavaUser’s Guide


• wfcFeature.WFeature.GetSections
The method wfcFeature.WFeature.GetSections retrieve sections from
the specified feature.

Note
The method will not return sections that are not available for use. For
example, the selected trajectory in a Sweep feature will not be returned.

Element Trees: Sections 385


23
Element Trees: Sketched Features
Overview ................................................................................................................ 387
Creating Features Containing Sections ..................................................................... 387
Creating Features with 2D Sections ......................................................................... 388
Creating Features with 3D Sections .......................................................................... 388

This chapter describes the Creo Object TOOLKIT Java methods that enable you
to work with sketched features.
Sketched features are features that require one or more sections to completely
define the feature, such as extruded and revolved protrusions.
This chapter outlines the necessary steps to programmatically create sketched
features using Creo Object TOOLKIT Java.

386 Creo Object TOOLKIT JavaUser’s Guide


Overview
The chapter Feature Element Tree on page 308 explains how to create a simple
feature using the feature element tree, and the documentation in the chapter
Element Trees: Sections on page 373 explains how to create a section. This
chapter explains how to put these methods together, with a few additional
techniques, to create features that contain sketched sections.

Creating Features Containing Sections


The chapter Feature Element Tree on page 308 explained that to create a feature
from an element tree, you must build the tree of elements using the
wfcElementTree object, and then call
wfcSolid.WSolid.WCreateFeature to create the feature using the tree. If
the feature is to contain a sketch, the sequence is a little more complex.
As explained in the chapter Element Trees: Sections on page 373, a 2D section
stored in a model file can be allocated by calling
wfcSession.WSession.CreateSection2D. Instead, Creo application
must allocate as part of the initial creation of the sketched feature, a section that
will be part of a feature. The allocation is done by calling
wfcSolid.WSolid.WCreateFeature with an element tree which describes
at minimum the feature type and form, in order to create an incomplete feature. In
creating the feature, Creo application calculates the location and orientation of the
section, and allocates the wfcSection object. This section is then retrieved
from the value of the PRO_E_SKETCHER element that is found in the element
tree extracted from the created feature. Fill the empty section using wfcSection
related methods.
After adding the section contents and the remaining elements in the tree, add the
new information to the feature using
wfcFeature.WFeature.RedefineFeature.

To Create Sketched Features Element Trees


1. Build an element tree but do not include the element PRO_E_SKETCHER.
2. Call wfcSolid.WSolid.WCreateFeature with the option wfcFEAT_
CR_INCOMPLETE_FEAT to create an incomplete feature.
3. Extract the value of the element PRO_E_SKETCHER created by the Creo
application from an element tree extracted using
wfcFeature.WFeature.GetElementTree on the incomplete feature.
4. Using that value as the wfcSection object create the necessary section
entities.

Element Trees: Sketched Features 387


5. Add any other elements not previously added to the tree, such as extrusion
depth. The depth elements may also be added before the creation of
incomplete feature (before step 2).
6. Call wfcFeature.WFeature.RedefineFeature with the completed
element tree.

Creating Features with 2D Sections


Sketched features using 2D sections do not require references to other geometry in
the Creo model. Some examples of where 2D sections are used are:
• Base features, sometimes called first features. This type of feature must be the
first feature created in the model.
• Sketched hole features.
To create 2D sketched features, follow the steps outlined in the section To Create
Sketched Features Element Trees on page 387.

Note
For 2D sketched features, you need not specify section references or use
projected 3D entities. Entities in a 2D section are dimensioned to themselves
only. A 2D section does not require any elements in the tree to setup the sketch
plane or the orientation of the sketch. Thus, the PRO_E_STD_SEC_SETUP_
PLANE subtree is not included.

Creating Features with 3D Sections


A 3D section needs to define its location with respect to the existing geometrical
features. The subtree contained in the element PRO_STD_SEC_SETUP_PLANE
defines the location of the sketch plane edge entities; any other 2D entities in the
sketch must be dimensioned to those entities, so that their 3D location is fully
defined.

3D Section Location in the Owning Model


Method Introduced:
• wfcSection.Section.GetLocation
The Creo application decides where the section will be positioned in 3D for all the
features except the first feature and sketched hole feature.

388 Creo Object TOOLKIT JavaUser’s Guide


If the section is 3D, the feature tree elements below PRO_E_STD_SEC_SETUP_
PLANE specifies the sketch plane, the direction from which it is being viewed, an
orientation reference, and a direction which that reference represents (TOP,
BOTTOM, LEFT or RIGHT). When you call
wfcSolid.WSolid.WCreateFeature, this information is used to calculate
the 3D plane in which the section lies, and its orientation in that plane.
The position of the section origin in the plane is not implied by the element tree,
and cannot be specified by the Creo Object TOOLKIT Java application: position
is chosen arbitrarily by the Creo application. This is because the interactive user of
Creo application never deals in absolute coordinates, and does not need to specify,
or even know, the location of the origin of the section. In Creo Object TOOLKIT
Java describe all section entities in terms of their coordinate values, so you need to
find out where Creo application has put the origin of the section. This is the role
of the method wfcSection.Section.GetLocation.
wfcSection.Section.GetLocation provides the transformation matrix
that goes from 2D coordinates within the section to 3D coordinates of the owning
part or assembly. This is equivalent to describing the position and orientation of
the 2D section coordinate system with respect to the base coordinate system of the
3D model.
wfcSection.Section.GetLocation can be called in order to calculate
where to position new section entities so that they are in the correct 3D position in
the part or assembly.

Element Trees: Sketched Features 389


24
Holes
Accessing Threaded Hole Properties ........................................................................ 391

This chapter describes how to access the hole properties in Creo Object
TOOLKIT Java.

390 Creo Object TOOLKIT JavaUser’s Guide


Accessing Threaded Hole Properties
Methods Introduced:
• wfcFeature.WHoleFeature.GetHoleProperties
• wfcFeature.WHoleFeature.SetHoleProperties
• wfcFeature.HoleProperties.Create
• wfcFeature.HoleProperties.GetThreadSeries
• wfcFeature.HoleProperties.SetThreadSeries
• wfcFeature.HoleProperties.GetScrewSize
• wfcFeature.HoleProperties.SetScrewSize
The methods wfcFeature.WHoleFeature.GetHoleProperties and
wfcFeature.WHoleFeature.SetHoleProperties retrieve and set the
properties of the specified hole feature using the wfcHoleProperties object.
The method wfcFeature.HoleProperties.Create creates a data object
that contains information about the thread series and screw size of a hole.
The method wfcFeature.HoleProperties.GetThreadSeries and
wfcFeature.HoleProperties.SetThreadSeries returns the type of
thread for the specified hole feature.
The methods wfcFeature.HoleProperties.GetScrewSize and
wfcFeature.HoleProperties.SetScrewSize to get and set the size of
screw for the specified hole feature.

Note
The screw size depends on the type of thread. Therefore, before you call the
method wfcFeature.HoleProperties.SetScrewSize you must
ensure that the thread type is set for the hole feature.

Holes 391
25
Geometry Evaluation
Geometry Traversal................................................................................................. 393
Curves and Edges ................................................................................................... 394
Contours................................................................................................................. 398
Surfaces ................................................................................................................. 400
Axes, Coordinate Systems, and Points...................................................................... 404
Interference ............................................................................................................ 405
Tessellation............................................................................................................. 407
Geometry Objects ................................................................................................... 411
Tracing a Ray.......................................................................................................... 417
Measurement.......................................................................................................... 418

This chapter describes geometry representation and discusses how to evaluate


geometry using Creo Object TOOLKIT Java.

392 Creo Object TOOLKIT JavaUser’s Guide


Geometry Traversal
• 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:
• Surface—An ideal geometric representation, that is, an infinite plane.
• Face—A trimmed surface. A face has one or more contours.
• Contour—A closed loop on a face. A contour consists of multiple edges. A
contour can belong to one face only.
• Edge—The boundary of a trimmed surface.
An edge of a solid is the intersection of two surfaces. The edge belongs to those
two surfaces and to two contours. An edge of a datum surface can be either the
intersection of two datum surfaces or the external boundary of the surface.
If the edge is the intersection of two datum surfaces it will belong to those two
surfaces and to two contours. If the edge is the external boundary of the datum
surface it will belong to that surface alone and to a single contour.

Traversing the Geometry of a Solid Block


Methods Introduced:
• pfcModelItem.ModelItemOwner.ListItems
• pfcGeometry.Surface.ListContours
• pfcGeometry.Contour.ListElements
To traverse the geometry, follow these steps:

Geometry Evaluation 393


1. Starting at the top-level model, use
pfcModelItem.ModelItemOwner.ListItems with an argument of
ModelItemType.ITEM_SURFACE.
2. Use pfcGeometry.Surface.ListContours to list the contours
contained in a specified surface.
3. Use pfcGeometry.Contour.ListElements to list the edges
contained in the contour.

Curves and Edges


Datum curves, surface edges, and solid edges are represented in the same way in
Creo Object TOOLKIT Java. You can get edges through geometry traversal or get
a list of edges using the methods presented in the chapter ModelItem on page 298.

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.
The following figure illustrates curve and edge parameterization.

Curve and Edge Types


Solid edges and datum curves can be any of the following types:

394 Creo Object TOOLKIT JavaUser’s Guide


• LINE—A straight line represented by the class
interfacepfcGeometry.Line.
• ARC—A circular curve represented by the class
interfacepfcGeometry.Arc.
• SPLINE—A nonuniform cubic spline, represented by the class
interfacepfcGeometry.Spline.
• B-SPLINE—A nonuniform rational B-spline curve or edge, represented by the
class interface pfcGeometry.BSpline.
• COMPOSITE CURVE—A combination of two or more curves, represented
by the class interfacepfcGeometry.CompositeCurve. This is used for
datum curves only.
See the appendix Geometry Representations on page 714 for the parameterization
of each curve type. To determine what type of curve a pfcGeometry.Edge or
pfcGeometry.Curve object represents, use the Java instanceof operator.
Because each curve class inherits from pfcGeometry.GeomCurve, you can
use all the evaluation methods in GeomCurve on any edge or curve.
The following curve types are not used in solid geometry and are reserved for
future expansion:
• CIRCLE (pfcGeometry.Circle)
• ELLIPSE (pfcGeometry.Ellipse)
• POLYGON (pfcGeometry.Polygon)
• ARROW (pfcGeometry.Arrow)
• TEXT (pfcGeometry.Text)

Composite Curves
A composite curve is a curve that is made up of more than one segment and has
no geometry of its own. A curve descriptor is a data object that describes the
geometry of a curve or edge.
Methods Introduced:
• WCompositeCurveDescriptor_Create
• wfcGeometry.WCompositeCurveDescriptor.SetCompDirections
• wfcGeometry.WCompositeCurveDescriptor.GetCompDirections
• wfcGeometry.WCompositeCurve.GetCompDirections
Use the method WCompositeCurveDescriptor_Create to create an
instance of the object wfcWCompositeCurveDescriptor that contains
information about the curve geometry of the specified composite curve.

Geometry Evaluation 395


In the curve descriptor, use the method
wfcGeometry.WCompositeCurveDescriptor.SetCompDirections
to set the direction of the component for the composite curve. The valid values for
the direction are defined by the enumerated type CurveDirection and are as
follows:
• CURVE_NO_FLIP
• CURVE_FLIP
Use the method
wfcGeometry.WCompositeCurveDescriptor.GetCompDirections
to get the direction of the component of the specified composite curve.
Use the method
wfcGeometry.WCompositeCurve.GetCompDirections to get the
direction of the component in a composite curve.

Evaluation of Curves and Edges


Methods Introduced:
• pfcGeometry.GeomCurve.Eval3DData
• pfcGeometry.GeomCurve.EvalFromLength
• pfcGeometry.GeomCurve.EvalParameter
• pfcGeometry.GeomCurve.EvalLength
• pfcGeometry.GeomCurve.EvalLengthBetween
• wfcGeometry.WCurve.GetCurveData
• wfcGeometry.WCurve.GetColorType
• wfcGeometry.WCurve.SetColorType
• wfcGeometry.WCurve.GetLineStyle
• wfcGeometry.WCurve.SetLineStyle
The methods in GeomCurve provide information about any curve or edge.
The method pfcGeometry.GeomCurve.Eval3DData returns a
CurveXYZData object with information on the point represented by the input
parameter t. The method pfcGeometry.GeomCurve.EvalFromLength
returns a similar object with information on the point that is a specified distance
from the starting point.
The method pfcGeometry.GeomCurve.EvalParameter returns the t
parameter that represents the input Point3D object.
Both pfcGeometry.GeomCurve.EvalLength and
pfcGeometry.GeomCurve.EvalLengthBetween return numerical values
for the length of the curve or edge.

396 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcGeometry.WCurve.GetCurveData to retrieve the
geometric representation data for the specified curve.
Use the methods wfcGeometry.WCurve.GetColorType and
wfcGeometry.WCurve.SetColorType to get and set the color of the
specified curve using the enumerated class type pfcBase.StdColor.
Use the methods wfcGeometry.WCurve.GetLineStyle and
wfcGeometry.WCurve.SetLineStyle to get and set the linestyle of the
specified curve using the enumerated class type pfcBase.StdLineStyle.

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.

• wfcGeometry.WEdge.GetEdgeType
• wfcGeometry.WEdge.GetEdgeVertexData
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.
The method pfcGeometry.Edge.EvalUV evaluates geometry information
based on the UV parameters of one of the bounding surfaces.
The method pfcGeometry.Edge.GetDirection returns a positive 1 if the
edge is parameterized in the same direction as the containing contour, and –1 if
the edge is parameterized opposite to the containing contour.
Use the method wfcGeometry.WEdge.GetEdgeType to return the type of
the specified edge.

Geometry Evaluation 397


Use the method wfcGeometry.WEdge.GetEdgeVertexData to get a list
of the edges and surfaces that meet at a specified solid vertex using the
enumerated type wfcGeometry.EdgeEndType. This method returns NULL if
the specified edge is not visible in the current geometry.

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.

• wfcSolid.WSolid.GetCurve
The method pfcGeometry.GeomCurve.GetCurveDescriptor returns a
curve’s geometry as a data object.
The method pfcGeometry.GeomCurve.GetNURBSRepresentation
returns a Non-Uniform Rational B-Spline Representation of a curve.
The method wfcSolid.WSolid.GetCurve retrieves the geometric
representation data for the specified curve.

Contours
Methods Introduced:
• pfcGeometry.Surface.ListContours
• pfcGeometry.Contour.GetInternalTraversal
• pfcGeometry.Contour.FindContainingContour
• pfcGeometry.Contour.EvalArea
• pfcGeometry.Contour.EvalOutline
• pfcGeometry.Contour.VerifyUV
• wfcGeometry.wfcGeometry.ContourDescriptor_Create

398 Creo Object TOOLKIT JavaUser’s Guide


• wfcGeometry.ContourDescriptor.SetContourTraversal
• wfcGeometry.ContourDescriptor.GetContourTraversal
• wfcGeometry.ContourDescriptor.SetEdgeIds
• wfcGeometry.ContourDescriptor.GetEdgeIds
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.
The method pfcGeometry.Contour.GetInternalTraversal returns a
ContourTraversal enumerated type that identifies whether a given contour is
on the outside or inside of a containing surface.
Use the method pfcGeometry.Contour.FindContainingContour to
find the contour that entirely encloses the specified contour.
The method pfcGeometry.Contour.EvalArea provides the area enclosed
by the contour.
The method pfcGeometry.Contour.EvalOutline returns the points that
make up the bounding rectangle of the contour.
Use the method pfcGeometry.Contour.VerifyUV to determine whether
the given UVParams argument lies inside the contour, on the boundary, or
outside the contour.

Note
To make the methods of wfcWContour available in pfcContour, cast
pfcContour to wfcWContour.

Use the method wfcGeometry.wfcGeometry.ContourDescriptor_


Create to create an instance of the object wfcContourDescriptor.This
object contains information about a contour such as its traversal (internal or
external) and identifiers of the edges that make up the contour.
Use the methods
wfcGeometry.ContourDescriptor.SetContourTraversal and
wfcGeometry.ContourDescriptor.GetContourTraversal to set
and get the type of contour traversal using the enumerated class type
pfcGeometry.ContourTraversal. The valid values are:
• CONTOUR_TRAV_INTERNAL—Specifies the traversal of the internal
contours.
• CONTOUR_TRAV_EXTERNAL—Specifies the traversal of the external
contours.

Geometry Evaluation 399


Use the method wfcGeometry.ContourDescriptor.SetEdgeIds and
wfcGeometry.ContourDescriptor.GetEdgeIds to set and get an array
of identifiers of the edges of the contour.

Surfaces
Using Creo Object TOOLKIT Java you access datum and solid surfaces in the
same way.

UV Parameterization
A surface in Creo 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.
The figure on the following page illustrates surface parameterization.

Surface Types
Surfaces within Creo can be any of the following types:

400 Creo Object TOOLKIT JavaUser’s Guide


• PLANE—A planar surface represented by the class interface
pfcGeometry.Plane.
• CYLINDER—A cylindrical surface represented by the class interface
IGeometry.Cylinder.
• CONE—A conic surface region represented by the class interface
pfcGeometry.Cone.
• TORUS—A toroidal surface region represented by the class
interfacepfcGeometry.Torus.
• REVOLVED SURFACE—Generated by revolving a curve about an axis. This
is represented by the class interface pfcGeometry.RevSurface.
• RULED SURFACE—Generated by interpolating linearly between two curve
entities. This is represented by the class interface
pfcGeometry.RuledSurface.
• TABULATED CYLINDER—Generated by extruding a curve linearly. This is
represented by the class interfacepfcGeometry.TabulatedCylinder.
• COONS PATCH—A coons patch is used to blend surfaces together. It is
represented by the class interfacepfcGeometry.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 interfacepfcGeometry.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 classinterfacepfcGeometry.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 interfacepfcGeometry.NURBSSurface.
• 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
interfacepfcGeometry.CylindricalSplineSurface.
To determine which type of surface a pfcGeometry.Surface object
represents, access the surface type using
pfcGeometry.Geometry.GetSurfaceType.

Surface Information
Methods Introduced:

Geometry Evaluation 401


• 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
• wfcGeometry.WSurface.GetNextSurface
The method pfcGeometry.Surface.GetOwnerQuilt returns the Quilt
object that contains the datum surface.
The method pfcGeometry.Surface.EvalClosestPoint projects a
three-dimensional point onto the surface. Use the method
pfcGeometry.Surface.EvalClosestPointOnSurface to determine
whether the specified three-dimensional point is on the surface, within the
accuracy of the part. If it is, the method returns the point that is exactly on the
surface. Otherwise the method returns null.
The method pfcGeometry.Surface.Eval3DData returns a
SurfXYZData 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.

402 Creo Object TOOLKIT JavaUser’s Guide


The method pfcGeometry.Surface.EvalArea returns the area of the
surface, whereas pfcGeometry.Surface.EvalDiameter returns the
diameter of the surface. If the diameter varies the optional UVParams argument
identifies where the diameter should be evaluated.
The method pfcGeometry.Surface.EvalPrincipalCurv returns a
CurvatureData object with information regarding the curvature of the surface
at the specified u and v parameters.
Use the method pfcGeometry.Surface.VerifyUV to determine whether
the UVParams are actually within the boundary of the surface.
The methods pfcGeometry.Surface.EvalMaximum and
pfcGeometry.Surface.EvalMinimum return the three-dimensional point
on the surface that is the furthest in the direction of (or away from) the specified
vector.
The method pfcGeometry.Surface.ListSameSurfaces identifies other
surfaces that are tangent and connect to the given surface.
The method wfcGeometry.WSurface.GetNextSurface returns the next
surface in the surface list. If no surface is present in the surface list, the method
returns the value NULL.

Note
Obtain the next surface again, in case the model geometry has changed.

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
• wfcGeometry.WSurfaceDescriptor.SetContourData
• wfcGeometry.WSurfaceDescriptor.GetContourData
• wfcGeometry.WSurfaceDescriptor.SetSurfaceId
• wfcGeometry.WSurfaceDescriptor.GetSurfaceId
The method pfcGeometry.Surface.GetSurfaceDescriptor returns a
surfaces geometry as a data object.

Geometry Evaluation 403


The method pfcGeometry.Surface.GetNURBSRepresentation
returns a Non-Uniform Rational B-Spline Representation of a surface.
Use the method
wfcGeometry.WSurfaceDescriptor.SetContourData and
wfcGeometry.WSurfaceDescriptor.GetContourData to set and get
the contour data information from an array of
wfcGeometry.ContourDescriptors.
Use the method wfcGeometry.WSurfaceDescriptor.SetSurfaceId
and wfcGeometry.WSurfaceDescriptor.GetSurfaceId to set and get
the Id of the specified surface.

Axes, Coordinate Systems, and Points


Coordinate axes, datum points, and coordinate systems are all model items. Use
the methods that return ModelItems to get one of these geometry objects. Refer
to the chapter ModelItem on page 298 for additional information.

Evaluation of ModelItems
Methods Introduced:
• pfcGeometry.Axis.GetSurf
• wfcGeometry.WAxis.GetAxisData
• wfcSolid.WSolid.GetAxis
• pfcGeometry.CoordSystem.GetCoordSys
• wfcSolid.WSolid.GetCsys
• pfcGeometry.Point.GetPoint
The method pfcGeometry.Axis.GetSurf returns the revolved surface that
uses the axis.
Use the method wfcGeometry.WAxis.GetAxisData to return the
geometric representation data for the specified axis as a object of the class
pfcGeometry.CurveDescriptor.
Use the method wfcSolid.WSolid.GetAxis to initialize the axis handle.
Specify the axis Id as the input parameter for this method.
The method pfcGeometry.CoordSystem.GetCoordSys returns the
Transform3D object (which includes the origin and x-, y-, and z- axes) that
defines the coordinate system.
Use the method wfcSolid.WSolid.GetCsys to return the coordinate system
handle as a object of the class wfcWCsys.

404 Creo Object TOOLKIT JavaUser’s Guide


The method pfcGeometry.Point.GetPoint returns the xyz coordinates of
the datum point.

Interference
Creo assemblies can contain interferences between components when constraint
by certain rules defined by the user. The com.ptc.pfc.pfcInterference
package allows the user to detect and analyze any interferences within the
assembly. The analysis of this functionality should be looked at from two
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 methods pfcInterference.GlobalEvaluator.GetAssem and
pfcInterference.GlobalEvaluator.SetAssem with
pfcAssembly.Assembly as an argument allow you to do exactly that.
The method
pfcInterference.GlobalEvaluator.ComputeGlobalInterfer
ence determines the set of all the interferences within the assembly.
This method will return a sequence of
pfcInterference.GlobalInterference objects or null if there are no
interfering parts. Each object contains a pair of intersecting parts and an object
representing the interference volume, which can be extracted by using
pfcInterference.GlobalInterference.GetSelParts and
pfcInterference.GlobalInterference.GetVolume respectively.

Analyzing Interference Information


Methods Introduced:

Geometry Evaluation 405


• 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
Select.SelectionPair object using two pfcSelect.Selection
objects as arguments.
A return from this method will serve as an argument to
pfcInterference.pfcInterference.CreateSelectionEvalua
tor, which will provide a way to determine the interference data between the two
selections.
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.
ComputeNearestCriticalDistance finds a critical point of the distance
function between two selections.
This method returns a pfcInterference.CriticalDistanceData
object, which is used to determine and set critical points, surface parameters, and
critical distance between points.

Analyzing Interference Volume


Methods Introduced:
• pfcInterference.InterferenceVolume.ComputeVolume
• pfcInterference.InterferenceVolume.Highlight
• pfcInterference.InterferenceVolume.GetBoundaries

406 Creo Object TOOLKIT JavaUser’s Guide


The method
pfcInterference.InterferenceVolume.ComputeVolume will
calculate a value for interfering volume.
The method pfcInterference.InterferenceVolume.Highlight
will highlight the interfering volume with the color provided in the argument to
the function.
The method
pfcInterference.InterferenceVolume.GetBoundaries will
return a set of boundary surface descriptors for the interference volume.

Tessellation
You can calculate tessellation for different types of Creo geometry. The
tessellation geometry is made up of:
• Small lines—For edges and curves.
• Triangles—For surfaces and solid models.

Surface Tessellation
Methods Introduced:
• wfcGeometry.wfcGeometry.SurfaceTessellationInput_Create
• wfcGeometry.SurfaceTessellationInput.GetAngleControl
• wfcGeometry.SurfaceTessellationInput.SetAngleControl
• wfcGeometry.SurfaceTessellationInput.GetStepSize
• wfcGeometry.SurfaceTessellationInput.SetStepSize
• wfcGeometry.SurfaceTessellationInput.GetProjection
• wfcGeometry.SurfaceTessellationInput.SetProjection
• wfcGeometry.SurfaceTessellationInput.GetCsysData
• wfcGeometry.SurfaceTessellationInput.SetCsysData
• wfcGeometry.SurfaceTessellationInput.GetChordHeight
• wfcGeometry.SurfaceTessellationInput.SetChordHeight
• wfcGeometry.WSurface.GetTessellation
• wfcGeometry.Tessellation.GetFacetVertexIndices
• wfcGeometry.Tessellation.GetUVParams
• wfcGeometry.Tessellation.GetVectors
• wfcGeometry.Tessellation.GetVertices

Geometry Evaluation 407


Use the method
wfcGeometry.wfcGeometry.SurfaceTessellationInput_Create
to create an instance of the object
wfcGeometry.SurfaceTessellationInput that contains information
about the surface tessellation. Specify the following parameters as input
arguments to create the surface tessellation:
• AngleControl—Regulates the amount of additional improvement provided
along curves with small radii. Specify a value from the range 0.0 to 1.0.
• StepSize—Controls the fineness of the triangulations for all surfaces. The
values range from five times of the model accuracy to the model size with a
default value of (model size)/30.
• Projection—Specifies the parameters used to calculate the UV projection
for the texture mapping. The types of UV projection are defined in the
enumerated class type
wfcGeometry.SurfaceTessellationProjection and are as
follows:
○ SRFTESS_DEFAULT_PROJECTION—Provides the UV parameters for
the tessellation points that map to a plane whose U and V extents are [0,1]
each.
○ SRFTESS_PLANAR_PROJECTION—Projects the UV parameters using
a planar transform, where u=x, v=y, and z is ignored.
○ SRFTESS_CYLINDRICAL_PROJECTION—Projects the UV parameters
using a cylindrical transform, where x=r*cos(theta), y=r*sin(theta), u=
theta, v=z, and r is ignored.
○ SRFTESS_SPHERICAL_PROJECTION—Projects the UV parameters
onto a sphere, where x=r*cos(theta)*sin(phi), y=r*sin(theta)*sin(phi), z=
r*cos(phi), u=theta, v=phi, and r is ignored.
○ SRFTESS_NO_PROJECTION—Provides the unmodified UV parameters
for the tessellation points.
.
• CsysData—Specifies the coordinate system data, including the
transformation matrix, origin, and axes information.
• ChordHeight—Specifies the maximum distance between a chord and a
surface.
Use the methods
wfcGeometry.SurfaceTessellationInput.GetAngleControl and
wfcGeometry.SurfaceTessellationInput.SetAngleControl to
get and set the value of the angle control used for surface tessellation.
Use the methods
wfcGeometry.SurfaceTessellationInput.GetStepSize and
wfcGeometry.SurfaceTessellationInput.SetStepSize to get and
set the maximum value for the step size used for the surface tessellation.

408 Creo Object TOOLKIT JavaUser’s Guide


Use the methods
wfcGeometry.SurfaceTessellationInput.GetProjection and
wfcGeometry.SurfaceTessellationInput.SetProjection to get
and set the parameters used to calculate the UV projection for the texture mapping
using the enumerated class type
wfcGeometry.SurfaceTessellationProjection.
Use the methods
wfcGeometry.SurfaceTessellationInput.GetCsysData and
wfcGeometry.SurfaceTessellationInput.SetCsysData to get and
set the coordinate system data for the surface tessellation.
Use the methods
wfcGeometry.SurfaceTessellationInput.GetChordHeight and
wfcGeometry.SurfaceTessellationInput.SetChordHeight to get
and set the chord height used for surface tessellation.
Use the method wfcGeometry.WSurface.GetTessellation to calculate
the tessellation of a given surface. Specify the object
wfcGeometry.SurfaceTessellationInput as the input argument for
this method. This method returns an object wfcGeometry.Tessellation
that contains the tessellation data.
The method wfcGeometry.Tessellation.GetFacetVertexIndices
returns a sequence of facet vertices for the specified surface tessellation data.
Use the method wfcGeometry.Tessellation.GetUVParams to obtain
the UV parameters for each of the tessellation vertices
Use the method wfcGeometry.Tessellation.GetVectors to obtain the
normal vectors for each of the tessellation vertices
Use the method wfcGeometry.Tessellation.GetVertices to obtain
the vertices for the tessellation for a specified surface.

Curve and Edge Tessellation


Methods Introduced:
• wfcGeometry.WCurve.GetCurveTessellation
• wfcGeometry.WEdge.GetEdgeTessellation
Use the method wfcGeometry.WCurve.GetCurveTessellation to
retrieve the curve tessellation for a datum curve as a
wfcGeometry.CurveTessellation pointer. It returns the number of
tessellation points.
Use the method wfcGeometry.WEdge.GetEdgeTessellation to retrieve
the edge tessellation for the specified edge. This method returns a pointer to the
class wfcGeometry.EdgeTessellation.

Geometry Evaluation 409


Part and Assembly Tessellation
Methods Introduced:
• wfcSolid.WSolid.Tessellate
• wfcGeometry.SurfaceTessellationData.GetFacetVertexIndices
• wfcGeometry.SurfaceTessellationData.GetNormals
• wfcGeometry.SurfaceTessellationData.GetNumberOfFacets
• wfcGeometry.SurfaceTessellationData.GetNumberOfVertices
• wfcGeometry.SurfaceTessellationData.GetSurface
• wfcGeometry.SurfaceTessellationData.GetVertexVectors
From Creo 3.0 M110 onward, the method wfcPart.WPart.Tessellate has
been deprecated. Use the method wfcSolid.WSolid.Tessellate instead.
The method wfcWSolid::Tessellate tessellates each surface of the
specified model. On parts, wfcSolid.WSolid.Tessellate acts on all
surfaces whereas on assemblies, this method acts only on surfaces that belong to
the assembly, that is, it does not tessellate surfaces of the assembly components.
Specify the ChordHeight, AngleControl and IncludeQuilts as input
parameters to this method. For more information on ChordHeight,
AngleControl and IncludeQuilts, refer to the section Surface
Tessellation on page 407.
Use the method
wfcGeometry.SurfaceTessellationData.GetFacetVertexIndi
ces to obtain an array of facet vertices in the tessellated surface of the specified
part.
Use the method
wfcGeometry.SurfaceTessellationData.GetNormals to get an
array of normal vectors present in the tessellated surface of the specified part.
Use the method
wfcGeometry.SurfaceTessellationData.GetNumberOfFacets to
obtain the number of facets present in the tessellated surface of the specified part.
Use the method
wfcGeometry.SurfaceTessellationData.GetNumberOfVertices
to obtain the number of vertices present in the tessellated surface of the specified
part.
Use the method
wfcGeometry.SurfaceTessellationData.GetSurface to get the
surface which has been tessellated in the specified part.
Use the method
wfcGeometry.SurfaceTessellationData.GetVertexVectors to
get an array of vertex vectors present in the tessellated surface of the specified
part.

410 Creo Object TOOLKIT JavaUser’s Guide


Geometry Objects
Geometry of Points
Method Introduced:
• wfcGeometry.WPoint.GetCoordinates
• wfcSolid.WSolid.ProjectPoint
• wfcSolid.ProjectionInfo.GetSurface
• wfcSolid.ProjectionInfo.GetUVParam
• wfcPart.WPart.FindGeometry
• wfcGeometry.WPoint.FindIntolerance
• wfcGeometry.WPoint.GetCoordinates
• wfcGeometryWPointTolerance.GetTolerance
• wfcGeometryWPointTolerance.GetWithinTolerance
Use the method wfcGeometry.WPoint.GetCoordinates to retrieve the
X, Y, and Z coordinates of the specified point.
The method wfcSolid.WSolid.ProjectPoint projects a point normal on
the solid with in the specified maximum distance, and returns the surface where
the point is projected along with the UV parameters of the surface as a
WSolid.ProjectionInfo object.

Note
The method wfcSolid.WSolid.ProjectPoint is supported only for
parts.

The method wfcSolid.ProjectionInfo.GetSurface returns the surface


on which the specified point has been projected.
Use the method wfcSolid.ProjectionInfo.GetUVParam to get the UV
point on the surface where the specified point has been projected.
Use the method wfcPart.WPart.FindGeometry to determine the surfaces
or edges on which the specified point is located.

Note
This method does not return the neighboring surfaces, if the specified point
lies on an edge.

Geometry Evaluation 411


Use the method wfcGeometry.WPoint.FindIntolerance to determine if
two points are co-incident, that is, whether the distance between two points is
within theCreo tolerances.
Use the method wfcGeometry.WPoint.GetCoordinates to retrieve the
X, Y and Z coordinates of the specified point.
The method wfcGeometryWPointTolerance.GetTolerance retrieves
the amount by which the distance between two points exceeds tolerance.
The method wfcGeometryWPointTolerance.GetWithinTolerance
returns true if distance between points is within tolerance and false if not.

Geometry of Coordinate System Datums


Methods Introduced:
• wfcGeometry.WCsysData_Create
• wfcGeometry.WCsysData.GetOrigin
• wfcGeometry.WCsysData.SetOrigin
• wfcGeometry.WCsysData.GetXAxis
• wfcGeometry.WCsysData.SetXAxis
• wfcGeometry.WCsysData.GetYAxis
• wfcGeometry.WCsysData.SetYAxis
• wfcGeometry.WCsysData.GetZAxis
• wfcGeometry.WCsysData.SetZAxis
The method wfcGeometry.WCsysData_Create creates a datum object that
contains information about the coordinate system. The input arguments are:
• XAxis—Specifies the X-axis of the coordinate system.
• YAxis—Specifies the Y-axis of the coordinate system.
• ZAxis—Specifies the Z-axis of the coordinate system.
• Origin—Specifies the origin of the coordinate system.
Use the methods wfcGeometry.WCsysData.GetOrigin and
wfcGeometry.WCsysData.SetOrigin to get and set the origin of the
coordinate system using the pfcBase.Vector3D object.
Use the methods wfcGeometry.WCsysData.GetXAxis and
wfcGeometry.WCsysData.SetXAxis to get and set the X–axis of the
coordinate system using the pfcBase.Vector3D object.
Use the methods wfcGeometry.WCsysData.GetYAxis and
wfcGeometry.WCsysData.SetYAxis to get and set the Y–axis of the
coordinate system using the pfcBase.Vector3D object.

412 Creo Object TOOLKIT JavaUser’s Guide


Use the methods wfcGeometry.WCsysData.GetZAxis and
wfcGeometry.WCsysData.SetZAxis to get and set the Z–axis of the
coordinate system using the pfcBase.Vector3D object.

Geometry of Solid Edges


The methods described in this section allow you get and set the parameters of
edges in a part. The geometric edges form a contour, which further forms the
surface of a part. Thus, the edges define the extent of a surface. Every edge in a
part has two surfaces adjacent to it.
Methods Introduced:
• wfcGeometry.wfcGeometry.EdgeDescriptor_Create
• wfcGeometry.EdgeDescriptor.GetId
• wfcGeometry.EdgeDescriptor.SetId
• wfcGeometry.EdgeDescriptor.GetEdgeSurface1
• wfcGeometry.EdgeDescriptor.SetEdgeSurface1
• wfcGeometry.EdgeDescriptor.GetEdgeSurface2
• wfcGeometry.EdgeDescriptor.SetEdgeSurface2
• wfcGeometry.wfcGeometry.EdgeSurfaceData_Create
• wfcGeometry.EdgeSurfaceData.GetEdgeSurfaceId
• wfcGeometry.EdgeSurfaceData.SetEdgeSurfaceId
• wfcGeometry.EdgeSurfaceData.GetDirection
• wfcGeometry.EdgeSurfaceData.SetDirection
• wfcGeometry.EdgeSurfaceData.GetUVParamsSequence
• wfcGeometry.EdgeSurfaceData.SetUVParamsSequence
• wfcGeometry.EdgeSurfaceData.GetUVCurveData
• wfcGeometry.EdgeSurfaceData.SetUVCurveData
• wfcGeometry.EdgeDescriptor.GetXYZCurveData
• wfcGeometry.EdgeDescriptor.SetXYZCurveData
The method wfcGeometry.wfcGeometry.EdgeDescriptor_Create
creates a data object that contains information about the edges in a solid surface.
The method wfcGeometry.EdgeDescriptor.GetId returns the ID of the
specified edge. Use the method wfcGeometry.EdgeDescriptor.SetId to
set ID of the edge.

Geometry Evaluation 413


The method wfcGeometry.EdgeDescriptor.GetEdgeSurface1
retrieves all the information of the first surface of an edge as a
EdgeSurfaceData object. Use the method
wfcGeometry.EdgeDescriptor.SetEdgeSurface1 to set the
parameters of the first surface of an edge.
The method wfcGeometry.EdgeDescriptor.GetEdgeSurface2
retrieves all the information of the second surface of an edge as a
EdgeSurfaceData object. Use the method
wfcGeometry.EdgeDescriptor.SetEdgeSurface2 to set the
parameters of the second surface of an edge.
The method wfcGeometry.wfcGeometry.EdgeSurfaceData_Create
to create a data object that contains information about the surface adjacent to an
edge.
The method wfcGeometry.EdgeSurfaceData.GetEdgeSurfaceId
returns the ID of the specified surface. Use the method
wfcGeometry.EdgeSurfaceData.SetEdgeSurfaceId to set the ID of
the specified surface.
The method wfcGeometry.EdgeSurfaceData.GetDirection identifies
whether an edge is parameterized along or against the direction of the specified
surface. Each edge belongs to two surfaces. The edge will be in the same direction
as one surface, and in the opposite direction of the other surface. Use the method
wfcGeometry.EdgeSurfaceData.SetDirection to set the direction of
the edge along the specified surface.
The method
wfcGeometry.EdgeSurfaceData.GetUVParamsSequence returns an
array of UV points data for the curve. Use the method
wfcGeometry.EdgeSurfaceData.SetUVParamsSequence to set the
UV points for the curve.
The method wfcGeometry.EdgeSurfaceData.GetUVCurveData
returns an array of UV curve data for the specified surface. Use the method
wfcGeometry.EdgeSurfaceData.SetUVCurveData to set the
parameters for the UV curve.
The method wfcGeometry.EdgeDescriptor.GetXYZCurveData
returns a data object that contains information about the geometry type for the
XYZ curve. Use the method
wfcGeometry.EdgeDescriptor.SetXYZCurveData to set the geometry
type for the XYZ curve.

414 Creo Object TOOLKIT JavaUser’s Guide


Geometry of Quilts
Methods Introduced:
• wfcGeometry.WQuilt.IsBackupGeometry
• wfcGeometry.WQuilt.GetVolume
• wfcSolid.WSolid.GetQuilt
• wfcGeometry.wfcGeometry.QuiltData_Create
• wfcGeometry.QuiltData.SetQuiltId
• wfcGeometry.QuiltData.GetQuiltId
• wfcGeometry.QuiltData.SetSurfaceDescriptors
• wfcGeometry.QuiltData.GetSurfaceDescriptors
Use the method wfcGeometry.WQuilt.IsBackupGeometry to identify if
the specified quilt belongs to the invisible Copy Geometry backup feature.
Use the method wfcGeometry.WQuilt.GetVolume to get the volume of a
closed quilt.
The method wfcSolid.WSolid.GetQuilt returns a data object which
contains information about the quilt for the specified quilt Id.
Use the method wfcGeometry.wfcGeometry.QuiltData_Create to
create an instance of the object wfcGeometry.QuiltData that contains
information about the quilt data. Specify the quilt ID and a pointer to the surface
descriptor as the input arguments for this method.
Use the methods wfcGeometry.QuiltData.SetQuiltId and
wfcGeometry.QuiltData.GetQuiltId to set and get the quilt id.
Use the method wfcGeometry.QuiltData.GetSurfaceDescriptors
and to access information about a quilt surface from an array of
wfcWSurfaceDescriptors. Use the method
wfcGeometry.QuiltData.SetSurfaceDescriptorsto set the values
for the surface descriptor.

Geometry of Surfaces
Method Introduced:
• wfcPart.WPart.GetVolumeInfo
• wfcPart.VolumeSurfaceInfo.GetNumberOfVolumes
• wfcPart.VolumeSurfaceInfo.GetSurfaceInfos
• wfcPart.BoundingSurfaceInfo.GetNumberOfSurfaces
• wfcPart.BoundingSurfaceInfo.GetSurfaceIds

Geometry Evaluation 415


The method wfcPart.WPart.GetVolumeInfo analyzes and returns the
number of connected volumes of a part and the surfaces that bound the volume as
a VolumeSurfaceInfo object. Connect volumes are disjoint components of a
solid. It comprises of all the shells and voids that lie in the same maximal ambient
shell. The maximal ambient shell is an external shell and is not located inside any
other shell.
The method wfcPart.VolumeSurfaceInfo.GetNumberOfVolumes
returns the number of volumes in the part.
The method wfcPart.VolumeSurfaceInfo.GetSurfaceInfos returns
the information of the bounding surfaces as a BoundingSurfaceInfos
object.
Use the method
wfcPart.BoundingSurfaceInfo.GetNumberOfSurfaces returns the
number of surfaces that bound the connected volumes.
The method wfcPart.BoundingSurfaceInfo.GetSurfaceIds returns
the IDs of the surfaces that bound the connected volumes.

Geometry of datums
Method Introduced:
• wfcGeometry.CsysDatumObject_Create
• wfcGeometryCsysDatumObject.GetCsysData
• wfcGeometryCsysDatumObject.SetCsysData
• wfcGeometry.CurveDatumObject_Create
• wfcGeometry.CurveDatumObject.GetCurve
• wfcGeometry.CurveDatumObject.SetCurve
• wfcGeometry.PlaneDatumObject_Create
• wfcGeometry.PlaneDatumObject.GetPlaneData
• wfcGeometry.PlaneDatumObject.SetPlaneData
• wfcGeometry.WPlaneData_Create
• wfcGeometry.WPlaneData.GetOrigin
• wfcGeometry.WPlaneData.SetOrigin
• wfcGeometry.WPlaneData.GetXAxis
• wfcGeometry.WPlaneData.SetXAxis
• wfcGeometry.WPlaneData.GetYAxis
• wfcGeometry.WPlaneData.SetYAxis
• wfcGeometry.WPlaneData.GetZAxis
• wfcGeometry.WPlaneData.SetZAxis

416 Creo Object TOOLKIT JavaUser’s Guide


The method wfcGeometry.CsysDatumObject_Create creates a
coordinate system datum object using wfcGeometry.WCsysDataobject input
parameter.
Use the methods wfcGeometryCsysDatumObject.GetCsysData and
wfcGeometryCsysDatumObject.SetCsysData to get and set the
coordinate system data using the wfcGeometry.WCsysData object.
The method wfcGeometry.CurveDatumObject_Create creates a curve
datum object using pfcGeometry.CurveDescriptor object input
argument.
Use the methods wfcGeometry.CurveDatumObject.GetCurve and
wfcGeometry.CurveDatumObject.SetCurve to get and set the curve
using the pfcGeometry.CurveDescriptor object.
The method wfcGeometry.PlaneDatumObject_Create creates a plane
datum object using wfcGeometry.WPlaneData object input argument.
Use the methods wfcGeometry.PlaneDatumObject.GetPlaneData
and wfcGeometry.PlaneDatumObject.SetPlaneData to get and set
the plane using the wfcGeometry.WPlaneData object.
The method wfcGeometry.WPlaneData_Create creates a data object that
contains information about the plane data. The input arguments are:
• XAxis—Specifies the X-axis of the coordinate system.
• YAxis—Specifies the Y-axis of the coordinate system.
• ZAxis—Specifies the Z-axis of the coordinate system.
• Origin—Specifies the origin of the coordinate system.
Use the methods wfcGeometry.WPlaneData.GetOrigin and
wfcGeometry.WPlaneData.SetOrigin to get and set the origin of the
plane using the pfcBase.Point3D object.
Use the methods wfcGeometry.WPlaneData.GetXAxis and
wfcGeometry.WPlaneData.SetXAxis to get and set the X-axis of the
plane using the pfcBase.Vector3D object.
Use the methods wfcGeometry.WPlaneData.GetYAxis and
wfcGeometry.WPlaneData.SetYAxis to get and set the Y-axis of the
plane using the pfcBase.Vector3D object.
Use the methods wfcGeometry.WPlaneData.GetZAxis and
wfcGeometry.WPlaneData.SetZAxis to get and set the Z-axis of the
plane using the pfcBase.Vector3D object.

Tracing a Ray
Method Introduced:

Geometry Evaluation 417


• wfcModel.WModel.ComputeRayIntersections
• wfcModel.wfcModel.Ray_Create
• wfcModel.Ray.SetPoint
• wfcModel.Ray.GetPoint
• wfcModel.Ray.SetVector
• wfcModel.Ray.GetVector
The method wfcModel.WModel.ComputeRayIntersections returns a
list of intersections between a ray and a model as a Selections object. The
method finds intersections in both directions from the start point of the ray, and
assigns each intersection a depth—the distance from the ray start point in the
direction defined. The intersections in the reverse direction have a negative depth.
The intersections are ordered from the negative depth to the positive depth. The
input arguments are:
• ApertureRadius—Specifies the aperture value in pixels. If you give a value
less than –1.0, the value is taken from the Creo configuration file option
pick_aperture_radius. If that option is not set, the function uses the
default value of 7.0.
• Ray—Specifies the ray. A ray is specified in terms of a start location and
direction vector as a Ray object.
The method wfcModel.wfcModel.Ray_Create creates a data object
that contains information related to the ray. Use the method
wfcModel.Ray.SetPoint to set the starting point for the ray. The
method wfcModel.Ray.GetPoint returns the starting point of the ray.
The method wfcModel.Ray.SetVector sets the direction vector for the
ray. Use the method wfcModel.Ray.GetVector to get the direction
vector.

Measurement
• wfcSelect.WSelection.EvaluateAngle
• wfcGeometry.WContour.Eval3DOutline
• wfcSelect.WSelection.EvaluateDiameter
Use the method wfcSelect.WSelection.EvaluateAngle to measure the
angle between two geometry items expressed as wfcSelect.WSelection
objects. Both objects must be straight, solid edges.
Use the method wfcGeometry.WContour.Eval3DOutline to find the 3D
bounding box for the inside surface of the specified outer contour. This method
takes into account the internal voids present.

418 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcSelect.WSelection.EvaluateDiameter to get the
diameter of the specified surface. Specify only revolved surfaces such as, cylinder,
cone, and so on for this method.

Geometry Evaluation 419


26
Dimensions and Parameters
Overview ................................................................................................................ 421
The ParamValue Object ........................................................................................... 421
Parameter Objects .................................................................................................. 422
Table Parameters .................................................................................................... 432
Driven and Driving Parameters................................................................................. 433
Dimension Objects .................................................................................................. 433

This chapter describes the Creo Object TOOLKIT Java methods and classes that
affect dimensions and parameters.

420 Creo Object TOOLKIT JavaUser’s Guide


Overview
Dimensions and parameters in Creo Parametric have similar characteristics but
also have significant differences. In Creo Object TOOLKIT Java, the similarities
between dimensions and parameters are contained in the
ModelItem.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.

The ParamValue Object


Both parameters and dimension objects contain an object of type
ModelItem.ParamValue. This object contains the integer, real, string, or
Boolean value of the parameter or dimension. Because of the different possible
value types that can be associated with a ParamValue object there are different
methods used to access each value type and some methods will not be applicable
for some ParamValue objects. If you try to use an incorrect method an
exception will be thrown.

Accessing a ParamValue Object


Methods Introduced:
• 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.
A NoteParamValue is an integer value that refers to the ID of a specified note.
To create a parameter of this type the identified note must already exist in the
model.

Accessing the ParamValue Value


Methods Introduced:

Dimensions and Parameters 421


• pfcModelItem.ParamValue.Getdiscr
• 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
Exceptions.XBadGetParamValue will be thrown.

Parameter Objects
The following sections describe the Creo Object TOOLKIT Java methods that
access parameters. The topics are as follows:
• Creating and Accessing Parameters on page 422
• Parameter Selection Options on page 425
• Parameter Information on page 426
• Parameter Restrictions on page 430

Creating and Accessing Parameters


Methods Introduced:
• pfcModelItem.ParameterOwner.CreateParam
• pfcModelItem.ParameterOwner.CreateParamWithUnits
• pfcModelItem.ParameterOwner.GetParam
• pfcModelItem.ParameterOwner.ListParams
• pfcModelItem.ParameterOwner.SelectParam
• pfcModelItem.ParameterOwner.SelectParameters
• pfcFamily.FamColParam.GetRefParam
• wfcModelItem.WParameterOwner.ApplyParameterTableset
• wfcModelItem.WParameterOwner.ExportParameterTable

422 Creo Object TOOLKIT JavaUser’s Guide


In Creo Object TOOLKIT Java, models, features, surfaces, and edges inherit from
the ModelItem.ParameterOwner interface, because each of the objects can
be assigned parameters in Creo Parametric.
The method pfcModelItem.ParameterOwner.GetParam gets a
parameter given its name.
The method pfcModelItem.ParameterOwner.ListParams returns a
sequence of all parameters assigned to the object.
To create a new parameter with a name and a specific value, call the method
pfcModelItem.ParameterOwner.CreateParam.
To create a new parameter with a name, a specific value, and units, call the
method pfcModelItem.ParameterOwner.CreateParamWithUnits.
The method pfcModelItem.ParameterOwner.SelectParam allows you
to select a parameter from the Creo Parametric user interface. The top model from
which the parameters are selected must be displayed in the current window.
The method pfcModelItem.ParameterOwner.SelectParameters
allows you to interactively select parameters from the Creo Parametric Parameter
dialog box based on the parameter selection options specified by the
ModelItem.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 on page 425 for more information.
The method pfcFamily.FamColParam.GetRefParam returns the
reference parameter from the parameter column in a family table.
The method
wfcModelItem.WParameterOwner.ApplyParameterTableset
assigns the specified parameter set to the parameter owner modelitem. You can
create or modify the parameters called by the parameter table set, that is, you can
modify the entries contained in this parameter table set, change the label set for
the parameter table set and alter the name of the table that owns this parameter
table set. The values specified for the parameters, are set as the default values for
the parameters.

Note
This method does not regenerate the model on applying the parameter set.

A parameter table simplifies storing and accessing the value sets used for
manipulating dimensions and parametric information. Parameter tables maintain
design intent, while allowing adjustment for different parameter values. As the
global parameters are numeric or have a value of yes or no, they control the
dimension values of the components and the mathematical relations between them
in an assembly. A parameter table makes it easy to switch between different

Dimensions and Parameters 423


configuration options of an assembly. The
methodwfcModelItem.WParameterOwner.ExportParameterTable
exports a file containing information about the parameter table in Creo Parametric
to a specified format. The input parameters for this method are:
• TopMdl—Specify the top level model from which parameters are to be
exported.
• Contexts—Specifies a bitmask that contains the context of parameters to
list in the exported file. Specify a context only if the argument owner is set to
NULL. The list of contexts is specified by the data class
pfcModelItem.ParameterSelectionContext and the valid
combinations of the context are:
○ pfcPARAMSELECT_ALLOW_SUBITEM_SELECTION used alone—
Specifies that all the parameters of the sub items of the top model will be
exported.
○ pfcPARAMSELECT_ALLOW_SUBITEM_SELECTION along with
any another context—Specifies that only the parameters that belong
to the selected context will be exported.
○ pfcPARAMSELECT_MODEL, pfcPARAMSELECT_PART or
pfcPARAMSELECT_ASM—Specifies that all the model level parameters
in the top model will be exported.
• ExportType—Specify the format of the exported file. The supported
formats are defined by the data class
wfcModelItem.ParamTableExportType and are as follows:
○ PARAMTABLE_EXPORT_TXT—Specifies that the file will be exported in
a .TXT format.
○ PARAMTABLE_EXPORT_CSV—Specifies that the file will be exported in
a .CSV format.
• Path—Specify the full path, including the name and the extension of the file
to be created during export.
• Columns—Specifies a list that contains the description about the number of
columns to be included in the exported file. The columns exported will match
the columns and options set by the user in the active session using File ▶
Export in the Parameters dialog box to export the entire parameter table in the
Comma Separated Value (CSV) format. This parameter is not applicable for
the text format. You can also specify the type of parameter table column to be
included in the export file using the data class
wfcModelItem.ParamColumn.
• Owner—Specify the owner modelitem of the parameters to be exported. Set
this parameter to NULL, if the parameters to be exported are selected by
context.

424 Creo Object TOOLKIT JavaUser’s Guide


Parameter Selection Options
Parameter selection options in Creo Object TOOLKIT Java are represented by the
ModelItem.ParameterSelectionOptions interface.
Methods Introduced:
• pfcModelItem.pfcModelItem.ParameterSelectionOptions_Create
• pfcModelItem.ParameterSelectionOptions.SetAllowContextSelection
• 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().
The parameter selection options are as follows:
• AllowContextSelection—This boolean attribute indicates whether to
allow parameter selection from multiple contexts, or from the invoking
parameter owner. By default, it is false and allows selection only from the
invoking parameter owner. If it is true and if specific selection contexts are not
yet assigned, then you can select the parameters from any context.
Use the method
pfcModelItem.ParameteSelectionOptions.SetAllow
ContextSelection to modify the value of this attribute.
• Contexts—The permitted parameter selection contexts in the form of the
ModelItem.ParameterSelectionContexts object. Use the method
pfcModelItem.ParameterSelectionOptions.SetContexts to
assign the parameter selection context. By default, you can select parameters
from any context.
• The types of parameter selection contexts are as follows:
○ PARAMSELECT_MODEL—Specifies that the top level model parameters
can be selected.
○ PARAMSELECT_PART—Specifies that any part’s parameters (at any level
of the top model) can be selected.
○ PARAMSELECT_ASM—Specifies that any assembly’s parameters (at any
level of the top model) can be selected.
○ PARAMSELECT_FEATURE—Specifies that any feature’s parameters can
be selected.
○ PARAMSELECT_EDGE—Specifies that any edge’s parameters can be
selected.

Dimensions and Parameters 425


○ PARAMSELECT_SURFACE—Specifies that any surface’s parameters can
be selected.
○ PARAMSELECT_QUILT—Specifies that any quilt’s parameters can be
selected.
○ PARAMSELECT_CURVE—Specifies that any curve’s parameters can be
selected.
○ PARAMSELECT_COMPOSITE_CURVE—Specifies that any composite
curve’s parameters can be selected.
○ PARAMSELECT_INHERITED—Specifies that any inheritance feature’s
parameters can be selected.
○ PARAMSELECT_SKELETON—Specifies that any skeleton’s parameters
can be selected.
○ PARAMSELECT_COMPONENT—Specifies that any component’s
parameters can be selected.
• AllowMultipleSelections—This boolean attribute indicates whether
or not to allow multiple parameters to be selected from the dialog box, or only
a single parameter. By default, it is true and allows selection of multiple
parameters.
Use the method
pfcModelItem.ParameterSelectionOptions.SetAllow
MultipleSelections to modify this attribute.
• SelectButtonLabel—The visible label for the select button in the dialog
box.
Use the method
pfcModelItem.ParameterSelectionOptions.SetSelectBut
tonLabel to set the label. If not set, the default label in the language of the
active Creo Parametric session is displayed.

Parameter Information
Methods Introduced:
• pfcModelItem.BaseParameter.GetValue
• pfcModelItem.BaseParameter.SetValue
• pfcModelItem.Parameter.GetScaledValue
• pfcModelItem.Parameter.SetScaledValue
• pfcModelItem.Parameter.GetUnits
• pfcModelItem.BaseParameter.GetIsDesignated
• pfcModelItem.BaseParameter.SetIsDesignated
• pfcModelItem.BaseParameter.GetIsModified

426 Creo Object TOOLKIT JavaUser’s Guide


• pfcModelItem.BaseParameter.ResetFromBackup
• pfcModelItem.Parameter.GetDescription
• pfcModelItem.Parameter.SetDescription
• pfcModelItem.Parameter.GetRestriction
• pfcModelItem.Parameter.GetDriverType
• pfcModelItem.Parameter.Reorder
• pfcModelItem.Parameter.Delete
• pfcModelItem.NamedModelItem.GetName
• wfcModelItem.WParameter.GetLockStatus
• wfcModelItem.WParameter.SetLockStatus
• wfcModelItem.WParameter.GetValueWithUnits
• wfcModelItem.WParameter.SetValueWithUnits
• wfcModelItem.wfcModelItem.ParamValueWithUnits_Create
• wfcModelItem.ParamValueWithUnits.GetValue
• wfcModelItem.ParamValueWithUnits.SetValue
• wfcModelItem.ParamValueWithUnits.GetUnits
• wfcModelItem.ParamValueWithUnits.SetUnits
• wfcModelItem.wfcModelItem.ParameterData_Create
• wfcModelItem.ParameterData.GetName
• wfcModelItem.ParameterData.GetUnits
• wfcModelItem.ParameterData.GetValue
• wfcModelItem.wfcModelItem.ParameterConflict_Create
• wfcModelItem.ParameterConflict.GetConflictDescription
• wfcModelItem.ParameterConflict.GetConflictSeverity
• wfcModelItem.ParameterConflict.GetParameterName
Parameters inherit methods from the BaseParameter, Parameter and
NamedModelItem interfaces.
The method pfcModelItem.BaseParameter.GetValue returns the value
of the parameter or dimension.
The method pfcModelItem.BaseParameter.SetValue assigns a
particular value to a parameter or dimension.
The method pfcModelItem.Parameter.GetScaledValue returns the
parameter value in the units of the parameter, instead of the units of the owner
model as returned by pfcModelItem.BaseParameter.GetValue.
The method pfcModelItem.Parameter.SetScaledValue assigns the
parameter value in the units provided, instead of using the units of the owner
model as assumed by pfcModelItem.BaseParameter.GetValue.

Dimensions and Parameters 427


The method pfcModelItem.Parameter.GetUnits returns the units
assigned to the parameter.
You can access the designation status of the parameter using the methods
pfcModelItem.BaseParameter.GetIsDesignated and
pfcModelItem.BaseParameter.SetIsDesignated.
The methods pfcModelItem.BaseParameter.GetIsModified and
pfcModelItem.BaseParameter.ResetFromBackup enable you to
identify a modified parameter or dimension, and reset it to the last stored value. A
parameter is said to be "modified" when the value has been changed but the
parameter's owner has not yet been regenerated.
The method pfcModelItem.Parameter.GetDescription returns the
parameter description, or null, if no description is assigned.
The method pfcModelItem.Parameter.SetDescription assigns the
parameter description.
The method pfcModelItem.Parameter.GetRestriction identifies if
the parameter’s value is restricted to a certain range or enumeration. It returns the
ModelItem.ParameterRestriction object. Refer to the section
Parameter Restrictions on page 430 for more information.
The methodpfcModelItem.Parameter.GetDriverType returns the
driver type for a material parameter. The driver types are as follows:
• PARAMDRIVER_PARAM—Specifies that the parameter value is driven by
another parameter.
• PARAMDRIVER_FUNCTION—Specifies that the parameter value is driven by
a function.
• PARAMDRIVER_RELATION—Specifies that the parameter value is driven by
a relation. This is equivalent to the value obtained using
pfcModelItem.BaseParameter.GetIsRelationDriven for a
parameter object type.
The method pfcModelItem.Parameter.Reorder reorders the given
parameter to come immediately after the indicated parameter in the Parameter
dialog box and information files generated by Creo Parametric.
The method pfcModelItem.Parameter.Delete permanently removes a
specified parameter.
The method pfcModelItem.NamedModelItem.GetName accesses the
name of the specified parameter.

428 Creo Object TOOLKIT JavaUser’s Guide


The method wfcModelItem.WParameter.GetLockStatus returns the
access state of the specified parameter. Use the function
wfcModelItem.WParameter.SetLockStatus to set the access state for
the specified parameter. The access state is defined in the enumerated data type
ParamLockstatus. The valid values are:
• PARAMLOCKSTATUS_UNLOCKED—Specifies parameters with full access.
Full access parameters are user-defined parameters that can be modified from
any application.
• PARAMLOCKSTATUS_LIMITED—Specifies parameters with limited access.
Full access parameters can be set to have limited access. Limited access
parameters can be modified by user, family tables and programs. These
parameters cannot be modified by relations.
• PARAMLOCKSTATUS_LOCKED—Specifies parameters with locked access
are parameters. The parameters can be locked either by an external
application, or by the user. You can modify parameters locked by an external
application only from within an external application. You cannot modify user-
defined locked parameters from within an external application.
The methods wfcModelItem.WParameter.GetValueWithUnits and
wfcModelItem.WParameter.SetValueWithUnits reads and sets the
value of a parameter specified by the
com.ptc.wfc.wfcParamValueWithUnits object. These methods also
retrieve and set the units of the parameter.
The method wfcModelItem.wfcModelItem.ParamValueWithUnits_
Create creates the wfcParamValueWithUnits object, which contains
information about the parameter.
The methods wfcModelItem.ParamValueWithUnits.GetValue and
wfcModelItem.ParamValueWithUnits.SetValue get and set the value
of the parameter. Use the methods
wfcModelItem.ParamValueWithUnits.GetUnits and
wfcModelItem.ParamValueWithUnits.SetUnits to get and set the
units of the parameter.
Use the method wfcModelItem.wfcModelItem.ParameterData_
Create to create the wfcModelItem.ParameterData object, which
contains information or data about the parameter. The input parameters are:
• Name—Specifies the name of the parameter.
• Value—Specifies the value of the parameter.
• Unit—Specifies the unit of the parameter.
The method wfcModelItem.ParameterData.GetName retrieves the name
of the parameter.
The method wfcModelItem.ParameterData.GetUnits retrieves the
units of the parameter.

Dimensions and Parameters 429


The method wfcModelItem.ParameterData.GetValue retrieves the
value of the parameter.
The method wfcModelItem.wfcModelItem.ParameterConflict_
Create creates a report which checks if the restricted value parameters in the
model are in agreement with an external file. The input parameters are:
• Name— Specifies the name of the parameter in conflict.
• Severity—Specifies the severity of the conflict.
• Description—Specifies the description of the parameter in conflict.
Use the method
wfcModelItem.ParameterConflict.GetConflictDescription to
retrieve the description of the parameter in conflict.
Use the method
wfcModelItem.ParameterConflict.GetConflictSeverity to
retrieve the severity of the conflict using the enumerated type
wfcModelItem.ParameterConflictSeverity.
Use the method
wfcModelItem.ParameterConflict.GetParameterName to retrieve
the name of the parameter in conflict.

Parameter Restrictions
Creo Parametric allows users to assign specified limitations to the value allowed
for a given parameter (wherever the parameter appears in the model). You can
only read the details of the permitted restrictions from Creo Object TOOLKIT
Java, but not modify the permitted values or range of values. Parameter
restrictions in Creo Object TOOLKIT Java are represented by the interface
ModelItem.ParameterRestriction.
Method Introduced:
• pfcModelItem.ParameterRestriction.GetType
The method pfcModelItem.ParameterRestriction.GetType returns
the ModelItem.RestrictionType object containing the types of parameter
restrictions. The parameter restrictions are of the following types:
• PARAMSELECT_ENUMERATION—Specifies that the parameter is restricted
to a list of permitted values.
• PARAMSELECT_RANGE—Specifies that the parameter is limited to a
specified range of numeric values.

430 Creo Object TOOLKIT JavaUser’s Guide


Enumeration Restriction
The PARAMSELECT_ENUMERATION type of parameter restriction is represented
by the interfaceModelItem.ParameterEnumeration. It is a child of the
ModelItem.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 ModelItem.ParamValue objects.

Range Restriction
The PARAMSELECT_RANGE type of parameter restriction is represented by the
interface ModelItem.ParameterRange. It is a child of the
ModelItem.ParameterRestriction interface.
Methods Introduced:
• 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
ModelItem.ParameterLimit object.
The method pfcModelItem.ParameterRange.GetMinimum returns the
minimum value limit for the parameter in the form of the
ModelItem.ParameterLimit object.
The method pfcModelItem.ParameterLimit.GetType returns the
ModelItem.ParameterLimitType containing the types of parameter
limits. The parameter limits are of the following types:
• PARAMLIMIT_LESS_THAN—Specifies that the parameter must be less than
the indicated value.
• PARAMLIMIT_LESS_THAN_OR_EQUAL—Specifies that the parameter
must be less than or equal to the indicated value.
• PARAMLIMIT_GREATER_THAN—Specifies that the parameter must be
greater than the indicated value.
• PARAMLIMIT_GREATER_THAN_OR_EQUAL—Specifies that the parameter
must be greater than or equal to the indicated value.

Dimensions and Parameters 431


The method pfcModelItem.ParameterLimit.GetValue returns the
boundary value of the parameter limit in the form of the
ModelItem.ParamValue object.

Table Parameters
A parameter table is made up of one or more parameter table sets. Each set
represents one or more parameters with their assigned values or assigned ranges.
A parameter owner such as model, feature, annotation element or geometry item
can only have one parameter table set to create a parameter. In Creo Parametric
Object TOOLKIT, a parameter table set is represented by the type
wfcModelItem.ParamtableSet and is made up of entries, represented by
wfcModelItem.ParamTableEntry. A single entry represents a parameter
with an assigned value or range.
Methods Introduced:
• wfcModelItem.ParamTableEntry.GetName
• wfcModelItem.ParamTableEntry.GetRange
• wfcModelItem.ParamTableEntry.GetValue
• wfcModelItem.WParameter.GetTableset
• wfcModelItem.ParamTableset.GetEntries
• wfcModelItem.ParamTableset.GetLabel
• wfcModelItem.ParamTableset.GetTablePath
Use the method wfcModelItem.ParamTableEntry.GetName to obtain
the name of the parameter in the table set.
Use the method wfcModelItem.ParamTableEntry.GetRange to obtain
the permitted range for the parameter in the table set. This method returns an
object of the class pfcModelItem.ParameterRange. Use the methods
pfcModelItem.ParameterRange.GetMaximum and
pfcModelItem.ParameterRange.GetMinimum to get the minimum and
maximum value for the parameter. For more information on these methods refer to
the section Parameter Restrictions on page 430.
Use the method wfcModelItem.ParamTableEntry.GetValue to get the
value set for a parameter in the table set.
Use the method wfcModelItem.WParameter.GetTableset to obtain the
parameter table set that contains the specified parameter.
Use the method wfcModelItem.ParamTableset.GetEntries to get the
list of parameters present in the parameter table set. This method returns an array
of parameter table set which contains information about all the parameters
defined.

432 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcModelItem.ParamTableset.GetLabel to get the set
label parameter defined for the parameter table set. A parameter that describes an
entire set of parameters and their values is called a set label parameter.
Use the method wfcModelItem.ParamTableset.GetTablePath to get
the name of the table that owns that parameter table set. If the parameter table set
has been loaded from a table file, this method returns the full path of the table. It
returns the table name, if the table parameter table set is stored in the model
directly.

Driven and Driving Parameters


Driven or dependent parameters are controlled by the equation you define. Driven
parameters enable you to set particular values for a dimension, drive the value of
one dimension based on the behavior of another dimension, and dynamically
suppress features based on changes in the part. Driving or independent parameters
on the other hand are capable of controlling an activity and their value does not
change often unlike driving parameters. The methods described below provide
access to the item, that is, parameter or method driving model parameters. You can
use Creo Parametric parameters to define the characteristics of your material
properties with either driven or driving parameters.
Methods Introduced:
• wfcModelItem.WParameter.GetDrivingParam
• wfcModelItem.WParameter.SetDrivingParam
If the driver type defined by pfcModelItem.ParameterDriverType is set
to PARAMDRIVER_PARAM, the method
wfcModelItem.WParameter.GetDrivingParam returns the name of the
driving parameter for the specified material parameter.
Use the method wfcModelItem.WParameter.SetDrivingParam to
assign the driving parameter for a material parameter. This method will set the
driver type to pfcPARAMDRIVER_PARAM.

Dimension Objects
Dimension objects include standard Creo Parametric 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.

Dimensions and Parameters 433


Getting Dimensions
Dimensions and reference dimensions are Creo Parametric model items. See the
section Getting ModelItem Objects on page 299 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
• wfcDimension.WDimension.GetBound
• wfcDimension.WDimension.GetNominalValue
• wfcDimension.WDimension.GetSymbolModeText
• wfcDimension.WDimension.IsFractional
• wfcDimension.WDimension.IsBasic
• wfcDimension.WDimension.IsInspection
• wfcDimension.WDimension.GetOwnerFeature
• wfcDimension.WDimension.IsDisplayedValueRounded
• wfcDimension.WDimension.DisplayValueAsRounded
• wfcDimension.WDimension.GetDisplayedValue
• wfcDimension.WDimension.GetOverrideValue
• wfcDimension.WDimension.GetDisplayedValueType
• wfcDimension.WDimension.IsSignDriven
• wfcDimension.WDimension.IsAccessibleInModel

434 Creo Object TOOLKIT JavaUser’s Guide


• wfcDimension.WDimension.GetSignificantDigits
• wfcDimension.WDimension.GetDenominator
All the BaseParameter methods are accessible to Dimensions as well as
Parameters. See the section Parameter Objects on page 422 for brief descriptions.

Note
You cannot set the value or designation status of reference dimension objects.

The methods pfcModelItem.BaseDimension.GetDimValue and


pfcModelItem.BaseDimension.SetDimValue access the dimension
value as a double. These methods provide a shortcut for accessing the dimensions'
values without using a ParamValue object.
The pfcModelItem.BaseParameter.GetIsRelationDriven method
identifies whether the part or assembly relations control a dimension.
The method pfcDimension.BaseDimension.GetDimType returns an
enumeration object that identifies whether a dimension is linear, radial, angular, or
diametrical.
The method pfcDimension.BaseDimension.GetSymbol returns the
dimension or reference dimension symbol (that is, “d#” or “rd#”).
The pfcDimension.BaseDimension.GetTexts and
pfcDimension.BaseDimension.SetTexts methods allows access to the
text strings that precede or follow the dimension value.
The method wfcDimension.WDimension.GetBound returns the bound
values of a dimension using the enumerated data type
wfcDimension.DimBound. When you design a model, the actual part
dimensions must be within certain predetermined limits of size. These limits of
size—the upper and lower dimension boundaries—are known as dimension
bounds. Refer to the section Modifying Dimensions on page 438 for more
information on bound values.
The method wfcDimension.WDimension.GetNominalValue returns the
nominal value of a dimension. The method returns the nominal value even if the
dimension is set to the upper or lower bound. The nominal value is returned in
degrees for an angular dimension and in the system of units for other types of
dimensions.
The method wfcDimension.WDimension.GetSymbolModeText returns
the text of the dimension in symbol mode.
The method wfcDimension.WDimension.IsFractional checks whether
the dimension is expressed in terms of a fraction rather than a decimal.

Dimensions and Parameters 435


The method wfcDimension.WDimension.IsBasic identifies if the
specified dimension is a basic dimension.
The method wfcDimension.WDimension.IsInspection identifies if the
specified dimension is an inspection dimension.
The method wfcDimension.WDimension.GetOwnerFeature returns the
feature that owns the specified dimension.
Use the method
wfcDimension.WDimension.IsDisplayedValueRounded to
determine whether the specified dimension is set to display its rounded off value.
In Creo Parametric TOOLKIT, a rounded off value is a decimal value that
contains only the desired number of digits after the decimal point. For example, if
a dimension has the stored value 10.34132 and you want to display only two
digits after the decimal point, you must round off the stored value to two decimal
places. Thus, rounding off converts 10.34132 to 10.34.
Use the method
wfcDimension.WDimension.DisplayValueAsRounded to set the
attribute of the given dimension to display either the rounded off value or the
stored value.
You can use this method for all dimensions, except angular dimensions created
prior to Pro/ENGINEER Wildfire 4.0, ordinate baseline dimensions, and
dimensions of legacy type. For these dimensions, the method throws an exception
pfcExceptions.XToolkitNotValid.
If you choose to display the rounded off value, the method
wfcDimension.WDimension.GetDisplayedValue retrieves the
displayed rounded value of the specified dimension. Otherwise, it retrieves the
stored value.
The method wfcDimension.WDimension.GetOverrideValue returns
the override value for a dimension. The default override value is zero.

Note
The override value is available only for driven dimensions.

Use the method


wfcDimension.WDimension.GetDisplayedValueType to obtain the
type of value displayed for a dimension using the enumerated type
wfcDimension.DimValueDisplay. The valid types are:

436 Creo Object TOOLKIT JavaUser’s Guide


• DIMVALUEDISPLAY_NOMINAL—Displays the actual value of the
dimension along with the tolerance value.
• DIMVALUEDISPLAY_OVERRIDE—Displays the override value for the
dimension along with the tolerance value.
• DIMVALUEDISPLAY_HIDE—Displays only the tolerance value for the
dimension.
When you set a negative value to a dimension, it will either change the dimension
to this negative value, or flip the direction around its reference and show a
positive value dimension instead. Use the method
wfcDimension.WDimension.IsSignDriven to check this. The method
returns the following values:
• true—When the negative sign in the dimension value is used to flip the
direction.
• false—When the negative sign is used to indicate a negative value, that is,
the dimension is negative.
The configuration option show_dim_sign when set to yes allows you to
display negative dimensions in the Creo Parametric user interface.
When the option is set no, the dimensions always show positive value. However,
in this case, if you set a negative value for the dimension, the direction is flipped.

Note
Some feature types, such as, dimensions for coordinate systems and datum
point offsets, always show negative or positive values, even if the option is set
to no. These features do not depend on the configuration option.

The method wfcDimension.WDimension.IsAccessibleInModel


identifies if a specified dimension is owned by the model. When a model owns the
dimension, then by default, the dimension is accessible in the model.
The method wfcDimension.WDimension.GetSignificantDigits
retrieves the number of decimals digits that are significant for a dimension or
tolerance. If you specify the input argument Tolerance as false, the method
retrieves the number of decimals digits that are significant for the dimension.
If you want to get the number of decimal places shown for the upper and lower
values of the dimension tolerance, specify the input argument Tolerance as true.
The method wfcDimension.WDimension.GetDenominator retrieves the
value of the largest possible denominator that is used to define a fractional value
or tolerance. If you specify the input argument Tolerance as false, the method
returns the value of the largest possible denominator used to define the fractional
value.

Dimensions and Parameters 437


If you want to get the value for the largest possible denominator for the upper and
lower tolerance values, specify the input argument Tolerance as true. By default,
this value is defined by the config.pro option, dim_fraction_
denominator.

Modifying Dimensions
Methods Introduced:
• wfcDimension.WDimension.SetBound
• wfcDimension.WDimension.SetAsBasic
• wfcDimension.WDimension.SetAsInspection
• wfcDimension.WDimension.SetOverrideValue
• wfcDimension.WDimension.SetDisplayedValueType
• wfcDimension.WDimension.SetElbowLength
• wfcDimension.WDimension.CreateSimpleBreak
• wfcDimension.WDimension.CreateJog
• wfcDimension.WDimension.EraseWitnessLine
• wfcDimension.WDimension.ShowWitnessLine
• wfcDimension.WDimension.SetSignificantDigits
• wfcDimension.WDimension.SetDenominator
• wfcDimension.WDimension.SetDimensionArrowType
The method wfcDimension.WDimension.SetBound sets the bound status
of the dimension using the enumerated type wfcDimension.DimBound. The
valid values are:
• DIM_BOUND_NOMINAL—Sets the dimension value to the nominal value. It
generates geometry based on exact ideal dimensions.
• DIM_BOUND_UPPER—Sets the dimension value to its maximum value. It
generates geometry based on a nominal dimension value plus the tolerance.
• DIM_BOUND_LOWER—Sets the dimension value to its minimum value. It
generates geometry based on a nominal dimension value minus the tolerance.
• DIM_BOUND_MIDDLE—Sets the dimension value to the nominal value plus
the mean of the upper and lower tolerance values.
The methods wfcDimension.WDimension.SetAsBasic and
wfcDimension.WDimension.SetAsInspection set the basic and
inspection notations of the dimension respectively. These methods are applicable
to both driven and driving dimensions.

438 Creo Object TOOLKIT JavaUser’s Guide


Note
The basic and inspection notations of the dimension are not available when
only the tolerance value for a dimension is displayed.

The method wfcDimension.WDimension.SetOverrideValue assigns


the override value for a dimension. This value is restricted to real numbers. The
default override value is zero.

Note
You can set the override value only for driven dimensions.

The method wfcDimension.WDimension.SetDisplayedValueType


sets the type of value to be displayed for a dimension using the enumerated data
type wfcDimension.DimValueDisplay.
The method wfcDimension.WDimension.SetElbowLength sets the
length of the elbow for the specified dimension in a solid. The method can also be
used to set the length of the elbow for a dimension in a drawing, where the
dimension is created in a solid and is displayed in a drawing. To work with
dimensions shown in a drawing, pass the name of the drawing in the input
argument Drw.
The method wfcDimension.WDimension.CreateSimpleBreak creates
a simple break on an existing dimension witness line. The input arguments are:
• Drawing—Specifies the drawing in which the dimension is present. You can
specify a NULL value.
• WitnessLineIndex—Specifies the index of the witness line. Depending on
which side of the dimension the witness line lies, specify the value as 1 or 2.
Use the methods
wfcDimension.DimLocation.GetFirstWitnessLineLocation
or
wfcDimension.DimLocation.GetSecondWitnessLineLoca
tion to get the location of the witness line end points for a dimension.

Note
This argument is not applicable for ordinate, radius, and diameter
dimensions.

Dimensions and Parameters 439


• BreakStart—Specifies the start point of the break.
• BreakEnd—Specifies the end point of the break.
The method wfcDimension.WDimension.CreateJog creates a jog on an
existing dimension witness line. The input arguments are:
• Drawing—Specifies the drawing in which the dimension is present. You can
specify a NULL value.
• WitnessLineIndex—Specifies the index of the witness line. Depending on
which side of the dimension the witness line lies, specify the value as 1 or 2.
Use the methods
wfcDimension.DimLocation.GetFirstWitnessLineLocation
or
wfcDimension.DimLocation.GetSecondWitnessLineLoca
tion to get the location of the witness line end points for a dimension.

Note
This argument is not applicable for ordinate, radius, and diameter
dimensions.

• JogPoints—Specifies an array of points to position the jog. If the specified


witness line has no jog added to it, then you must specify minimum two points
that is, the start point and end point of the jog.

Note
The methods wfcDimension.WDimension.CreateSimpleBreak
and wfcDimension.WDimension.CreateJog throw an exception
pfcExceptions.XToolkitInvalidType when breaks and jogs are
not supported for the specified dimension type, for example, diameter
dimension. The methods throw an exception
pfcExceptions.XToolkitAbort when it is not possible to create
breaks or jogs for the specified dimension witness line. For example, if you
add a jog that is duplicate to an existing jog on the dimension witness line.

When you create a dimension, witness lines are created based on the dimension
placement location and dimension references. These witness lines do not overlap
with the reference geometry.
The method wfcDimension.WDimension.EraseWitnessLine erases a
specified witness line from the dimension. The input arguments are:

440 Creo Object TOOLKIT JavaUser’s Guide


• Drawing—Specifies the drawing in which the dimension is displayed. To
erase witness line from a solid, specify this argument as NULL.
• WitnessLineIndex—Specifies the index of the witness line. Specify the value
as 1 or 2 depending on which side of the dimension the witness line lies. Use
the methods
wfcDimension.DimLocation.GetFirstWitnessLineLocation
or
wfcDimension.DimLocation.GetSecondWitnessLineLoca
tion to get the location of the witness line end points for a dimension.
Use the method wfcDimension.WDimension.ShowWitnessLine to
show the erased witness line for the specified dimension.

Note
The methods wfcDimension.WDimension.EraseWitnessLine and
wfcDimension.WDimension.ShowWitnessLine erase and show the
witness lines of dimensions and reference dimensions, respectively. These
methods work with both drawings and solids.

The method wfcDimension.WDimension.SetSignificantDigits


sets the number of decimals digits that are significant for a dimension or tolerance.
If you specify the input argument Tolerance as false, the method sets the
number of decimal places for a decimal dimension.
• If the number of decimal places required to display the stored value of the
dimension is greater than the number of decimal places specified in the
method wfcDimension.WDimension.SetSignificantDigits and
the round displayed value attribute of the dimension is ON, the stored value is
unchanged. Only the displayed number of decimal places is changed and the
displayed value is updated accordingly. For example, consider a dimension
with its stored value as 12.12323 and the round displayed value attribute of the
dimension is set to ON. If the method
wfcDimension.WDimension.SetSignificantDigits sets the
number of decimal places to 3, the stored value of the dimension is
unchanged, that is, the stored value will be 12.12323. The displayed value of
the dimension is rounded to 3 decimal places, that is, 12.123. The round
displayed value attribute is not changed.
• If the number of decimal places required to display the stored value of the
dimension is greater than the number of decimal places specified in the
method wfcDimension.WDimension.SetSignificantDigits and
the round displayed value attribute of the dimension is OFF, the number of
decimal places of the dimension is modified and the stored value is rounded to
the specified number of decimal places. For example, consider a dimension
with its stored value as 12.12323 and the round displayed value attribute of the

Dimensions and Parameters 441


dimension is OFF. If the method
wfcDimension.WDimension.SetSignificantDigits sets the
dimension to 3 decimal places, then the stored value of the dimension is
rounded to 3 decimal places and is modified to 12.123. The dimension is
displayed as 12.123.
• If the number of decimal places required to display the stored value of the
dimension is less than the number of decimal places specified in the method
wfcDimension.WDimension.SetSignificantDigits, the number
of decimal places is set to the specified value. The status of the round
displayed value attribute is not considered, as no change or an increase to the
number of decimal places will have no effect on the stored value. For example,
consider a dimension with its stored value as 12.12323. If the method
wfcDimension.WDimension.SetSignificantDigits sets the
dimension to 8 decimal places and if trailing zeros are displayed, then the
dimension is displayed as 12.12323000.
For a driven dimension:
• If the number of decimal places set by the method is greater than or equal to
the number of decimal places required to display the stored value of the
dimension, the decimal places value is changed and no change to the round
displayed value attribute is made.
• If the number of decimal places of the dimension is less than the number
required to display the stored value of the dimension, the round displayed
value attribute is automatically set to ON as it is not possible to change the
stored value of a driven dimension.
If you want to set the number of decimal places shown for the upper and lower
values of the dimension tolerance, specify the input argument Tolerance as true.
Thus, the decimals of the dimension tolerance can be set independent of the
number of dimension decimals. By default, the number of decimal places for
tolerance values is calculated based upon the “linear_tol” settings of the model.

Note
Specify a non-negative number as input for the argument Digits in the method
wfcDimension.WDimension.SetSignificantDigits. It should
be such that when you apply either the upper or lower values of tolerance to
the given dimension, the total number of digits before and after the decimal
point in the resulting values must not exceed 13.

442 Creo Object TOOLKIT JavaUser’s Guide


The method wfcDimension.WDimension.SetDenominator sets the
denominator for fractional dimensions and tolerances. If you specify the input
argument Tolerance as false, the method sets the denominator for fractional
dimensions. When you call the method
wfcDimension.WDimension.SetDenominator:
• The stored value remains unchanged if,
○ it can be expressed as an exact fraction with the given denominator,
regardless of whether the round-off attribute is set or not.
○ the stored value cannot be expressed as an exact fraction, but the round-off
attribute is set. In this case, the fraction is the approximate representation
of the stored value.
• The stored value changes to the nearest fraction and triggers a regeneration of
the model, if it cannot be expressed as an exact fraction with the given
denominator and the round-off attribute is not set.
If you want to set the value for the largest possible denominator for the upper and
lower tolerance values, specify the input argument Tolerance as true. By default,
this value is defined by the config.pro option, dim_fraction_
denominator.
Use the method
wfcDimension.WDimension.SetDimensionArrowType to set the style
for the arrow head of a leader for a specified dimension. The input arguments are:
• ArrowIndex—Specifies the index of the witness line. Depending on which side
of the dimension the witness line lies, specify the value as 1 or 2. For diameter
dimensions, this value determines which of the two arrows to change. For
other dimensions, the value of 1 indicates the arrow on the first witness line,
and the value of 2 indicates the arrow on the second witness line. For ordinate
and radius dimensions, this value is ignored. Use the method
wfcDimension.DimLocation.GetFirstWitnessLineLocation
or
wfcDimension.DimLocation.GetSecondWitnessLineLoca
tion to get the location of the witness line end points for a dimension.
• ArrowType—Specifies the type of arrow head using the enumerated data type
wfcAnnotation.LeaderArrowType.
• Drawing—Optional argument. Specifies the name of the drawing. For
dimensions created in drawing mode and owned by a solid, which can be
displayed only in the context of that drawing, specify the name of the drawing
in the input argument drawing.

Dimensions and Parameters 443


Cleaning Up Dimensions
You can clean up the placement of dimensions in a drawing to meet the industry
standards, and enable easier reading of your model detailing. You can adjust the
location and display of dimensions by setting controls on the placement of a
dimension. You can also set the cosmetic attributes, like flip the direction of arrow
when the arrows do not fit between the witness lines and center the dimension text
between two witness lines.
Methods Introduced:
• wfcWDrawing.WDrawing.CleanupDimensions
Use the method wfcWDrawing.WDrawing.CleanupDimensions to clean
up the dimensions in a drawing. The input argument is:
• View—Specifies the view in which the dimensions must be cleaned as a
pfcView2D.View2D object. If you pass the value as NULL, the dimensions
are cleaned for all the views in the specified drawing.
The dimensions are cleaned using the default values set in the Clean Dimensions
dialog box in Creo Parametric user interface.

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
• wfcSolid.WSolid.GetTolerance
• wfcSolid.WSolid.SetTolerance
• wfcSession.WSession.GetDefaultTolerance
• wfcSolid.WSolid.GetModelClass
• wfcSolid.WSolid.SetModelClass
• wfcSolid.WSolid.LoadToleranceClass
• wfcDimension.WDimension.IsToleranceDisplayed
• wfcDimension.WDimension.GetDisplayedUpperLimitTolerance
• wfcDimension.WDimension.GetDisplayedLowerLimitTolerance
Only true dimension objects can have geometric tolerances.

444 Creo Object TOOLKIT JavaUser’s Guide


The methods pfcDimension.Dimension.GetTolerance and
pfcDimension.Dimension.SetTolerance enable you to access the
dimension tolerance. The object types for the dimension tolerance are:
• DimTolLimits—Displays dimension tolerances as upper and lower limits.

Note
This format is not available when only the tolerance value for a dimension
is displayed.

• DimTolPlusMinus—Displays dimensions as nominal with plus-minus


tolerances. The positive and negative values are independent.
• DimTolSymmetric—Displays dimensions as nominal with a single value
for both the positive and the negative tolerance.
• DimTolSymSuperscript—Displays dimensions as nominal 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 Creo Parametric.
To determine whether a given tolerance is plus/minus, symmetric, limits, or
superscript use instanceof.
The method wfcSolid.WSolid.GetTolerance returns the tolerance value
for the specified solid. The input arguments are:
• Type—Specifies the type of tolerance as linear or angular using the
enumerated class type wfcSolid.ToleranceType.
• Decimals—Specifies the number of decimal places to identify the tolerance
value.

Use the method wfcSolid.WSolid.SetTolerance to set the geometric


tolerance for the solid. Specify the tolerance type, number of decimal places for
the tolerance value, and the tolerance value as the input arguments.
The method wfcSession.WSession.GetDefaultTolerance returns the
default value for the specified linear or angular tolerance value. The default value
is set in the Creo Parametric configuration files. Specify the tolerance type and
number of decimal places to identify the tolerance value as the input arguments.
All the user specified information for a tolerance is saved in a tolerance table for
ISO and DIN standards. You can retrieve and set the data for tolerance tables
using Creo Object TOOLKIT Java methods. A model with ISO or DIN standard

Dimensions and Parameters 445


has an extra attribute called the tolerance class which determines the general
coarseness of the model. The method wfcSolid.WSolid.GetModelClass
returns the type of coarseness in a model using the enumerated class type
wfcSolid.ModelClass. The valid values are:
• MODELCLASS_NONE
• MODELCLASS_FINE
• MODELCLASS_MEDIUM
• MODELCLASS_COARSE
• MODELCLASS_VERY_COARSE
Use the method wfcSolid.WSolid.SetModelClass to set the tolerance
class for a solid.
The method wfcSolid.WSolid.LoadToleranceClass loads the hole or
shaft tolerance table for a model with ISO or DIN standard in the current session.
Pass the tolerance table name ToleranceClassName as the input argument.
The method wfcDimension.WDimension.IsToleranceDisplayed
checks whether the tolerances of the specified dimension are currently displayed.
Refer to the Creo Parametric Detailed Drawings Help for more information.
If the round off attribute for the given dimension is set, the methods
wfcDimension.WDimension.GetDisplayedUpperLimitTolerance
and
wfcDimension.WDimension.GetDisplayedLowerLimitTolerance
retrieve the displayed rounded values of the upper and lower limits of the
specified dimension. Otherwise, it retrieves the stored values of the tolerances as
done by the method wfcSolid.WSolid.GetTolerance. For example,
consider a dimension that is set to round off to two decimal places and has the
upper and lower tolerances 0.123456. By default, the tolerance values displayed
are also rounded off to two decimal places. In this case, the methods
wfcDimension.WDimension.GetDisplayedUpperLimitTolerance
and
wfcDimension.WDimension.GetDisplayedLowerLimitTolerance
retrieve the upper and lower values as 0.12.

Dimension Prefix and Suffix


Methods Introduced:
• wfcDimension.WDimension.GetPrefix
• wfcDimension.WDimension.SetPrefix
• wfcDimension.WDimension.GetSuffix
• wfcDimension.WDimension.SetSuffix

446 Creo Object TOOLKIT JavaUser’s Guide


The method wfcDimension.WDimension.GetPrefix retrieves the prefix
assigned to the specified dimension.
Use the method wfcDimension.WDimension.SetPrefix to set the
specified prefix for a dimension.
The method wfcDimension.WDimension.GetSuffix retrieves the suffix
assigned to the specified dimension.
Use the method wfcDimension.WDimension.SetSuffix to set the
specified suffix for a dimension.

Dimension Location
The methods described in this section extract the dimension location and
geometry in 3D space for solid model dimensions.

Dimension Entity Location


The following methods extract the locations of geometric endpoints for the
dimension. You can calculate the dimension location plane, witness line, and
dimension orientation vectors from these points. The location of the points is
specified in the same coordinate system as the solid model.
Methods Introduced:
• wfcDimension.DimLocation.GetNormal
• wfcDimension.DimLocation.GetCenterLeaderInformation
• wfcDimension.CenterLeaderInformation.GetCenterLeaderType
• wfcDimension.CenterLeaderInformation.GetElbowLength
• wfcDimension.CenterLeaderInformation.GetElbowDirection
• wfcDimension.CenterLeaderInformation.GetLeaderArrowType
• wfcDimension.DimLocation.GetFirstZExtensionLineLocation
• wfcDimension.DimLocation.GetSecondZExtensionLineLocation
• wfcDimension.DimLocation.GetFirstArrowheadLocation
• wfcDimension.DimLocation.GetSecondArrowheadLocation
• wfcDimension.DimLocation.GetElbowLength
• wfcDimension.DimLocation.GetFirstWitnessLineLocation
• wfcDimension.DimLocation.GetSecondWitnessLineLocation
• wfcDimension.DimLocation.GetLocation
• wfcDimension.DimLocation.HasElbow

Dimensions and Parameters 447


The method wfcDimension.DimLocation.GetNormal returns the vector
normal to the dimensioning plane for a radial or diameter dimension. This normal
vector should correspond to the axis normal to the arc being measured by the
radial or diameter dimension.
The method
wfcDimension.DimLocation.GetCenterLeaderInformation
obtains the information about the center leader as a
wfcDimension.CenterLeaderInformation object. The type of center
leader is determined by the orientation of the dimension text.
Use the method
wfcDimension.CenterLeaderInformation.GetCenterLeader
Type to get the type of center leader. The valid values are defined in the
enumerated data type wfcDimension.DimCenterLeaderType:
• DimCenterLeaderType.DIM_CLEADER_CENTERED_ELBOW—
Specifies that the dimension text is placed next to and centered about the
elbow of the center leader.
• DimCenterLeaderType.DIM_CLEADER_ABOVE_ELBOW—Specifies
that the dimension text is placed next to and above the elbow of the center
leader.
• DimCenterLeaderType.DIM_CLEADER_ABOVE_EXT_ELBOW—
Specifies that the dimension text is placed above the extended elbow of the
center leader.
• DimCenterLeaderType.DIM_PARALLEL_ABOVE—Specifies that the
dimension text is placed parallel to and above the center leader.
• DimCenterLeaderType.DIM_PARALLEL_BELOW—Specifies that the
dimension text is placed parallel to and below the center leader.
The method
wfcDimension.CenterLeaderInformation.GetElbowLength and
wfcDimension.CenterLeaderInformation.GetElbowDirection
return the length and direction of the elbow used by the center leader and the
leader end symbol.
The method
wfcDimension.CenterLeaderInformation.GetLeaderArrowType
returns the type of arrow for the leader.

Note
A center leader type is available only for linear and diameter dimensions.

The methods
wfcDimension.DimLocation.GetFirstZExtensionLineLocation
and

448 Creo Object TOOLKIT JavaUser’s Guide


wfcDimension.DimLocation.GetSecondZExtensionLineLoca
tion obtains the endpoints of the first and second Z-extension lines created for a
specified dimension. Z-extension lines are automatically created whenever the
dimension’s attachment does not intersect its reference in the Z-Direction. The Z-
extension line is attached at the edge of the surface at the closest distance from the
dimension witness line.
The methods
wfcDimension.DimLocation.GetFirstArrowheadLocation and
wfcDimension.DimLocation.GetSecondArrowheadLocation
returns the location of the first and second arrow heads for a dimension.
The method wfcDimension.DimLocation.GetElbowLength returns the
length of the elbow for a dimension.
The methods
wfcDimension.DimLocation.GetFirstWitnessLineLocation and
wfcDimension.DimLocation.GetSecondWitnessLineLocation
gets the location of the first and second witness line end points for a dimension.
The method wfcDimension.DimLocation.GetLocation returns the
location of the elements that make up a solid dimension or reference dimension.
The method wfcDimension.DimLocation.HasElbow specifies if a
dimension has an elbow. The method returns the following values:
• True—If the dimension has an elbow.
• False—If the dimension does not have an elbow.

Dimension Orientation
Methods Introduced:
• wfcDimension.WDimension.SetAnnotationPlane
• wfcDimension.WDimension.GetAnnotationPlane
The method wfcDimension.WDimension.SetAnnotationPlane
assigns an annotation plane as the orientation of a specified dimension stored in an
annotation element.
The method wfcDimension.WDimension.GetAnnotationPlane
obtains the orientation of a specified dimension stored in an annotation element.

Driving Dimension Annotation Elements


You can convert driving dimensions created by features into annotation elements
and place them on annotation planes. However, you can create the driving
dimension annotation elements only in the features that own the dimensions.
These annotation elements cannot have any user defined or system references.
Methods Introduced:

Dimensions and Parameters 449


• wfcDimension.WDimension.CreateAnnotationElement
• wfcDimension.WDimension.DeleteAnnotationElement
The method
wfcDimension.WDimension.CreateAnnotationElement creates an
annotation element for a specified driving dimension based on the specified
annotation orientation.
The method
wfcDimension.WDimension.DeleteAnnotationElement removes
the annotation element containing the driving dimension. It deletes all the
parameters and relations associated with the annotation element.

Accessing Reference and Driven Dimensions


The methods described in this section provide additional access to reference and
driven dimension annotations.
Many methods listed in the previous sections that are applicable for driving
dimensions are also applicable for reference and driven dimensions.
Methods Introduced:
• wfcDimension.WDimension.CanRegenerate
• wfcDimension.WDimension.Delete
• wfcDimension.WDimension.IsDriving
• wfcDimension.WDimension.GetDimensionAttachPoints
• wfcDimension.WDimension.GetDimensionSenses
• wfcDimension.WDimension.GetOrientationHint
• wfcDimension.WDimension.SetDimensionAttachPoints
The method wfcDimension.WDimension.CanRegenerate identifies if a
driven dimension can be regenerated.
The method wfcDimension.WDimension.Delete deletes the driven or
reference dimension. Dimensions stored in annotation elements should be deleted
using wfcSelect.WSelection.DeleteAnnotationElement.
The method wfcDimension.WDimension.IsDriving determines if a
dimension is driving geometry or is driven by it. If a dimension drives geometry,
its value can be modified and the model regenerated with the given change. If a
dimension is driven by geometry, its value is fixed but it can be deleted and
redefined as necessary. A driven dimension may also be included in an annotation
element.
The method
wfcDimension.WDimension.GetDimensionAttachPoints gets the
entities to which a dimension is attached. This method supports dimensions that
are created with intersection type of reference.

450 Creo Object TOOLKIT JavaUser’s Guide


The method wfcDimension.WDimension.GetDimensionSenses gets
information on how dimensions attach to the entity, that is, to what part of the
entity and in what direction the dimension runs. The method returns a
pfcDimension.DimSenses object for the driven or reference dimension.
This method supports dimensions that are created with intersection type of
reference. Refer to the section Creating Drawing Dimensions on page 151for more
information.
The method wfcDimension.WDimension.GetOrientationHint gets
the orientation of the driven or reference dimensions in cases where this cannot be
deduced from the attachments themselves. This method supports dimensions that
are created with intersection type of reference. The orientation of the dimension is
given by the enumerated type pfcDimension.DimOrientationHint. The
valid values are:
• ORIENTATION_HINT_HORIZONTAL—Specifies a horizontal dimension.
• ORIENTATION_HINT_VERTICAL—Specifies a vertical dimension.
• ORIENTATION_HINT_SLANTED—Specifies the shortest distance between
two attachment points (available only when the dimension is attached to
points).
• ORIENTATION_HINT_ELLIPSE_RADIUS1—Specifies the start radius for
a dimension on an ellipse.
• ORIENTATION_HINT_ELLIPSE_RADIUS2—Specifies the end radius for
a dimension on an ellipse.
• ORIENTATION_HINT_ARC_ANGLE—Specifies the angle of the arc for a
dimension of an arc.
• ORIENTATION_HINT_ARC_LENGTH—Specifies the length of the arc for a
dimension of an arc.
• ORIENTATION_HINT_LINE_TO_TANGENT_CURVE_ANGLE—Specifies
the value to dimension the angle between the line and the tangent at a curve
point (the point on the curve must be an endpoint).
• ORIENTATION_HINT_RADIAL_DIFF—Specifies the linear dimension of
the radial distance between two concentric arcs or circles.
The method
wfcDimension.WDimension.SetDimensionAttachPoints sets the
geometric references and parameters of the driven or reference dimension. This
method supports dimensions that are created with intersection type of reference.
The input arguments are:
• DimAttachments—Specifies the points on the model where you want to attach
the dimension.
• DimSenses—Specifies how the dimension attaches to each attachment point of
the model, that is, to what part of the entity.

Dimensions and Parameters 451


• OrientHint—Specifies the orientation of the dimension and has one of the
values given by the enumerated type
pfcDimension.DimOrientationHint.
• AnnotPlane—Specifies the annotation plane for the dimensions.

45 Degree Chamfer Dimensions


You can create 45-degree chamfer dimensions by referencing one of the following
items:
• Edges, including solid or surface edges, silhouette edges, curves, and sketches.
• Surfaces
• Revolve surfaces
The methods described in this section provide access to the display style of 45-
degree chamfer dimensions in a solid. These methods can also be used to access
the display style of the chamfer dimension in a drawing, where the dimension is
created in a solid and is displayed in a drawing. To work with dimensions shown
in a drawing, pass the name of the drawing in the input argument drawing in the
methods.

Note
The default display of a 45-degree chamfer dimension depends upon the
setting of the config.pro option, default_chamfer_text.

Methods Introduced:
• wfcDimension.WDimension.GetChamferLeaderStyle
• wfcDimension.WDimension.SetChamferLeaderStyle
• wfcDimension.WDimension.GetConfiguration
• wfcDimension.WDimension.SetConfiguration
• wfcDimension.WDimension.GetChamferStyle
• wfcDimension.WDimension.SetChamferStyle
The methods wfcDimension.WDimension.GetChamferLeaderStyle
and wfcDimension.WDimension.SetChamferLeaderStyle retrieve
and set the style of the leader for the specified 45-degree chamfer dimension using
the enumerated type wfcDimension.DimChamferLeaderStyle. The valid
values are as follows:

452 Creo Object TOOLKIT JavaUser’s Guide


• DIM_CHMFR_LEADER_STYLE_NORMAL—Defines the leader of the
chamfer dimension normal to the chamfer edge (ASME, ANSI, JIS, ISO
Standard).
• DIM_CHMFR_LEADER_STYLE_DEFAULT—Defines that the chamfer
dimension leader style should be displayed using the default value.
The methods wfcDimension.WDimension.GetConfiguration and
wfcDimension.WDimension.SetConfiguration retrieve and set the
dimension configuration for chamfer dimensions using the enumerated type
wfcDimension.DimLeaderConfig. The dimension configuration defines
the style in which the dimension must be displayed. The valid values are as
follows:
• DIMCONFIG_LEADER—Creates the dimension with a leader.
• DIMCONFIG_LINEAR—Creates a linear dimension.
• DIMCONFIG_CENTER_LEADER—Creates the dimension with the leader
note attached to the center of the dimension leader line.
The methods wfcDimension.WDimension.GetChamferStyle and
wfcDimension.WDimension.SetChamferStyle retrieve and set the
dimension scheme for the specified 45-degree chamfer dimension using the
enumerated type wfcDimension.DimChamferStyle. The valid values are
as follows:
• DIM_CHMFRSTYLE_CD—Specifies that the chamfer dimension text should
be displayed in the C(Dimension value) format (JIS/GB Standard).
• DIM_CHMFRSTYLE_D_X_45—Specifies that the chamfer dimension text
should be displayed in the (Dimension value) X 45° format (ISO/DIN
Standards).
• DIM_CHMFRSTYLE_DEFAULT—Specifies that the chamfer dimension text
should be displayed using the default value set in the drawing detail option
default_chamfer_text.
• DIM_CHMFRSTYLE_45_X_D—Specifies that the chamfer dimension text
should be displayed in the 45° X (Dimension value) format (ASME/ANSI
Standards).

Dimensions and Parameters 453


27
Relations
Accessing Relations ................................................................................................ 455
Accessing Post Regeneration Relations.................................................................... 456
Adding a Customized Function to the Relations Dialog Box ........................................ 456

This chapter describes how to access relations on all models and model items in
Creo application using the methods provided in Creo Object TOOLKIT Java.

454 Creo Object TOOLKIT JavaUser’s Guide


Accessing Relations
In Creo Object TOOLKIT Java, 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 Creo application.
Methods Introduced:
• pfcModelItem.RelationOwner.RegenerateRelations
• pfcModelItem.RelationOwner.DeleteRelations
• pfcModelItem.RelationOwner.GetRelations
• pfcModelItem.RelationOwner.SetRelations
• pfcModelItem.RelationOwner.EvaluateExpression
• wfcModelItem.WRelationOwner.EvaluateExpressionWithUnits
• wfcModelItem.WRelationOwner.UseUnits
• wfcModelItem.WRelationOwner.UnitsUsed
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.DeleteRelations
deletes all the relations assigned to the owner item.
The method pfcModelItem.RelationOwner.GetRelations returns the
list of initial relations assigned to the owner item as a sequence of strings.
The method pfcModelItem.RelationOwner.SetRelations assigns the
sequence of strings as the new relations to the owner item.
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 on page 421 in the chapter Dimensions and Parameters on
page 420 for more information on this object.
The method wfcModelItem.WRelationOwner.EvaluateExpression
has been deprecated. Use the method
wfcModelItem.WRelationOwner.EvaluateExpressionWithUnits
instead.
Use the method
wfcModelItem.WRelationOwner.EvaluateExpressionWithUnits
if you want the units of the relation to be considered while evaluating the
expression. Specify the input argument Consider_units as true to consider
the units. In this case, the result of the relation is returned along with its unit as

Relations 455
ParamValueWithUnits object. Refer to the section The ParamValue Object
on page 421 in the chapter Dimensions and Parameters on page 420 for more
information on this object.
The method wfcModelItem.WRelationOwner.UseUnits specifies if
units must be considered while solving the specified relation. Use the method
wfcModelItem.WRelationOwner.UnitsUsed to check if units will be
considered while solving the relation.

Accessing Post Regeneration Relations


Method Introduced:
• pfcModel.Model.GetPostRegenerationRelations
• pfcModel.Model.RegeneratePostRegenerationRelations
• pfcModel.Model.DeletePostRegenerationRelations
The method pfcModel.Model.GetPostRegenerationRelations lists
the post-regeneration relations assigned to the model. It can be NULL, if not set.

Note
To work with post-regeneration relations, use the post-regeneration relations
attribute in the methods
pfcModelItem.RelationOwner.SetRelations,
pfcModelItem.RelationOwner.RegenerateRelations and
pfcModelItem.RelationOwner.DeleteRelations.

You can regenerate the relation sets post-regeneration in a model using the method
pfcModel.Model.RegeneratePostRegenerationRelations.
To delete all the post-regeneration relations in the specified model, call the method
pfcModel.Model.DeletePostRegenerationRelations.

Adding a Customized Function to the


Relations Dialog Box
Methods Introduced:
• 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

456 Creo Object TOOLKIT JavaUser’s Guide


Creo Parametric. 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:
• Name—The name of the custom function.
• RelationFunctionOptions—This object contains the options that
determine the behavior of the custom relation function. Refer to the section
Relation Function Options on page 457 for more information.
• RelationFunctionListener—This object contains the action listener
methods for the implementation of the custom function. Refer to the section
Relation Function Listeners on page 458 for more information.

Note
Creo Object TOOLKIT Java relation functions are valid only when the custom
function has been registered by the application. If the application is not
running or not present, models that contain user-defined relations cannot
evaluate these relations. In this situation, the relations are marked as errors.
However, these errors can be commented until needed at a later time when the
relations functions are reactivated in a Creo Parametric session.

Relation Function Options


Methods Introduced:
• 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

Relations 457
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:
• ArgumentTypes—The types of arguments in the form of the
pfcRelations.RelationFunctionArgument object. By default, this
parameter is null, indicating that no arguments are permitted.
Use the method
pfcRelations.pfcRelations.RelationFunctionArgument_
Create 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, Creo 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.

Relation Function Listeners


The interface pfcRelations.RelationFunctionListener provides the
method signatures to implement a custom relation function.
Methods Introduced:
• pfcRelations.RelationFunctionListener.CheckArguments
• pfcRelations.RelationFunctionListener.AssignValue
• pfcRelations.RelationFunctionListener.EvaluateFunction

458 Creo Object TOOLKIT JavaUser’s Guide


The method
pfcRelations.RelationFunctionListener.CheckArguments
checks the validity of the arguments passed to the custom function. This listener
method takes the following input arguments:
• The owner of the relation being evaluated
• The custom function name
• A sequence of arguments passed to the custom function
If the implementation of this method determines that the 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 owner of the relation being evaluated
• The custom function name
• A sequence of arguments passed to the custom function
You must return the computed result of the custom relation function.
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:
• The owner of the relation being evaluated
• The custom function name
• A sequence of arguments passed to the custom function
• The value obtained by Creo from evaluating the right hand side of the relation

Relations 459
28
Assemblies and Components
Structure of Assemblies and Assembly Objects ......................................................... 461
Assembling Components ......................................................................................... 467
Redefining and Rerouting Assembly Components ..................................................... 473
Exploded Assemblies .............................................................................................. 474
Skeleton Models...................................................................................................... 477
Flexible Components and Inheritance Features in an Assembly .................................. 478
Variant Items for Flexible Components ...................................................................... 479
Gathering Components by Rule................................................................................ 480

This chapter describes the Creo Object TOOLKIT Java functions that access the
functions of a Creo assembly. You must be familiar with the following before you
read this section:
• The Selection Object
• Coordinate Systems
• The Geometry section

460 Creo Object TOOLKIT JavaUser’s Guide


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.
The solid geometry of an assembly is contained in its components. A component
is a feature of type ComponentFeat.ComponentFeat, which is a reference
to a part or another assembly, and a set of parametric constraints for determining
its geometrical location within the parent assembly.
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.
The important Creo Object TOOLKIT Java functions for assemblies are those that
operate on the components of an assembly. The object ComponentFeat, which
is an instance of Feature is defined for that purpose. Each assembly component
is treated as a variety of feature, and the integer identifier of the component is also
the feature identifier.
An assembly can contain a hierarchy of assemblies and parts at many levels, in
which some assemblies and parts may appear more than once. To identify the role
of any database item in the context of the root assembly, it is not sufficient to have
the integer identifier of the item and the handle to its owning part or assembly, as
would be provided by its Feature description.
It is also necessary to give the full path of the assembly-component references
down from the root assembly to the part or assembly that owns the database item.
This is the purpose of the object ComponentPath, which is used as the input to
Creo Object TOOLKIT Java assembly functions.
The following figure shows an assembly hierarchy with two examples of the
contents of a ComponentPath object.

Assemblies and Components 461


In the assembly shown in the figure, subassembly C is component identifier 11
within assembly A, Part B is component identifier 3 within assembly AB, and so
on. The subassembly AB occurs twice. To refer to the two occurrences of part B,
use the following:
(?)Component B’ Component B"
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
The object ComponentPath is one of the main portions of the Selection
object.

Assembly Components
Methods Introduced:
• pfcComponentFeat.ComponentFeat.GetIsBulkitem
• pfcComponentFeat.ComponentFeat.GetIsSubstitute
• pfcComponentFeat.ComponentFeat.GetCompType
• pfcComponentFeat.ComponentFeat.SetCompType

462 Creo Object TOOLKIT JavaUser’s Guide


• 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
• wfcComponentFeat.WComponentFeat.MakeUniqueSubAssembly
• wfcComponentFeat.WComponentFeat.RemoveUniqueSubAssembly
• wfcComponentFeat.WComponentFeat.IsUnplaced
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.
The method pfcComponentFeat.ComponentFeat.GetModelDescr
returns the model descriptor of the component part or subassembly.

Assemblies and Components 463


Note
From Pro/ENGINEER Wildfire 4.0 onwards, the method
pfcComponentFeat.ComponentFeat.GetModelDescr throws an
exception pfcExceptions.XtoolkitCantOpen if called on an
assembly component whose immediate generic is not in 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.GetImmediateGenericInfo
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.SetIsPlaced
forces the component to be considered placed. The value of this parameter is
important in assembly Bill of Materials.

Note
Once a component is constrained or packaged, it cannot be made unplaced
again.

A component of an assembly that is either partially constrained or unconstrained


is known as a packaged component. Use the method
pfcCompontentFeat.ComponentFeat.GetIsPackaged to determine
if the specified component is packaged.
The method
pfcCompontentFeat.ComponentFeat.GetIsUnderconstrained
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 pfcCompontentFeat.ComponentFeat.GetPosition
retrieves the component’s initial position before constraints and movements have
been applied. If the component is packaged this position is the same as the

464 Creo Object TOOLKIT JavaUser’s Guide


constraint’s actual position. This method modifies the assembly component data
but does not regenerate the assembly component. To regenerate the component,
use the method pfcComponentFeat.ComponentFeat.Regenerate.
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.
The method
wfcComponentFeat.WComponentFeat.MakeUniqueSubAssembly
creates a unique instance of the sub-assembly by specifying the path to the sub-
assembly. Use the method
wfcComponentFeat.WComponentFeat.RemoveUniqueSubAssembly
to remove the instance of the sub-assembly.
Use the method wfcComponentFeat.WComponentFeat.IsUnplaced
checks if the specified component is unplaced. Unplaced components belong to an
assembly without being assembled or packaged. If the method returns true, the
component is unplaced.

Regenerating an Assembly Component


Method Introduced:
• pfcComponentFeat.ComponentFeat.Regenerate
The method pfcComponentFeat.ComponentFeat.Regenerate
regenerates an assembly component. The method regenerates the assembly
component just as in an interactive Creo session.

Creating a Component Path


Methods Introduced
• 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.

Component Path Information


Methods Introduced:

Assemblies and Components 465


• pfcAssembly.ComponentPath.GetRoot
• pfcAssembly.ComponentPath.SetRoot
• pfcAssembly.ComponentPath.GetComponentIds
• pfcAssembly.ComponentPath.SetComponentIds
• pfcAssembly.ComponentPath.GetLeaf
• pfcAssembly.ComponentPath.GetTransform
• pfcAssembly.ComponentPath.SetTransform
• pfcAssembly.ComponentPath.GetIsVisible
• wfcAssembly.SubstituteComponent.GetSubCompPath
• wfcAssembly.SubstituteComponent.GetSubCompFeat
• wfcAssembly.WComponentPath.GetSubstituteComponent
• wfcAssembly.WComponentPath.GetSubstitutionType
The method pfcAssembly.ComponentPath.GetRoot returns the
assembly at the head of the component path object.
The method pfcAssembly.ComponentPath.SetRoot setsthe assembly at
the head of the component path object as the root assembly.
The method pfcAssembly.ComponentPath.GetComponentIds returns
the sequence of ids which is the path to the particular component.
The method pfcAssembly.ComponentPath.SetComponentIds sets the
path from the root assembly to the component through various subassemblies
containing this component.
The method pfcAssembly.ComponentPath.GetLeaf returns the solid
model at the end of the component path.
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.
The method pfcAssembly.ComponentPath.SetTransform applies a
temporary transformation to the assembly component, similar to the
transformation that takes place in an exploded state. The transformation will only
be applied if the assembly is using DynamicPositioning.
The method pfcAssembly.ComponentPath.GetIsVisible identifies if
a particular component is visible in any simplified representation.
The methods wfcAssembly.SubstituteComponent.GetSubCompPath
and wfcAssembly.SubstituteComponent.GetSubCompFeat return
the component path and handle to the component feature of the substituted
component.

466 Creo Object TOOLKIT JavaUser’s Guide


The method
wfcAssembly.WComponentPath.GetSubstituteComponent returns
the component path and handle to the substituted component, when the replacing
component is a simplified representation. The method
wfcAssembly.WComponentPath.GetSubstitutionType returns the
substitution type of the simplified representation using the enumerated type
wfcAssembly.SubstitutionType:
• SUBSTITUTE_NONE—Specifies that no substitution type has been defined.
• SUBSTITUTE_INTERCHG—Specifies that the component is substituted with
an interchange assembly component or a family table.
• SUBSTITUTE_PRT_REP—Specifies that the part is substituted with a
simplified representation.
• SUBSTITUTE_ASM_REP—Specifies that the assembly is substituted with a
simplified representation.
• SUBSTITUTE_ENVELOPE—Specifies that the assembly is substituted with
an envelope.
• SubstitutionType_nil—NULL value.

Displayed Entities
Methods Introduced:
• wfcAssembly.WComponentPath.ListDisplayedPoints
• wfcAssembly.WComponentPath.ListDisplayedCsyses
• wfcAssembly.WComponentPath.ListDisplayedCurves
• wfcAssembly.WComponentPath.ListDisplayedQuilts
The methods in this section return the list of entities, that is, points, coordinate
systems, datum curves, and quilts that are currently displayed in an assembly.

Assembling Components
Methods Introduced:
• pfcAssembly.Assembly.AssembleComponent
• pfcAssembly.Assembly.AssembleByCopy
• pfcComponentFeat.ComponentFeat.GetConstraints
• pfcComponentFeat.ComponentFeat.SetConstraints
• wfcComponentFeat.WComponentFeat.RemoveConstraint
• wfcAssembly.WAssembly.AutoInterchange
• wfcAssembly.WAssembly.CreateAssemblyItem

Assemblies and Components 467


• wfcAssembly.WAssembly.GetConnectors
• wfcAssembly.WAssembly.GetHarnesses
• wfcAssembly.WAssembly.GetLinestocks
• wfcAssembly.LineStock.GetName
• wfcAssembly.LineStock.SetName
• wfcAssembly.WAssembly.GetSpools
• wfcAssembly.Spool.GetName
• wfcAssembly.Spool.SetName
• wfcAssembly.WAssembly.ListDisplayedComponents
• wfcExternalObject.ExternalFeatRefAsmComp.GetPathToOwner
• wfcExternalObject.ExternalFeatRefAsmComp.SetPathToOwner
• wfcExternalObject.ExternalFeatRefAsmComp.GetPathToRef
• wfcExternalObject.ExternalFeatRefAsmComp.SetPathToRef
• wfcExternalObject.WExternalFeatureReference.GetAsmcomponents
• wfcExternalObject.WExternalFeatureReference.GetFeature
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
interfacepfcBase.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 pfcAssembly.Assembly.AssembleByCopy creates a new
component in the specified assembly by copying from the specified component. If
no model is specified, then the new component is created empty. The input
parameters for this method are:
• LeaveUnplaced—If true the component is unplaced. If false the component is
placed at a default location in the assembly. Unplaced components belong to
an assembly without being assembled or packaged. These components appear
in the model tree, but not in the graphic window. Unplaced components can be
constrained or packaged by selecting them from the model tree for
redefinition. When its parent assembly is retrieved into memory, an unplaced
component is also retrieved.
• ModelToCopy—Specify the model to be copied into the assembly
• NewModelName—Specify a name for the copied model
The method pfcComponentFeat.ComponentFeat.GetConstraints
retrieves the constraints for a given assembly component.

468 Creo Object TOOLKIT JavaUser’s Guide


The method pfcComponentFeat.ComponentFeat.SetConstraints
allows you to set the constraints for a specified assembly component. The input
parameters for this method are:
• Constraints—Constraints for the assembly component. These constraints are
explained in detail in the later sections.
• ReferenceAssembly—The path to the owner assembly, if the constraints have
external references to other members of the top level assembly. If the
constraints are applied only to the assembly component then the value of this
parameter should be null.
This method modifies the component feature data but does not regenerate the
assembly component. To regenerate the assembly use the method
pfcSolid.Solid.Regenerate.
The method
wfcComponentFeat.WComponentFeat.RemoveConstraint removes
one or all the constraints for the specified assembly component. It takes the index
of the constraint as its input argument.
The method wfcAssembly.WAssembly.AutoInterchange interchanges
an assembly component with another component that contains equivalent
assembly constraints. The input parameters are:
• ComponentIDs—Specifies the component identifiers of the replaced members
from the assembly nodes.
• ReplacementModel—Specifies the replacing component, which can be a part
or a sub-assembly.
The method wfcAssembly.WAssembly.CreateAssemblyItem creates
an assembly item that defines the flexible components. Refer to the section
Flexible Components and Inheritance Features in an Assembly on page 478 for
more information on flexible items.
The method wfcAssembly.WAssembly.GetConnectors returns the list of
connectors defined for the specified assembly.
The method wfcAssembly.WAssembly.GetHarnesses returns the list of
harnesses defined for the specified assembly.
The method wfcAssembly.WAssembly.GetLinestocks returns the list of
linestocks defined for the specified assembly. Use the methods
wfcAssembly.LineStock.GetName and
wfcAssembly.LineStock.SetName to get and set the name of linestock in
an assembly.
The method wfcAssembly.WAssembly.GetSpools returns the list of
spools defined for the specified assembly. Use the methods
wfcAssembly.Spool.GetName and wfcAssembly.Spool.SetName to
get and set the name of spool in an assembly.

Assemblies and Components 469


Use the method
wfcAssembly.WAssembly.ListDisplayedComponents to retrieve a
list of all the currently displayed components in a solid.
The methods
wfcExternalObject.ExternalFeatRefAsmComp.GetPathToOwner
and
wfcExternalObject.ExternalFeatRefAsmComp.SetPathToOwner
retrieve and set the path from the external specified reference to the component
that owns the specified external reference.
The methods
wfcExternalObject.ExternalFeatRefAsmComp.GetPathToRef
and
wfcExternalObject.ExternalFeatRefAsmComp.SetPathToRef
retrieve and set the path from the external specified reference to the component
from which the external reference was created.
The method
wfcExternalObject.WExternalFeatureReference.GetAsmcompo
nents retrieves from the specified external reference a path to the component
from which the reference was created. It also returns a path to the component that
owns the specified external reference.
The method
wfcExternalObject.WExternalFeatureReference.GetFeature
retrieves from the specified external reference a feature referred to by the external
reference.

Constraint Attributes
Methods Introduced:
• pfcComponentFeat.pfcComponentFeat.ConstraintAttributes_Create
• pfcComponentFeat.ConstraintAttributes.GetForce
• pfcComponentFeat.ConstraintAttributes.SetForce
• pfcComponentFeat.ConstraintAttributes.GetIgnore
• pfcComponentFeat.ConstraintAttributes.SetIgnore
The method
pfcComponentFeat.pfcComponentFeat.ConstraintAttributes_
Create returns the constraint attributes object based on the values of the
following input parameters:

470 Creo Object TOOLKIT JavaUser’s Guide


• Ignore—Constraint is ignored during regeneration. Use this capability to store
extra constraints on the component, which allows you to quickly toggle
between different constraints.
• Force—Constraint has to be forced for line and point alignment.
• None—No constraint attributes. This is the default value.
Use the Get methods to retrieve the values of the input parameters specified
above and the Set methods to modify the values of these input parameters.

Assembling a Component Parametrically


You can position a component relative to its neighbors (components or assembly
features) so that its position is updated as its neighbors move or change. This is
called parametric assembly. The Creo application allows you to specify constraints
to determine how and where the component relates to the assembly. You can add
as many constraints as you need to make sure that the assembly meets the design
intent.
Methods Introduced:
• 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

Assemblies and Components 471


The method
pfcComponentFeat.pfcComponentFeat.ComponentConstraint_
Create returns the component constraint object having the following
parameters:
• ComponentConstraintType—Using the TYPE options, you can specify the
placement constraint types. They are as follows:
○ ASM_CONSTRAINT_MATE—Use this option to make two surfaces touch
one another, that is coincident and facing each other.
○ ASM_CONSTRAINT_MATE_OFF—Use this option to make two planar
surfaces parallel and facing each other.
○ ASM_CONSTRAINT_ALIGN—Use this option to make two planes
coplanar, two axes coaxial and two points coincident. You can also align
revolved surfaces or edges.
○ ASM_CONSTRAINT_ALIGN_OFF—Use this option to align two planar
surfaces at an offset.
○ ASM_CONSTRAINT_INSERT—Use this option to insert a "male"
revolved surface into a ``female'' revolved surface, making their respective
axes coaxial.
○ ASM_CONSTRAINT_ORIENT—Use this option to make two planar
surfaces to be parallel in the same direction.
○ ASM_CONSTRAINT_CSYS—Use this option to place a component in an
assembly by aligning the coordinate system of the component with the
coordinate system of the 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.

472 Creo Object TOOLKIT JavaUser’s Guide


○ 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:
○ 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.
• Offset—The mate or align offset value from the reference.
• Attributes—Constraint attributes for a given constraint
• UserDefinedData—A string that specifies user data for the given constraint.
Use the Get methods to retrieve the values of the input parameters specified
above and the Set methods to modify the values of these input parameters.

Redefining and Rerouting Assembly


Components
These functions enable you to reroute previously assembled components, just as in
an interactive Creo session.
Methods Introduced:
• pfcComponentFeat.ComponentFeat.RedefineThroughUI
• pfcComponentFeat.ComponentFeat.MoveThroughUI
The method
pfcComponentFeat.ComponentFeat.RedefineThroughUI must be
used in interactive Creo Object TOOLKIT Java applications. This method

Assemblies and Components 473


displays the dialog box for constraints. This enables the end user to redefine the
constraints interactively. The control returns to Creo Object TOOLKIT Java
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 Creo Object TOOLKIT Java application when the
user selects OK or Cancel and the dialog box is closed.

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.
The method pfcAssembly.Assembly.GetIsExploded reports whether
the specified assembly is currently exploded. Use this method in the assembly
mode only. The exploded status of an assembly depends on the mode. If an
assembly is opened in the drawing mode, the state of the assembly in the drawing
view is displayed. The drawing view does not represent the actual exploded state
of the assembly.
The method pfcAssembly.Assembly.GetActiveExplodedState
returns the current active explode state.
The method pfcAssembly.Assembly.GetDefaultExplodedState
returns the default explode state.
The method pfcAssembly.ExplodedState.Activate activates the
specified explode state representation.

Accessing Exploded States


Methods Introduced:

474 Creo Object TOOLKIT JavaUser’s Guide


• wfcAssembly.WAssembly.GetExplodeStateFromName
• wfcAssembly.WAssembly.GetExplodeStateFromId
• wfcAssembly.WAssembly.SelectExplodedState
• wfcAssembly.WExplodedState.GetExplodedStateName
• wfcAssembly.WExplodedState.SetExplodedStateName
• wfcAssembly.WExplodedState.GetExplodedcomponents
• wfcAssembly.WExplodedState.GetExplodedStateMoves
• wfcAssembly.WExplodedState.SetExplodedStateMoves
• wfcAssembly.wfcAssembly.ExplodedAnimationMoveInstruction_Create
• wfcAssembly.ExplodedAnimationMoveInstruction.GetCompSet
• wfcAssembly.ExplodedAnimationMoveInstruction.SetCompSet
• wfcAssembly.ExplodedAnimationMoveInstruction.GetMove
• wfcAssembly.ExplodedAnimationMoveInstruction.SetMove
• wfcAssembly.wfcAssembly.ExplodedAnimationMove_Create
• wfcAssembly.ExplodedAnimationMove.GetMoveType
• wfcAssembly.ExplodedAnimationMove.SetMoveType
• wfcAssembly.ExplodedAnimationMove.GetStartPoint
• wfcAssembly.ExplodedAnimationMove.SetStartPoint
• wfcAssembly.ExplodedAnimationMove.GetDirVector
• wfcAssembly.ExplodedAnimationMove.SetDirVector
• wfcAssembly.ExplodedAnimationMove.GetValue
• wfcAssembly.ExplodedAnimationMove.SetValue
The methods wfcAssembly.WAssembly.GetExplodeStateFromName
and wfcAssembly.WAssembly.GetExplodeStateFromId return the
exploded state representation of a solid with the specified name and ID
respectively.
The method wfcAssembly.WAssembly.SelectExplodedState enables
you to select a specific exploded state from the list of defined exploded states.
The method
wfcAssembly.WExplodedState.GetExplodedStateName returns the
name of the exploded state. Use the method
wfcAssembly.WExplodedState.SetExplodedStateName to set the
name of the exploded state.
The method
wfcAssembly.WExplodedState.GetExplodedcomponents returns an
array of assembly component paths that are included in the exploded state.

Assemblies and Components 475


The method
wfcAssembly.WExplodedState.GetExplodedStateMoves retrieves
an array of moves for the specified exploded state. The sequence of moves defines
the exploded position of an assembly component or a set of assembly components.
For example, you can move an assembly component over the X-axis, rotate it over
a selected edge, and then move over the Y-axis. The final position of the assembly
component is attained by performing these three moves. Use the method
wfcAssembly.WExplodedState.SetExplodedStateMoves to set the
array of moves of an exploded state.
The method
wfcAssembly.wfcAssembly.ExplodedAnimationMoveInstruc
tion_Create creates a
wfcAssembly.ExplodedAnimationMoveInstruction that contains
information about the moves of an exploded state.
The methods
wfcAssembly.ExplodedAnimationMoveInstruction.GetCompSet
returns an array that contains the full path to the assembly component. Use the
method
wfcAssembly.ExplodedAnimationMoveInstruction.SetCompSet
to set an array of paths to the assembly components.
The methods
wfcAssembly.ExplodedAnimationMoveInstruction.GetMove and
wfcAssembly.ExplodedAnimationMoveInstruction.SetMove
retrieve and set the move of the exploded state as a
ExplodedAnimationMove object.
The method wfcAssembly.wfcAssembly.ExplodedAnimationMove_
Create creates the wfcAssembly.ExplodedAnimationMove data object.
The method wfcAssembly.ExplodedAnimationMove.GetMoveType
returns the type of move for the exploded state. The move can have one of the
following values:
• EXPLDANIM_MOVE_TRANSLATE
• EXPLDANIM_MOVE_ROTATE
Use the method
wfcAssembly.ExplodedAnimationMove.SetMoveType to set the
move type using the enumerated type
wfcAssembly.ExplodedAnimationMoveType.
The methods
wfcAssembly.ExplodedAnimationMove.GetStartPoint and
wfcAssembly.ExplodedAnimationMove.SetStartPoint get and set
the start location of the transitional direction or the rotational axis, depending
upon the selected move type.

476 Creo Object TOOLKIT JavaUser’s Guide


The methods wfcAssembly.ExplodedAnimationMove.GetDirVector
and wfcAssembly.ExplodedAnimationMove.SetDirVector get and
set the direction vector for the transitional direction or the rotational axis,
depending upon the selected move type.
Depending upon the selected move type, the methods
wfcAssembly.ExplodedAnimationMove.GetValue and
wfcAssembly.ExplodedAnimationMove.SetValue get and set the
translational distance or the rotation angle.

Manipulating Exploded States


Methods Introduced:
• wfcAssembly.WAssembly.CreateExplodedState
• wfcAssembly.WAssembly.DeleteExplodedState
The method wfcAssembly.WAssembly.CreateExplodedState creates
a new exploded state based on the values of the following input arguments:
• name—Specifies the name of the exploded state. This argument cannot be
NULL.
• AnimMoveInstructions—Specifies an array of
ExplodedAnimationMoveInstruction objects.
Use the method wfcAssembly.WAssembly.DeleteExplodedState to
delete a specified exploded state.

Skeleton Models
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.
The method pfcAssembly.Assembly.GetSkeleton returns the skeleton
model of the specified assembly.

Assemblies and Components 477


The method pfcAssembly.Assembly.DeleteSkeleton deletes a
skeleton model component from the specified assembly.
The method pfcAssembly.Assembly.AssembleSkeletonByCopy adds
a specified skeleton model to the assembly. The input parameters for this method
are:
• SkeletonToCopy—Specify the skeleton model to be copied into the assembly
• NewSkeletonName—Specify a name for the copied skeleton model
The method pfcSolid.Solid.GetIsSkeleton determines if the specified
part model is a skeleton model or a concept model. It returns a true if the model is
a skeleton else it returns a false.

Flexible Components and Inheritance


Features in an Assembly
A flexible component allows variance of items such as features, dimensions,
annotations, and parameters of a model in the context of an assembly. The
methods in this section describe the properties for the flexible component.
An Inheritance feature allows one-way associative propagation of geometry and
feature data from a reference part to target part within an assembly. The reference
part is the original part and the target part contains the inheritance features.
Inheritance features are always created by referencing existing parts. An
inheritance feature begins with all of its geometry and data identical to the
reference part from which it is derived.
Use inheritance features or flexible components to create variations of a model in
an assembly. This section refers collectively to inheritance features and flexible
components as "variant features".
Methods Introduced:
• wfcComponentFeat.WComponentFeat.CreateFlexibleModel
• wfcComponentFeat.WComponentFeat.
CreatePredefinedFlexibilityComponent
• wfcComponentFeat.WComponentFeat.IsFlexible
• wfcComponentFeat.WComponentFeat.SetAsFlexible
• wfcComponentFeat.WComponentFeat.UnsetAsFlexible
The method
wfcComponentFeat.WComponentFeat.CreateFlexibleModel
creates a flexible model from the specified flexible model component.

478 Creo Object TOOLKIT JavaUser’s Guide


The method
wfcComponentFeat.WComponentFeat.CreatePredefinedFlexi
bility
Component converts the specified assembly component to a flexible component.
It uses the variant items with predefined flexibility to create the flexible
component.
Use the method wfcComponentFeat.WComponentFeat.IsFlexible to
identify if the specified assembly component is a flexible component. If the
method returns true, the component is a flexible component.
The method wfcComponentFeat.WComponentFeat.SetAsFlexible
converts a specified assembly component to a flexible component by using the
variant items specified in the input argument.
The method
wfcComponentFeat.WComponentFeat.UnsetAsFlexible converts a
flexible component to a regular component.

Variant Feature Model


Method Introduced:
• wfcModel.WModel.IsVariantFeatModel
The method wfcModel.WModel.IsVariantFeatModel returns a boolean
to identify if a model pointer is from an inheritance feature or a flexible
component. The method returns true, if the model pointer is from an inheritance
feature, else it returns false.

Variant Items for Flexible Components


Varied items define component flexibility. You define components, dimensions,
features, parameters, references, gtols, and so on in the original part. The methods
described in this section enable you to assign values to the varied items to define
component flexibility in the assembly
Methods Introduced:
• wfcComponentFeat.wfcComponentFeat.AssemblyItemInstructions_
Create
• wfcComponentFeat.AssemblyItemInstructions.GetItemOwner
• wfcComponentFeat.AssemblyItemInstructions.SetItemOwner
• wfcComponentFeat.AssemblyItemInstructions.GetItemCompPath
• wfcComponentFeat.AssemblyItemInstructions.SetItemCompPath
• wfcComponentFeat.AssemblyItemInstructions.GetItemId

Assemblies and Components 479


• wfcComponentFeat.AssemblyItemInstructions.SetItemId
• wfcComponentFeat.AssemblyItemInstructions.GetItemType
• wfcComponentFeat.AssemblyItemInstructions.SetItemType
The method
wfcComponentFeat.wfcComponentFeat.AssemblyItemInstruc
tions_Create creates a new instance of the object
wfcAssemblyItemInstruction that contains the instructions to define a
variant item for a flexible component. Specify the model owner, item type, and
item ID as input arguments of this method.
The method
wfcComponentFeat.AssemblyItemInstructions.GetItemOwner
gets the name of the model owner for the specified variant item.
The method
wfcComponentFeat.AssemblyItemInstructions.GetItemComp
Path gets the component path for the variant item. Use the method
wfcComponentFeat.AssemblyItemInstructions.SetItemComp
Path to set the component path for the variant item.
The methods
wfcComponentFeat.AssemblyItemInstructions.GetItemId and
wfcComponentFeat.AssemblyItemInstructions.SetItemId get
and set the identifier for the variant item.
The methods
wfcComponentFeat.AssemblyItemInstructions.GetItemType
and
wfcComponentFeat.AssemblyItemInstructions.SetItemType
get and set the type of variant item using the enumerated type
pfcModelItem.ModelItemType.

Gathering Components by Rule


Creo application provides tools to search for components within large assemblies.
This section describes how to access some of the functionality through Creo
application.
You can specify different types of rules and use them to generate a list of
components for which the rule applies. The components can be gathered using the
following rules:
• By model name
• By parameters, using an expression
• By location with a zone
• By distance from a point

480 Creo Object TOOLKIT JavaUser’s Guide


• By size
• By an existing simplified representation
Method Introduced:
• wfcAssembly.AssemblyRule.GetRuleType
Use the method wfcAssembly.AssemblyRule.GetRuleType to get the
type of rule that was used to search for the component. The types of rules are:
• RULE_NONESpecifies that no rule has been set.
• RULE_NAME—Specifies the rule to search components by model name.
• RULE_EXPR—Specifies the rule to search components by parameters, using
an expression.
• RULE_ZONE—Specifies the rule to search components by location with a
zone.
• RULE_DIST—Specifies the rule to search components by distance from a
point.
• RULE_SIZE—Specifies the rule to search components by size.
• RULE_SIMP_REP—Specifies the rule to search components by an existing
simplified representation.

Gathering Components by Model Name


Methods Introduced:
• wfcAssembly.wfcAssembly.AssemblyNameRule_Create
• wfcAssembly.AssemblyNameRule.SetNameMask
• wfcAssembly.AssemblyNameRule.GetNameMask
The class wfcAssembly.AssemblyNameRule specifies the rule to gather
components by model name. This class is an interface that can be used to define
the name rule and contains the methods described below:

Assemblies and Components 481


Use the method wfcAssembly.wfcAssembly.AssemblyNameRule_
Create o create a rule to search for components by name. Specify the search
string as the input parameter NameMask for this method. Use wildcards to
improve the search results.
• Use the method wfcAssembly.AssemblyNameRule.SetNameMask to
set the search string for the name rule.
• Use the method wfcAssembly.AssemblyNameRule.GetNameMask to
get the search string used in the name rule.

Note
The attribute 'NameMask' can be a wildcard character that is, you can specify
wildcard characters for object names, their extensions, and directory names.
For more information, refer to the online Help.

Gathering Components by Size


Methods Introduced:
• wfcAssembly.wfcAssembly.AssemblySizeRule_Create
• wfcAssembly.AssemblySizeRule.SetAbsolute
• wfcAssembly.AssemblySizeRule.GetAbsolute
• wfcAssembly.AssemblySizeRule.SetGreaterThan
• wfcAssembly.AssemblySizeRule.GetGreaterThan
• wfcAssembly.AssemblySizeRule.SetIncludeDatums
• wfcAssembly.AssemblySizeRule.GetIncludeDatums
• wfcAssembly.AssemblySizeRule.SetValue
• wfcAssembly.AssemblySizeRule.GetValue
The class wfcAssembly.AssemblySizeRule is an interface that can be
used to define the rule to gather components by their size.
Use the method wfcAssembly.wfcAssembly.AssemblySizeRule_
Create to create a rule to search for components by size. The input parameters
of this method are as follows:
• Absolute—If set to true, compares the absolute size of the model with
respect to the assembly, else compares the relative size of the model with
respect to the assembly.
• GreaterThan—If set to true, searches for components that are larger than the
specified size, else searches for components that are smaller.

482 Creo Object TOOLKIT JavaUser’s Guide


• IncludeDatums—If set to true, gather the model volume using the bounding
box, else use the regeneration outline to gather the model volume.
• Value—Specifies the actual size against which the size of the model will be
compared.
Use the methods wfcAssembly.AssemblySizeRule.SetAbsolute and
wfcAssembly.AssemblySizeRule.GetAbsoluteto set and get the
absolute or relative size of the model respectively. Set the value of the input
parameter to true, to compare the absolute size of the model with the size of the
top-level assembly. Specify false, to compare the relative size of the model with
respect to the assembly. For the relative size, specify a value in the range of 0.0 to
1.0. The method compares the component size to that of the top-level assembly
and uses this ratio to determine whether the component should be gathered.
Use the methods wfcAssembly.AssemblySizeRule.SetGreaterThan
and wfcAssembly.AssemblySizeRule.GetGreaterThan to set and get
the absolute or relative size of the model respectively. To search for components
greater than the specified size, set the parameter GreaterThan to true. If you set
the parameter to false, the method gathers the components that are smaller than
the specified size.
Use the methods
wfcAssembly.AssemblySizeRule.SetIncludeDatums and
wfcAssembly.AssemblySizeRule.GetIncludeDatums to set and get
the model size using the bounding box or regeneration outline. Specify the value
true to use bounding box, or false for regeneration outline.
Use the methods wfcAssembly.AssemblySizeRule.SetValue and
wfcAssembly.AssemblySizeRule.GetValueto set the get the size
against which the specified model will be compared. The valid range for this
parameter is from 0.0 to 1.0 only if the Absolute attribute is set to false.

Gathering Components by Simplified


Representation
Methods Introduced:
• wfcAssembly.wfcAssembly.AssemblySimpRepRule_Create
• wfcAssembly.AssemblySimpRepRule.GetRuleSimpRep
• wfcAssembly.AssemblySimpRepRule.SetRuleSimpRep
The class wfcAssembly.AssemblySimpRepRule specifies the rule to
gather components that belong to the specified simplified representation. This
class is an interface that can be used to define the simplified representation rule
and contains the methods described below:
Use the method wfcAssembly.wfcAssembly.AssemblySimpRepRule_
Create to create a rule to search for components by simplified representation.

Assemblies and Components 483


Use the methods
wfcAssembly.AssemblySimpRepRule.GetRuleSimpRep and
wfcAssembly.AssemblySimpRepRule.SetRuleSimpRep to get and
set the simplified representation to be used for the rule.

Gathering Components by Parameters


Methods Introduced:
• wfcAssembly.wfcAssembly.AssemblyExpressionRule_Create
• wfcAssembly.AssemblyExpressionRule.GetExpressions
• wfcAssembly.AssemblyExpressionRule.SetExpressions
The class wfcAssembly.AssemblyExpressionRule specifies the rule to
gather components by parameter. This class is an interface that can be used to
define the parameter rule and contains the methods described below:
Use the method
wfcAssembly.wfcAssembly.AssemblyExpressionRule_Create to
create a rule to search for components by parameter expressions. The parameter of
this method is given below:
• Expressions—Specifies the expression created using the parameters and
logical operators.
Use the methods
wfcAssembly.AssemblyExpressionRule.GetExpressions and
wfcAssembly.AssemblyExpressionRule.SetExpressions to get
and set the parameter expressions. You can specify an expression in the relations
format to search for components of a particular parameter value. For example,
consider the following expression:
type == "electrical" | cost <= 10
When you supply this expression to the rule, it searches for components that have
a “cost” parameter of less than or equal to 10, or for components whose type
parameter is set to “electrical.”

Gathering Components by Zone


Methods Introduced:
• wfcAssembly.wfcAssembly.AssemblyZoneRule_Create
• wfcAssembly.AssemblyZoneRule.GetZoneFeature
• wfcAssembly.AssemblyZoneRule.SetZoneFeature
The class wfcAssembly.AssemblyZoneRule specifies the rule to gather
components by the specified zone feature. This class is an interface that can be
used to define the zone rule and contains the methods described below:

484 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcAssembly.wfcAssembly.AssemblyZoneRule_
Create to create a rule to search for components by the zone feature. The
parameter of this method is given below:
• ZoneFeature—Gathers all the components that belong to the specified
zone feature.
Use the methods wfcAssembly.AssemblyZoneRule.GetZoneFeature
and wfcAssembly.AssemblyZoneRule.SetZoneFeature to get and set
the zone feature. When you create a zone, the method creates a zone feature in the
top-level assembly.

Gathering Components by Distance from a Point


Methods Introduced:
• wfcAssembly.wfcAssembly.AssemblyDistanceRule_Create
• wfcAssembly.AssemblyDistanceRule.GetCenter
• wfcAssembly.AssemblyDistanceRule.SetCenter
• wfcAssembly.AssemblyDistanceRule.GetDistance
• wfcAssembly.AssemblyDistanceRule.SetDistance
• wfcAssembly.AssemblyDistanceRule.GetIncludeDatums
• wfcAssembly.AssemblyDistanceRule.SetIncludeDatums
The class wfcAssembly.AssemblyDistanceRule specifies the rule to
gather components within specified distance from a point. This class is an
interface that can be used to define the distance rule and contains the methods
described below:
Use the method
wfcAssembly.wfcAssembly.AssemblyDistanceRule_Create to
create a rule to search for components within specified distance. The parameters
of this method are given below:
• Center—Specifies the centre point of the specified region.
• Distance—Specifies the distance from center point.
• IncludeDatums—Specifies the type of datum to be included.
Use the methods wfcAssembly.AssemblyDistanceRule.GetCenter
and wfcAssembly.AssemblyDistanceRule.SetCenter to get and set
the center point from which the distance is measured.
Use the method wfcAssembly.AssemblyDistanceRule.GetDistance
to get the distance against which the components will be gathered. The method
wfcAssembly.AssemblyDistanceRule.SetDistance sets the
distance from the centre point of the model.

Assemblies and Components 485


Use the methods
wfcAssembly.AssemblyDistanceRule.GetIncludeDatums and
wfcAssembly.AssemblyDistanceRule.SetIncludeDatums to set
and get the model size respectively. If set to true, gather the model volume using
the bounding box, else use the regeneration outline to gather the model volume.

486 Creo Object TOOLKIT JavaUser’s Guide


29
Family Tables
Working with Family Tables ...................................................................................... 488
Creating Family Table Instances ............................................................................... 490
Creating Family Table Columns ................................................................................ 491
Operations on Family Table Instances....................................................................... 491
Family Table Utilities ................................................................................................ 492

This chapter describes how to use Creo Object TOOLKIT Java classes and
methods to access and manipulate family table information.

487
Working with Family Tables
Creo Object TOOLKIT Java provides several methods for accessing family table
information. Because every model inherits from the
interfacepfcFamily.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.
From Pro/ENGINEER Wildfire 4.0 onwards, the behavior of the method
pfcFamily.FamilyMember.GetParent has changed as a result of
performance improvement in family table retrieval mechanism. When you now
call the method pfcFamily.FamilyMember.GetParent, it throws an
exception pfcExceptions.XToolkitCantOpen, if the immediate generic
of a model instance in a nested family table is currently not in session. Handle this
exception and use the method
pfcFamily.FamilyMember.GetImmediateGenericInfo to get the
model descriptor of the immediate generic model. This information can be used to
retrieve the immediate generic model.
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.

488 Creo Object TOOLKIT JavaUser’s Guide


Similarly, the method pfcFamily.FamilyTableRow.CreateInstance
returns an instance model created from the information stored in the
FamilyTableRow object.
The method pfcFamily.FamilyMember.ListRows returns a sequence of
all rows in the family table, whereas pfcFamily.FamilyMember.GetRow
gets the row object with the name you specify.
Use the method pfcFamily.FamilyMember.RemoveRow to permanently
delete the row from the family table.
The method pfcFamily.FamilyTableRow.GetInstanceName returns
the name that corresponds to the invoking row object.
To control whether the instance can be changed or removed, call the methods
pfcFamily.FamilyTableRow.GetIsLockedand
pfcFamily.FamilyTableRow.SetIsLocked.

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.
The method pfcFamily.FamilyMember.GetColumn returns a family table
column, given its symbolic name.
To permanently delete the column from the family table and all changed values in
all instances, call the method pfcFamily.FamilyMember.RemoveColumn.
The method pfcFamily.FamilyTableColumn.GetSymbol returns the
string symbol at the top of the column, such as D4 or F5.
The method pfcFamily.FamilyTableColumn.GetType returns an
enumerated value indicating the type of parameter governed by the column in the
family table.

Family Tables 489


The method pfcFamily.FamColModelItem.GetRefItem returns the
ModelItem (Feature or Dimension) controlled by the column, whereas
pfcFamily.FamColParam.GetRefParam returns the Parameter
controlled by the column.

Accessing Cell Information


Methods Introduced:
• 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 method pfcFamily.FamilyMember.SetCell assigns a value to a
column in a particular family table instance.
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.

Creating Family Table Instances


Methods Introduced:
• pfcFamily.FamilyMember.AddRow
• pfcModelItem.pfcModelItem.CreateStringParamValue
• pfcModelItem.pfcModelItem.CreateIntParamValue
• pfcModelItem.pfcModelItem.CreateDoubleParamValue
• pfcModelItem.pfcModelItem.CreateBoolParamValue

490 Creo Object TOOLKIT JavaUser’s Guide


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.

Creating Family Table Columns


Methods Introduced:
• 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.
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 method pfcFamily.FamilyMember.AddColumn adds the column to
the family table. You can specify the values; if you pass nothing for the values, the
method assigns the value * to each instance to accept the column’s default value.

Operations on Family Table Instances


Methods Introduced:
• wfcFamily.WFamilyTableRow.GetModelFromDisk
• wfcFamily.WFamilyTableRow.GetModelFromSession
• wfcFamily.WFamilyTableRow.IsFlatState
• wfcFamily.WFamilyTableRow.IsModifiable
• wfcFamily.WFamilyMember.SelectRows

Family Tables 491


Use the method wfcFamily.WFamilyTableRow.GetModelFromDisk to
retrieve an instance of a model from the disk as an object of the class
wfcModel.WModel.
Use the method
wfcFamily.WFamilyTableRow.GetModelFromSession o retrieve the
handle to the instance model for the given instance if the model is in session..
Use the method wfcFamily.WFamilyTableRow.IsFlatState to identify
if the family table instance, that is, a completely unbent instance of a sheet metal
part. This method returns the value true if the family table instance is a flat state
instance.
Use the method wfcFamily.WFamilyTableRow.IsModifiable to check
if the given instance of a family table can be modified. This method returns the
value true if the instance is modifiable.The input parameter for this method is:
• ShowUI—Specifies whether the Conflicts dialog box should be shown to
resolve the conflicts, if detected. Pass the value true to show the dialog box.
Use the method wfcFamily.WFamilyMember.SelectRows to select one
or more instances from the specified family table. The input parameter for this
method is:
• AllowMultiSelect—Specify the value true to enable the selection of
more than one instance in the family table.

Family Table Utilities


Methods Introduced:
• wfcFamily.WFamilyMember.EditFamilyTable
• wfcFamily.WFamilyMember.EraseFamilyTable
• wfcFamily.WFamilyMember.GetFamilyTableStatus
• wfcFamily.WFamilyMember.IsModifiable
• wfcFamily.WFamilyMember.ShowFamilyTable
Use the method wfcFamily.WFamilyMember.EditFamilyTable to edit
the specified family table using the Pro/TABLE or another text editor.
Use the method wfcFamily.WFamilyMember.EraseFamilyTable to
erase the specified family table.
Use the method wfcFamily.WFamilyMember.GetFamilyTableStatus
to determine the validity status of the family table.

492 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcFamily.WFamilyMember.IsModifiable to check
whether the specified family table can be modified. This method returns the value
true if the family table is modifiable. The input parameter for this method is:
• ShowUI—Specifies whether the Conflicts dialog box should be shown to
resolve the conflicts, if detected. Pass the value true to show the dialog box.
Use the method wfcFamily.WFamilyMember.ShowFamilyTable to
display the family table using Pro/TABLE or another text editor.

Family Tables 493


30
Action Listeners
Creo Object TOOLKIT Java Action Listeners ............................................................. 495
Creating an ActionListener Implementation ............................................................... 495
Action Sources........................................................................................................ 496
Types of Action Listeners ......................................................................................... 497
Cancelling an ActionListener Operation..................................................................... 505

This chapter describes the Creo Object TOOLKIT Java methods that enable you
to use action listeners.

494 Creo Object TOOLKIT JavaUser’s Guide


Creo Object TOOLKIT Java Action
Listeners
An ActionListener in Java is a class that is assigned to respond to certain
events. In Creo Object TOOLKIT Java, 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 Creo Object TOOLKIT Java are defined by these classes:
• Interface—Named <Object>ActionListener. This interface defines the
methods that can respond to various events.
• Default class—Named Default<Object>ActionListener. This class has every
available method overridden by an empty implementation. You create your
own action listeners by extending the default class and overriding the methods
for events that interest you.

Note
When notifications are set in Creo Object TOOLKIT Java applications, every
time an event is triggered, notification messages are added to the trail files.
From Creo Parametric 2.0 M210 onward, a new environment variable
PROTK_LOG_DISABLE enables you to disable this behavior. When set to
true, the notifications messages are not added to the trail files.

Creating an ActionListener
Implementation
You can create a proper ActionListener class using either of the following
methods:
Define a separate class within the java file.
Example:
public class MyApp {
session.AddActionListener (new SolidAL1());
}

Action Listeners 495


class SolidAL1 extends DefaultSolidActionListener {
// Include overridden methods here
}
To use your action listener in different Java applications, define it in a separate
file.
Example:
MyApp.java:
import solidAL1;

public class MyApp {


session.AddActionListener (new SolidAL1());
}

SolidAL1.java:
public class SolidAL1 extends DefaultSolidActionListener {
// Include overridden methods here.
}

Action Sources
Methods introduced:
• pfcBase.ActionSource.AddActionListener
• pfcBase.ActionSource.RemoveActionListener
Many Creo Object TOOLKIT Java 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)

496 Creo Object TOOLKIT JavaUser’s Guide


○ Solid Action Listener
○ Feature Action Listener
• 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.

Types of Action Listeners


The following sections describe the different kinds of action listeners: session, UI
command, solid, and feature.

Dimension Level Action Listeners


Methods Introduced:
• wfcDimension.DimensionActionListener.
OnBeforeDimensionValueModify
The method
wfcDimension.DimensionActionListener.OnBeforeDimension
ValueModify is called before the dimension value is modified.

Session Level Action Listeners


Methods introduced:
• pfcSession.SessionActionListener.OnAfterDirectoryChange
• pfcSession.SessionActionListener.OnAfterWindowChange
• pfcSession.SessionActionListener.OnAfterModelDisplay
• pfcSession.SessionActionListener.OnBeforeModelErase
• pfcSession.SessionActionListener.OnBeforeModelDelete
• pfcSession.SessionActionListener.OnBeforeModelRename
• pfcSession.SessionActionListener.OnBeforeModelSave
• pfcSession.SessionActionListener.OnBeforeModelPurge

Action Listeners 497


• 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.
The pfcSession.SessionActionListener.OnAfterModelDisplay
method activates every time a model is displayed in a window.

Note
Model display events happen when windows are moved, opened and closed,
repainted, or the model is regenerated. The event can occur more than once in
succession.

The methods
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 Creo Parametric. The model names placed in the descriptors
will be used by Creo Parametric as the default names in the user interface.

UI Command Action Listeners


Methods introduced:
• 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 Creo Parametric menu. The
pfcCommand.UICommandActionListener.OnCommand method of the
registered UICommandActionListener is called whenever the command
button is clicked.

498 Creo Object TOOLKIT JavaUser’s Guide


Model Level Action listeners
Methods introduced:
• pfcModel.ModelActionListener.OnAfterModelSave
• pfcModel.ModelEventActionListener.OnAfterModelCopy
• pfcModel.ModelEventActionListener.OnAfterModelRename
• pfcModel.ModelEventActionListener.OnAfterModelErase
• pfcModel.ModelEventActionListener.OnAfterModelDelete
• pfcModel.ModelActionListener.OnAfterModelRetrieve
• pfcModel.ModelActionListener.OnBeforeModelDisplay
• pfcModel.ModelActionListener.OnAfterModelCreate
• pfcModel.ModelActionListener.OnAfterModelSaveAll
• pfcModel.ModelEventActionListener.OnAfterModelCopyAll
• pfcModel.ModelActionListener.OnAfterModelEraseAll
• pfcModel.ModelActionListener.OnAfterModelDeleteAll
• wfcSession.WSession.AddBeforeModelRetrieveListener
• wfcSession.BeforeModelRetrieveActionListener.OnBeforeModelRetrieve
• wfcSession.wfcSession.BeforeModelRetrieveInstructions_Create
• wfcSession.BeforeModelRetrieveInstructions.GetRetrieveOptions
• wfcSession.BeforeModelRetrieveInstructions.SetRetrieveOptions
• wfcSession.BeforeModelRetrieveInstructions.GetModelFilePath
• wfcSession.BeforeModelRetrieveInstructions.SetModelFilePath
• wfcSession.BeforeModelSaveAllListener.OnBeforeModelSave
• wfcSession.BeforeModelRetrieveListener.OnBeforeModelRetrieve
• wfcModel.ModelParamActionListener.OnBeforeParameterCreate
• wfcModel.ModelParamActionListener.OnBeforeParameterModify
• wfcModel.ModelParamActionListener.OnAfterParameterModify
• wfcModel.ModelParamActionListener.OnAfterParameterDelete
• wfcModel.ModelAfterRenameAllActionListener.
OnAfterModelRenameAll
• wfcModel.ModelReplaceActionListener.OnAfterModelReplace
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.

Action Listeners 499


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.

Note
The method
pfcModel.ModelActionListener.OnBeforeModelDisplay is
not supported in asynchronous mode.

The method
pfcModel.ModelActionListener.OnAfterModelCreate is called
after the successful creation of a model.
The method
wfcSession.WSession.AddBeforeModelRetrieveListener
supersedes the method
wfcSession.WSession.AddModelRetrievePreListener. The
method creates a listener. This listener blocks the standard Creo File Open dialog
box.
The method
wfcSession.WSession.AddModelRetrievePreListener creates a
listener. This listener blocks the standard Creo File Open dialog box.

500 Creo Object TOOLKIT JavaUser’s Guide


The method
wfcSession.BeforeModelRetrieveActionListener.OnBeforeMo
delRetrieve supersedes the method
wfcSession.BeforeModelRetrieveListener.OnBeforeModelRe
trieve. The method
wfcSession.BeforeModelRetrieveActionListener.OnBeforeMo
delRetrieve is called when you activate the File ▶ Open menu. This method
contains its own code for handling the File open event. You must replace the
standard File Open dialog box with the dialog box created by your application to
open files. The method also retrieves the model specified in the object
wfcSession.BeforeModelRetrieveInstructions. Use the method
wfcSession.wfcSession.BeforeModelRetrieveInstructions_
Create to create an instance of
wfcSession.BeforeModelRetrieveInstructions object, which
specifies the instructions for retrieving the model. The method
wfcSession.BeforeModelRetrieveInstructions.SetRetrie
veOptions uses the enumerated data type
wfcSession.WModelRetrieveOption to specify how the model must be
retrieved. Use the method
wfcSession.BeforeModelRetrieveInstructions.GetRetrie
veOptions to get the type of option used to retrieve the model. The model can
be retrieved using the following options:
• MODEL_RETRIEVE_NORMAL—Retrieves the models normally.
• MODEL_RETRIEVE_SIMP_REP—Retrieves the models as a simplified
representation.
• MODEL_RETRIEVE_VIEW_ONLY—Used for drawings only. Retrieves the
model in view only mode.
Use the methods
wfcSession.BeforeModelRetrieveInstructions.GetModelFile
Path and
wfcSession.BeforeModelRetrieveInstructions.SetModelFile
Path to get and set the file path of the model that must be retrieved. The file path
includes the path, file name, extension, and version of the model.
The method
wfcSession.BeforeModelSaveAllListener.OnBeforeModelSave
is called before a model has been saved. This method provides more functionality
than the existing method
pfcSession.SessionActionListener.OnBeforeModelSave. The
method
wfcSession.BeforeModelSaveAllListener.OnBeforeModelSave
is called on the current model and also its dependents. For example, before saving
an assembly, the method is called on the assembly and also on all the assembly

Action Listeners 501


components. It is also called for various user actions such as, saving a copy of the
model, checkin of a model, and so on. During conflict resolution, the method may
be called more than once.
The methods in interface
com.ptc.wfc.wfcModelParamActionListener are triggered whenever
these events occur for any parameter in the model.
The method
wfcModel.ModelParamActionListener.OnBeforeParameter
Create is called before a parameter is created.
The method
wfcModel.ModelParamActionListener.OnBeforeParameterModi
fy is called before the parameter is modified.
The method
wfcModel.ModelParamActionListener.OnAfterParameterModi
fy is called after the parameter has been successfully modified.
The method
wfcModel.ModelParamActionListener.OnAfterParameterDe
lete is called after the parameter has been deleted.
The method
wfcModel.ModelAfterRenameAllActionListener.OnAfterModel
RenameAll is called after all the models described using the
pfcModel.ModelDescriptor object have been renamed.
The method
wfcModel.ModelReplaceActionListener.OnAfterModelReplace
is called after successfully replacing a model.

Solid Level Action Listeners


Methods introduced:
• 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

502 Creo Object TOOLKIT JavaUser’s Guide


listener is assigned. These methods take the first feature to be regenerated and a
handle to the Solid object as arguments. In addition, the method
pfcSolid.SolidActionListener.OnAfterRegenerate includes a
Boolean argument that indicates whether regeneration was successful.

Note
• It is not recommended to modify geometry or dimensions using the
pfcSolid.SolidActionListener.OnBeforeRegenerate method
call.
• A regeneration that did not take place because nothing was modified is
identified as a regeneration failure.

The pfcSolid.SolidActionListener.OnBeforeUnitConvert and


pfcSolid.SolidActionListener.OnAfterUnitConvert methods
activate when a user modifies the unit scheme (by selecting the Creo Parametric
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.

Note
SolidActionListeners can be registered with the session object so that
its methods are called when these events occur for any solid model that is in
session.

The pfcSolid.SolidActionListener.OnBeforeFeatureCreate
method activates when the user starts to create a feature that requires the Feature
Creation dialog box. Because this event occurs only after the dialog box is
displayed, it will not occur at all for datums and other features that do not use this
dialog box. This method takes two arguments: the solid model that will contain
the feature and the ModelItem identifier.
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 503


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
• wfcFeature.FeatureParamActionListener.OnBeforeParameterCreate
• wfcFeature.FeatureParamActionListener.OnBeforeParameterModify
• wfcFeature.FeatureParamActionListener.OnAfterParameterModify
• wfcFeature.FeatureParamActionListener.OnAfterParameterDelete
Each method in FeatureActionListener takes as an argument the feature
that triggered the event.
FeatureActionListeners can be registered with the object so that the
action listener’s methods are called whenever these events occur for any feature
that is in session or with a solid model to react to changes only in that model.
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.

504 Creo Object TOOLKIT JavaUser’s Guide


The method
pfcFeature.FeatureActionListener.OnBeforeRedefine is called
before a feature is redefined.
The method pfcFeature.FeatureActionListener.OnAfterCopy is
called after a feature has been successfully copied.
The method
pfcFeature.FeatureActionListener.OnBeforeParameterDe
lete is called before a feature parameter is deleted.
The methods in com.pfc.wfc.wfcFeatureParamActionListener are
triggered whenever these events occur for any parameter in the feature.
The method
wfcFeature.FeatureParamActionListener.OnBeforeParameter
Create is called before a parameter is created.
The method
wfcFeature.FeatureParamActionListener.OnBeforeParameter
Modify is called before the parameter is modified.
The method
wfcFeature.FeatureParamActionListener.OnAfterParameter
Modify is called after the parameter has been successfully modified.
The method
wfcFeature.FeatureParamActionListener.OnAfterParameter
Delete is called after the parameter has been deleted.

Cancelling an ActionListener Operation


Creo Object TOOLKIT Java allows you to cancel certain notification events,
registered by the action listeners.
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 Creo Parametric
operation. This method will throw a Creo Object TOOLKIT Java exception
signalling to Creo Parametric to cancel the listener event.
Note: Your application should not catch the Creo Object TOOLKIT Java
exception, or should rethrow it if caught, so that Creo Parametric is forced to
handle it.
The following events can be cancelled using this technique:
• pfcSession.SessionActionListener.OnBeforeModelErase
• pfcSession.SessionActionListener.OnBeforeModelDelete

Action Listeners 505


• 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
• pfcFeature.FeatureActionListener.OnBeforeParameterDe
lete
• pfcFeature.FeatureActionListener.OnBeforeParameter
Create
• pfcFeature.FeatureActionListener.OnBeforeRedefine

506 Creo Object TOOLKIT JavaUser’s Guide


31
Interface
Exporting Files and 2D Models ................................................................................. 508
Exporting to PDF and U3D ....................................................................................... 517
Exporting 3D Geometry ........................................................................................... 524
Shrinkwrap Export ................................................................................................... 526
Importing Files ........................................................................................................ 533
Importing 3D Geometry............................................................................................ 535
Printing Files ........................................................................................................... 549
Automatic Printing of 3D Models............................................................................... 557
Solid Operations...................................................................................................... 561
Window Operations ................................................................................................. 564

This chapter describes various methods of importing and exporting files in Creo
Object TOOLKIT Java.

507
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 Creo working directory. The input
parameters are:
• filename—Output file name including extensions
• exportdata—The pfcModel.ExportInstructions object that controls
the export operation. The type of data that is exported is given by the
pfcModel.ExportType object.
There are four general categories of files to which you can export models:
• File types whose instructions inherit from
pfcModel.GeomExportInstructions.
These instructions export files that contain precise geometric information used
by other CAD systems.
• File types whose instructions inherit from
pfcModel.CoordSysExportInstructions.
These instructions export files that contain coordinate information describing
faceted, solid models (without datums and surfaces).
• File types whose instructions inherit from
pfcModel.FeatIdExportInstructions.
These instructions export information about a specific feature.
• General file types that inherit only from
pfcModel.ExportInstructions.
These instructions provide conversions to file types such as BOM (bill of
materials).
For information on exporting to a specific format, see the Creo Object TOOLKIT
Java APIWizard and the Creo online help.

Export Instructions
Methods Introduced:
• pfcModel.pfcModel.RelationExportInstructions_Create
• pfcModel.pfcModel.ModelInfoExportInstructions_Create
• pfcModel.pfcModel.ProgramExportInstructions_Create
• pfcModel.pfcModel.IGESFileExportInstructions_Create

508 Creo Object TOOLKIT JavaUser’s Guide


• 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
• pfcModel.pfcModel.SliceExportData_Create
• pfcExport.pfcExport.NEUTRALFileExportInstructions_Create
• pfcExport.pfcExport.ProductViewExportInstructions_Create
• pfcSession.BaseSession.ExportDirectVRML

Export Instructions Table


Interface Used to Export
RelationExportInstructions A list of the relations and parameters in a part or
assembly
ModelInfoExportInstructions Information about a model, including units
information, features, and children
ProgramExportInstructions A program file for a part or assembly that can be
edited to change the model
IGESExportInstructions A drawing in IGES format
DXFExportInstructions A drawing in DXF format
RenderExportInstructions A part or assembly in RENDER format

Interface 509
Interface Used to Export
STLASCIIExportInstructions A part or assembly to an ASCII STL file
STLBinaryExportInstructions A part or assembly in a binary STL file
BOMExportInstructions A BOM for an assembly
DWGSetupExportInstructions A drawing setup file
FeatInfoExportInstructions Information about one feature in a part or assembly
MfgFeatCLExportInstructions A cutter location (CL) file for one NC sequence in a
manufacturing assembly
MfgOperClExportInstructions A cutter location (CL) file for all the NC sequences
in a manufacturing assembly
MaterialExportInstructions A material from a part
CGMFILEExportInstructions A drawing in CGM format
InventorExportInstructions A part or assembly in Inventor format
FIATExportInstructions A part or assembly in FIAT format
ConnectorParamExportInstructions The parameters of a connector to a text file
CableParamsFileInstructions Cable parameters from an assembly
CATIAFacetsExportInstructions A part or assembly in CATIA format (as a faceted
model)
VRMLModelExportInstructions A part or assembly in VRML format
STEP2DExportInstructions A two-dimensional STEP format file
MedusaExportInstructions A drawing in MEDUSA file
CADDSExportInstructions A CADDS5 solid model
NEUTRALFileExportInstructions A Creo part to neutral format
ProductViewExportInstructions A part, assembly, or drawing in Creo View format
Export.SliceExportData A slice export format

Note
The New Instruction Classes replace the following Deprecated Classes:

Deprecated Classes New Instruction Classes


STEPExportInstructions STEP3DExportInstructions
VDAExportInstructions VDA3DExportInstructions
IGES3DExportInstructions IGES3DNewExportInstructions

Exporting Drawing Sheets


Methods Introduced:
• pfcModel.DXFExportInstructions.GetOptionValue
• pfcModel.DXFExportInstructions.SetOptionValue
• pfcModel.pfcModel.Export2DOption_Create

510 Creo Object TOOLKIT JavaUser’s Guide


• pfcModel.Export2DOption.SetExportSheetOption
• pfcModel.Export2DOption.SetModelSpaceSheet
• pfcModel.Export2DOption.SetSheets
When you export a drawing to DXF format, use the methods
pfcModel.DXFExportInstructions.GetOptionValue and
pfcModel.DXFExportInstructions.SetOptionValue to get and set
the options that are required to export multiple sheets.
The options required to export multiple sheets of a drawing are given by the
pfcModel.Export2DOption object.
The method pfcModel.pfcModel.Export2DOptions_Create creates a
new instance of the pfcModel.Export2DOption object. This object contains
the following options:
• ExportSheetOption—Specifies the option for exporting multiple drawing
sheets. Use the method
pfcModel.Export2DOption.SetExportSheetOption to set the
option for exporting multiple drawing sheets. The options are given by the
pfcModel.Export2DSheetOption class and can be of the following
types:
○ EXPORT_CURRENT_TO_MODEL_SPACE—Exports only the drawing’s
current sheet as model space to a single file. This is the default type.
○ 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.

Interface 511
Exporting to Faceted Formats
The methods described in this section support the export of Creo drawings and
solid models to faceted formats like CATIA CGR.
Methods Introduced:
• pfcExport.TriangulationInstructions.GetAngleControl
• pfcExport.TriangulationInstructions.SetAngleControl
• pfcExport.TriangulationInstructions.GetChordHeight
• pfcExport.TriangulationInstructions.SetChordHeight
• pfcExport.TriangulationInstructions.GetStepSize
• pfcExport.TriangulationInstructions.SetStepSize
• pfcExport.TriangulationInstructions.GetFacetControlOptions
• pfcExport.TriangulationInstructions.SetFacetControlOptions
The methods
pfcExport.TriangulationInstructions.GetAngleControl and
pfcExport.TriangulationInstructions.SetAngleControl gets
and sets the angle control for the exported facet drawings and models. You can set
the value between 0.0 to 1.0.
Use the methods
pfcExport.TriangulationInstructions.GetChordHeight and
pfcExport.TriangulationInstructions.SetChordHeight to get
and set the chord height for the exported facet drawings and models.
The methods
pfcExport.TriangulationInstructions.GetStepSize and
pfcExport.TriangulationInstructions.SetStepSize allow you
to control the step size for the exported files. The default value is 0.0.

Note
You must pass the value of Step Size value as NULL, if you specify the
Quality value.

512 Creo Object TOOLKIT JavaUser’s Guide


The methods
pfcModel.CoordSysExportInstructions.GetStepSize and
pfcModel.CoordSysExportInstructions.SetStepSize control the
step size for the exported files. The default value is 0.0.

Note
You must pass the value of Step Size value as NULL, if you specify the
Quality value.

The methods
pfcExport.TriangulationInstructions.GetFacetControlOp
tions and
pfcExport.TriangulationInstructions.SetFacetControlOp
tions control the facet export options using bit flags. You can set the bit flags
using the pfcModel.FacetControlFlag object. It has the following values:
• FACET_STEP_SIZE_ADJUST—Adjusts the step size according to the
component size.
• FACET_CHORD_HEIGHT_ADJUST—Adjusts the chord height according to
the component size.
• FACET_USE_CONFIG—If this flag is set, values of the flags FACET_
STEP_SIZE_OFF, FACET_STEP_SIZE_ADJUST, and FACET_CHORD_
HEIGHT_ADJUST are ignored and the configuration settings from the Creo
user interface are used during the export operation.
• FACET_CHORD_HEIGHT_DEFAULT—Uses the default value set in the Creo
user interface for the chord height.
• FACET_ANGLE_CONTROL_DEFAULT—Uses the default value set in the
Creo user interface for the angle control.
• FACET_STEP_SIZE_DEFAULT—Uses the default value set in the Creo
user interface for the step size.
• FACET_STEP_SIZE_OFF—Switches off the step size control.
• FACET_FORCE_INTO_RANGE—Forces the out-of-range parameters into
range. If any of the FACET_*_DEFAULT option is set, then the option
FACET_FORCE_INTO_RANGE is not applied on that parameter.

Interface 513
• FACET_STEP_SIZE_FACET_INCLUDE_QUILTS—Includes quilts in the
export of Creo model to the specified format.
• EXPORT_INCLUDE_ANNOTATIONS—Includes annotations in the export of
Creo model to the specified format.

Note
To include annotations, during the export of Creo model, you must call the
method pfcModel.Model.Display before calling
pfcModel.Model.Export.

Exporting Using Coordinate System


The methods described in this section support the export of files with information
about the faceted solid models (without datums and surfaces). The files are
exported in reference to the coordinate-system feature in the model being
exported.
Methods Introduced:
• pfcModel.CoordSysExportInstructions.GetCsysName
• pfcModel.CoordSysExportInstructions.SetCsysName
• pfcModel.CoordSysExportInstructions.GetQuality
• pfcModel.CoordSysExportInstructions.SetQuality
• pfcModel.CoordSysExportInstructions.GetMaxChordHeight
• pfcModel.CoordSysExportInstructions.SetMaxChordHeight
• pfcModel.CoordSysExportInstructions.GetAngleControl
• pfcModel.CoordSysExportInstructions.SetAngleControl
• pfcModel.CoordSysExportInstructions.GetSliceExportData
• pfcModel.CoordSysExportInstructions.SetSliceExportData
• pfcModel.CoordSysExportInstructions.GetStepSize
• pfcModel.CoordSysExportInstructions.SetStepSize
• pfcModel.CoordSysExportInstructions.GetFacetControlOptions
• pfcModel.CoordSysExportInstructions.SetFacetControlOptions
The method
pfcModel.CoordSysExportInstructions.GetCsysName returns the
name of the the name of a coordinate system feature in the model being exported.
It is recommended to use the coordinate system that places the part or assembly in
its upper-right quadrant, so that all position and distance values of the exported

514 Creo Object TOOLKIT JavaUser’s Guide


assembly or part are positive. The method
pfcModel.CoordSysExportInstructions.SetCsysName allows you
to set the coordinate system feature name.
The methods pfcModel.CoordSysExportInstructions.GetQuality
and pfcModel.CoordSysExportInstructions.SetQuality can be
used instead of
pfcModel.CoordSysExportInstructions.GetMaxChordHeight
and
pfcModel.CoordSysExportInstructions.GetMaxChordHeight
and pfcModel.CoordSysExportInstructions.GetAngleControl
and pfcModel.CoordSysExportInstructions.SetAngleControl.
You can set the value between 1 and 10. The higher the value you pass, the lower
is the Maximum Chord Height setting and higher is the Angle Control setting the
method uses. The default Quality value is 1.0.

Note
You must pass the value of Quality as NULL, if you use Maximum Chord
Height and Angle Control values. If Quality, Maximum Chord Height, and
Angle Control are all NULL, then the Quality setting of 3 is used.

Use the methods


pfcModel.CoordSysExportInstructions.GetMaxChordHeight
and
pfcModel.CoordSysExportInstructions.SetMaxChordHeight to
work with the maximum chord height for the exported files. The default value is
0.1.

Note
You must pass the value of Maximum Chord Height as NULL, if you specify
the Quality value.

Interface 515
The methods
pfcModel.CoordSysExportInstructions.GetAngleControl and
pfcModel.CoordSysExportInstructions.SetAngleControl allow
you to work with the angle control setting for the exported files. The default value
is 0.1.

Note
You must pass the value of Angle Control value as NULL, if you specify the
Quality value.

The methods
pfcModel.CoordSysExportInstructions.GetSliceExportData
and
pfcModel.CoordSysExportInstructions.SetSliceExportData
get and set the pfcModel.SliceExportData data object that specifies data
for the slice export. The options in this object are described as follows:
• CompIds—Specifies the sequence of integers that identify the components that
form the path from the root assembly down to the component part or assembly
being referred to. Use the methods
pfcModel.SliceExportData.GetCompIds and
pfcModel.SliceExportData.SetCompIds to work with the
component IDs.
The methods
pfcModel.CoordSysExportInstructions.GetStepSize and
pfcModel.CoordSysExportInstructions.SetStepSize control the
step size for the exported files. The default value is 0.0.

Note
You must pass the value of Step Size value as NULL, if you specify the
Quality value.

The methods
pfcModel.CoordSysExportInstructions.GetFacetControlOp
tions and
pfcModel.CoordSysExportInstructions.SetFacetControlOp
tions control the facet export options using bit flags. You can set the bit flags
using the pfcModel.FacetControlFlag object. For more information on
the bit flag values, please refer to the section Exporting to Faceted Formats on
page 512.

516 Creo Object TOOLKIT JavaUser’s Guide


Exporting to PDF and U3D
The methods described in this section support the export of Creo drawings and
solid models to Portable Document Format (PDF) and U3D format. You
can export a drawing or a 2D model as a 2D raster image embedded in a PDF file.
You can export Creo solid models in the following ways:
• As a U3D model embedded in a one-page PDF file
• As 2D raster images embedded in the pages of a PDF file representing saved
views
• As a standalone U3D file
While exporting multiple sheets of a Creo drawing to a PDF file, you can choose
to export all sheets, the current sheet, or selected sheets.
These methods also allow you to insert a variety of non-geometric information to
improve document content, navigation, and search.
Methods Introduced:
• pfcExport.pfcExport.PDFExportInstructions_Create
• pfcExport.PDFExportInstructions.GetFilePath
• pfcExport.PDFExportInstructions.SetFilePath
• pfcExport.PDFExportInstructions.GetOptions
• pfcExport.PDFExportInstructions.SetOptions
• pfcExport.PDFExportInstructions.GetProfilePath
• pfcExport.PDFExportInstructions.SetProfilePath
• pfcExport.pfcExport.PDFOption_Create
• pfcExport.PDFOption.SetOptionType
• pfcExport.PDFOption.SetOptionValue
The method pfcExport.pfcExport.PDFExportInstructions_
Create creates a new instance of the
pfcExport.PDFExportInstructions data object that describes how to
export Creo drawings or solid models to the PDF and U3D formats. The options in
this object are described as follows:
• FilePath—Specifies the name of the output file. Use the method
pfcExport.PDFExportInstructions.SetFilePath to set the
name of the output file.
• Options—Specifies a collection of PDF export options of the type
pfcExport.PDFOption.Createa new instance of this object using the
method pfcExport.pfcExport.PDFOption_Create. This object
contains the following attributes:

Interface 517
○ OptionType—Specifies the type of option in terms of the
pfcExport.PDFOptionType class. Set this option using the method
pfcExport.PDFOption.SetOptionType.
○ OptionValue—Specifies the value of the option in terms of the
pfcArgument.ArgValue object. Set this option using the method
pfcExport.PDFOption.SetOptionValue.
Use the method
pfcExport.PDFExportInstructions.SetOptions to set the
collection of PDF export options.
• ProfilePath—Specifies the export profile path. Use the method
pfcExport.PDFExportInstructions.SetProfilePath to set the
profile path. When you set the profile path, the PDF export options set in the
data object pfcExport.PDFExportInstructions data object are
ignored when the method pfcModel.Model.Export is called. You can
set the profile path as NULL.

Note
You can specify the profile path only for drawings.

The types of options (given by the EpfcExport.PDFOptionType class)


available for export to PDF and U3D formats are described as follows:
• PDFOPT_FONT_STROKE—Allows you to switch between using TrueType
fonts or “stroking” text in the resulting document. This option is given by the
pfcExport.PDFFontStrokeMode class and takes the following values:
○ PDF_USE_TRUE_TYPE_FONTS—Specifies TrueType fonts. This is
the default type.
○ 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.

518 Creo Object TOOLKIT JavaUser’s Guide


○ 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:
○ PDF_PARAMS_ALL—Exports the drawing and the model parameters to
PDF. This is the default.
○ PDF_PARAMS_DESIGNATED—Exports only the specified model
parameters in the PDF metadata.
○ PDF_PARAMS_NONE—Exports the drawing to PDF without the model
parameters.
• PDFOPT_HYPERLINKS—Sets hyperlinks to be exported as label text only or
sets the underlying hyperlink URLs as active. The default value is true,
specifying that the hyperlinks are 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.

Interface 519
• 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.
• 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 the 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.

520 Creo Object TOOLKIT JavaUser’s Guide


○ 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 Creo pentable to control
the line weight, line style, and line color of the exported geometry. The default
value is false.
• PDFOPT_LINECAP—Enables you to control the treatment of the ends of the
geometry lines exported to PDF. It is given by the
pfcExport.PDFLinecap class and takes the following values:
○ PDF_LINECAP_BUTT—Specifies the butt cap square end. This is the
default value.
○ PDF_LINECAP_ROUND—Specifies the round cap end.
○ PDF_LINECAP_PROJECTING_SQUARE—Specifies the projecting
square cap end.
• 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 Creo drawing
that are to be exported to PDF. It is given by the
pfcExport.PrintSheets enumerated 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.

Interface 521
• 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.
○ 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 Creo 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.

522 Creo Object TOOLKIT JavaUser’s Guide


○ 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.
• PDFOPT_BACKGROUND_COLOR_RED—Specifies the default red
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_BACKGROUND_COLOR_GREEN—Specifies the default green
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_BACKGROUND_COLOR_BLUE—Specifies the 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.
• PDFOPT_PDF_SAVE—Specifies the PDF save options. It is given by the
pfcExport.PDFSaveMode class and takes the following values:
○ PDF_ARCHIVE_1—Applicable only for the value PDF_2D_DRAWING.
Saves the drawings as PDF with the following conditions:
◆ The value of pfcExport.PDFLayerMode is set to PDF_
LAYERS_NONE.
◆ The value of PDFOPT_HYPERLINKS is set to FALSE.

Interface 523
◆ The shaded views in the drawings will not have transparency and may
overlap other data in the PDF.
◆ The value of PDFOPT_PASSWORD_TO_OPEN is set to NULL.
◆ The value of PDFOPT_MASTER_PASSWORD is set to NULL.
○ PDF_FULL—Saves the PDF with the values set by you. This is the default
value.

Exporting 3D Geometry
Creo Object TOOLKIT Java allows you to export three dimensional geometry to
various formats.

Export Instructions
Methods Introduced:
• pfcModel.Model.ExportIntf3D
• pfcExport.pfcExport.GeometryFlags_Create
• pfcExport.pfcExport.InclusionFlags_Create
• pfcExport.pfcExport.LayerExportOptions_Create
• pfcExport.pfcExport.TriangulationInstructions_Create
From Creo Parametric 5.0 F000 onward, the following interfaces along with their
methods have been deprecated. Use the method
pfcModel.Model.ExportIntf3D instead to export Creo Parametric models
to other file formats. All the options that can be set with these interfaces and
methods, can also be set using the export profile option in Creo Parametric. Refer
to the Creo Parametric Data Exchange Online Help for more information.
• Export3DInstructions
• ACIS3DExportInstructions
• CATIAModel3DExportInstructions
• CATIASession3DExportInstructions
• CatiaPart3DExportInstructions
• CatiaProduct3DExportInstructions
• CatiaCGR3DExportInstructions
• DXF3DExportInstructions
• DWG3DExportInstructions
• IGES3DNewExportInstructions
• JT3DExportInstructions

524 Creo Object TOOLKIT JavaUser’s Guide


• ParaSolid3DExportInstructions
• STEP3DExportInstructions
• SWPart3DExportInstructions
• SWAsm3DExportInstructions
• UG3DExportInstructions
• VDA3DExportInstructions
The method pfcModel.Model.ExportIntf3D exports a Creo Parametric
model to the specified output format using the default export profile. The export
options must be set using the export profile option in Creo Parametric.
The method pfcExport.pfcExport.TriangulationInstructions_
Create creates a object that will be used to define the parameters for faceted
exports.

Export Utilities
Methods Introduced:
• pfcSession.BaseSession.IsConfigurationSupported
• pfcSession.BaseSession.IsGeometryRepSupported
The method
pfcSession.BaseSession.IsConfigurationSupported checks
whether the specified assembly configuration is valid for a particular model and
the specified export format. The input parameters for this method are:
• Configuration—Specifies the structure and content of the output files.
• Type—Specifies the output file type to create.
The method returns a true value if the configuration is supported for the specified
export type.
The method pfcSession.BaseSession.IsGeometryRepSupported
checks whether the specified geometric representation is valid for a particular
export format. The input parameters are :
• Flags—The type of geometry supported by the export operation.
• Type—The output file type to create.
The method returns a true value if the geometry combination is valid for the
specified model and export type.
The methods
pfcSession.BaseSession.IsConfigurationSupported and
pfcSession.BaseSession.IsGeometryRepSupported must be called

Interface 525
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.
Use the methodModel.Model.Export to export the assembly to the specified
output format.

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.
You can create the following types of nonassociative exported shrinkwrap models:
• Surface Subset—This type consists of a subset of the original model’s
surfaces.
• Faceted Solid—This type is a faceted solid representing the original solid.
• Merged Solid—The external components from the reference assembly model
are merged into a single part representing the solid geometry in all collected
components.
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
ShrinkwrapExportInstructions object as an argument.
Use the appropriate interface given in the following table to create the required
type of shrinkwrap. All the interfaces have their own static method to create an
object of the specified type. The object created by these interfaces can be used as
an object of type ShrinkwrapExportInstructions or
ShrinkwrapModelExportInstructions.
Type of Shrinkwrap Model Interface to Use
Surface Subset ShrinkwrapSurfaceSubset
Instructions
Faceted Part ShrinkwrapFacetedPart
Instructions
Faceted VRML ShrinkwrapFacetedVRML
Instructions
Faceted STL ShrinkwrapFacetedSTLInstructions
Merged Solid ShrinkwrapMergedSolidInstructions

526 Creo Object TOOLKIT JavaUser’s Guide


Setting Shrinkwrap Options
The interfaceShrinkwrapModelExportInstructions contains the
general methods available for all the types of shrinkwrap models. The object
created by any of the interfaces specified in the preceeding table can be used with
these methods.
Methods Introduced:
• pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetMethod
• 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.GetMe
thod returns the method used to create the shrinkwrap. The types of shrinkwrap
methods are:

Interface 527
• SWCREATE_SURF_SUBSET—Surface Subset
• SWCREATE_FACETED_SOLID—Faceted Solid
• SWCREATE_MERGED_SOLID—Merged Solid
The method
pfcShrinkwrap.ShrinkwrapModelExportInstructions.GetQual
ity 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.SetQual
ity to set the quality level for the system during the shrinkwrap export. The
default value is 1.
The method
pfcShrinkwrap.ShrinkwrapModelExportInstructions.
GetAutoHoleFilling returns true if auto hole filling is enabled during
Shrinkwrap export. The method
pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetAuto
HoleFilling sets a flag that forces Creo application to identify all holes and
surfaces that intersect a single surface and fills those holes during shrinkwrap. The
default value is true.
The methods
pfcShrinkwrap.ShrinkwrapModelExportInstructions.Get
IgnoreSkeleton and
pfcShrinkwrap.ShrinkwrapModelExportInstructions.Se
tIgnoreSkeleton determine whether the skeleton model geometry must be
included in the shrinkwrap model.
The
methodspfcShrinkwrap.ShrinkwrapModelExportInstructions.
Get
IgnoreQuilts and
pfcShrinkwrap.ShrinkwrapModelExportInstructions.Set
IgnoreQuilts determine whether external quilts must be included in the
shrinkwrap model.
The method
pfcShrinkwrap.ShrinkwrapModelExportInstructions.
GetAssign
MassProperties determines the mass property of the model. The method
pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetAs
sign
MassProperties assign 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.

528 Creo Object TOOLKIT JavaUser’s Guide


The method pfcShrinkwrap.ShrinkwrapModelExport
Instructions.GetIgnoreSmallSurfaces specifies whether small
surfaces are ignored during the creation of a shrinkwrap model. The method
pfcShrinkwrap.ShrinkwrapModelExportInstructions
.SetIgnore
SmallSurfaces sets a flag that forces Creo application to skip surfaces smaller
than a certain size. The default value is false. The size of the surface is specified
as a percentage of the model’s size. This size can be modified using the methods
pfcShrinkwrap.ShrinkwrapModelExportInstructions
.GetSmall
SurfPercentage and
pfcShrinkwrap.ShrinkwrapModelExportInstructions.Set
SmallSurfPercentage.
The method
pfcShrinkwrap.ShrinkwrapModelExportInstructions.Get
DatumReferences and
pfcShrinkwrap.ShrinkwrapModelExportInstructions.SetDa
tum
References specify and select the datum planes, points, curves, axes, and
coordinate system references to be included in the shrinkwrap model.

Surface Subset Options


Methods Introduced:
• pfcShrinkwrap.pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions_
Create
• pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.
GetAdditionalSurfaces
• pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.
SetAdditionalSurfaces
• pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.GetOutputModel
• pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.SetOutputModel
The static method
pfcShrinkwrap.Shrinkwrap.ShrinkwrapSurfaceSubsetInstruc
tions
_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.

Interface 529
GetAdditionalSurfaces specifies the surfaces included in the shrinkwrap
model while the method
pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.
SetAdditionalSurfaces selects individual surfaces to be included in the
shrinkwrap model.
The method
pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.
GetOutputModel returns the template model where the shrinkwrap geometry
is to be created while the method
pfcShrinkwrap.ShrinkwrapSurfaceSubsetInstructions.
SetOutputModel sets the template model.

Faceted Solid Options


The ShrinkwrapFacetedFormatInstructions interface consists of the
following types:
• SWFACETED_PART—Creo part with normal geometry. This is the default
format type.
• SWFACETED_STL—An STL file.
• SWFACETED_VRML—A VRML file.
Use the Create method to create the object of the specified type. Upcast the
object to use the general methods available in this interface.
Methods Introduced:
• pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.GetFormat
• pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.GetFramesFile
• pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.SetFramesFile
The method
pfcShrinkwrap.ShrinkwrapFacetedFormatInstructions.Get
Format returns 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.

Faceted Part Options


Methods Introduced:

530 Creo Object TOOLKIT JavaUser’s Guide


• pfcShrinkwrap.pfcShrinkwrap.ShrinkwrapFacetedPartInstructions_
Create
• pfcShrinkwrap.ShrinkwrapFacetedPartInstructions.GetLightweight
• pfcShrinkwrap.ShrinkwrapFacetedPartInstructions.SetLightweight
The static method
pfcShrinkwrap.Shrinkwrap.ShrinkwrapFacetedPartInstruc
tions_Create returns an object used to create a shrinkwrap model of
shrinkwrap faceted type. The input parameters of this method are:
• OutputModel—Specify the output model where the shrinkwrap must be
created.
• Lightweight—Specify this value as True if the shrinkwrap model is a
Lightweight Creo part.
The method
pfcShrinkwrap.ShrinkwrapFacetedPartInstructions.
GetLightweight returns a true value if the output file format of the
shrinkwrap model is a Lightweight Creo part. The method
pfcShrinkwrap.ShrinkwrapFacetedPartInstructions.
SetLight
weight specifies if the Creo part is exported as a light weight faceted geometry.

VRML 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 VRML
format. Specify the name of the output model as an input to this method.
The method
pfcShrinkwrap.ShrinkwrapVRMLInstructions.GetOutputFile
returns the name of the output file to be created and the method
pfcShrinkwrap.ShrinkwrapVRMLInstructions.SetOutputFile
specifies the name of the output file to be created.

STL Export Options


Methods Introduced:

Interface 531
• 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.

Merged Solid Options


Methods Introduced:
• pfcShrinkwrap.pfcShrinkwrap.ShrinkwrapMergedSolidInstructions_
Create
• pfcShrinkwrap.ShrinkwrapMergedSolidInstructions.
GetAdditionalComponents
• pfcShrinkwrap.ShrinkwrapMergedSolidInstructions.
SetAdditionalComponents
The static method
pfcShrinkwrap.Shrinkwrap.ShrinkwrapMergedSolidInstruc
tions_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.GetAddi
tional
Components specifies individual components of the assembly to be merged into
the shrinkwrap model. Use the method
pfcShrinkwrap.ShrinkwrapMergedSolidInstructions.SetAddi
tional
Components to select individual components of the assembly to be merged into
the shrinkwrap model.

532 Creo Object TOOLKIT JavaUser’s Guide


VRML Representation

Importing Files
Method Introduced:
• pfcModel.Model.Import
The method pfcModel.Model.Import reads a file into Creo. The format
must be the same as it would be if these files were created by Creo application.
The parameters are:
• FilePath—Absolute path of the file to be imported along with its extension.
• ImportData—The ImportInstructions object that controls the import
operation.

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
• pfcModel.pfcModel.CableParamsImportInstructions_Create
• pfcModel.pfcModel.STEPImport2DInstructions_Create
• pfcModel.pfcModel.IGESImport2DInstructions_Create
• pfcModel.pfcModel.DXFImport2DInstructions_Create
• pfcModel.pfcModel.DWGImport2DInstructions_Create
The methods described in this section create an instructions data object to import a
file of a specified type into Creo application. The details are as shown in the table
below:
Interface Used to Import
RelationImportInstructions A list of relations and parameters in a part or
assembly.
IGESSectionImportInstructions A section model in IGES format.

Interface 533
Interface Used to Import
ProgramImportInstructions A program file for a part or assembly that can be
edited to change the model.
ConfigImportInstructions Configuration instructions.
DWGSetupImportInstructions A drawing s/u file.
SpoolImportInstructions Spool instructions.
ConnectorParamsImportInstructions Connector parameter instructions.
ASSEMTreeCFGImportInstructions Assembly tree CFG instructions.
WireListImportInstructions Wirelist instructions.
CableParamsImportInstructions Cable parameters from an assembly.
STEPImport2DInstructions A part or assembly in STEP format.
IGESImport2DInstructions A part or assembly in IGES format.
DXFImport2DInstructions A drawing in DXF format.
DWGImport2DInstructions A drawing in DWG format.

Note
• The method pfcModel.Model.Import does not support importing of
CADAM type of files.
• 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 on page 115.

Importing 2D Models
Method Introduced:
• pfcSession.BaseSession.Import2DModel
The method pfcSession.BaseSession.Import2DModel imports a two
dimensional model based on the following parameters:
• NewModelName—Specifies the name of the new model.
• Type—Specifies the type of the model. The type can be one of the following:
○ STEP
○ IGES
○ DXF
○ DWG
○ SET

534 Creo Object TOOLKIT JavaUser’s Guide


• FilePath—Specifies the location of the file to be imported along with the file
extension
• Instructions—Specifies the pfcImport2DInstructions object that
controls the import operation.
The interface pfcModel.Import2DInstructions contains the
following attributes:
○ Import2DViews—Defines whether to import 2D drawing views.
○ ScaleToFit—If the current model has a different sheet size than that
specified by the imported file, set the parameter to true to retain the current
sheet size. Set the parameter to false to retain the sheet size of the imported
file.
○ FitToLeftCorner—If this parameter is set to true, the bottom left corner of
the imported file is adjusted to the bottom left corner of the current model.
If it is set to false, the size of imported file is retained.

Note
The method pfcSession.BaseSession.Import2DModel does
not support importing of CADAM type of files.

Importing 3D Geometry
Methods Introduced:
• pfcSession.BaseSession.GetImportSourceType
• 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:
• FileToImport—Specifies the path of the file along with its name and
extension.
• NewModelImportType—Specifies the type of model to be imported.
The method pfcSession.BaseSession.ImportNewModel is used to
import an external 3D format file and creates a new model or set of models of type
pfcModel. The input parameters of this method are:

Interface 535
• FileToImport—Specifies the path to the file along with its name and extension
• pfcNewModelImportType—Specifies the type of model to be imported.
The types of models that can be imported are as follows:
○ IMPORT_NEW_IGES
○ IMPORT_NEW_VDA
○ IMPORT_NEW_NEUTRAL
○ IMPORT_NEW_CADDS
○ IMPORT_NEW_STEP
○ IMPORT_NEW_STL
○ IMPORT_NEW_VRML
○ IMPORT_NEW_POLTXT
○ 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_CATIA_PRODUCT
○ IMPORT_NEW_UG
○ IMPORT_NEW_PRODUCTVIEW
○ IMPORT_NEW_CATIA_CGR
○ IMPORT_NEW_JT
○ IMPORT_NEW_SW_PART
○ IMPORT_NEW_SW_ASSEM
○ IMPORT_NEW_INVENTOR_PART
○ IMPORT_NEW_INVENTOR_ASSEM
○ IMPORT_NEW_CC
○ IMPORT_NEW_SEDGE_PART
○ IMPORT_NEW_SEDGE_ASSEMBLY
○ IMPORT_NEW_SEDGE_SHEETMETAL_PART
○ IMPORT_NEW_3MF

536 Creo Object TOOLKIT JavaUser’s Guide


• 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. Creo 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.
The method pfcExceptions.XCancelProEAction.Throw can be called
from the body of the method
pfcImport.LayerImportFilter.OnLayerImport to end the filtering
of the layers.

Modifying the Imported Layers


Layers help you organize model items so that you can perform operations on those
items collectively. These operations primarily include ways of showing the items
in the model, such as displaying or blanking, selecting, and suppressing. The
methods described in this section modify the attributes of the imported layers.
Methods Introduced:
• pfcImport.ImportedLayer.GetName
• pfcImport.ImportedLayer.SetNewName
• pfcImport.ImportedLayer.GetSurfaceCount
• pfcImport.ImportedLayer.GetCurveCount
• pfcImport.ImportedLayer.GetTrimmedSurfaceCount
• pfcImport.ImportedLayer.SetAction
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.GetSurfaceCount returns the
number of curves on the layer.
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 537
The method pfcImport.ImportedLayer.SetAction sets the display of
the imported layers. The input parameter for this method is ImportAction. The
types of actions that can be performed on the imported layers are:
• IMPORT_LAYER_DISPLAY—Displays the imported layer.
• IMPORT_LAYER_SKIP—Does not import entities on this layer.
• IMPORT_LAYER_BLANK—Blanks the selected layer.
• IMPORT_LAYER_IGNORE—Imports only entities on this layer but not the
layer.
The default action type is IMPORT_LAYER_DISPLAY.

Import Feature Properties


The methods defined in this section get the properties of the import feature.
Methods Introduced:
• wfcFeature.WFeature.GetIdMap
• wfcFeature.WFeature.GetUserIds
• wfcFeature.WFeature.GetItemIds
• wfcFeature.ImportFeatureIdMap.GetItemId
• wfcFeature.ImportFeatureIdMap.SetItemId
• wfcFeature.ImportFeatureIdMap.GetItemType
• wfcFeature.ImportFeatureIdMap.SetItemType
• wfcFeature.ImportFeatureIdMap.GetUserId
• wfcFeature.ImportFeatureIdMap.SetUserId
• wfcFeature.WFeature.GetImportFeatureData
• wfcFeature.ImportFeatureData.GetIntfType
• wfcFeature.ImportFeatureData.GetFileName
• wfcFeature.ImportFeatureData.GetCsys
• wfcFeature.ImportFeatureData.GetAttributes
The method wfcFeature.WFeature.GetIdMap returns an array that
contains the mapping between user defined IDs and the IDs assigned by Creo
application to the entity items in the import feature.
The method wfcFeature.WFeature.GetUserIds converts a Creo item ID
to an array of user defined IDs. For example, if the edges defined by you are
created as a single edge by Creo application and are assigned a single item ID.

538 Creo Object TOOLKIT JavaUser’s Guide


When you pass this single item ID assigned by Creo application to the method
wfcFeature.WFeature.GetUserIds, it will return an array of user IDs
against each edge defined. The input parameters are:
• ItemId—Specifies the ID assigned by Creo application for the geometry item.
• ItemType—Specifies the type of geometry item. The following types are
supported:
○ Surface (ITEM_SURFACE)
○ Edge (ITEM_EDGE)
○ Quilt (ITEM_QUILT)
Use the method wfcFeature.WFeature.GetItemIds to get the IDs
assigned by Creo application for the specified user ID. The input parameters are:
• UserId—Specifies the user ID for the geometry item.
• ItemType—Specifies the type of geometry item. The following types are
supported:
○ Surface (ITEM_SURFACE)
○ Edge (ITEM_EDGE)
○ Quilt (ITEM_QUILT)
The methods wfcFeature.ImportFeatureIdMap.GetItemId and
wfcFeature.ImportFeatureIdMap.SetItemId retrieve and set the
item id of an import feature id map.
The methods wfcFeature.ImportFeatureIdMap.GetItemType and
wfcFeature.ImportFeatureIdMap.SetItemType retrieve and set item
type of the import feature id map using the enumerated type
pfcModelItem.ModelItemType.
The methods wfcFeature.ImportFeatureIdMap.GetUserId and
wfcFeature.ImportFeatureIdMap.SetUserId retrieve and set the id
or ids assigned by Creo Parametric.
The method wfcFeature.WFeature.GetImportFeatureData returns
information about the parameters assigned to the specified import feature as a
ImportFeatureData object.
The method wfcFeature.ImportFeatureData.GetIntfType returns
the file format type of the specified import feature.
The method wfcFeature.ImportFeatureData.GetFileName returns
the name of the file from which the import feature was created.
The method wfcFeature.ImportFeatureData.GetCsys returns the
coordinate system with respect to which the import feature is aligned.

Interface 539
The method wfcFeature.ImportFeatureData.GetAttributes
returns the attributes assigned to the import feature as a
wfcImportFeatAttributes object.

Import Feature Attributes


Attributes define the action to be taken when creating the import feature.
Methods Introduced:
• wfcFeature.ImportRedefByFeatAttributes_Create
• wfcFeature.ImportRedefByFeatAttributes.GetImportFeatAttributes
• wfcFeature.ImportRedefByFeatAttributes.SetImportFeatAttributes
• wfcFeature.wfcFeature.ImportFeatAttributes_Create
• wfcFeature.ImportFeatAttributes.MakeSolid
• wfcFeature.ImportFeatAttributes.SetSolid
• wfcFeature.ImportFeatAttributes.IsAdded
• wfcFeature.ImportFeatAttributes.SetAdded
• wfcFeature.ImportFeatAttributes.AreSurfacesJoined
• wfcFeature.ImportFeatAttributes.SetSurfacesJoined
The method wfcFeature.ImportRedefByFeatAttributes_Create
creates a data object that contains information about the an import feature that is
redefined by attributes.
Use the methods
wfcFeature.ImportRedefByFeatAttributes.GetImportFeatAt
tributes and
wfcFeature.ImportRedefByFeatAttributes.SetImportFeatAt
tributes to retrieve and set the import feature attributes using the object
wfcFeature.ImportFeatAttributes.
The method wfcFeature.wfcFeature.ImportFeatAttributes_
Create creates a data object that contains information about the attributes of the
import feature.
The method wfcFeature.ImportFeatAttributes.MakeSolid returns
a boolean value that indicates if the import feature was created as a solid or a
surface type. Use the method

540 Creo Object TOOLKIT JavaUser’s Guide


wfcFeature.ImportFeatAttributes.SetSolid to specify whether the
import feature must be created as a solid or a surface type. You must specify True
to create the import feature as solid and False to create it as a surface.

Note
If the import feature is an open surface, you cannot create the import feature of
solid type even if you set the boolean value to the method
wfcFeature.ImportFeatAttributes.SetSolid to True.

The method wfcFeature.ImportFeatAttributes.IsAdded returns a


boolean value that indicates if the import feature is created as a cut or a protrusion.
You can create the import feature as a cut or protrusion only if the import feature
is of solid type. Use the method
wfcFeature.ImportFeatAttributes.SetAdded to specify if the
import feature must be created as a cut or protrusion. Specify True to create as a
cut and false to create as a protrusion.
The method
wfcFeature.ImportFeatAttributes.AreSurfacesJoined returns
a boolean value that indicates if the import feature is created as a single quilt
(joined surface) or separate surfaces (as it was in the original file). You can create
the import feature as single quilt or separate surfaces only when the import feature
is of surface type. Use the method
wfcFeature.ImportFeatAttributes.SetSurfacesJoined to
specify if the import feature must be created as a single quilt or separate surfaces.
You must specify True to create as single quilt and false to create as separate
surfaces.

Redefining the Import Feature


The methods defined in this section allow you to redefine the import feature.
Methods Introduced:
• wfcFeature.WFeature.RedefineImportFeature
• wfcFeature.ImportFeatureRedefSource.GetRedefOperationType
• wfcSession.WSession.GetImportFeatRedefSourceType
• wfcFeature.ImportRedefByDataSource_Create
• wfcFeature.ImportRedefByDataSource.GetDataSource
• wfcFeature.ImportRedefByDataSource.SetDataSource

Interface 541
The method wfcFeature.WFeature.RedefineImportFeature
redefines the import feature. The input argument Source contains the data about
the source files and operation type to be used for redefinition of import feature as
a ImportFeatureRedefSource object.
Use the method
wfcFeature.ImportFeatureRedefSource.GetRedefOperation
Type to get the operation type for the redefinition of the import feature as an
enumerated data type ImportFeatRedefOperationType. The types of
operation are:
• IMPORT_FEAT_REDEF_CHANGE_ATTR—Specifies if the attributes of the
existing import feature must be changed.
• IMPORT_FEAT_REDEF_SUBSTITUTE—Specifies if the existing import
feature is substituted with a new import feature.
The method
wfcSession.WSession.GetImportFeatRedefSourceType
determines the type of data source that must be passed as input for redefining the
import feature. The type of data source depends on the type of operation. The data
source can be of the following types:
• IMPORT_FEAT_REDEF_DATA_SOURCE_NONE—Specifies that the
existing data source must be reloaded.
• IMPORT_FEAT_REDEF_DATA_SOURCE_ATTR—Specifies that the data
source must contain information about the attributes of the import feature.
• IMPORT_FEAT_REDEF_DATA_SOURCE_NEW—Specifies that the data
source must contain information about the new part model to be imported into
Creo.
Use the method wfcFeature.ImportRedefByDataSource_Create to
create an object whose import feature is redefined by a data source.
The methods
wfcFeature.ImportRedefByDataSource.GetDataSource and
wfcFeature.ImportRedefByDataSource.SetDataSource retrieve
and set the data source with which the import feature is redefined.

Extracting Creo Parametric Geometry as Interface


Data
The methods defined in this section allow you to extract interface data from Creo
geometry. You can use this data to create the import feature.
Methods Introduced:
• wfcPart.WPart.GetInterfaceData
• wfcPart.wfcPart.ConversionOptions_Create

542 Creo Object TOOLKIT JavaUser’s Guide


• wfcPart.ConversionOptions.GetEdgeRepresentation
• wfcPart.ConversionOptions.SetEdgeRepresentation
• wfcPart.wfcPart.EdgeRepresentation_Create
• wfcPart.EdgeRepresentation.GetUVPoints
• wfcPart.EdgeRepresentation.SetUVPoints
• wfcPart.EdgeRepresentation.GetUVCurves
• wfcPart.EdgeRepresentation.SetUVCurves
• wfcPart.EdgeRepresentation.GetXYZCurves
• wfcPart.EdgeRepresentation.SetXYZCurves
• wfcPart.ConversionOptions.GetCurveConversionOption
• wfcPart.ConversionOptions.SetCurveConversionOption
• wfcPart.ConversionOptions.GetSurfaceConversionOption
• wfcPart.ConversionOptions.SetSurfaceConversionOption
• wfcModel.wfcModel.InterfaceData_Create
• wfcModel.InterfaceData.GetSurfaceData
• wfcModel.InterfaceData.SetSurfaceData
• wfcModel.InterfaceData.GetEdgeDescriptor
• wfcModel.InterfaceData.SetEdgeDescriptor
• wfcModel.InterfaceData.GetQuiltData
• wfcModel.InterfaceData.SetQuiltData
• wfcModel.InterfaceData.GetDatumData
• wfcModel.InterfaceData.SetDatumData
• wfcModel.InterfaceData.GetAccuracytype
• wfcModel.InterfaceData.SetAccuracytype
• wfcModel.InterfaceData.GetAccuracy
• wfcModel.InterfaceData.SetAccuracy
• wfcModel.InterfaceData.GetOutline
• wfcModel.InterfaceData.SetOutline
• wfcSession.WSession.GetDataSourceType
The method wfcPart.WPart.GetInterfaceData extracts information
about the geometry of a part as a InterfaceData object. The interface data
can be used to extract all geometric data in order to convert it to another geometric
format. Pass the information about the curves, edges, and surfaces of a part as an
object of type ConversionOptions.

Interface 543
The method wfcPart.wfcPart.ConversionOptions_Create creates a
data object of type ConversionOptions that contains information about the
curves, edges, and surfaces of a part.
The method
wfcPart.ConversionOptions.GetEdgeRepresentation gets the
information about the representation of edges in a part as a
EdgeRepresentation object. Use the method
wfcPart.ConversionOptions.SetEdgeRepresentation to set the
parameters for the representation of edges in a part.
The method wfcPart.wfcPart.EdgeRepresentation_Create creates
a data object that contains information about the representation of edges in a part.
The parameters of this method are:
• UVPoints—Specifies the representation of the edge using UV points. Use the
methods wfcPart.EdgeRepresentation.GetUVPoints and
wfcPart.EdgeRepresentation.SetUVPoints to get and set the
edge UV points on the surface for edge representation.
• UVCurves—Specifies the representation of the edge using UV curves. Use the
methods wfcPart.EdgeRepresentation.GetUVCurves and
wfcPart.EdgeRepresentation.SetUVCurves to get and set the
edge UV curves on the surface for edge representation.
• XYZCurves—Specifies the representation of the edge using XYZ curves. Use
the methods wfcPart.EdgeRepresentation.GetXYZCurves and
wfcPart.EdgeRepresentation.SetXYZCurves to get and set the
XYZ curves on the surface for edge representation.
The method
wfcPart.ConversionOptions.GetCurveConversionOption returns
the conversion option set for curves during the data exchange. Use the method
wfcPart.ConversionOptions.SetCurveConversionOption to set
the curve conversion option.
The method
wfcPart.ConversionOptions.GetSurfaceConversionOption
returns the conversion option set for surfaces during the data exchange. Use the
method
wfcPart.ConversionOptions.SetSurfaceConversionOption to
set the surface conversion option.
The method wfcModel.wfcModel.InterfaceData_Create creates a
data object of type that contains the interface data.
The method wfcModel.InterfaceData.GetSurfaceData returns an
array of surface data for the specified interface data. Use the method
wfcModel.InterfaceData.SetSurfaceData to set the surface data for
a part import.

544 Creo Object TOOLKIT JavaUser’s Guide


The method wfcModel.InterfaceData.GetEdgeDescriptor returns
an array of edge data for the specified interface data. Use the method
wfcModel.InterfaceData.SetEdgeDescriptor to set the edge data
for a part import.
The method wfcModel.InterfaceData.GetQuiltData returns an array
of quilt data for the specified interface data. Use the method
wfcModel.InterfaceData.SetQuiltData to set the quilt data for a part
import.
The method wfcModel.InterfaceData.GetDatumData returns an array
of datum data for the specified interface data. Use the method
wfcModel.InterfaceData.SetDatumData to set the datum data for a
part import.
The method wfcModel.InterfaceData.GetAccuracytype gets the
type of accuracy for the interface data using the enumerated type
wfcModel.Accuracytype. Use the method
wfcModel.InterfaceData.SetAccuracytype to set the type of
accuracy. The valid values are:
• ACCU_RELATIVE—Specifies the comparative ratio of the smallest model
dimension to the part size. Creo application can display geometry equal to or
greater than the ratio without any error. This is the default accuracy type in a
model.
• ACCU_ABSOLUTE—Specifies the absolute accuracy of a model that defines
the smallest allowable size of the unit that Creo application can display or
interpret without any error.
Refer to theCreo Help for more information on accuracy.
The method wfcModel.InterfaceData.GetAccuracy returns the value
of the accuracy for the specified model. Use the method
wfcModel.InterfaceData.SetAccuracy to set the accuracy for the
specified model.
The method wfcModel.InterfaceData.GetOutline returns the
maximum and minimum values of x, y, and z coordinates for the display outline of
the bounding box that contains the interface data. Use the method
wfcModel.InterfaceData.SetOutline to set the display outline for the
bounding box to contain the interface data.
The method wfcSession.WSession.GetDataSourceType returns the
type of the interface source data in session using the enumerated type
wfcSession.IntfDataSourceType. The valid values are:
• INTF_DATA_SOURCE_FILE—Specifies that the data source is from a file.
• INTF_DATA_SOURCE_MEMORY—Specifies that the data source is of neutral
type.

Interface 545
Extracting Interface Data for Neutral Files
The methods defined in this section allow you to extract interface data for neutral
data files. You can use this data to create an import feature.
Methods Introduced:
• wfcModel.wfcModel.WIntfNeutral_Create
• wfcModel.WIntfNeutral.GetInterfaceData
• wfcModel.WIntfNeutral.SetInterfaceData
The method wfcModel.wfcModel.WIntfNeutral_Create creates a data
object of type wfcWIntfNeutral that contains information about the interface
data for the neutral file type. The input parameters for this method are:
• FileName—Specifes the name of the neutral file.
• Data—Specifies the interface data for the specified neutral file as an object of
type wfcInterfaceData. Use the method
wfcModel.WIntfNeutral.SetInterfaceData to set the interface
data for the specified neutral file. The method
wfcModel.WIntfNeutral.GetInterfaceData gets the interface
data for the specified neutral file. Refer to the section Extracting Creo
Parametric Geometry as Interface Data on page 542, for more information on
interface data object InterfaceData.

Associative Topology Bus Enabled Models and


Features
Associative Topology Bus (ATB) propagates changes made to the original CAD
system data in the heterogeneous design environment. All geometric IDs
preserved by the native system after the change to the native file are also
preserved in the imported geometry by the ATB update. With ATB, you can work
withCreo part or assembly that is:
• A Translated Image Model (TIM) representation of a model imported from the
ATB interface, such as, CADDS or CATIA.
• ACreo assembly containing one or more components which are models
imported from an ATB interface, such as, CADDS or CATIA.
• A Creo part containing an Import feature that is imported from an ATB
interface such as, ICEM.
Only import operations in Creo applications create TIM parts and assemblies. You
can open CATIA, CADDS model files as TIMs. Neutral part files and files of
other ATB-enabled formats are imported as native Creo parts with ATB-enabled
features.

546 Creo Object TOOLKIT JavaUser’s Guide


The TIM parts and assemblies store their ATB information at the model level.
However, ATB-enabled import features store ATB information at the feature-level.
The TIMs are displayed in the Model Tree with ATB icons that indicate their
status with respect to their reference file as up-to-date, out-of-date, and so on.
These methods related to ATB models or features enable you to perform the
following actions on a TIM model or ATB-enabled feature or the entire geometry
of the imported model:
• Check the status of the TIMs or the ATB-enabled features.
• Update TIMs or ATB-enabled features that are identified as out-of-date.
• Change the link of a TIM or ATB-enabled feature.
• Break the association between a TIM or the ATB-enabled feature and the
original reference model.
Methods Introduced:
• wfcModel.WModel.GetTIMInfo
• wfcModel.TIMInfo.IsModelTIM
• wfcModel.TIMInfo.ModelHasTIMFeats
• wfcModel.TIMInfo.GetFeatIds
• wfcModel.WModel.VerifyATB
• wfcModel.ATBVerificationResults.GetOutOfDateModels
• wfcModel.ATBVerificationResults.GetUnlinkedModels
• wfcModel.ATBVerificationResults.GetOldVersionModels
• wfcModel.WModel.MarkATBModelAsOutOfDate
• wfcModel.WModel.UpdateATB
• wfcModel.WModel.RelinkATB
The method wfcModel.WModel.GetTIMInfo returns information about
TIM in the specified model as a wfcTIMInfo object.
The method wfcModel.TIMInfo.IsModelTIM checks if the specified
model is a TIM.
The method wfcModel.TIMInfo.ModelHasTIMFeats checks if the
specified model contains a TIM feature.
The method wfcModel.TIMInfo.GetFeatIds lists all the TIMs or ATB-
enabled features present in the specified model. This method can be called after
the method wfcModel.TIMInfo.ModelHasTIMFeats which determines if
the specified model has one or more TIM features.
The method wfcModel.WModel.VerifyATB verifies if the specified ATB
model is out of date with the source CAD model. The method first checks if the
specified model is a TIM. If the model is not a TIM, this method checks if the

Interface 547
ATB-enabled model was created by importing or appending ICEM or neutral
surfaces to existing Creo part models. The method
wfcModel.WModel.VerifyATB returns the
wfcATBVerificationResults object that represents the status of the TIMs.
You can specify a Creo Part or Assembly that is—
• A Translated Image Model (TIM) representation of a model imported from the
ATB interface, such as, CADDS or CATIA.
• A Creo assembly containing one or more components which are models
imported from an ATB Interface, such as, CADDS or CATIA.
• A Creo part containing an Import feature that is imported from an ATB
interface such as, ICEM.
The input arguments for this method are:
• FeatIds—Specify an array of feature ids for the ATB-enabled features in the
model. If a model contains more than one ATB-enabled feature, the verify
method works only on the specified feature. If you do not specify a feature id,
the method wfcModel.WModel.VerifyATB verifies the entire model
including TIMs from non-native CAD models.
• SearchPaths—Specify the complete location to the source CAD model. You
can specify multiple directories to search for the model. If no search path is
specified, then the method will search in current working directory or
locations set in the configuration option atb_search_path.
Use the method
wfcModel.ATBVerificationResults.GetOutOfDateModels to get
an array of TIMs or the ATB-enabled features that are out-of-date with the source
model and require an update. These TIMs or the ATB-enabled features can be
relinked. Such models are represented by a red icon in the Model Tree in the Creo
user interface.
Use the method
wfcModel.ATBVerificationResults.GetUnlinkedModels to get an
array of TIMs or the ATB-enabled features that have missing links because the
reference model is missing from the designated search path. These models are
represented by a yellow icon in the Model Tree in the Creo user interface.
Use the method
wfcModel.ATBVerificationResults.GetOldVersionModels to get
an array of TIMs for which the source CAD model is older than the one with
which the TIM was last updated. These models are represented by a yellow icon
in the Model Tree in the Creo user interface.
The method wfcModel.WModel.MarkATBModelAsOutOfDate identifies
all the ATB-enabled features that are out of date for the update operation.

548 Creo Object TOOLKIT JavaUser’s Guide


The method wfcModel.WModel.UpdateATB updates the ATB-enabled
models or features that are displayed in the session. The update action
synchronizes the derived structure and the contents of the TIMs with the primary
structure and the content of the source non-native CAD models. This method
returns an error if there are non-displayed models in the session or if the input
model is not displayed.

Note
• If the link of a TIM or ATB-enabled feature is broken, you cannot re-
establish the link or update the part that is independent and has lost its
association with the reference model.
• The geometry added or removed from the model before the update is
added or removed from the TIM after the update.
• ATB incorrectly identifies the imported geometry as up-to-date based on
the old reference file which is found before the updated reference file.

The method wfcModel.WModel.RelinkATB relinks a TIM to a source CAD


model specified by the input argument MasterModelPath. This method relinks all
those models or features that have lost their association or link with their master
model. In order to relink a model, provide the name and location of the master
model, using MasterModelPath to which the specified model or feature is to be
linked. If the master model with the same name is found, the Creo TIM model is
linked to that master model.

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 549
• PrinterOption—Specifies the printer settings for printing a file in terms of the
pfcExport.PrintPrinterOption object. Set this attribute using the
method pfcExport.PrinterInstructions.SetPrinterOption.
• PlacementOption—Specifies the placement options for printing purpose in
terms of the pfcExport.PrintMdlOption object. Set this attribute using
the method
pfcExport.PrinterInstructions.SetPlacementOption.
• ModelOption—Specifies the model options for printing purpose in terms of
the pfcExport.PrintPlacementOption object. Set this attribute
using the method
pfcExport.PrinterInstructions.SetModelOption.
• 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.pfcExport.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

550 Creo Object TOOLKIT JavaUser’s Guide


• 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.
The method pfcSession.BaseSession.GetPrintPrinterOptions
retrieves the printer settings.
The pfcExport.PrintPrinterOption object contains the following
options:
• DeleteAfter—Determines if the file is deleted after printing. Set it to true to
delete the file after printing. Use the method
pfcExport.PrintPrinterOption.SetDeleteAfter to assign this
option.
• FileName—Specifies the name of the file to be printed. Use the method
pfcExport.PrintPrinterOption.SetFileName to set the name.

Note
If the method pfcModel.Model.Export is called for
pfcModel.ExportType object, then the argument FileName is
ignored, and can be passed as NULL. You must use the method
pfcModel.Model.Export to set the FileName.

• 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.

Interface 551
Note
If you want to plot a layout without adding a border on the paper, use
the following paper sizes defined in the enumerated data type
pfcModel.PlotPaperSize:
◆ CEEMPTYPLOT—The paper size is 22.5 x 36 in
◆ CEEMPTYPLOT_MM—The paper size is 625 x 1000 mm

• 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
pfcExport.PrintPrinterOption.SetQuantity to assign the
quantity.
• 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

552 Creo Object TOOLKIT JavaUser’s Guide


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.

Placement Options
The placement options for printing purpose are defined in the
pfcExport.PrintPlacementOption object.
Methods Introduced:
• pfcExport.pfcExport.PrintPlacementOption_Create
• pfcSession.BaseSession.GetPrintPlacementOptions
• pfcExport.PrintPlacementOption.SetBottomOffset
• 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

Interface 553
The method pfcExport.pfcExport.PrintPlacementOption_
Create creates a new instance of the
pfcExport.PrintPlacementOption object.
The method
pfcSession.BaseSession.GetPrintPlacementOptions retrieves
the placement options.
The pfcExport.PrintPlacementOption object contains the following
options:
• BottomOffset—Specifies the offset from the lower-left corner of the plot. Use
the method
pfcExport.PrintPlacementOption.SetBottomOffset to set
this option.
• ClipPlot—Specifies whether the plot is clipped. Set this option to true to clip
the plot or to false to avoid clipping of plot. Use the method
pfcExport.PrintPlacementOption.SetClipPlot to set this
option.
• 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.

554 Creo Object TOOLKIT JavaUser’s Guide


• 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.

Model Options
The model options for printing purpose are defined in the
pfcExport.PrintMdlOption object.
Methods Introduced:
• pfcExport.pfcExport.PrintMdlOption_Create
• pfcSession.BaseSession.GetPrintMdlOptions
• pfcExport.PrintMdlOption.SetDrawFormat
• 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.
The method pfcSession.BaseSession.GetPrintMdlOptions
retrieves the model options.
The pfcExport.PrintMdlOption object contains the following options:

Interface 555
• DrawFormat—Displays the drawing format used for printing. Use the method
pfcExport.PrintMdlOption.SetDrawFormat to set this option.
• FirstPage—Specifies the first page number. Use the method
pfcExport.PrintMdlOption.SetFirstPage to set this option.
• LastPage—Specifies the last page number. Use the method
pfcExport.PrintMdlOption.SetLastPage to set this option.
• LayerName—Specifies the name of the layer. Use the method
pfcExport.PrintMdlOption.SetLayerName to set the name.
• 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.

556 Creo Object TOOLKIT JavaUser’s Guide


Plotter Configuration File (PCF) Options
The printing options for PCF file are defined in the
Export.PrinterPCFOptions object.
Methods Introduced:
• 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 object.
The pfcExport.PrinterPCFOptions object contains the following
options:
• PrinterOption—Specifies the printer settings for printing a file in terms of the
pfcExport.PrintPrinterOption object. Set this attribute using the
method pfcExport.PrinterPCFOptions.SetPrinterOption.
• PlacementOption—Specifies the placement options for printing purpose in
terms of the pfcExport.PrintMdlOption object. Set this attribute using
the method
pfcExport.PrinterPCFOptions.SetPlacementOption.
• ModelOption—Specifies the model options for printing purpose in terms of
the pfcExport.PrintPlacementOption object. Set this attribute
using the method
pfcExport.PrinterPCFOptions.SetModelOption.

Automatic Printing of 3D Models


Creo Object TOOLKIT Java provides the capability of automatically creating and
plotting a drawing of a solid model. The Creo Object TOOLKIT Java application
needs only to supply instructions for the print activity, and Creo Parametric will
automatically create the drawing, print it, and then discard it.
The methods listed here are analogous to the command File ▶ Print ▶ Quick
Drawing in Creo Parametric user interface.
Method Introduced:
• wfcQuickPrint.wfcQuickPrint.QuickPrintGeneralViewInsructions_
Create
• wfcQuickPrint.QuickPrintGeneralViewInsructions.
GetGeneralViewLocation

Interface 557
• wfcQuickPrint.QuickPrintGeneralViewInsructions.
SetGeneralViewLocation
• wfcQuickPrint.QuickPrintGeneralViewInsructions.GetScale
• wfcQuickPrint.QuickPrintGeneralViewInsructions.SetScale
• wfcQuickPrint.QuickPrintGeneralViewInsructions.GetViewDisplayStyle
• wfcQuickPrint.QuickPrintGeneralViewInsructions.SetViewDisplayStyle
• wfcQuickPrint.QuickPrintGeneralViewInsructions.GetViewName
• wfcQuickPrint.QuickPrintGeneralViewInsructions.SetViewName
• wfcQuickPrint.wfcQuickPrint.QuickPrintInstructions_Create
• wfcQuickPrint.QuickPrintInstructions.GetDrawingTemplate
• wfcQuickPrint.QuickPrintInstructions.SetDrawingTemplate
• wfcQuickPrint.QuickPrintInstructions.GetGeneralViewInstructions
• wfcQuickPrint.QuickPrintInstructions.SetGeneralViewInstructions
• wfcQuickPrint.QuickPrintInstructions.GetLayoutType
• wfcQuickPrint.QuickPrintInstructions.SetLayoutType
• wfcQuickPrint.QuickPrintInstructions.GetManualLayoutType
• wfcQuickPrint.QuickPrintInstructions.SetManualLayoutType
• wfcQuickPrint.QuickPrintInstructions.GetOrientation
• wfcQuickPrint.QuickPrintInstructions.SetOrientation
• wfcQuickPrint.QuickPrintInstructions.GetPaperSize
• wfcQuickPrint.QuickPrintInstructions.SetPaperSize
• wfcQuickPrint.QuickPrintInstructions.GetPrintFlatToScreen
• wfcQuickPrint.QuickPrintInstructions.SetPrintFlatToScreen
• wfcQuickPrint.QuickPrintInstructions.GetProjectionViewLocations
• wfcQuickPrint.QuickPrintInstructions.SetProjectionViewLocations
The method
wfcQuickPrint.wfcQuickPrint.QuickPrintGeneralView
Insructions_Create creates a new instance of the
wfcQuickPrintGeneralViewInsructions object that contains the quick
drawing print instructions for general view.
The methods
wfcQuickPrint.QuickPrintGeneralViewInsructions.
GetGeneralViewLocation and
wfcQuickPrint.QuickPrintGeneralViewInsructions.

558 Creo Object TOOLKIT JavaUser’s Guide


SetGeneralViewLocation get and set the location of the view being added
for projected view layout. This option is ignored for a manual view layout. You
can set the view location using the enumerated type
wfcQuickPrint.QuickPrintGeneralViewLocation:
• QPRINT_PROJ_GENVIEW_MAIN
• QPRINT_PROJ_GENVIEW_NW
• QPRINT_PROJ_GENVIEW_SW
• QPRINT_PROJ_GENVIEW_SE
• QPRINT_PROJ_GENVIEW_NE

Note
The general view location options are analogous to the images in the Quick
Drawing dialog box under View Layout.

The methods
wfcQuickPrint.QuickPrintGeneralViewInsructions.GetScale
and
wfcQuickPrint.QuickPrintGeneralViewInsructions.SetScale
get and set the view scale.
The methods
wfcQuickPrint.QuickPrintGeneralViewInsructions.GetView
DisplayStyle and
wfcQuickPrint.QuickPrintGeneralViewInsructions.SetView
DisplayStyle get and set the display styles being used in a view using the
object wfcDrawingViewDisplay For more information on view display
styles, refer to section Drawing View Display Information on page 147.
The methods
wfcQuickPrint.QuickPrintGeneralViewInsructions.GetView
Name and
wfcQuickPrint.QuickPrintGeneralViewInsructions.SetView
Name get and set the saved view name.
The method
wfcQuickPrint.wfcQuickPrint.QuickPrintInstructions_
Create creates a new instance of the wfcQuickPrintInstructions
object that contains the quick drawing print instructions.
The methods
wfcQuickPrint.QuickPrintInstructions.GetDrawingTemplate
and
wfcQuickPrint.QuickPrintInstructions.SetDrawingTemplate

Interface 559
get and set the path to the drawing template file to be used for the quick drawing
print operation. The methods are applicable only to views with layout type
wfcQPRINT_LAYOUT_TEMPLATE.
The methods
wfcQuickPrint.QuickPrintInstructions.GetGeneralViewIn
structions and
wfcQuickPrint.QuickPrintInstructions.SetGeneralViewIn
structions get and set the quick drawing print instructions for general view
using the object wfcQuickPrintGeneralViewInsructions.
Use the methods
wfcQuickPrint.QuickPrintInstructions.GetLayoutType and
wfcQuickPrint.QuickPrintInstructions.SetLayoutType to get
and set the layout type for print operation. You can set the layout type using the
enumerated type wfcQuickPrint.QuickPrintLayoutType:
• QPRINT_LAYOUT_PROJ—Specifies a projected view-type layout.
• QPRINT_LAYOUT_MANUAL—Specifies a manually arranged layout.
• QPRINT_LAYOUT_TEMPLATE—Specifies the use of a drawing template to
define the layout. If this option is specified, only the template name is required
to define the print; other options are not used.
The methods
wfcQuickPrint.QuickPrintInstructions.GetManualLayout
Type and
wfcQuickPrint.QuickPrintInstructions.SetManualLayout
Type get and set the layout type when three views are being used in a manual
layout. These methods are applicable only to views with layout type
wfcQPRINT_LAYOUT_MANUAL.
You can set the layout type using the enumerated type
wfcQuickPrint.QuickPrintManual3View. The layout can be of the
following types:
• QPRINTMANUAL_3VIEW_1_23VERT
• QPRINTMANUAL_3VIEW_23_VERT1
• QPRINTMANUAL_3VIEW_123_HORIZ

Note
The general view location options are analogous to the images in the Quick
Drawing dialog box under View Layout.

The methods
wfcQuickPrint.QuickPrintInstructions.GetOrientation and
wfcQuickPrint.QuickPrintInstructions.SetOrientation allow

560 Creo Object TOOLKIT JavaUser’s Guide


you to get and set the sheet orientation for the quick print operation. You can set
the orientation using the enumerated type
wfcQuickPrint.QuickPrintOrientation:
• QPRINT_ORIENTATION_PORTRAIT
• QPRINT_ORIENTATION_LANDSCAPE
The methods
wfcQuickPrint.QuickPrintInstructions.GetPaperSize and
wfcQuickPrint.QuickPrintInstructions.SetPaperSize get and
set the size of the print for the print operation using the object pfcPrintSize.
For more information on print options, see the section Printer Options on page
550.
Use the method
wfcQuickPrint.QuickPrintInstructions.SetPrintFlat
ToScreen to set the ProBoolean flag to print the flat-to-screen annotations.
The flat-to-screen annotations created at screen locations in the Creo graphics
window are printed at their relative locations in the drawing. You can print flat-to-
screen annotations such as notes, symbols, and surface finish symbols.
The methods
wfcQuickPrint.QuickPrintInstructions.GetProjectionView
Locations and
wfcQuickPrint.QuickPrintInstructions.SetProjectionView
Locations get and set the projected views to be included in the print operation.
The methods define the projected views using the object
wfcQuickPrint.QuickPrintProjectionViewLocations. These
methods are applicable only to views with layout type wfcQPRINT_LAYOUT_
PROJ. You can set the following projections types using the enumerated type
wfcQuickPrint.QuickPrintProjectionViewLocations:
• QPRINT_PROJ_TOP_VIEW
• QPRINT_PROJ_RIGHT_VIEW
• QPRINT_PROJ_LEFT_VIEW
• QPRINT_PROJ_BOTTOM_VIEW
• QPRINT_PROJ_BACK_NORTH
• QPRINT_PROJ_BACK_EAST
• QPRINT_PROJ_BACK_SOUTH
• QPRINT_PROJ_BACK_WEST

Solid Operations
Method Introduced:

Interface 561
• pfcSolid.Solid.CreateImportFeat
• wfcSolid.WSolid.ImportAsFeat
• wfcSession.WSession.ImportAsModel
The method pfcSolid.Solid.CreateImportFeat creates a new import
feature in the solid and takes the following input arguments:
• IntfData—The source of data from which to create the import feature. It is
given by the pfcModel.IntfDataSource object. The type of source data
that can be imported is given by the pfcModel.IntfType class and can be
of the following types:
○ INTF_NEUTRAL
○ INTF_NEUTRAL_FILE
○ INTF_IGES
○ INTF_STEP
○ INTF_VDA
○ 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
○ INTF_INVENTOR_PART
○ INTF_INVENTOR_ASM
○ INTF_IBL
○ INTF_PTS
○ INTF_SE_PART

562 Creo Object TOOLKIT JavaUser’s Guide


○ INTF_SE_SHEETMETAL_PART
• 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.
The method wfcSolid.WSolid.ImportAsFeat creates a new import
feature in the solid. It takes the following input arguments:
• IntfData—Specifies the source of data using which the import feature is
created. You can specify the data source as a file or interface data of only
neutral type.
○ For a file, the data source is specified as a IntfDataSource object. The
type of source data that can be imported is given by the enumerated data
type pfcModel.IntfType.
○ For the interface data, the data source is specified as a WIntfNeutral
object. Refer to the section Extracting Interface Data for Neutral Files on
page 546, for more information on WIntfNeutral object type.
• CoordSys—Specifies the pointer to a reference coordinate system. If this is
NULL, the method uses the default coordinate system.
• CutOrAdd—Specifies whether the import feature must be created as a cut or a
protrusion. The default option is to add and has the value PRO_B_FALSE. If
NULL, the method performs an add operation.
• Profile—Specifies the import profile path. It can be NULL.
The method wfcSession.WSession.ImportAsModel imports a model in
the solid. It takes the following arguments:
• FileToImport—Specifies the path of the file along with its name and
extension.
• NewModelType—Specifies the type of the file to be imported.
• Type—Specifies the type of the model to be created. It can be a part, assembly,
or drawing.
• NewModelName—Specifies a name for the imported model.
• ModelRepType—Specifies the representation type for the new imported
model.
• profile—Specifies the import profile path. It can be NULL.

Interface 563
Note
The input argument profile allows you to include the import of Creo
Elements/Direct containers, face parts, wire parts, and empty parts.

• Filter—Specifies the filter string in the form of callback method. The method
determines the display and mapping of layers of the imported model. It can be
NULL.

Window Operations
Method Introduced:
• pfcWindow.Window.ExportRasterImage
The method pfcWindow.Window.ExportRasterImage outputs a standard
Creo raster output file.

Creating Import Features from Files


To create import features in Creo Parametric from external format files use the
methods described in this section.
Methods Introduced:
• wfcModel.IntfIBL_Create
• wfcModel.IntfInventorAsm_Create
• wfcModel.IntfInventorPart_Create
• wfcModel.IntfPTS_Create
• wfcModel.IntfSEdgePart_Create
• wfcModel.IntfSEdgeSheetmetal_Create
Use the method wfcModel.IntfIBL_Create to create a new object that
represents the IBL file that creates an import feature.
Use the method wfcModel.IntfInventorAsm_Create to create a new
object that represents the Inventor Assembly file that creates an import feature.
Use the method wfcModel.IntfInventorPart_Create to create a new
object that represents the Inventor pat file that creates an import feature.
Use the method wfcModel.IntfPTS_Create to create a new object that
represents the PTS file that creates an import feature.
Use the method wfcModel.IntfSEdgePart_Create to create a new object
that represents the solid Edge part file that creates an import feature.

564 Creo Object TOOLKIT JavaUser’s Guide


Use the method wfcModel.IntfSEdgeSheetmetal_Create to create a
new object that represents the solid Edge sheetmetal file that creates an import
feature.
The output of the above methods is the value of the input argument IntfData
passed to the method wfcSolid.WSolid.ImportAsFeat.

Interface 565
32
Simplified Representations
Overview ................................................................................................................ 567
Retrieving Simplified Representations....................................................................... 568
Creating and Deleting Simplified Representations...................................................... 569
Extracting Information About Simplified Representations............................................ 569
Modifying Simplified Representations ....................................................................... 570
Simplified Representation Utilities............................................................................. 572
Expanding LightWeight Graphics Simplified Representations ..................................... 574

Creo Object TOOLKIT Java gives programmatic access to all the simplified
representation functionality of Creo application. Create simplified representations
either permanently or on the fly and save, retrieve, or modify them by adding or
deleting items.

566 Creo Object TOOLKIT JavaUser’s Guide


Overview
Using Creo Object TOOLKIT Java, you can create and manipulate assembly
simplified representations just as you can using Creo application interactively.

Note
Creo Object TOOLKIT Java supports simplified representation of assemblies
only, not parts.

Simplified representations are identified by the pfcSimpRep.SimRep class.


This class is a child of pfcModelItem.ModelItem, so you can use the
methods dealing with pfcModelItems to collect, inspect, and modify
simplified representations.
The information required to create and modify a simplified representation is
stored in a class called pfcSimpRep.SimpRepInstructions which
contains several data objects and fields, including:
• String—The name of the simplified representation
• pfcSimpRep.SimpRepAction—The rule that controls the default
treatment of items in the simplified representation.
• pfcSimpRep.SimpRepItem—An array of assembly components and the
actions applied to them in the simplified representation.
A pfcSimpRep.SimpRepItem is identified by the assembly component path
to that item. Each pfcSimpRep.SimpRepItem has it’s own
pfcSimpRep.SimpRepAction assigned to it.
pfcSimpRep.SimpRepAction is a visible data object that includes a field of
type pfcSimpRep.SimpRepActionType. You can use the method
pfcSimpRep.SimpRepAction.Action() to set the actions. To delete an
existing item, you must set the action as NULL.
pfcSimpRep.SimpActionType is an enumerated type that specifies the
possible treatment of items in a simplified representation. The possible values are
as follows
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.
SIMPREP_EXCLUDE Exclude this component from the simplified
representation.
SIMPREP_SUBSTITUTE Substitute the component in the simplified
representation.

Simplified Representations 567


Values Action
SIMPREP_GEOM Use only the geometrical representation of the
component.
SIMPREP_GRAPHICS Use only the graphics representation of the
component.
SIMPREP_SYMB Use the symbolic representation of the component.

Retrieving Simplified Representations


Methods Introduced:
• pfcSession.BaseSession.RetrieveAssemSimpRep
• pfcSession.BaseSession.RetrieveGeomSimpRep
• pfcSession.BaseSession.RetrieveGraphicsSimpRep
• pfcSession.BaseSession.RetrieveSymbolicSimpRep
• pfcSimpRep.pfcSimpRep.RetrieveExistingSimpRepInstructions_Create
• wfcSession.WSession.RetrieveDefaultEnvelopeSimprep
• wfcSession.WSession.LoadModelRepresentation
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.
To retrieve an existing simplified representation, pass an instance of
pfcSimpRep.pfcSimpRep.RetrieveExistingSimpRepInstruc
tions_Create and specify its name as the second argument to this method.
Creo application retrieves that representation and any active submodels and
returns the object to the simplified representation as a
pfcAssembly.Assembly object.
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.

568 Creo Object TOOLKIT JavaUser’s Guide


The method
wfcSession.wfcWSession.RetrieveDefaultEnvelopeSimprep
retrieves the simplified representation of the default envelope of an assembly in
the session. This method is not supported for parts.
The method wfcSession.wfcWSession.LoadModelRepresentation
retrieves the specified simplified representation of a model into memory.

Creating and Deleting Simplified


Representations
Methods Introduced:
• 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.
To generate the new simplified representation, call
pfcSolid.Solid.CreateSimpRep. This method returns the
pfcSimpRep.SimpRep object for the new representation.
The method pfcSolid.Solid.DeleteSimpRep deletes a simplified
representation from its model owner. The method requires only the
pfcSimpRep.SimpRep object as input.

Extracting Information About Simplified


Representations
Methods Introduced:
• pfcSimpRep.SimpRep.GetInstructions
• pfcSimpRep.SimpRepInstructions.GetDefaultAction
• pfcSimpRep.CreateNewSimpRepInstructions.GetNewSimpName
• pfcSimpRep.SimpRepInstructions.GetIsTemporary
• pfcSimpRep.SimpRepInstructions.GetItems
• wfcCombState.WSimpRep.GetSimprepSubstitutionName

Simplified Representations 569


• wfcCombState.WSimpRep.IsSimpRepInstructionDefault
• wfcCombState.WSimpRep.SetSimpRepInstructionDefaultAction
Given the object to a simplified representation,
pfcSimpRep.SimpRep.GetInstructions fills out the
pfcSimpRep.SimpRepInstructions object.
The pfcSimpRep.SimpRepInstructions.GetDefaultAction,
pfcSimpRep.CreateNewSimpRepInstructions.GetNewSimpName,
and pfcSimpRep.SimpRepInstructions.GetIsTemporary methods
return the associated values contained in the
pfcSimpRep.SimpRepInstructionsobject.
The method pfcSimpRep.SimpRepInstructions.GetItems returns all
the items that make up the simplified representation.
The method
wfcCombState.WSimpRep.GetSimprepSubstitutionName returns
the name of the substituted representation at the given assembly path. This method
returns the name even when the substituted representation is deleted from the
model at the given path.
The method
wfcCombState.WSimpRep.IsSimpRepInstructionDefault
determines if the specified simplified representation is the default representation
for the owner model.
Use the method
wfcCombState.WSimpRep.SetSimpRepInstructionDefaultAc
tion to set the default action for the simplified representation using the
enumerated type SimpRepActionType.

Modifying Simplified Representations


Methods Introduced:
• pfcSimpRep.SimpRep.GetInstructions
• pfcSimpRep.SimpRep.SetInstructions
• pfcSimpRep.SimpRepInstructions.SetDefaultAction
• pfcSimpRep.CreateNewSimpRepInstructions.SetNewSimpName
• pfcSimpRep.SimpRepInstructions.SetIsTemporary
• wfcCombState.WSimpRep.GetSimprepdataTempvalue
• wfcCombState.WSimpRep.SetSimprepdataName

570 Creo Object TOOLKIT JavaUser’s Guide


Using Creo Object TOOLKIT Java, you can modify the attributes of existing
simplified representations. After you create or retrieve a simplified representation,
you can make calls to the methods listed in this section to designate new values
for the fields in the pfcSimpRep.SimpRepInstructions object.
To modify an existing simplified representation retrieve it and then get the
pfcSimpRep.SimpRepInstructions object by calling
pfcSimpRep.SimpRep.GetInstructions. If you created the
representation programmatically within the same application, the
pfcSimpRep.SimpRepInstructions object is already available. Once you
have modified the data object, reassign it to the corresponding simplified
representation by calling the method
pfcSimpRep.SimpRep.SetInstructions.
The method wfcCombState.WSimpRep.GetSimprepdataTempvalue
returns a boolean value that specifies if the simplified representation is a
temporary one.
Use the method wfcCombState.WSimpRep.SetSimprepdataName to set
the name of the simplified representation in the SimpRepInstructions
object.

Adding Items to and Deleting Items from a


Simplified Representation
Methods Introduced:
• 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
• wfcCombState.WSimpRep.DeleteSimpRepInstructionItem
You can add and delete items from the list of components in a simplified
representation using Creo Object TOOLKIT Java. If you created a simplified
representation using the option Exclude as the default rule, you would generate a
list containing the items you want to include. Similarly, if the default rule for a

Simplified Representations 571


simplified representation is Include, you can add the items that you want to be
excluded from the simplified representation to the list, setting the value of the
pfcSimpRep.SimpRepActionType to SIMPREP_EXCLUDE.
The method
wfcCombState.WSimpRep.DeleteSimpRepInstructionItem deletes
the specified item from SimpRepInstructions object.

How to Add Items


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

How to Remove Items


Follow the procedure above, except remove the unwanted
pfcSimpRep.SimpRepItem from the sequence.

Simplified Representation Utilities


Methods Introduced:
• pfcModelItem.ModelItemOwner.ListItems
• pfcModelItem.ModelItemOwner.GetItemById
• pfcSolid.Solid.GetSimpRep
• pfcSolid.Solid.SelectSimpRep
• pfcSolid.Solid.ActivateSimpRep
• pfcSolid.Solid.GetActiveSimpRep
This section describes the utility methods that relate to simplified representations.
The method pfcModelItem.ModelItemOwner.ListItems can list all of
the simplified representations in a Solid.

572 Creo Object TOOLKIT JavaUser’s Guide


The method pfcModelItem.ModelItemOwner.GetItemById initializes
a pfcSimpRep.SimpRep object. It takes an integer id.

Note
Creo Object TOOLKIT Java supports simplified representation of Assemblies
only, not Parts.

The method pfcSolid.Solid.GetSimpRep initializes a


pfcSimpRep.SimpRep object. The method takes the following arguments:
• SimpRepname The name of the simplified representation in the solid. If you
specify this argument, the method ignores the rep_id.
The method pfcSolid.Solid.SelectSimpRep creates a Creo menu to
enable interactive selection. The method takes the owning solid as input, and
outputs the object to the selected simplified representation. If you choose the Quit
menu button, the method throws an exception XToolkitUserAbort
The methods pfcSolid.Solid.GetActiveSimpRep and
pfcSolid.Solid.ActivateSimpRep enable you to find and get the
currently active simplified representation, respectively. Given an assembly object,
pfcSolid.Solid.GetActiveSimpRep returns the object to the currently
active simplified representation. If the current representation is the master
representation, the return is null.
The method pfcSolid.Solid.ActivateSimpRep activates the requested
simplified representation.
To set a simplified representation to be the currently displayed model, you must
also call pfcModel.ModelDisplay.

Simplified Representations 573


Expanding LightWeight Graphics
Simplified Representations
Methods Introduced:
• wfcAssembly.WAssembly.ExpandLightweightGraphicsSimprep
Use the method
wfcAssembly.WAssembly.ExpandLightweightGraphicsSimprep
to expand the light weight graphics representation to the specified level. The input
arguments of this method are:
• TreeItem—Specify the model feature whose light weight graphic
representation is to be expanded.
• LWGLevel—Specify the level up to which the expansion should take place
using the enumerated type
wfcAssembly.LightweightGraphicsSimprepLevel. The valid
values for this enumerated class type are:
○ LWG_SIMPREP_LEVEL_NEXT—Specifies the expansion of the 3D
Thumbnail to the next level.
○ LWG_SIMPREP_LEVEL_ALL-Specifies the expansion of the 3D
Thumbnail to all levels.

574 Creo Object TOOLKIT JavaUser’s Guide


33
Running J-Link Applications in
Asynchronous Mode
Overview ................................................................................................................ 576
Simple Asynchronous Mode..................................................................................... 577
Starting and Stopping Creo Parametric ..................................................................... 578
Connecting to a Creo Parametric Process ................................................................. 579
Full Asynchronous Mode.......................................................................................... 581
Troubleshooting Asynchronous J-Link....................................................................... 583

This chapter explains how to use J-Link in Asynchronous Mode.

Note
Creo Object TOOLKIT Java is not supported in Asynchronous Mode.

575
Overview
Asynchronous mode is a multiprocess mode in which the J-Link application and
Creo Parametric 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 Creo
Parametric.
Another important difference between synchronous and asynchronous modes is in
the startup of the J-Link application. In synchronous mode, the application is
started by Creo Parametric, based on information contained in the registry file. In
asynchronous mode, the application (containing its own main() method) is started
independently of Creo Parametric and subsequently either starts or connects to a
Creo Parametric process.

Note
An asynchronous application that starts Creo Parametric will not appear in the
Auxiliary Applications dialog box.

The use of RPC causes asynchronous mode to perform more slowly than
synchronous mode. For this reason, apply asynchronous mode only when it is
needed.
An asynchronous mode is not the only mode in which your application has
explicit control over Creo Parametric. Because Creo Parametric calls a Java start
method when an application starts, your synchronous application can take control
by initiating all operations in Java start method (thus interrupting any user
interaction). This technique is important when you want to run Creo Parametric in
batch mode.
Depending on how your asynchronous application handles messages from Creo
Parametric, your application can be classified as either simple or full. The
following sections describe simple and full asynchronous mode.

Setting up an Asynchronous J-Link Application


For your asynchronous application to communicate with Creo Parametric, you
must set the environment variable PRO_COMM_MSG_EXE to the full path of the
executable pro_comm_msg.
On Windows systems, set PRO_COMM_MSG_EXE in the Environment section of
the System window that you access from the Control Panel.

576 Creo Object TOOLKIT JavaUser’s Guide


To support the asynchronous mode, use the jar file pfcasync.jar in your
CLASSPATH. This file is available at <creo_loadpoint>\<datecode>\
Common Files\text\java. This file contains all required classes for running
with asynchronous J-Link.

Note
Asynchronous applications are incompatible with the classes in the
synchronous .jar files. You must build and run your application classes
specifically to run in asynchronous mode.

You must add the asynchronous library, pfcasyncmt, to your environment that
launches the J-Link application. This library is stored in <creo_loadpoint>\
<datecode>\Common Files\<machine type>\<lib>.

Note
The library has prefix and extension specifiers for a dynamically loaded
library for the platform being used.

System Library Path


i486_nt, x86e_win64 pfcasyncmt.dll set PATH=<creo_
loadpoint>
\<datecode>\Common
Files\<machine Type>\
lib;%PATH%

Asynchronous J-Link applications must load the library prior to calls made to the
asynchronous methods. This can be accomplished by adding the following line to
your application.
System.loadLibrary (“pfcasyncmt”)

Simple Asynchronous Mode


A simple asynchronous application does not implement a way to handle
requests from Creo Parametric. Therefore, J-Link cannot plant listeners to be
notified when events happen in Creo Parametric. Consequently, Creo Parametric
cannot invoke the methods that must be supplied when you add, for example,
menu buttons to Creo Parametric.

Running J-Link Applications in Asynchronous Mode 577


Despite this limitation, a simple asynchronous mode application can be used to
automate processes in Creo Parametric. The application may either start or
connect to an existing Creo Parametric session, and may access Creo Parametric
in interactive or in a non graphical, non interactive mode. When Creo Parametric
is running with graphics, it is an interactive process available to the user.
When you design a J-Link application to run in simple asynchronous mode, keep
the following points in mind:
• The Creo Parametric process and the application perform operations
concurrently.
• None of the application’s listener methods can be invoked by Creo Parametric.
Simple asynchronous mode supports normal J-Link methods but does not support
ActionListeners. These considerations imply that the J-Link application does not
know the state (the current mode, for example) of the Creo Parametric process at
any moment.

Starting and Stopping Creo Parametric


The following methods are used to start and stop Creo Parametric when using J-
Link applications.
Methods Introduced:
• pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_Start
• pfcAsyncConnection.AsyncConnection.End
A simple asynchronous application can spawn and connect to a Creo Parametric
process with the method
pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_
Start. The Creo Parametric process listens for requests from the application and
acts on the requests at suitable breakpoints, usually between commands.
Unlike applications running in synchronous mode, asynchronous applications are
not terminated when Creo Parametric terminates. This is useful when the
application needs to perform Creo Parametric operations intermittently, and
therefore, must start and stop Creo Parametric more than once during a session.
The application can connect to or start only one Creo Parametric session at any
time. If the J-Link application spawns a second session, connection to the first
session is lost.
To end any Creo Parametric process that the application is connected to, call the
method pfcAsyncConnection.AsyncConnection.End.

578 Creo Object TOOLKIT JavaUser’s Guide


Setting Up a Noninteractive Session
You can spawn a Creo Parametric session that is both noninteractive and
nongraphical. In asynchronous mode, include the following strings in the Creo
Parametric start or connect call to
pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_
Start:
• -g:no_graphics—Turn off the graphics display.
• -i:rpc_input—Causes Creo Parametric to expect input from your
asynchronous application only.

Note
Both of these arguments are required, but the order is not important.

The syntax of the call for a noninteractive, nongraphical session is as follows:


pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_Start
("pro -g:no_graphics -i:rpc_input",<text_dir>);
where pro is the command to start Creo Parametric.

Example Code
The sample code in the file pfcAsyncStartExample.java located at
<creo_jlink_loadpoint>/jlink_appls/jlinkasyncexamples
demonstrates how to use J-Link in asynchronous mode. The method starts Creo
Parametric asynchronously, retrieves a Session, and opens a model in Creo
Parametric.

Connecting to a Creo Parametric Process


Methods Introduced:
• pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_Connect
• pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_
GetActiveConnection
• pfcAsyncConnection.AsyncConnection.Disconnect
A simple asynchronous application can also connect to a Creo Parametric 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 Creo
Parametric sessions are running. If several versions of Creo Parametric are

Running J-Link Applications in Asynchronous Mode 579


running on the same computer, try to connect by specifying user and display
parameters. However, if several versions of Creo Parametric are running in the
same user and display parameters, the connection may not be possible.
pfcAsyncConnection.pfcAsyncConnection.AsyncConnection
_GetActiveConnection returns the current connection to a Creo Parametric
session.
To disconnect from a Creo Parametric process, call the method
pfcAsyncConnection.AsyncConnection.Disconnect. This method
can be called only if you used the method
pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_
Connect to get the connection.
The connection to a Creo Parametric 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 Creo Parametric and other
processes. The name service daemon is set up as part of the Creo Parametric
installation.

Connecting Via Connection ID


Methods Introduced:
• pfcAsyncConnection.AsyncConnection.GetConnectionId
• pfcAsyncConnection.ConnectionId.GetExternalRep
• pfcSession.BaseSession.GetConnectionId
• pfcAsyncConnection.pfcAsyncConnection.ConnectionId_Create
• pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_
ConnectById
Each Creo Parametric process maintains a unique identity for communications
purposes. Use this ID to reconnect to a Creo Parametric process.
The method
pfcAsyncConnection.AsyncConnection.GetConnectionId returns
a data structure containing the connection ID.
If the connection id must be passed to some other application the method
pfcAsyncConnection.ConnectionId.GetExternalRep provides the
string external representation for the connection ID.
The method pfcSession.BaseSession.GetConnectionId provides
access to the asynchronous connection ID for the current Creo Parametric session.
This ID can be passed to any asynchronous mode application that needs to
connect to the current session of Creo Parametric.

580 Creo Object TOOLKIT JavaUser’s Guide


The method
pfcAsyncConnection.pfcAsyncConnection.ConnectionId_
Create takes a string representation and creates a ConnectionId data object.
The method pfcAsyncConnection.pfcAsyncConnection.
AsyncConnection_ConnectById connects to Creo Parametric at the
specified connection ID.

Note
Connection IDs are unique for each Creo Parametric process and are not
maintained after you quit Creo Parametric.

Status of a Creo Parametric Process


Method Introduced:
• pfcAsyncConnection.AsyncConnection.IsRunning
To find out whether a Creo Parametric process is running, use the method
pfcAsyncConnectionAsyncConnection.IsRunning.

Getting the Session Object


Method Introduced:
• pfcAsyncConnection.AsyncConnection.GetSession
The method pfcAsyncConnection.AsyncConnection.GetSession
returns the session object representing the Creo Parametric session. Use this object
to access the contents of the Creo Parametric session. See the Session Objects on
page 61 chapter for additional information.

Full Asynchronous Mode


Full asynchronous mode is identical to the simple asynchronous mode except in
the way the J-Link application handles requests from Creo Parametric. In simple
asynchronous mode, it is not possible to process these requests. In full
asynchronous mode, the application implements a control loop that ‘‘listens’’ for
messages from Creo Parametric. As a result, Creo Parametric can call functions in
the application, including callback functions for menu buttons and notifications.

Running J-Link Applications in Asynchronous Mode 581


Note
Using full asynchronous mode requires starting or connecting to Creo
Parametric using the methods described in the previous sections. The
difference is that the application must provide an event loop to process calls
from menu buttons and listeners.

Methods Introduced:
• pfcAsyncConnection.AsyncConnection.EventProcess
• pfcAsyncConnection.AsyncConnection.WaitForEvents
• pfcAsyncConnection.AsyncConnection.InterruptEventProcessing
• pfcAsyncConnection.AsyncActionListener.OnTerminate
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 Creo Parametric. 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 on page 61 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 Creo Parametric. No other processing takes
place while the application is waiting. The loop continues until
pfcAsyncConnection.AsyncConnection.InterruptEventPro
cessing is called from a J-Link callback action, or until the application detects
the termination of Creo Parametric.
It is often necessary for your full asynchronous application to be notified of the
termination of the Creo Parametric process. In particular, your control loop need
not continue to listen for Creo Parametric messages if Creo Parametric is no
longer running.
An AsyncConnection object can be assigned an Action Listener to bind a
termination action that is executed upon the termination of Creo Parametric. The
method
pfcAsyncConnection.AsyncActionListener.OnTerminate

582 Creo Object TOOLKIT JavaUser’s Guide


handles the termination that you must override. It sends a member of the class
pfcAsyncConnection.TerminationStatus, which is one of the
following:
• TERM_EXIT—Normal exit (the user clicks Exit on the menu).
• TERM_ABNORMAL—Quit with error status.
• TERM_SIGNAL—Fatal signal raised.
Your application can interpret the termination type and take appropriate action.
For more information on Action Listeners, see the Action Listeners on page 494
chapter.

Example Code
The sample code in the file pfcAsyncFullExample.java located at
<creo_jlink_loadpoint>/jlink_appls/jlinkasyncexamples is
a fully asynchronous application. It follows the procedure for a full asynchronous
application:
1. The application establishes listeners for Creo Parametric events, in this case,
the menu button and the termination listener.
2. The application goes into a control loop calling EventProcess which allows
the application to respond to the Creo Parametric events.

Message and Menu File


J-Link
J-Link
#
#
AsyncApp
Hit me!
#
#
AsyncAppHelp
Launch async application callback
#
#

Troubleshooting Asynchronous J-Link


General Problems
UnsatisfiedLinkError in System.loadLibrary ("pfcasyncmt")
Add $PRO_DIRECTORY/$PRO_MACHINE_TYPE/lib to your library path:

Running J-Link Applications in Asynchronous Mode 583


Windows and Windows XP 64bit:$PATH (separated with semicolon)
Java gives this exception when it has any trouble loading the library, not just when
the library is not in the library path. If you are working in a non-standard
configuration make sure that all of these libraries are in your library path (subject
to your OS naming, for example cipstdmtz.dll on Windows):
• pfcasyncmt
• jnicipjavamtz
• jniadaptsmtz
• cipstdmtz
• ctoolsmtz
• baselibmtz
• i18nmtz
Look at what is printed on stdout/stderr. There can be unresolved symbols.
Windows usually reports unresolved symbols in a pop-up dialog so you will see it
immediately. If that does not help, then enable the debug output from the
operating system's dynamic loader, start with reading the main page.

UnsatisfiedLinkError on first call to a JLink method


Ensure that you executed the System.loadLibrary ("pfcasyncmt"). Put
a debug printout right after it to ensure it gets loaded.
In most cases the J-Link jar files (pfcasync.jar) are loaded using a non-
system class loader. Java lets you load native libraries from classes loaded with
either the system class loader (pfcasync.jarmust be in the default
CLASSPATH), or a signed class loader. Java will not throw an exception on
System.loadLibrary. For this reason everything will appear to be fine until
the first call to a native method. At this point you will get an
UnsatisfiedLinkError. Add J-Link jar files to the default CLASSPATH,
usually to the CLASSPATH environment or an appropriate place in your servlet
engine's configuration.

NullPointerException from a JLink method early in program execution


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.
• Sync J-Link jars:
• Async J-Link jars:

584 Creo Object TOOLKIT JavaUser’s Guide


pfcExceptions.XToolkitNotFound exception on the first call to
pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_Start
on Windows
Make sure your Creo Parametric command is correct. If it's not a full path to a
script/executable, make sure $PATH is set correctly. Try full path in the command:
if it works, then your $PATHis incorrect.

pfcExceptions.XToolkitGeneralError or pfcExceptions.CommError on
the first call to pfcAsyncConnection.pfcAsyncConnection.
AsyncConnection_Start or pfcAsyncConnection.
pfcAsyncConnection.AsyncConnection_Connect
• Make sure the environment variable PRO_COMM_MSG_EXE is set to full path
to pro_comm_msg, including file name, including .exe on Windows.
• Make sure the environment variable PRO_DIRECTORY is set to Creo
Parametric installation directory.
• Make sure name service () is running.

pfcAsyncConnection.pfcAsyncConnection.AsyncConnection_Start
hangs, even though Creo Parametric already started
Make sure name service () is also started with Creo Parametric. Open Task
Manager and look for nmsd.exe in the process listing.

Problems Specific to Servlets and JSP


pfcExceptions.XToolkitGeneralError or pfcExceptions.CommError on
the first call to pfcAsyncConnection.pfcAsyncConnection.
AsyncConnection_Start or pfcAsyncConnection.
pfcAsyncConnection.AsyncConnection_Connect
• Make sure you have PRO_COMM_MSG_EXE and PRO_DIRECTORY set
correctly.
• On Windows, servlet engine deployments typically belong to the SYSTEM
account and not a local user account. So, you must set PRO_COMM_MSG_EXE
and PRO_DIRECTORY in your system environment and restart Windows to
cause this change to take effect.

Running J-Link Applications in Asynchronous Mode 585


34
Task Based Application Libraries
Managing Application Arguments ............................................................................. 587
Launching a Creo Parametric TOOLKIT DLL ............................................................. 588
Creating Creo Object TOOLKIT Java Task Libraries................................................... 590
Launching Tasks from Creo Object TOOLKIT Java Task Libraries ............................... 591

Applications created using different Creo API products are interoperable. These
products use Creo applications as the medium of interaction, eliminating the task
of writing native-platform specific interactions between different programming
languages.
Application interoperability allows Creo Object TOOLKIT Java applications to
call into Creo Parametric TOOLKIT from areas not covered in the native
interface. It allows you to put a Java front end on legacy Creo Parametric
TOOLKIT applications.
Creo Object TOOLKIT Java can call Creo Parametric web pages belonging to
Web.Link, and functions in Creo Parametric TOOLKIT DLLs. Creo Object
TOOLKIT Java synchronous applications can also register tasks for use by other
applications.

586 Creo Object TOOLKIT JavaUser’s Guide


Managing Application Arguments
Creo Object TOOLKIT Java 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 Creo 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
• pfcArgument.ArgValue.GetStringValue
• pfcArgument.ArgValue.SetStringValue
• pfcArgument.ArgValue.GetSelectionValue
• pfcArgument.ArgValue.SetSelectionValue

Task Based Application Libraries 587


• pfcArgument.ArgValue.GetTransformValue
• pfcArgument.ArgValue.SetTransformValue
The class pfcArgument.ArgValue contains one of the seven types of values.
Creo Object TOOLKIT Java provides different methods to create each of the
seven types of argument values.
The method pfcArgument.ArgValue.Getdiscr returns the type of value
contained in the argument value object.
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.
The method pfcArgument.Arguments.create creates a new empty
sequence of task arguments.
The method pfcArgument.Argument.GetLabel returns the label of the
argument. The method pfcArgument.Argument.SetLabel sets the label
of the argument.
The method pfcArgument.Argument.GetValue returns the value of the
argument. The method pfcArgument.Argument.SetValue sets the value
of the argument.

Launching a Creo Parametric TOOLKIT


DLL
The methods described in this section enable a Creo Object TOOLKIT Java user
to register and launch a Creo Parametric TOOLKIT DLL from a Creo Object
TOOLKIT Java application. The ability to launch and control a Creo Parametric
TOOLKIT application enables the following:

588 Creo Object TOOLKIT JavaUser’s Guide


• Reuse of existing Creo Parametric TOOLKIT code with Creo Object
TOOLKIT Java applications.
• ATB operations.
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 Creo Parametric TOOLKIT DLL. The input parameters of this
method are similar to the fields of a registry file and are as follows:
• ApplicationName—The name of the application to initialize.
• DllPath—The full path to the DLL binary file.
• TextPath—The path to the application’s message and user interface text files.
• UserDisplay—Set this parameter to true to register the application in the
Creo user interface and to see error messages if the application fails. If this
parameter is false, the application will be invisible to the user.
The application's user_initialize() function is called when the application
is started. The method returns a handle to the loaded Creo Parametric TOOLKIT
DLL.
In order to register and start a legacy Pro/TOOLKIT DLL that is not Unicode-
compliant, use the method
pfcSession.BaseSession.LoadProToolkitLegacyDll. This
method conveys to Creo Parametric that the loaded DLL application is not
Unicode-compliant and built in the pre-Wildfire 4.0 environment. It takes the
same input parameters as the earlier method
pfcSession.BaseSession.LoadProToolkitDll.

Note
The method
pfcSession.BaseSession.LoadProToolkitLegacyDll must be
used only by a pre-Creo Object TOOLKIT Java application to load a pre-
Wildfire 4.0 Pro/TOOLKIT DLL.

Task Based Application Libraries 589


Use the method pfcSession.BaseSession.GetProToolkitDll to
obtain a Creo Parametric 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:
• Use the function ProToolkitDllIdGet() within the DLL application to
get a string representation of the DLL application. Pass NULL to the first
argument of ProToolkitDllIdGet() to get the string identifier for the
calling application.
• Use the Get method for the Id attribute in the DLL interface. The method
pfcProToolkit.Dll.GetId() returns the DLL identifier string.
Use the method pfcProToolkit.Dll.ExecuteFunction to call a
properly designated function in the Creo Parametric TOOLKIT DLL library. The
input parameters of this method are:
• FunctionName—Name of the function in the Creo Parametric TOOLKIT DLL
application.
• InputArguments—Input arguments to be passed to the library function.
The method returns an object of interface
com.ptc.pfc.pfcProToolkit.FunctionReturn. This interface
contains data returned by a Creo Parametric TOOLKIT function call. The object
contains the return value, as integer, of the executed function and the output
arguments passed back from the function call.
The method pfcProToolkit.Dll.IsActive determines whether a Creo
Parametric TOOLKIT DLL previously loaded by the method
pfcSession.BaseSession.LoadProToolkitDll is still active.
The method pfcProToolkit.Dll.Unload is used to shutdown a Creo
Parametric TOOLKIT DLL previously loaded by the method
pfcSession.BaseSession.LoadProToolkitDll and the application's
user_terminate() function is called.

Creating Creo Object TOOLKIT Java Task


Libraries
The methods described in this section allow you to setup Creo Object TOOLKIT
Java libraries to be used and called from other custom Creo applications in Creo
Parametric TOOLKIT or Creo Object TOOLKIT Java.

590 Creo Object TOOLKIT JavaUser’s Guide


Creo Object TOOLKIT Java task libraries must be compiled using the
synchronous Creo Object TOOLKIT Java library called otk.jar. Each task
must be registered within the application for it to be called from external
applications. Provide the following information to the application to use your Creo
Object TOOLKIT Java application as a task library:
1. The required CLASSPATH settings.
2. The name of the invocation class containing the static start and stop methods.
3. The name of static Start() and Stop() methods
4. The path to the text files, if the application deals with messages or menus.
5. The registration name of the task.
6. The input argument names and types.
7. The output argument names and types.
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:
• The name of the task. This name must be provided by calling applications.
• Object implementing the interface JLinkTaskListener that has the
pfcJLinkTaskListener.OnExecute callback method overridden. The
class pfcLink.DefaultJLinkTaskListener makes extending the
interface easier.
The method pfcJLinkTaskListener.OnExecute is called when the
calling application tries to invoke a registered task. This method must contain the
body of the Creo Object TOOLKIT Java task. The method signature includes a
sequence of input arguments and allows you to return a sequence of output
arguments to the caller.
Use the method pfcSession.BaseSession.UnregisterTask to delete a
task that is no longer needed. This method must be called when you exit the
application using the application's stop method.

Launching Tasks from Creo Object


TOOLKIT Java Task Libraries
The methods described in this section allow you to launch tasks from a predefined
Creo Object TOOLKIT Java task library.

Task Based Application Libraries 591


Methods Introduced:
• pfcSession.BaseSession.StartJLinkApplication
• pfcJLink.JLinkApplication.ExecuteTask
• pfcJLink.JLinkApplication.IsActive
• pfcJLink.JLinkApplication.Stop
Use the method pfcSession.BaseSession.StartJLinkApplication
to start a Creo Object TOOLKIT Java application. The input parameters of this
method are similar to the fields of a registry file and are as follows:
• ApplicationName—Assigns a unique name to this Creo Object TOOLKIT
Java application.
• ClassName—Specifies the name of the Java class that contains the Creo
Object TOOLKIT Java application’s start and stop method. This should be a
fully qualified Java package and class name.
• StartMethod—Specifies the start method of the Creo Object TOOLKIT Java
application.
• StopMethod—Specifies the stop method of the Creo Object TOOLKIT Java
application.
• AdditionalClassPath—Specifies the locations of packages and classes that
must be loaded when starting this Creo Object TOOLKIT Java application. If
this parameter is specified as null, the default classpath locations are used.
• TextPath—Specifies the application text path for menus and messages. If this
parameter is specified as null, the default text locations are used.
• UserDisplay—Specifies whether to display the application in the Auxiliary
Applications dialog box in the Creo application.
Upon starting the application, the static start() method is invoked. The method
returns a JLink.JLinkApplication referring to the Creo Object TOOLKIT
Java application.
The method pfcJLink.JLinkApplication.ExecuteTask calls a
registered task method in a Creo Object TOOLKIT Java application. The input
parameters of this method are:
• Name of the task to be executed.
• A sequence of name value pair arguments contained by the interface
pfcArguments.Arguments.
The method outputs an array of output arguments. These arguments are returned
by the task’s implementation of the pfcJLinkTaskListener.OnExecute
call back method.

592 Creo Object TOOLKIT JavaUser’s Guide


The method pfcJLink.JLinkApplication.IsActive returns a True
value if the application specified by the pfcJLink.JLinkApplication
object is active.
The method pfcJLink.JLinkApplication.Stop stops the application
specified by the pfcJLink.JLinkApplication object. This method
activates the application’s static Stop() method.

Task Based Application Libraries 593


35
Graphics
Overview ................................................................................................................ 595
Getting Mouse Input ................................................................................................ 595
Cosmetic Properties ................................................................................................ 596
Graphics Colors ...................................................................................................... 605
Line Styles for Graphics ........................................................................................... 607
Displaying Graphics................................................................................................. 608
Display Lists and Graphics ....................................................................................... 611

This chapter covers Creo Object TOOLKIT Java Graphics including displaying
lists, displaying text and using the mouse.

594 Creo Object TOOLKIT JavaUser’s Guide


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.

Getting Mouse Input


The following methods are used to read the mouse position in screen coordinates
with the mouse button depressed. Each method outputs the position and an
enumerated type description of which mouse button was pressed when the mouse
was at that position. These values are contained in the interface
pfcSession.MouseStatus. The enumerated values are defined in
pfcSession.MouseButton.
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.
The method pfcSession.Session.UIGetCurrentMouseStatus
returns a value whenever the mouse is moved or a button is pressed. With this
method a button does not have to be pressed for a value to be returned. You can
use an input argument to flag whether or not the returned positions are snapped to
the window grid.

Drawing a Mouse Box


This method allows you to draw a mouse box.
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 button. The return value for this
method is of the type pfcBase.Outline3D.
You can supply the first corner location programmatically or you can allow the
user to select both corners of the box.

Graphics 595
Cosmetic Properties
You can enhance your model using Creo Object TOOLKIT Java methods that
change the surface properties, or set different light sources. The following section
describes these methods in detail.

Surface Properties
Methods Introduced:
• wfcSelect.WSelection.GetVisibleAppearance
• wfcSelect.WSelection.SetVisibleAppearance
• wfcDisplay.wfcDisplay.Appearance_Create
• wfcDisplay.Appearance.GetAmbient
• wfcDisplay.Appearance.SetAmbient
• wfcDisplay.Appearance.GetDescription
• wfcDisplay.Appearance.SetDescription
• wfcDisplay.Appearance.GetDiffuse
• wfcDisplay.Appearance.SetDiffuse
• wfcDisplay.Appearance.GetHighlight
• wfcDisplay.Appearance.SetHighlight
• wfcDisplay.Appearance.GetHighlightColor
• wfcDisplay.Appearance.SetHighlightColor
• wfcDisplay.Appearance.GetKeywords
• wfcDisplay.Appearance.SetKeywords
• wfcDisplay.Appearance.GetLabel
• wfcDisplay.Appearance.SetLabel
• wfcDisplay.Appearance.GetName
• wfcDisplay.Appearance.SetName
• wfcDisplay.Appearance.GetRGBColor
• wfcDisplay.Appearance.SetRGBColor
• wfcDisplay.Appearance.GetReflection
• wfcDisplay.Appearance.SetReflection
• wfcDisplay.Appearance.GetShininess
• wfcDisplay.Appearance.SetShininess
• wfcDisplay.Appearance.GetTransparency

596 Creo Object TOOLKIT JavaUser’s Guide


• wfcDisplay.Appearance.SetTransparency
• wfcSelect.WSelection.SetVisibleTextures
• wfcSelect.WSelection.GetVisibleTextures
• wfcDisplay.wfcDisplay.Texture_Create
• wfcDisplay.Texture.GetType
• wfcDisplay.Texture.SetType
• wfcDisplay.Texture.GetFilePath
• wfcDisplay.Texture.SetFilePath
• wfcDisplay.Texture.GetPlacement
• wfcDisplay.Texture.SetPlacement
• wfcDisplay.wfcDisplay.TexturePlacement_Create
• wfcDisplay.TexturePlacement.GetTextureProjectionType
• wfcDisplay.TexturePlacement.SetTextureProjectionType
• wfcDisplay.TexturePlacement.GetHorizontalOffset
• wfcDisplay.TexturePlacement.SetHorizontalOffset
• wfcDisplay.TexturePlacement.GetVerticalOffset
• wfcDisplay.TexturePlacement.SetVerticalOffset
• wfcDisplay.TexturePlacement.GetRotate
• wfcDisplay.TexturePlacement.SetRotate
• wfcDisplay.TexturePlacement.GetHorizontalScale
• wfcDisplay.TexturePlacement.SetHorizontalScale
• wfcDisplay.TexturePlacement.GetVerticalScale
• wfcDisplay.TexturePlacement.SetVerticalScale
• wfcDisplay.TexturePlacement.GetBumpHeight
• wfcDisplay.TexturePlacement.SetBumpHeight
• wfcDisplay.TexturePlacement.GetDecalIntensity
• wfcDisplay.TexturePlacement.SetDecalIntensity
• wfcDisplay.TexturePlacement.GetHorizontalFlip
• wfcDisplay.TexturePlacement.SetHorizontalFlip
• wfcDisplay.TexturePlacement.GetVerticalFlip
• wfcDisplay.TexturePlacement.SetVerticalFlip
• wfcSession.WSession.IsTextureFileEmbedded
• wfcSession.WSession.GetTextureFilePath

Graphics 597
The methods wfcSelect.WSelection.GetVisibleAppearance and
wfcSelect.WSelection.SetVisibleAppearance enable you to
retrieve and set the appearance properties for the specified model using an object
of the class WSelection.AppearanceProperties.

Note
To set the default surface appearance properties, pass the value NULL to the
Appearance parameter of the
wfcModel.WModel.SetVisibleAppearance method.

The class wfcDisplay.Appearance is an interface to the appearance


properties and contains the methods described below.
Use the method wfcDisplay.wfcDisplay.Appearance_Create to
create an instance of the wfcDisplay.Appearance object.
• Ambient—Specifies the indirect, scattered light the model receives from its
surroundings. The valid range is from 0.0 to 1.0.
• Description—Specifies the model description.
• Diffuse—Specifies the reflected light that comes from directional, point, or
spot lights. The valid range is from 0.0 to 1.0.
• Highlight—Specifies the intensity of the light reflected from a highlighted
surface area. The valid range is from 0.0 to 1.0.
• HighlightColor—Specifies the highlight color, in terms of red, green,
and blue. The valid range is from 0.0 to 1.0.
• Keywords—Specifies the keywords in the specified model.
• Label—Specifies the labels in the model.
• Name— Specifies the name of the model.
• RGBColor— Specifies the color, in the RGB format. The valid range is from
0.0. to 1.0.
• Reflection—Specifies how reflective the surface is. The valid range is
from 0, that is dull to 100, that is shiny.
• Shininess—Specifies the properties of a highlighted surface area. A plastic
model would have a lower shininess value, while a metallic model would have
a higher value. The valid range is from from 0.0. to 1.0.
• Transparency— Specifies the transparency value, which is between 0 that
is completely opaque to 1.0 that is completely transparent.
Use the methods wfcDisplay.Appearance.GetAmbient and
wfcDisplay.Appearance.SetAmbient to get and set the ambience value.

598 Creo Object TOOLKIT JavaUser’s Guide


Use the methods wfcDisplay.Appearance.GetDescription and
wfcDisplay.Appearance.SetDescription to get and set the
description for the specified model.
Use the methods wfcDisplay.Appearance.GetDiffuse and
wfcDisplay.Appearance.SetDiffuse to get and set the value for the
diffused light.
Use the methods wfcDisplay.Appearance.GetHighlight and
wfcDisplay.Appearance.SetHighlight to get and set the intensity of
the highlighted light.
Use the methods wfcDisplay.Appearance.GetHighlightColor and
wfcDisplay.Appearance.SetHighlightColor to get and set the
highlight color.
Use the methods wfcDisplay.Appearance.GetKeywords and
wfcDisplay.Appearance.SetKeywords to get and set the keywords.
Use the methods wfcDisplay.Appearance.GetLabel and
wfcDisplay.Appearance.SetLabel to get and set labels in the specified
model.
Use the methods wfcDisplay.Appearance.GetName and
wfcDisplay.Appearance.SetName to get and set the model name for the
specified model.
Use the methods wfcDisplay.Appearance.GetRGBColor and
wfcDisplay.Appearance.SetRGBColor to get and set the RGBColor.
Use the methods wfcDisplay.Appearance.GetReflection and
wfcDisplay.Appearance.SetReflection to get and set the reflectivity
of the surface.
Use the methods wfcDisplay.Appearance.GetShininess and
wfcDisplay.Appearance.SetShininess to get and set the properties of
a highlighted surface area.
Use the methods wfcDisplay.Appearance.GetTransparency and
wfcDisplay.Appearance.SetTransparency to get and set the
transparency value.
Use the methods wfcSelect.WSelection.GetVisibleTextures and
wfcSelect.WSelection.SetVisibleTextures to get and set the
properties related to the surface texture respectively using an object of the class
WSelection. The class wfcDisplay.Texture is an interface to the texture
property and contains the methods described below.

Graphics 599
Use the method wfcDisplay.wfcDisplay.Texture_Create to create an
instance of the wfcDisplay.wfcDisplay.Texture object. The parameters
of this method are given below:
• Type—Specifies the type of the texture.
• FilePath—Specifies the full path to the texture.
• Placement—Specifies the properties related to the placement of surface
texture.
Use the methods wfcDisplay.Texture.GetType and
wfcDisplay.Texture.SetType to get and set the type of the texture using
the enumerated type wfcDisplay.TextureType.The valid values of the
enumerated type wfcTextureType are as follows:
• NULL_TEXTURE—Specifies that no texture map is assigned.
• BUMP_TEXTURE—Specifies the single-channel texture maps that represent
height fields. This texture results in shaded surface and has a wrinkled or
irregular appearance.
• COLOR_TEXTURE—Specifies the surface color such as woodgrain, geometric
patterns, and pictures applied to the texture.
• DECAL_TEXTURE—Specifies the specialized texture maps such as company
logos or text that are applied to a surface. A decal is a texture with an alpha or
transparency mask.
Use the methods wfcDisplay.Texture.GetFilePath and
wfcDisplay.Texture.SetFilePath to get and set the full path to the
texture map.
Use the methods wfcDisplay.Texture.GetPlacement and
wfcDisplay.Texture.SetPlacement to get and set the sequence of
placements properties using an object of the class
wfcDisplay.TexturePlacement. The parameters of the class
wfcDisplay.TexturePlacement are as follows:
Use the method wfcDisplay.wfcDisplay.TexturePlacement_
Create to create an instance of the object
wfcDisplay.TexturePlacement. The parameters of this method are as
follows:
• TextureProjectionType—Specifies the projection type of the texture
on the selected surface or surfaces.
• LineEnvelope—Specifies the coordinate system that defines the direction
for the planar projection, or the center for the other projection types.
• HorizontalOffset—Specifies the percentage of horizontal shift of the
texture map on the surface.
• VerticalOffset—Specifies the percentage of vertical shift of the texture
map on the surface.

600 Creo Object TOOLKIT JavaUser’s Guide


• Rotate—Specifies the angle to rotate the texture map on the surface.
• HorizontalScale—Specifies the horizontal scaling of the texture map.
• VerticalScale—Specifies the vertical scaling of the texture map.
• BumpHeight—Specifies the height of the bump on the surface of the texture
map.
• DecalIntensity—Specifies the alpha or transparency mask intensity on
the surface.
• HorizontalFlip—Specifies that the texture map on the surface should be
flipped horizontally.
• VerticalFlip—Specifies that the texture map on the surface should be
flipped vertically.
Use the methods
wfcDisplay.TexturePlacement.GetTextureProjectionType and
wfcDisplay.TexturePlacement.SetTextureProjectionType to
get and set the texture projection type using the enumerated type
wfcDisplay.TextureProjectionType.
Use the methods wfcDisplay.TexturePlacement.GetTextureType
and wfcDisplay.TexturePlacement.SetTextureType to get and set
the type of texture using the enumerated type wfcTextureType
Use the methods
wfcDisplay.TexturePlacement.GetHorizontalOffset and
wfcDisplay.TexturePlacement.SetHorizontalOffset to get and
set the horizontal offset.
Use the methods
wfcDisplay.TexturePlacement.GetVerticalOffset and
wfcDisplay.TexturePlacement.SetVerticalOffset to get and set
the vertical offset.
Use the methods wfcDisplay.TexturePlacement.GetRotate and
wfcDisplay.TexturePlacement.SetRotate to get and set the rotating
angle.
Use the methods
wfcDisplay.TexturePlacement.GetHorizontalScale and
wfcDisplay.TexturePlacement.SetHorizontalScale to get and
set the horizontal scale.
Use the methods
wfcDisplay.TexturePlacement.GetVerticalScale and
wfcDisplay.TexturePlacement.SetVerticalScale to get and set
the vertical scale.
Use the methods wfcDisplay.TexturePlacement.GetBumpHeight
and wfcDisplay.TexturePlacement.SetBumpHeight to get and set
the height of the bump.

Graphics 601
Use the methods
wfcDisplay.TexturePlacement.GetDecalIntensity and
wfcDisplay.TexturePlacement.SetDecalIntensity to get and set
the decal intensity.
Use the methods
wfcDisplay.TexturePlacement.GetHorizontalFlip and
wfcDisplay.TexturePlacement.SetHorizontalFlip to get and set
the horizontal flip.
Use the methods wfcDisplay.TexturePlacement.GetVerticalFlip
and wfcDisplay.TexturePlacement.SetVerticalFlip to get and set
the vertical flip.
The method wfcSession.WSession.IsTextureFileEmbedded checks
if the specified texture, decal, or bump map file is embedded in the model.
The method wfcSession.WSession.IsTextureFileEmbedded returns
the full path of the specified texture, decal, or bump map file and loads the file
from the path. If you specify the input argument CreateTempFile as true, the
method creates a temporary copy of the texture file.

Item Properties
Methods Introduced:
• wfcSolid.ItemAppearanceAndTextures.GetAppearance
• wfcSolid.ItemAppearanceAndTextures.GetTextures
• wfcSolid.ItemAppearanceAndTextures.GetSelection
The method
wfcSolid.ItemAppearanceAndTextures.GetAppearance retrieves
the appearance properties for the specified item using the
wfcDisplay.Appearance object.
The method wfcSolid.ItemAppearanceAndTextures.GetTextures
retrieves the texture properties for the specified item using the
wfcDisplay.Textures object.
Use the method
wfcSolid.ItemAppearanceAndTextures.GetSelection to retrieve
the selection handle of the item using the pfcSelect.Selection object.
For more information, see Surface Properties on page 596

Setting Light Sources


The methods in this section allow you to set the light sources to render a model in
the specified graphics window.
Methods Introduced:

602 Creo Object TOOLKIT JavaUser’s Guide


• wfcDisplay.WWindow.GetLightInstructions
• wfcDisplay.WWindow.SetLightInstructions
• wfcDisplay.wfcDisplay.LightSourceInstruction_Create
• wfcDisplay.LightSourceInstruction.GetName
• wfcDisplay.LightSourceInstruction.SetName
• wfcDisplay.LightSourceInstruction.GetType
• wfcDisplay.LightSourceInstruction.SetType
• wfcDisplay.LightSourceInstruction.GetColor
• wfcDisplay.LightSourceInstruction.SetColor
• wfcDisplay.LightSourceInstruction.GetPosition
• wfcDisplay.LightSourceInstruction.SetPosition
• wfcDisplay.LightSourceInstruction.GetDirection
• wfcDisplay.LightSourceInstruction.SetDirection
• wfcDisplay.LightSourceInstruction.GetSpreadAngle
• wfcDisplay.LightSourceInstruction.SetSpreadAngle
• wfcDisplay.LightSourceInstruction.GetCastShadows
• wfcDisplay.LightSourceInstruction.SetCastShadows
• wfcDisplay.LightSourceInstruction.GetIsActive
• wfcDisplay.LightSourceInstruction.SetIsActive
The method wfcDisplay.WWindow.GetLightInstructions retrieves
the information about the light sources in the specified Creo window. Use the
method wfcDisplay.WWindow.SetLightInstructions to set the
parameters for a light source in the specified window.
Use the method
wfcDisplay.wfcDisplay.LightSourceInstruction_Create to
create an instance of the object LightSourceInstruction that contains all
the information related to light sources. The parameters of this method are as
follows:
• inName—Specifies the name of the light source.
• inType—Specifies the type of light using the enumerated data type
wfcLightType. The light types are —ambient, direction, point, spot, or
HDRI.
• inColor—Specifies the color of the light in red, green, and blue values.
• inIsActive—Specifies if the light source is active.

Graphics 603
Use the methods wfcDisplay.LightSourceInstruction.GetName
and wfcDisplay.LightSourceInstruction.SetName to get and set
the name of the light source.
Use the methods wfcDisplay.LightSourceInstruction.GetType
and wfcDisplay.LightSourceInstruction.SetType to get and set
the type of light source using the enumerated data type
wfcDisplay.LightType. The light types are:
• LIGHT_AMBIENT—Ambient light illuminates all the surfaces equally. The
position of the light in the room has no effect on the rendering. Ambient light
exists by default and cannot be created or set in Creo application.
• LIGHT_DIRECTION—Directional light casts parallel light rays illuminating
all surfaces at the same angle, regardless of the position of the model.
• LIGHT_POINT—Point light is similar to the light from a bulb in a room
where the light radiates from the center. The light reflected off a surface
varies, depending on the surface position with respect to the light.
• LIGHT_SPOT—Spotlight is similar to a light bulb but with its rays confined
within a cone called the spot angle.
• LIGHT_HDRI—High Dynamic Range Image (HDRI) is used to illuminate
the model. The light type cannot be set in Creo application.

Use the methods wfcDisplay.LightSourceInstruction.GetColor


and wfcDisplay.LightSourceInstruction.SetColor to get and set
the color of light as red, green, and blue values.
The method wfcDisplay.LightSourceInstruction.GetIsActive
checks if the light source is active. Use the method
wfcDisplay.LightSourceInstruction.SetIsActive to set the light
source as active.
Use the methods
wfcDisplay.LightSourceInstruction.GetPosition and
wfcDisplay.LightSourceInstruction.SetPosition to get and set
the position of the light source. Specify the position only for point and spot lights.
Use the methods
wfcDisplay.LightSourceInstruction.GetDirection and
wfcDisplay.LightSourceInstruction.SetDirection to get and
set the direction of the light source. Specify the direction only for direction and
spot lights.
Use the methods
wfcDisplay.LightSourceInstruction.GetSpreadAngle and
wfcDisplay.LightSourceInstruction.SetSpreadAngle to get and
set the angle to which the light is spread in radians. Specify the spread angle only
for spot light.

604 Creo Object TOOLKIT JavaUser’s Guide


Use the method
wfcDisplay.LightSourceInstruction.GetCastShadows to
identify if the light source casts a shadow. The
wfcDisplay.LightSourceInstruction.SetCastShadows sets the
light source to cast a shadow. Shadows can be applied only in Creo Render Studio.
Refer to Creo Render Studio Help for more information.

Graphics Colors
Creo application uses several predefined colors in its color map which correspond
to the system colors presented to the user through the user interface. The names of
the types generally indicate what they are used for in Creo application.

Note
PTC reserves the right to change both the definitions of the predefined
colormap and also of the assignment of entities to members of the color map
as required by improvements to the user interface. PTC recommends not
relying on the predefined RGB color for displaying of Creo Object TOOLKIT
Java entities or graphics, and also recommends against relying on the
relationship between certain colormap entries and types of entities. The
following sections describe how to construct your application so that it does
not rely on potentially variant properties in Creo application.

Setting Colors to Match Existing Entities


Method Introduced:
• wfcDisplay.WDisplay.GetColorByObjectType
The method wfcDisplay.WDisplay.GetColorByObjectType returns
the standard color used to display the specified entity in Creo application.
The association between objects and colormap entries may change in a new
release of Creo. This causes the association between the application entities and
the Creo entities to be lost. You can use this method to get the display color of the
entity.

Version of Creo Parametric Color Map


Methods Introduced:
• wfcDisplay.WDisplay.GetColorRGBVersion
• wfcDisplay.WDisplay.SetColorRGBVersion

Graphics 605
The method wfcDisplay.WDisplay.GetColorRGBVersion returns the
version of the Creo color map. Use the method
wfcDisplay.WDisplay.SetColorRGBVersion to set the version of the
color map using the enumerated data type wfcDisplay.ColorRGBVersion.
To specify a color map from releases prior to the Pro/ENGINEER Wildfire release
specify the value as:
• COLORRGB_STANDARD_VERSION—Specifies the appearance.dmt
files for the color map.
• COLORRGB_PRE_WILDFIRE_VERSION—Specifies the color.map files
for the color map from releases prior to the Pro/ENGINEER Wildfire release.

Creo Parametric Color Schemes


Methods Introduced:
• wfcDisplay.WDisplay.GetColorRGBAlternateScheme
• wfcDisplay.WDisplay.SetColorRGBAlternateScheme
The method wfcDisplay.WDisplay.SetColorRGBAlternateScheme
allow you to change the color scheme of Creo application to a predefined alternate
color scheme. The alternate color scheme defined in the enumerated data type
wfcDisplay.ColorRGBAlternateScheme has the following valid values:
• COLORRGB_ALT_DEFAULT—Resets the color scheme to the default color
scheme of light to dark blue gradient background.
• COLORRGB_ALT_BLACK_ON_WHITE—Displays black entities on a white
background.
• COLORRGB_ALT_WHITE_ON_BLACK—Displays white entities on a black
background.
• COLORRGB_ALT_WHITE_ON_GREEN—Displays white entities on a dark
green background.
• COLORRGB_OPTIONAL1—Represents the color scheme with a dark
background.
• COLORRGB_OPTIONAL2—Represents the color scheme with a medium
background.
• COLORRGB_CLASSIC_WF—Resets the color scheme to the light to dark
grey background. This was the default color scheme till Pro/ENGINEER
Wildfire 4.0.
Use the method
wfcDisplay.WDisplay.GetColorRGBAlternateScheme to get the
current alternate color scheme.

606 Creo Object TOOLKIT JavaUser’s Guide


Line Styles for Graphics
Methods Introduced:
• wfcSession.WSession.GetLineStyleData
• wfcSession.LineStyleData.GetName
• wfcSession.LineStyleData.GetDefinition
• wfcSession.LineStyleData.GetCapStyle
• wfcSession.LineStyleData.GetJoinStyle
• wfcSession.LineStyleData.GetDashOffset
• wfcSession.LineStyleData.GetDashList
• wfcSession.LineStyleData.GetFillStyle
• wfcSession.LineStyleData.GetFillRule
The method wfcSession.WSession.GetLineStyleData returns
information about the specified line style as a LineStyleData object.
The method wfcSession.LineStyleData.GetName returns the name of
the specified line style.
The method wfcSession.LineStyleData.GetDefinition returns the
definition of the line style as a series of dashes (-) and spaces ( ).
The method wfcSession.LineStyleData.GetCapStyle returns the cap
style used for line ends. The method
wfcSession.LineStyleData.GetJoinStyle returns the style in which
line ends are joined. The cap style and join line settings are used from the pen
table file for printing a drawing file as a PDF document.
The method wfcSession.LineStyleData.GetDashOffset returns the
distance between the two dashes in the pattern.
The method wfcSession.LineStyleData.GetDashList returns a list of
dashes defined in the specified line style.
The method wfcSession.LineStyleData.GetFillStyle returns the
name of the line font for the specified line style.
The method wfcSession.LineStyleData.GetFillRule returns the rule
defined to fill a unit of length with the line style pattern.

Graphics 607
Displaying Graphics
All the methods in this section draw graphics in the Creo 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 Creo graphics color. The default graphics color is white.
The methods in this section are called using the
interfacepfcDisplay.Display. This interface is extended by the
pfcSession.BaseSession interface. This architecture allows you to call all
these methods on any Session object.
y default graphic elements are not stored in the Creo display list. Thus, they do not
get redrawn by Creo when the user uses repaint and orientation commands.
However, if you store graphic elements in either 2-D or 3-D display lists, Creo
application will redraw them when appropriate. See the section on Display Lists
and Graphics on page 611 for more information.
Methods Introduced:
• pfcDisplay.Display.SetPenPosition
• pfcDisplay.Display.DrawLine
• pfcDisplay.Display.DrawPolyline
• wfcDisplay.WDisplay.DrawPolylines
• pfcDisplay.Display.DrawCircle
• pfcDisplay.Display.DrawArc2D
• pfcDisplay.Display.DrawPolygon2D
The method pfcDisplay.Display.SetPenPosition sets the point at
which you want to start drawing a line. The function
pfcDisplay.Display.DrawLine draws a line to the given point from the
position given in the last call to either of the two functions. 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.
The method pfcDisplay.Display.DrawCircle uses solid coordinates for
the center of the circle and the radius value. The circle will be placed to the XY
plane of the model.
The method pfcDisplay.Display.DrawPolyline also draws polylines,
using an array to define the polyline.
Use the method wfcDisplay.WDisplay.DrawPolylines to draw
multiple polylines. Pass the sequence of polylines as a wfcPolylines object as
the input argument.

608 Creo Object TOOLKIT JavaUser’s Guide


In two-dimensional models the Display Graphics methods draw graphics at the
specified screen coordinates.
The method pfcDisplay.Display.DrawPolygon2D draws a polygon in
screen coordinates. The method pfcDisplay.Display.DrawArc2D draws
an arc in screen coordinates.

Controlling Graphics Display


Methods Introduced:
• pfcDisplay.Display.GetCurrentGraphicsColor
• pfcDisplay.Display.SetCurrentGraphicsColor
• pfcDisplay.Display.GetCurrentGraphicsMode
• pfcDisplay.Display.SetCurrentGraphicsMode
The method pfcDisplay.Display.GetCurrentGraphicsColor
returns the standard color used to display graphics in the Creo application.
TheCreo default is COLOR_DRAWING (white). The method
pfcDisplay.Display.SetCurrentGraphicsColor allows you to
change the color used to draw subsequent graphics.
The method pfcDisplay.Display.GetCurrentGraphicsMode returns
the mode used to draw graphics:
• DRAW_GRAPHICS_NORMAL—Creo application draws graphics in the
required color in each invocation.
• DRAW_GRAPHICS_COMPLEMENT—Creo application draws graphics
normally, but will erase graphics drawn a second time in the same location.
This allows you to create rubber band lines.
The method pfcDisplay.Display.GetCurrentGraphicsMode allows
you to set the current graphics mode.

Displaying Text in the Graphics Window


Method Introduced:
• 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.
Text items drawn are not known to Creo and therefore are not redrawn when you
select View, Repaint. To notify the Creo application of these objects, create them
inside the OnDisplay() method of the Display Listener.

Graphics 609
Controlling Text Attributes
Methods Introduced:
• 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.
You can get and set the following information:
• Text height (in screen coordinates)
• Width ratio of each character, including the gap, as a proportion of the height
• Rotation angle of the whole text, in counterclockwise degrees
• Slant angle of the text, in clockwise degrees

Controlling Text Fonts


Methods Introduced:
• pfcDisplay.Display.GetDefaultFont
• pfcDisplay.Display.GetCurrentFont
• pfcDisplay.Display.SetCurrentFont
• pfcDisplay.Display.GetFontById
• pfcDisplay.Display.GetFontByName
The method pfcDisplay.Display.GetDefaultFont returns the default
Creo text font. The text fonts are identified in Creo application by names and by
integer identifiers. To find a specific font, use the methods
pfcDisplay.Display.GetFontById or
pfcDisplay.Display.GetFontByName.

610 Creo Object TOOLKIT JavaUser’s Guide


Display Lists and Graphics
When generating a display of a solid in a window, Creo application maintains two
display lists. A display list contains a set of vectors that are used to represent the
shape of the solid in the view. A 3D display list contains a set of three-
dimensional vectors that represent an approximation to the geometry of the edges
of the solid. This list gets rebuilt every time the solid is regenerated.
A 2D display list contains the two-dimensional projections of the edges of the
solid 3D display list onto the current window. It is rebuilt from the 3D display list
when the orientation of the solid changes. The methods in this section enable you
to add your own vectors to the display lists, so that the graphics will be
redisplayed automatically by Creo application until the display lists are rebuilt.
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
Creo. 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.
Methods Introduced:
• pfcDisplay.DisplayListener.OnDisplay
• pfcDisplay.Display.CreateDisplayList2D
• pfcDisplay.Display.CreateDisplayList3D
• pfcDisplay.DisplayList2D.Display
• pfcDisplay.DisplayList3D.Display
• pfcDisplay.DisplayList2D.Delete
• 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.
In order to create a display list in Creo application, you must call
pfcDisplay.Display.CreateDisplayList2D or
pfcDisplay.Display.CreateDisplayList3D to tell Creo application
to use your listener to create the display list vectors.
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.
The methods pfcDisplay.DisplayList2D.Delete and the method
pfcDisplay.DisplayList3D.Delete will remove both the specified
display list from a session.

Graphics 611
Note
The method pfcWindow.Window.Refresh does not cause either of the
display lists to be regenerated, but simply repaints the window using the 2D
display list.

Exceptions
Possible exceptions that might be thrown by displaying graphics methods are
shown in the following table:
Exception Reason
XToolkitNotExist The display list is empty.
XToolkitNotFound The function could not find the display list or the
font specified in a previous call to
pfcDisplay.Display.SetCurrentFont
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.

612 Creo Object TOOLKIT JavaUser’s Guide


36
External Data
External Data .......................................................................................................... 614
Exceptions.............................................................................................................. 618

This chapter explains using External Data in Creo Object TOOLKIT Java.

613
External Data
This chapter describes how to store and retrieve external data. External data
enables a Creo Object TOOLKIT Java application to store its own data in a Creo
database in such a way that it is invisible to the Creo user. This method is different
from other means of storage accessible through the Creo user interface.

Introduction to External Data


External data provides a way for the Creo application to store its own private
information about a Creo model within the model file. The data is built and
interrogated by the application as a workspace data structure. It is saved to the
model file when the model is saved, and retrieved when the model is retrieved.
The external data is otherwise ignored by Creo; the application has complete
control over form and content.
The external data for a specific Creo model is broken down into classes and slots.
A class is a named ‘‘bin’’ for your data, and identifies it as yours so no other Creo
API application (or other classes in your own application) will use it by mistake.
An application usually needs only one class. The class name should be unique for
each application and describe the role of the data in your application.
Each class contains a set of data slots. Each slot is identified by an identifier and
optionally, a name. A slot contains a single data item of one of the following
types:
Creo Object TOOLKIT Java Type Data
pfcExternal.ExternalDataType.EXTDATA_INTEGER integer
pfcExternal.ExternalDataType.EXTDATA_DOUBLE double
pfcExternal.ExternalDataType.EXTDATA_STRING string

The Creo Object TOOLKIT Java interfaces used to access external data in Creo
applications are:
Creo Object TOOLKIT Java Type Data Type
com.ptc.pfc.External.ExternalDataAccess This is the top level object and is
created when attempting to access
external data.
com.ptc.pfc.pfcExternal.ExternalDataClass This is a class of external data and is
identified by a unique name.
com.ptc.pfc.pfcExternal.ExternalDataSlot This is a container for one item of
data. Each slot is stored in a class.
com.ptc.pfc.pfcExternal.ExternalData This is a compact data structure that
contains either an integer, double or
string value.

614 Creo Object TOOLKIT JavaUser’s Guide


Compatibility with Creo Parametric TOOLKIT
Creo Object TOOLKIT Java and Creo Parametric TOOLKIT share external data
in the same manner. Creo Object TOOLKIT Java external data is accessible by
Creo Parametric TOOLKIT and the reverse is also true. However, an error will
result if Creo Object TOOLKIT Java attempts to access external data previously
stored by Creo Parametric TOOLKIT as a stream.

Accessing External Data


Methods Introduced:
• pfcModel.Model.AccessExternalData
• pfcModel.Model.TerminateExternalData
• pfcExternal.ExternalDataAccess.IsValid
The method pfcModel.Model.AccessExternalData prepares Creo
application 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.
The method pfcModel.Model.TerminateExternalData stops Creo
application from accessing external data in a model. When you use this method all
external data in the model will be removed. Permanent removal will occur when
the model is saved.

Note
If you need to preserve the external data created in session, you must save the
model before calling this function. Otherwise, your data will be lost.

The method pfcExternal.ExternalDataAccess.IsValid determines


if the ExternalDataAccess object can be used to read and write data.

Storing External Data


Methods Introduced:
• pfcExternal.ExternalDataAccess.CreateClass
• pfcExternal.ExternalDataClass.CreateSlot
• pfcExternal.ExternalDataSlot.SetValue

External Data 615


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.
The next step is to use
pfcExternal.ExternalDataClass.CreateSlot to create an empty
data slot and input a slot name. The method outputs a
pfcExternal.ExternalDataSlot object to identify the new slot.

Note
Slot names cannot begin with a number.

The method pfcExternal.ExternalDataSlot.SetValue specifies the


data type of a slot and writes an item of that type to the slot. The input is a
pfcExternal.ExternalData object that you can create by calling any one
of the methods in the next section.

Initializing Data Objects


Methods Introduced:
• pfcExternal.pfcExternal.CreateIntExternalData
• pfcExternal.pfcExternal.CreateDoubleExternalData
• pfcExternal.pfcExternal.CreateStringExternalData
These methods initialize a pfcExternal.ExternalData object with the
appropriate data inputs.

Retrieving External Data


Methods Introduced:
• pfcExternal.ExternalDataAccess.LoadAll
• pfcExternal.ExternalDataAccess.ListClasses
• pfcExternal.ExternalDataClass.ListSlots
• pfcExternal.ExternalDataSlot.GetValue
• pfcExternal.ExternalData.Getdiscr
• pfcExternal.ExternalData.GetIntegerValue
• pfcExternal.ExternalData.GetDoubleValue
• pfcExternal.ExternalData.GetStringValue

616 Creo Object TOOLKIT JavaUser’s Guide


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 Creo model file and put it in the
workspace. The method needs to be called only once to retrieve all the data.
The method pfcExternal.ExternalDataAccess.ListClasses
returns a sequence of ExternalDataClasses registered in the model. The
method pfcExternal.ExternalDataClass.ListSlots provide a
sequence of ExternalDataSlots existing for each class.
The method pfcExternal.ExternalDataSlot.GetValue reads the
pfcExternal.ExternalData from a specified slot.
To find out a data type of a pfcExternal.ExternalData, call
pfcExternal.ExternalData.Getdiscr and then call one of these
methods to get the data, depending on the data type:
• pfcExternal.ExternalData.GetIntegerValue
• pfcExternal.ExternalData.GetDoubleValue
• pfcExternal.ExternalData.GetStringValue

Selecting the Node from the External Application


Tree
The tree created by an external application is similar to the Creo model tree. Each
node of this tree represents an external object that has been created by the
application. The external objects could be different types of entities, such as, light
sources, light sensors, and so on.
Methods Introduced:
• wfcSession.WSession.RegisterExternalSelectionHighlight
• wfcSelect.ExternalSelectionHighlight.StartNotify
• wfcSelect.ExternalSelectionHighlight.Action
• wfcSelect.ExternalSelectionHighlight.EndNotify
• wfcSelect.WSelection.RecordExternalSelection
• wfcSession.WSession.ReleaseExternalSelectionHighlight
The method
wfcSession.WSession.RegisterExternalSelectionHighlight
registers the callback methods when you select or deselect a node in the user tree
or an object in the graphics window. The notification method
wfcSelect.ExternalSelectionHighlight.StartNotify is called
when the method pfcSession.BaseSession.Select is activated. It
notifies the application about entering pfcSession.BaseSession.Select.
The callback method

External Data 617


wfcSelect.ExternalSelectionHighlight.Action is called when
you select or deselect an external object. The Creo Object TOOLKIT C++
application will highlight the external object or remove the highlight according to
the selection. The notification method
wfcSelect.ExternalSelectionHighlight.EndNotify is called
when the applications is about to exit the method
pfcSession.BaseSession.Select.
On clicking a tree node, the application creates a WSelection object and uses
the method wfcSelect.WSelection.RecordExternalSelection to
pass it to pfcSession.BaseSession.Select. Pass the enumerated data
type SelectionRecordAction as the input argument. The valid values are:
• wfcSELECT_OVERRIDE—Specifies that the previous selection is
overridden.
• wfcSELECT_TOGGLE—Specifies that the last two selections are toggled
between.
Use the method
wfcSession.WSession.ReleaseExternalSelectionHighlight to
release the memory of the client interface ExternalSelectionHighlight
in the method
wfcSession.WSession.RegisterExternalSelectionHighlight.
After the client interface is released it cannot be used by the application.

Exceptions
Most exceptions thrown by external data methods in Creo Object TOOLKIT Java
extend pfcExceptions.XExternalDataError, which is a subclass of
pfcExceptions.XToolkitError.
An additional exception thrown by external data methods is
pfcExceptions.XBadExternalData. This exception signals an error
accessing data. For example, external data access might have been terminated or
the model might contain stream data from Creo Parametric TOOLKIT .
The following table lists these exceptions.
Exception Cause
XExternalDataInvalidObject Generated when a model or class is
invalid.
XExternalDataClassOrSlotExists Generated when creating a class or slot
and the proposed class or slot already
exists.
XExternalDataNamesTooLong Generated when a class or slot name is
too long.
XExternalDataSlotNotFound Generated when a specified class or
slot does not exist.
XExternalDataEmptySlot Generated when the slot you are
attempting to read is empty.

618 Creo Object TOOLKIT JavaUser’s Guide


Exception Cause
XExternalDataInvalidSlotName Generated when a specified slot name
is invalid.
XBadGetExternalData Generated when you try to access an
incorrect data type in a
External.ExternalData object.

External Data 619


37
Windchill Connectivity APIs
Introduction............................................................................................................. 621
Accessing a Windchill Server from a Creo Session .................................................... 621
Accessing Workspaces............................................................................................ 624
Workflow to Register a Server .................................................................................. 626
Aliased URL............................................................................................................ 627
Server Operations ................................................................................................... 627
Utility APIs .............................................................................................................. 638

Creo application has the capability to be directly connected to Windchill solutions,


including Windchill ProjectLink and PDMLink servers. This access allows users
to manage and control the product data seamlessly from within the Creo
application.
This chapter lists Creo Object TOOLKIT Java APIs that support Windchill servers
and server operations in a connected Creo session.

620 Creo Object TOOLKIT JavaUser’s Guide


Introduction
The methods introduced in this chapter provide support for the basic Windchill
server operations from within Creo. With these methods, operations such as
registering a Windchill server, managing workspaces, and check in or check out of
objects will be possible via Creo Object TOOLKIT Java. The capabilities of these
APIs are similar to the operations available from within the Creo client, with some
restrictions.
Some of these APIs are supported from a non-interactive, that is, batch mode
application.

Accessing a Windchill Server from a Creo


Session
Creo application allows you to register Windchill servers as a connection between
the Windchill database and Creo application. Although the represented Windchill
database can be from Windchill ProjectLink or Windchill PDMLink all types of
databases are represented in the same way.
You can use the following identifiers when referring to Windchill servers in Creo
Object TOOLKIT Java:
• Codebase URL—This is the root portion of the URL that is used to connect to
a Windchill server. For example http://wcserver.company.com/
Windchill.
• Server Alias—A server alias is used to refer to the server after it has been
registered. The alias is also used to construct paths to files in the server
workspaces and commonspaces. The server alias is chosen by the user or
application and it need not have any direct relationship to the codebase URL.
An alias can be any normal name, such as my_alias.

Accessing Information Before Registering a Server


To start working with a Windchill server, you must establish a connection by
registering the server in Creo application. The methods described in this section
allow you to connect to a Windchill server and access information related to the
server.
Methods Introduced:
• pfcSession.BaseSession.AuthenticateBrowser
• pfcSession.BaseSession.GetServerLocation
• pfcServer.ServerLocation.GetClass
• pfcServer.ServerLocation.GetLocation

Windchill Connectivity APIs 621


• 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 Creo 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.
The method pfcServer.ServerLocation.GetLocation returns a
pfcServer.ServerLocation object representing the codebase URL for a
possible server. The server may not have been registered yet, but you can use this
object and the methods it contains to gather information about the server prior to
registration.
The method pfcServer.ServerLocation.GetClass returns the class of
the server or server location. The values are:
• Windchill—Denotes a Windchill PDMLink server.
• ProjectLink—Denotes Windchill ProjectLink type of servers.
The method pfcServer.ServerLocation.GetVersion returns the
version of Windchill that is configured on the server or server location, for
example, 9.0 or 10.0. This method accepts the server codebase URL as the
input.

Note
pfcServer.ServerLocation.GetVersion works only for Windchill
servers and throws the pfcExceptions.XToolkitUnsupported
exception, if the server is not a Windchill server.

The method pfcServer.ServerLocation.ListContexts gives a list of


all the available contexts for a specified server. A context is used to associate a
workspace with a product, project, or library.
The method pfcServer.ServerLocation.CollectWorkspaces
returns the list of available workspaces for the specified server. The workspace
objects returned contain the name of each workspace and its context.

622 Creo Object TOOLKIT JavaUser’s Guide


Registering and Activating a Server
The Creo Object TOOLKIT Java methods call the same underlying API as the
Creo application to register and unregister servers. Hence, registering the servers
using Creo Object TOOLKIT Java methods is similar to registering the servers
using the Creo user interface. Therefore, the servers registered by Creo Object
TOOLKIT Java are available in the Creo Server Registry. The servers are also
available in other locations in the Creo user interface such as, the Folder Navigator
and the embedded browser.
Methods Introduced:
• pfcSession.BaseSession.RegisterServer
• pfcServer.Server.Activate
• pfcServer.Server.Unregister
The method pfcSession.BaseSession.RegisterServer registers the
specified server with the codebase URL. You can automate the registration of
servers in interactive mode. To preregister the servers use the standard
config.fld setup. If you do not want the servers to be preregistered in batch
mode, set the environment variable PTC_WF_ROOT to an empty directory before
starting Creo application.
A successful call to
pfcSession.BaseSession.AuthenticateBrowser with a valid
username and password is essential for
pfcSession.BaseSession.RegisterServer to register the server
without launching the authentication dialog box. Registration of the server
establishes the server alias. You must designate an existing workspace to use when
registering the server. After the server has been registered, you may create a new
workspace.
The method pfcServer.Server.Activate sets the specified server as the
active server in the Creo session.
The method pfcServer.Server.Unregister unregisters the specified
server.

Accessing Information From a Registered Server


Methods Introduced:
• pfcServer.Server.GetIsActive
• pfcServer.Server.GetAlias
• pfcServer.Server.GetContext
The method pfcServer.Server.GetIsActive specifies if the server is
active.

Windchill Connectivity APIs 623


The method pfcServer.Server.GetAlias returns the alias of a server if
you specify the codebase URL.
The method pfcServer.Server.GetContext returns the active context of
the active server.

Information on Servers in Session


Methods Introduced:
• pfcSession.BaseSession.GetActiveServer
• pfcSession.BaseSession.GetServerByAlias
• pfcSession.BaseSession.GetServerByUrl
• pfcSession.BaseSession.ListServers
The method pfcSession.BaseSession.GetActiveServer returns
returns the active server handle.
The method pfcSession.BaseSession.GetServerByAlias returns the
handle to the server matching the given server alias, if it exists in session.
The method pfcSession.BaseSession.GetServerByUrl returns the
handle to the server matching the given server URL and workspace name, if it
exists in session.
The method pfcSession.BaseSession.ListServers returns a list of
servers registered in this session.

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.
Methods Introduced:
• pfcServer.pfcServer.WorkspaceDefinition_Create
• pfcServer.WorkspaceDefinition.GetWorkspaceName
• pfcServer.WorkspaceDefinition.GetWorkspaceContext
• pfcServer.WorkspaceDefinition.SetWorkspaceName
• pfcServer.WorkspaceDefinition.SetWorkspaceContext
The interfacepfcServer.WorkspaceDefinition contains the name and
context of the workspace. The method
pfcServer.ServerLocation.CollectWorkspaces returns an array of

624 Creo Object TOOLKIT JavaUser’s Guide


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.

Creating and Modifying the Workspace


Methods Introduced:
• pfcServer.Server.CreateWorkspace
• pfcServer.Server.GetActiveWorkspace
• pfcServer.Server.SetActiveWorkspace
• pfcServer.ServerLocation.DeleteWorkspace
The method pfcServer.Server.CreateWorkspace creates and activates
a new workspace.
The method pfcServer.Server.GetActiveWorkspace retrieves the
name of the active workspace.
The method pfcServer.Server.SetActiveWorkspace sets a specified
workspace as an active workspace.
The method pfcServer.ServerLocation.DeleteWorkspace deletes
the specified workspace. The method deletes the workspace only if the following
conditions are met:
• The workspace is not the active workspace.
• The workspace does not contain any checked out objects.
Use one of the following techniques to delete an active workspace:
• Make the required workspace inactive using
pfcServer.Server.SetActiveWorkspace with the name of some

Windchill Connectivity APIs 625


other workspace and then call
pfcServer.ServerLocation.DeleteWorkspace.
• Unregister the server using pfcServer.Server.Unregister and delete
the workspace.

Workflow to Register a Server


To Register a Server with an Existing Workspace
Perform the following steps to register a Windchill server with an existing
workspace:
1. Set the appropriate authentication context using the method
pfcSession.BaseSession.AuthenticateBrowser with a valid
username and password.
2. Look up the list of workspaces using the method
pfcServer.ServerLocation.CollectWorkspaces. If you already
know the name of the workspace on the server, then ignore this step.
3. Register the workspace using the method
pfcSession.BaseSession.RegisterServer with an existing
workspace name on the server.
4. Activate the server using the method pfcServer.Server.Activate.

To Register a Server with a New Workspace


Perform the following steps to register a Windchill server with a new workspace:
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.

626 Creo Object TOOLKIT JavaUser’s Guide


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:
• Object in workspace has a prefix wtws
wtws://<server_alias>/<workspace_name>/<object_server_name>

where <object_server_name> includes <object_


name>.<object_extension>
For example,
wtws://my_server/my_workspace/abcd.prt,
wtws://my_server/my_workspace/intf_file.igs

where
<server_alias> is my_server
<workspace_name> is my_workspace
• Object in commonspace has a prefix wtpub
wtpub://<server_alias>/<folder_location>/<object_server_name>

For example,
wtpub://my_server/path/to/cs_folder/abcd.prt

where
<server_alias> is my_server
<folder_location> is path/to/cs_folder

Note
○ object_server_name must be in lowercase.
○ The APIs are case-sensitive to the aliased URL.
○ <object_extension> should not contain Creo versions, for example,
.1 or .2, and so on.

Server Operations
After registering the Windchill server with Creo application, you can start
accessing the data on the Windchill servers. The Creo interaction with Windchill
servers leverages the following locations:

Windchill Connectivity APIs 627


• Commonspace (Shared folders)
• Workspace (Server-side workspace)
• Workspace local cache (Client-side workspace)
• Creo session
• Local disk
The methods described in this section enable you to perform the basic server
operations. The following illustration shows how data is transferred among these
locations.

Save
Methods Introduced:
• pfcModel.Model.Save
The method pfcModel.Model.Save stores the object from the session in the
local workspace cache, when a server is active.

628 Creo Object TOOLKIT JavaUser’s Guide


Upload
An upload transfers Creo 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
The method pfcServer.Server.UploadObjects uploads the object to the
workspace. The object to be uploaded must be present in the current Creo session.
You must save the object to the workspace using pfcModel.Model.Save
before attempting to upload it.
The method pfcServer.Server.UploadObjectsWithOptions uploads
objects to the workspace using the options specified in the
pfcServer.UploadOptions interface. These options allow you to 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.
Create the pfcServer.UploadOptions object using the method
pfcServer.pfcServer.UploadOptions_Create.
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

Windchill Connectivity APIs 629


• pfcServer.CheckinOptions.SetBaselineLocation
• pfcServer.CheckinOptions.GetBaselineLifecycle
• pfcServer.CheckinOptions.SetKeepCheckedout
The method pfcServer.Server.CheckinObjects checks in an object
into the database. The object to be checked in must be present in the current Creo
session. Changes made to the object are not included unless you save the object to
the workspace using the method pfcModel.Model.Save before you check it
in.
If you pass NULL as the value of the options parameter, the checkin operation is
similar to the Check-In option in Creo application. For more details on Check-In,
refer to the Creo online help.
Use the method pfcServer.pfcServer.CheckinOptions_Create to
create a new CheckinOptions object.
By using an appropriately constructed options argument, you can control the
checkin operation. Use the APIs listed above to access and modify the checkin
options. The checkin options are as follows:
• DefaultFolder—Specifies the default folder location on the server for the
automatic checkin operation.
• NonDefaultFolderAssignment—Specifies the folder location on the server to
which the objects will be checked in.
• AutoresolveOption—Specifies the option used for auto-resolving missing
references. These options are defined in the ServerAutoresolveOption
, and are as follows:
○ SERVER_DONT_AUTORESOLVE—Model references missing from the
workspace are not automatically resolved. This may result in a conflict
upon checkin. This option is used by default.
○ SERVER_AUTORESOLVE_IGNORE—Missing references are
automatically resolved by ignoring them.
○ SERVER_AUTORESOLVE_UPDATE_IGNORE—Missing references are
automatically resolved by updating them in the database and ignoring them
if not found.
• Baseline—Specifies the baseline information for the objects upon checkin.
The baseline information for a checkin operation is as follows:
○ BaselineName—Specifies the name of the baseline.
○ BaselineNumber—Specifies the number of the baseline.
The default format for the baseline name and baseline number is Username
+ time (GMT) in milliseconds.

630 Creo Object TOOLKIT JavaUser’s Guide


○ BaselineLocation—Specifies the location of the baseline.
○ BaselineLifecycle—Specifies the name of the lifecycle.
• KeepCheckedout—If the value specified is true, then the contents of the
selected object are checked into the Windchill server and automatically
checked out again for further modification.

Retrieval
Standard Creo Object TOOLKIT Java 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.

Checkout and Download


To modify an object from the commonspace, you must check out the object. The
process of checking out communicates your intention to modify a design to the
Windchill server. The object in the database is locked, so that other users can
obtain read-only copies of the object, and are prevented from modifying the object
while you have checked it out.
Checkout is often accompanied by a download action, where the objects are
brought from the server-side workspace to the local workspace cache. In Creo
Object TOOLKIT Java, both operations are covered by the same set of methods.
Methods Introduced:
• pfcServer.Server.CheckoutObjects
• pfcServer.Server.CheckoutMultipleObjects
• pfcServer.pfcServer.CheckoutOptions_Create
• pfcServer.CheckoutOptions.SetDependency
• pfcServer.CheckoutOptions.SetSelectedIncludes
• pfcServer.CheckoutOptions.SetIncludeInstances

Windchill Connectivity APIs 631


• 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:
• Mdl—Specifies the object to be checked out. This is applicable if the model
has already been retrieved without checking it out.
• File—Specifies the top-level object to be checked out.
• Checkout—The checkout flag. If you specify the value of this argument as
true, the selected object is checked out. Otherwise, the object is downloaded
without being checked out. The download action enables you to bring read-
only copies of objects into your workspace. This allows you to examine the
object without locking it.
• Options—Specifies the checkout options object. If you pass NULL as the value
of this argument,, then the default Creo checkout rules apply. Use the method
pfcServer.pfcServer.CheckoutOptions_Create to create a new
CheckoutOptions object.
Use the method pfcServer.Server.CheckoutMultipleObjects to
check out and download multiple objects to the workspace based on the
configuration specifications of the workspace. This method takes the same input
arguments as listed above, except for Mdl and File. Instead it takes the argument
Files that specifies the sequence of the objects to check out or download.

Note
Creo Object TOOLKIT Java methods do not support the AS_STORED
configuration.

By using an appropriately constructed options argument in the above functions,


you can control the checkout operation. Use the APIs listed above to modify the
checkout options. The checkout options are as follows:
• Dependency—Specifies the dependency rule used while checking out
dependents of the object selected for checkout. The types of dependencies
given by the ServerDependency class are as follows:
○ SERVER_DEPENDENCY_ALL—All the objects that are dependent on the
selected object are downloaded, that is, they are added to the workspace.

632 Creo Object TOOLKIT JavaUser’s Guide


○ SERVER_DEPENDENCY_REQUIRED—All the objects that are required
to successfully retrieve the selected object in the CAD application are
downloaded, that is, they are added to workspace.
○ SERVER_DEPENDENCY_NONE—None of the dependent objects from the
selected object are downloaded, that is, they are not added to workspace.
• 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.
The following truth table explains the dependencies of the different control factors
in the method pfcServer.Server.CheckoutObjects and the effect of
different combinations on the end result.
Argument checkout pfcServer.Checkou pfcServer.Checkou Result
in tOptions.SetDown tOptions.SetRea
pfcServer.Server. load donly
Checkout
Objects
true true NA Object is checked out and
its content is
downloaded.
true false NA Object is checked out but
content is not
downloaded.
false NA true Object is downloaded
without checkout and as
read-only.
false NA false Not supported

Windchill Connectivity APIs 633


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 Creo session.

Import and Export


Creo Object TOOLKIT Java provides you with the capability of transferring
specified objects to and from a workspace. Import and export operations must take
place in a session with no models. An import operation transfers a file from the
local disk to the workspace.
Methods Introduced:
• pfcSession.BaseSession.ExportFromCurrentWS
• pfcSession.BaseSession.ImportToCurrentWS
• pfcSession.WSImportExportMessage.GetDescription
• pfcSession.WSImportExportMessage.GetFileName
• pfcSession.WSImportExportMessage.GetMessageType
• pfcSession.WSImportExportMessage.GetResolution
• pfcSession.WSImportExportMessage.GetSucceeded
• pfcSession.BaseSession.SetWSExportOptions
• pfcSession.pfcSession.WSExportOptions_Create
• pfcSession.WSExportOptions.SetIncludeSecondaryContent
The method pfcSession.BaseSession.ExportFromCurrentWS
exports the specified objects from the current workspace to a disk in a linked
session of Creo application.
The method pfcSession.BaseSession.ImportToCurrentWS imports
the specified objects from a disk to the current workspace in a linked session of
Creo application.
Both pfcSession.BaseSession.ExportFromCurrentWS and
pfcSession.BaseSession.ImportToCurrentWS allow you to specify a
dependency criterion to process the following items:

634 Creo Object TOOLKIT JavaUser’s Guide


• All external dependencies
• Only required dependencies
• No external dependencies
Both pfcSession.BaseSession.ExportFromCurrentWS and
pfcSession.BaseSession.ImportToCurrentWS return the messages
generated during the export or import operation in the form of the
pfcSession.WSImportExportMessages object. Use the APIs listed
above to access the contents of a message. The message specified by the
pfcSession.WSImportExportMessage object contains the following
items:
• Description—Specifies the description of the problem or the message
information.
• FileName—Specifies the object name or the name of the object path.
• MessageType—Specifies the severity of the message in the form of the
WSImportExportMessageType class. The severity is one of the
following types:
○ WSIMPEX_MSG_INFO—Specifies an informational type of message.
○ WSIMPEX_MSG_WARNING—Specifies a low severity problem that can be
resolved according to the configured rules.
○ WSIMPEX_MSG_CONFLICT—Specifies a conflict that can be overridden.
○ WSIMPEX_MSG_ERROR—Specifies a conflict that cannot be overridden
or a serious problem that prevents processing of an object.
• Resolution—Specifies the resolution applied to resolve a conflict that can
be overridden. This is applicable when the message is of the type WSIMPEX_
MSG_CONFLICT.
• Succeeded—Determines whether the resolution succeeded or not. This is
applicable when the message is of the type WSIMPEX_MSG_CONFLICT.
The method pfcSession.BaseSession.SetWSExportOptions sets the
export options used while exporting the objects from a workspace in the form of
the pfcSession.WSExportOptions object. Create this object using the
method pfcSession.pfcSession.WSExportOptions_Create. The
export options are as follows:
• Include Secondary Content—Indicates whether or not to include secondary
content while exporting the primary Creo model files. Use the method

Windchill Connectivity APIs 635


pfcSession.WSExportOptions.SetIncludeSecondaryCon
tent to set this option.

File Copy
Creo Object TOOLKIT Java provides you with the capability of copying a file
from the workspace or target folder to a location on the disk and vice-versa.
Methods Introduced:
• pfcSession.BaseSession.CopyFileToWS
• pfcSession.BaseSession.CopyFileFromWS
Use the method pfcSession.BaseSession.CopyFileToWS to copy a file
from the disk to the workspace. The file can optionally be added as secondary
content to a given workspace file. If the viewable file is added as secondary
content, a dependency is created between the Creo model and the viewable file.
Use the method pfcSession.BaseSession.CopyFileFromWS to copy a
file from the workspace to a location on disk.
When importing or exporting Creo models, PTC recommends that you use
methods pfcSession.BaseSession.ImportToCurrentWS and
pfcSession.BaseSession.ExportFromCurrentWS, respectively, to
perform the import or export operation. Methods that copy individual files do not
traverse Creo model dependencies, and therefore do not copy a fully retrievable
set of models at the same time.
Additionally, only the methods
pfcSession.BaseSession.ImportToCurrentWS and
pfcSession.BaseSession.ExportFromCurrentWS provide full
metadata exchange and support. That means
pfcSession.BaseSession.ImportToCurrentWS can communicate all
the Creo designated parameters, dependencies, and family table information to a
PDM system while pfcSession.BaseSession.ExportFromCurrentWS
can update exported Creo data with PDM system changes to designated and
system parameters, dependencies, and family table information. Hence PTC
recommends the use of pfcSession.BaseSession.CopyFileToWS and
pfcSession.BaseSession.CopyFileFromWS to process only non-Creo
files.

Server Object Status


Methods Introduced:
• pfcServer.Server.IsObjectCheckedOut
• pfcServer.Server.IsObjectModified
• pfcServer.Server.IsServerObjectModified

636 Creo Object TOOLKIT JavaUser’s Guide


• pfcServer.ServerObjectStatus.GetIsCheckedOut
• pfcServer.ServerObjectStatus.GetIsModifiedInWorkspace
• pfcServer.ServerObjectStatus.GetIsModifiedLocally
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. The value true
indicates that the specified object is checked out to the active workspace.
The value false indicates one of the following statuses:
• The specified object is not checked out
• The specified object is only uploaded to the workspace, but was never checked
in
• The specified object is only saved to the local workspace cache, but was never
uploaded
The method pfcServer.Server.IsObjectModified specifies whether
the object has been modified in the workspace. This method returns true if the
object was modified locally.
Use the method pfcServer.Server.IsServerObjectModified to
check if the specified object has been modified in workspace or is modified
locally. This method returns an object of the class
pfcServer.ServerObjectStatus.
Use the method pfcServer.ServerObjectStatus.GetIsCheckedOut
to identify whether the object has been checked out or not. This method returns
the value true if the object is checked out.
Use the method
pfcServer.ServerObjectStatus.GetIsModifiedInWorkspace to
identify whether the object has been modified in workspace. This method returns
the value true if the object is modified in workspace.
Use the method
pfcServer.ServerObjectStatus.GetIsModifiedLocally to
identify whether the object has been modified locally or not. This method returns
the value true if the object is modified locally.

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.

Windchill Connectivity APIs 637


Conflicts During Server Operations
Method Introduced:
• 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.Delete
Workspace
Remove object pfcServer.Server.RemoveObjects

These APIs throw a common exception XToolkitCheckoutConflict if an


error is encountered during server operations. Use the method
pfcExceptions.XToolkitCheckoutConflict.GetConflictDe
scription to extract details of the error condition. The exception description
will include the details of the error condition. This description is similar to the
description displayed by the Creo HTML user interface in the conflict report.

Utility APIs
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 on page 627. During the search operation, the workspace
takes precedence over the shared space.

638 Creo Object TOOLKIT JavaUser’s Guide


You can also use this method to search for files that are not in the Creo 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.
The method pfcSession.BaseSession.GetUrlFromAliasedUrl
converts an aliased URL to a standard URL for the objects on the server.
For example, wtws://my_alias/Creo Parametric/abcd.prt is
converted to an appropriate URL on the server as http://
server.mycompany.com/Windchill.
The method pfcSession.BaseSession.GetAliasFromAliasedUrl
returns the server alias from aliased URL.

Windchill Connectivity APIs 639


38
Technical Summary of Changes
Summary of Technical Changes ............................................................................... 641
Technical Summary of Changes for Creo 4.0 M030 .................................................... 676
Technical Summary of Changes for Creo 4.0 M040 .................................................... 678
Technical Summary of Changes for Creo 4.0 M050 .................................................... 679
Technical Summary of Changes for Creo 4.0 M060 .................................................... 680
Technical Summary of Changes for Creo 5.0.0.0 ....................................................... 681
Technical Summary of Changes for Creo 5.0.1.0 ....................................................... 692
Technical Summary of Changes for Creo 5.0.2.0 ....................................................... 692

640 Creo Object TOOLKIT JavaUser’s Guide


Summary of Technical Changes
This chapter describes the critical and miscellaneous technical changes in Creo 4.0
and Creo Object TOOLKIT Java. It also lists the new and superseded functions
for this release.

Critical Technical Changes


This section describes the changes in Creo 4.0 and Creo Object TOOLKIT Java
that might require alteration of existing Creo Object TOOLKIT Java applications.

Accessing Member Information in a Pattern of Pattern


From Creo Parametric 3.0 M060, the method
pfcFeature.FeaturePattern.ListMembers returns all the pattern
header features created at the first level for a pattern of pattern. It does not return
the pattern members under each pattern header.

Non-Applet Based Version of the APIWizard


To open the non-applet based version of the Creo Object TOOLKIT Java
APIWizard, point your browser to:
<creo_otk_java_loadpoint_doc>\objecttoolkit_Creo\index.html

A page containing links to the Creo Object TOOLKIT Java APIWizard and User’s
Guide will open in the web browser.
The non-applet based version of the Creo Object TOOLKIT Java APIWizard has
enhanced search capabilities. The new search options enable you to search for
only global methods, exceptions, licensed methods, and methods that are
supported in Creo Direct, in addition to searching for all classes and methods.

Applet Based Version of the APIWizard


From Creo 4.0 F000, the Applet Based APIWizard is no longer supported. Use the
non-applet based APIWizard instead.

Change in Behavior of pfcTable::CheckIfIsFromFormat


The method pfcTable.Table.CheckIfIsFromFormat did not correctly
check if the drawing table was created using the drawing format. The method
would return false, if the first segment of the table was not on the current sheet
in the Creo user interface, even though the table was created using the drawing
format. This behavior has been fixed in Creo Parametric 2.0 M120. The method
now checks and returns the correct boolean value.

Technical Summary of Changes 641


As in the previous releases, the method
pfcTable.Table.CheckIfIsFromFormat ignores the value provided in
the input argument SheetNumber.

Change in Directory Structure for Creo Installation


From Creo 3.0 onward, the directory structure for Creo installation has changed
from:
• <creo_loadpoint>\Parametric to <creo_loadpoint>\
<datecode>\Parametric.
• <creo_loadpoint>\Common Files\<datecode> to <creo_
loadpoint>\<datecode>\Common Files

Documentation Updated for pfcServer.Server.


IsObjectModified
The documentation for the method
pfcServer.Server.IsObjectModified has been updated in Creo 3.0
M010. This method returns true if the object was modified locally.

Disable Notification Messages in Trail Files


When notifications are set in Creo Object TOOLKIT Java applications, every time
an event is triggered, notification messages are added to the trail files.
From Creo Parametric 2.0 M210 onward, a new environment variable PROTK_
LOG_DISABLE allows you to disable this behavior. When set to true, the
notifications messages are not added to the trail files.

J-Link Installed Along with Creo Object TOOLKIT Java


From Creo 4.0 F000 onward, J-Link is not available as a separate installation in
the product CD. J-Link is automatically installed when you install Creo Object
TOOLKIT Java.
You can run the J-Link applications by making the following changes:
• The application should be packaged as a .jar, which must be included in the
classpath.
• This jar must be unlocked.
• pfc.jar is no longer supported. The classpath should contain otk.jar
instead of pfc.jar.
• The registry should indicate startup as java.

642 Creo Object TOOLKIT JavaUser’s Guide


Layout Model Type
From Creo 3.0 M010 onward, the enumerated type pfcModel.ModelType
contains an additional value MDL_CE_SOLID that represents models of type
Layout. Creo Object TOOLKIT Java methods will only be able to read models of
type Layout, but will not be able to pass Layout models as input to other methods.
To work with Layout models, you must rebuild your existing Creo Object
TOOLKIT Java applications.

List of Classes and Methods


From Creo 3.0 M020 onward, a list of all the Creo Object TOOLKIT Java classes
and methods is available in the file otk_methods.txt located at creo_otk_
java_loadpoint_doc.

No Support for LWG_SIMPREP_LEVEL_SELECTED


The value LWG_SIMPREP_LEVEL_SELECTED in enumerated data type
wfcAssembly.LightweightGraphicsSimprepLevel is not supported,
and is reserved for future use.

Support for Advanced Licensing


From Creo Object TOOLKIT Java 4.0 F000 onward, advanced licensing is
supported. Certain methods will be available under license option 222, that is, the
TOOLKIT-for-3D_Drawings license.

Support for Deleting Items While Visiting Them


While using the visit functionality, PTC recommends that you must not delete the
items that the function will visit. If you delete these items, the results may be
unpredictable.

Support for Creo Unite


Creo Unite enables you to open non-Creo parts and assemblies in Creo Parametric
and other Creo applications without creating separate Creo models.
Most of the Creo Object TOOLKIT Java methods support multi-CAD assemblies.
The methods which do not support assemblies of mixed content will throw the
exception pfcXToolkitUnsupported, when a non-native part or assembly is
passed as the input model.

Technical Summary of Changes 643


When using the method wfcSolid.WSolid.WCreateFeature while
working with a multi-CAD model, the following scenarios are possible depending
on the value of the configuration option confirm_on_edit_foreign_
models. The default value of the configuration option confirm_on_edit_
foreign_models is yes.
• If the configuration option confirm_on_edit_foreign_models is set
to no, the non-Creo model is modified without any notification.
• If the configuration option confirm_on_edit_foreign_models is set
to yes, or the option is not defined in the configuration file, then in batch mode
the application will throw the exception
pfcExceptions.XToolkitGeneralError.
• In some situations you may need to provide input in the interactive mode with
Creo. Refer to the Creo Parametric Data Exchange online help, for more
information.

New Functions
This section describes new functions for Creo Object TOOLKIT Java for Creo
Object TOOLKIT Java 4.0.

Action listeners
New Function Description
wfcSession.WSession. Creates a listener, which blocks the
AddBeforeModelRetrieveListener standard Creo File Open dialog box.
wfcSession. Notifies when the standard Creo File
BeforeModelRetrieveActionListener. Open dialog box is opened. The method
OnBeforeModelRetrieve also retrieves the model specified in the
object
wfcSession.BeforeModelRe
trieveInstructions.

644 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcModel.ModelParamActionListener. Action listener methods that are called
OnBeforeParameterCreate when a parameter is created, modified,
wfcModel.ModelParamActionListener. and deleted in a model.
OnBeforeParameterModify
wfcFeatureParamActionListener::
OnAfterParameterModify
wfcModel.ModelParamActionListener.
OnAfterParameterDelete
wfcFeature. Action listener methods that are called
FeatureParamActionListener. when a parameter is created, modified,
OnBeforeParameterCreate and deleted in a feature.
wfcFeature.
FeatureParamActionListener.
OnBeforeParameterModify
wfcFeature.
FeatureParamActionListener.
OnAfterParameterModify
wfcFeature.
FeatureParamActionListener.
OnAfterParameterDelete

Annotations
New Function Description
Creating Annotation Features
wfcSelect.WSelection. Creates a new annotation feature in the
CreateAnnotationFeature model.
Redefining Annotation Features
wfcSelect.WSelection. Adds a new non-graphical annotation
AddAnnotationElement element to the feature.
wfcSelect.WSelection. Adds a series of new annotation
AddElementsInAnnotationFeature elements to the annotation feature.
wfcSelect.WSelection. Copies and adds an existing annotation
CopyAnnotationElement element to the specified annotation
feature.
wfcSelect.WSelection. Deletes an annotation element from the
DeleteAnnotationElement feature.
wfcSelect.WSelection. Deletes a series of annotation elements
DeleteElementsInAnnotationFeature from the feature.

Technical Summary of Changes 645


New Function Description
Accessing Annotations
wfcAnnotation.Annotation. Shows the annotation in the current
ShowInDrawing combined state.
wfcAnnotation.Annotation.Display Temporarily displays and removes an
wfcAnnotation.Annotation.Undisplay annotation from the display for the
specified combined state.
wfcAnnotation.Annotation. Temporarily displays and removes an
DisplayInDrawing annotation from the display for the
wfcAnnotation.Annotation. specified drawing.
UndisplayInDrawing
wfcAnnotation.Annotation.Update Updates the display of an annotation,
but does not actually display it.
wfcAnnotation.Annotation.IsInactive Indicates whether the annotation can be
shown or not.
wfcDrawing.WDrawing. Removes an annotation from the
EraseAnnotation display for the specified drawing.
wfcSelect.WSelection. Displays the annotation of the specified
ShowAnnotations type for the selected feature or
component.
wfcSelect.WSelection.ShowAxes Displays the axes for the selected
feature and component.
wfcSelect.WSelection. Displays the datum targets for the
ShowDatumTargets selected feature and component.
wfcView2D.WView2D. Displays the annotation of the specified
ShowAnnotations type in the drawing view.
wfcView2D.WView2D.ShowAxes Displays the axes in the drawing view.
wfcView2D.WView2D. Displays the datum targets in the
ShowDatumTargets drawing view.
Accessing and modifying Annotation Elements
wfcAnnotation.Annotation. Retrieves the annotation element that
GetAnnotationElement contains the annotation.
wfcAnnotation.AnnotationElement. Gets the type of the annotation
GetAnnotationType contained in the annotation element.
wfcAnnotation.AnnotationElement. Checks if the annotation element has
IsReadOnly read only or full access.
wfcAnnotation.AnnotationElement. Checks if an annotation element has
HasMissingReferences missing references.
wfcAnnotation.AnnotationElement. Checks if the annotation element is

646 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
IsIncomplete incomplete because of missing strong
references.
wfcAnnotation.AnnotationElement. Gets the copy flag of the annotation
GetCopyFlag elements.
wfcAnnotation.AnnotationElement. Gets the value of the dependency flag
IsDependent for the annotation element.
wfcAnnotation.AnnotationElement. Gets the annotation contained in an
GetAnnotation annotation element.
wfcAnnotation.AnnotationElement. Gets the feature that owns the
GetAnnotationFeature annotation element.
wfcAnnotation.AnnotationElement. Checks if a reference is weak or strong
IsReferenceStrong in a given annotation element.
wfcAnnotation.AnnotationElement. Retrieves an array of references
CollectAnnotationReferences contained in the specified annotation
element.
wfcAnnotation.AnnotationElement. Get the surfaces which make up a quilt
CollectQuiltReferenceSurfaces surface collection reference for the
annotation element.
wfcAnnotation.AnnotationElement. Gets the description property for a
GetAnnotationReferenceDescription given annotation element reference.
wfcAnnotation.AnnotationElement. Sets the description property for a given
SetAnnotationReferenceDescription annotation element reference.
wfcSelect.WSelection. Modifies the annotation contained in an
SetAnnotationInAnnotationElement annotation element.
wfcSelect.WSelection. Sets the copy flag for the annotation
SetCopyFlagInAnnotationElement element.
wfcSelect.WSelection. Sets the dependency flag of the
SetDependencyFlag annotation element.
wfcSelect.WSelection. Gets and sets the autopropagate flag for
GetAutoPropagateFlagInAnnotatio- the specified annotation element
nElement reference.
wfcSelect.WSelection.
SetAutoPropagateFlagInAnnotationEle-
ment
wfcSelect.WSelection. Adds a strong user-defined reference to
AddAnnotationReferenceInAnnotatio- the annotation element.
nElement
wfcSelect.WSelection. Replaces all the user-defined references
SetAnnotationReferencesInAnnotatio- in the annotation element with the
nElement specified references.

Technical Summary of Changes 647


New Function Description
wfcSelect.WSelection. Removes the user-defined reference
RemoveAnnotationReferenceInAnnota- from the annotation element.
tionElement
wfcSelect.WSelection. Converts a weak reference to a strong
StrengthenAnnotationElementRefer- reference.
ence
wfcSelect.WSelection. Converts a strong reference to a weak
WeakenAnnotationElementReference reference.
Automatic Propagation of Annotation Elements
wfcSession.WSession.AutoPropagate Causes the local and automatic
propagation of annotation elements to
the currently selected feature within the
same model, after a supported feature
has either been created or modified.
Annotation Text Styles
wfcAnnotation.Annotation. Gets and sets the text style for the
GetTextStyle specified annotation.
wfcAnnotation.Annotation.
SetTextStyle
wfcAnnotation.Annotation. Gets and sets the text style for the
GetTextStyleInDrawing annotation in the specified drawing.
wfcAnnotation.Annotation.
SetTextStyleInDrawing
pfcDetail.AnnotationTextStyle_Create Creates a data object that contains
information about text style for an
annotation.
pfcDetail.AnnotationTextStyle. Gets and sets the angle of the text style.
GetAngle
pfcDetail.AnnotationTextStyle.
SetAngle
pfcDetail.AnnotationTextStyle. Gets and sets the color of the text style.
GetColor
pfcDetail.AnnotationTextStyle.
SetColor
pfcDetail.AnnotationTextStyle.GetFont Gets and sets the font of the text.
pfcDetail.AnnotationTextStyle.SetFont
pfcDetail.AnnotationTextStyle. Gets and sets the height of the text
GetHeight style.

648 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
pfcDetail.AnnotationTextStyle.
SetHeight
pfcDetail.AnnotationTextStyle. Gets and sets the width of the text style.
GetWidth
pfcDetail.AnnotationTextStyle.
SetWidth
pfcDetail.AnnotationTextStyle. Gets and sets the thickness of the text
GetThickness style.
pfcDetail.AnnotationTextStyle.
SetThickness
pfcDetail.AnnotationTextStyle. Gets and sets the horizontal
GetHorizontalJustification justification of the text style.
pfcDetail.AnnotationTextStyle.
SetHorizontalJustification
pfcDetail.AnnotationTextStyle. Gets and sets the vertical justification
GetVerticalJustification of the text style.
pfcDetail.AnnotationTextStyle.
SetVerticalJustification
pfcDetail.AnnotationTextStyle. Gets and sets the slant angle of the text
GetSlantAngle style.
pfcDetail.AnnotationTextStyle.
SetSlantAngle
pfcDetail.AnnotationTextStyle. Checks if the text height is in relation to
IsHeightInModelUnits the model units or as a fraction of the
screen size.
pfcDetail.AnnotationTextStyle. Sets the height of the text in relation to
SetHeightInModelUnits the model units or as a fraction of the
screen size.
pfcDetail.AnnotationTextStyle. Checks if the text style is mirrored.
IsTextMirrored
pfcDetail.AnnotationTextStyle. Specifies the option to mirror the text
MirrorText style.
pfcDetail.AnnotationTextStyle. Checks if the text style is underlined.
IsTextUnderlined
pfcDetail.AnnotationTextStyle. Specifies the option to underline the
UnderlineText text style.
wfcSolid.WSolid. Retrieves the default height of the
GetDefaultTextHeight annotations and dimensions in the
specified solid.

Technical Summary of Changes 649


New Function Description
Annotation Orientation
wfcAnnotation.Annotation.Rotate Rotates a given annotation by the
specified angle.
wfcSelect.WSelection. Creates a new annotation plane from
CreateAnnotationPlane either a datum plane, a flat surface, or
an existing annotation that already
contains an annotation plane.
wfcSolid.WSolid. Creates a new annotation plane from a
CreateAnnotationPlaneFromView saved model view.
wfcSolid.WSolid. Retrieves an annotation plane that
CreateFlatToScreenPlane represents a flat-to-screen annotation in
the model.
wfcAnnotation.AnnotationPlane. Retrieves the planar surface used as the
GetReference annotation plane.
wfcAnnotation.AnnotationPlane. Retrieves the geometry of the
GetPlaneData annotation plane in terms of the origin
and orientation of the annotation plane.
wfcAnnotation.AnnotationPlane. Retrieves the normal vector that
GetNormalVector determines the viewing direction of the
annotation plane.
wfcAnnotation.AnnotationPlane. Obtains the name of the view that was
GetViewName originally used to determine the
orientation of the annotation plane.
wfcAnnotation.AnnotationPlane. Retrieves the annotation plane type.
GetPlaneType
wfcAnnotation.AnnotationPlane. Checks if the annotation orientation is
IsFrozen frozen or driven by reference to the
plane geometry.
wfcAnnotation.AnnotationPlane. Sets the annotation orientation to be
SetFrozen frozen.
wfcAnnotation.AnnotationPlane. Checks and assigns if the annotations
IsForceToPlane that reference the annotation plane are
wfcAnnotation.AnnotationPlane. placed on that plane.
SetForceToPlane
wfcAnnotation.AnnotationPlane. Gets the current rotation angle in
GetPlaneAngle degrees for a given annotation plane.
wfcAnnotation.AnnotationPlane. Gets the text orientation of all
GetPlaneOrientation annotations on that plane.
Annotation Associativity

650 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcAnnotation.Annotation. Checks if a given annotation in a
IsAssociative drawing view is associative to the
annotation in the 3D model.
wfcAnnotation.Annotation. Gets the associativity of the attachment.
GetAttachmentAssociativity
wfcAnnotation.Annotation. Updates the position of the drawing
UpdatePosition annotation, and makes it associative to
the position of the annotation in the 3D
model.
wfcAnnotation.Annotation. Updates the attachment of the drawing
UpdateAttachment annotation, and makes it associative to
the attachment of the annotation in the
3D model.
Accessing Set Datum Tags
wfcAnnotation.SetDatumTag. Gets and sets the item on which the
GetAttachment datum tag is placed.
wfcAnnotation.SetDatumTag.
SetAttachment
wfcAnnotation.SetDatumTag. Gets and sets the annotation plane for
GetAnnotationPlane the set datum tag.
wfcAnnotation.SetDatumTag.
SetAnnotationPlane
wfcAnnotation.SetDatumTag.Show Displays the set datum tag annotation.
Designating Dimensions and Symbols
wfcModel.WModel.DesignateSymbol Designates a dimension, dimension
tolerance, geometric tolerance or
surface finish symbol to the specified
model.
wfcModel.WModel. Determines if a dimension, dimension
IsDesignatedSymbol tolerance, geometric tolerance or
surface finish symbol has been
designated to a model.
wfcModel.WModel. Undesignates the dimension, dimension
UndesignateSymbol tolerance, geometric tolerance or
surface finish symbol from the
specified model.
Surface Finish Annotations
wfcAnnotation.SurfaceFinish.GetValue Gets and sets the value of a surface
wfcAnnotation.SurfaceFinish.SetValue finish annotation.

Technical Summary of Changes 651


New Function Description
wfcAnnotation.SurfaceFinish. Gets the surface or surfaces referenced
GetReferences by the surface finish.
wfcAnnotation.SurfaceFinish. Gets and sets a surface collection which
GetSurfaceCollection contains the references of the surface
wfcAnnotation.SurfaceFinish. finish.
SetSurfaceCollection
wfcAnnotation.SurfaceFinish.Modify Modifies the symbol instance data for
the specified surface finish.
wfcAnnotation.SurfaceFinish. Gets the symbol instance data for the
GetSymbolInstructions surface finish.
wfcAnnotation.SurfaceFinish.Delete Deletes the specified surface finish.
wfcAnnotation.SurfaceFinish.Show Displays the surface finish annotation.
wfcModel.WModel. Creates a new symbol-based surface
CreateSurfaceFinish finish annotation.
Symbol Annotations
wfcDetail.WDetailSymbolInstItem. Retrieves and sets the annotation plane
GetAnnotationPlane for the 3D symbol data.
wfcDetail.WDetailSymbolInstItem.
SetAnnotationPlane
wfcDetail.WDetailSymbolDefItem. Visits the notes contained in a symbol
VisitNotes definition stored in a solid model or a
drawing.
wfcDetail.WDetailSymbolDefItem. Visits the entities contained in a symbol
VisitEntities definition stored in a solid model.
wfcSolid.WSolid. Enables retrieval of a symbol definition
RetrieveSymbolDefItem into a given solid model.
wfcSolid.WSolid.ListDetailItems Collects and returns a sequence of all
the symbol instances used in the
specified solid.
Detail Tree
wfcSolid.WSolid.CollapseDetailTree Collapse all nodes of the detail tree in
the Creo Parametric window and make
its child nodes invisible.
wfcSolid.WSolid.ExpandDetailTree Expands the detail tree in the Creo
Parametricwindow.
wfcSolid.WSolid.RefreshDetailTree Builds the detail tree in the Creo
Parametric window that contains the
model.

652 Creo Object TOOLKIT JavaUser’s Guide


Application Information: Compatibility
New Function Description
pfcSession.Session.GetAppInfo Gets and sets information related to
pfcSession.Session.SetAppInfo compatibility in an application.
pfcSession.Session.AppInfo_Create Gets and sets the compatibility value
pfcSession.AppInfo.GetCompatibility for the specified application.

pfcSession.AppInfo.SetCompatibility

Combined States
New Function Description
wfcCombState.CombState. Retrieves annotations and their status
GetAnnotations flags from a specified combined state
item.
wfcCombState.CombStateAnnotation. Creates a data object that contains
Create information about annotations from a
combined state.
wfcCombState.CombStateAnnotation. Retrieve and set the annotations for the
GetAnnotation combined state.
wfcCombState.CombStateAnnotation.
SetAnnotation
wfcCombState.CombStateAnnotation. Retrieve and specify if the displayed
GetOption annotation is in the combined state.
wfcCombState.CombStateAnnotation.
SetOption
wfcCombState.CombState. Adds annotations to a specified
AddAnnotations combined state item.
wfcCombState.CombState. Remove the annotations from a
RemoveAnnotations specified combined state item.
wfcCombState.CombState. Removes an annotation from the
EraseAnnotation display for the specified combined
state.
wfcCombState.CombState. Checks if the display of annotations is
GetStateOfAnnotations controlled by the specified combined
state or layers. The method returns
TRUE when the display is controlled by
combined state.
wfcCombState.CombState.IsDefault Checks if the specified combined state
is set as the default combined state for
the model.

Technical Summary of Changes 653


New Function Description
wfcCombState.CombState.IsPublished Checks if the specified combined state
has been published to Creo View.
wfcSolid.WSolid. Updates the layer state, which is active
UpdateActiveLayerState in the specified model.

Detail Items
New Function Description
Creating, Modifying and Reading Detail Items
wfcDetail.WDetailSymbolDefItem. Copies a specified symbol definition
CopyToAnotherModel from one model to another.
Detail Note Data
wfcDetail.WDetailNoteItem. Gets a list of all the symbol instances
CollectSymbolInstances that are declared in a detail note via the
“sym()” callout format.
pfcDetail.DetailNoteItem. Retrieves and sets the text style for the
SetNoteTextStyle specified note as a
pfcDetail.AnnotationText
Style object.
Cross-referencing 3D Notes and Drawing Annotations
wfcDetail.WDetailNoteItem. Gets a detail note that represents a
GetAssociativeNoteInDrawing shown model tree.
wfcDetail.WDetailNoteItem. Gets the solid model note that is
GetAssociativeNoteInSolid displayed as a detail note, if applicable.
Symbol Definition Attachments
wfcDetail.WDetailSymbolDefItem. Adds parametric leader attachments to
AddAttachment the symbol definition.
Symbol Instance Data
wfcDetail.WDetailSymbolInstItem. Retrieves the dimension to which the
GetAttachedDimension specified symbol instance is attached.
wfcDetail.WDetailSymbolInstItem. Adds a leader to a symbol instance
AddLeader description.
wfcDetail.WDetailSymbolInstItem. Adds variable text to the symbol
AddVarText instance description.
wfcDetail.WDetailSymbolInstItem. Retrieves the data of an entity in the
GetEntityInstructions symbol instance.
wfcDetail.WDetailSymbolInstItem. Retrieves the data of a note in the
GetNoteInstructions symbol instance.

654 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
Cross-referencing Weld Symbols and Drawing Annotations
wfcDetail.WDetailSymbolInstItem. Gets the weld feature that owns the
GetFeature shown weld symbol.
Detail Group Data
wfcDetail.WDetailGroupItem. Adds an item to the group contents.
AddElement
Drawing Symbol Groups
wfcDetail.WDetailSymbolGroup. Adds a single item to the symbol group,
AddItem provided such an item belongs to the
symbol definition.

Dimensions
New Function Description
Dimension Information
wfcDimension.WDimension. Retrieves the nominal value of a
GetNominalValue dimension.
wfcDimension.WDimension.GetBound Retrieves the bound values of a
dimension.
wfcDimension.WDimension. Retrieves the text of the dimension in
GetSymbolModeText symbol mode.
wfcDimension.WDimension. Checks if the dimension is expressed in
IsFractional terms of a fraction.
wfcDimension.WDimension.IsBasic Checks if the dimension is of the basic
notation type.
wfcDimension.WDimension. Checks if the dimension is of the
IsInspection inspection notation type.
wfcDimension.WDimension. Retrieves the feature that owns the
GetOwnerFeature specified dimension.
wfcDimension.WDimension. Checks if the specified dimension is set
IsDisplayedValueRounded to display its rounded off value.
wfcDimension.WDimension. Sets the attribute of the given
DisplayValueAsRounded dimension to display the rounded off
value.
wfcDimension.WDimension. Retrieves the displayed rounded value
GetDisplayedValue of the specified dimension.
wfcDimension.WDimension. Retrieves the override value for a
GetOverrideValue dimension.
wfcDimension.WDimension. Retrieves the type of value displayed

Technical Summary of Changes 655


New Function Description
GetDisplayedValueType for a dimension.
wfcDimension.WDimension. Checks if the dimension has a negative
IsSignDriven or positive value.
wfcDimension.WDimension. Checks if the specified dimension is
IsAccessibleInModel owned by the model.
wfcDimension.WDimension. Depending on the value of the input
GetSignificantDigits argument Tolerance, retrieves the
number of decimal places shown for the
upper and lower values of the
dimension tolerance or the number of
decimals digits that are significant for
the dimension.
wfcDimension.WDimension. Depending on the value of the input
GetDenominator argument Tolerance, retrieves the value
for the largest possible denominator for
the upper and lower tolerance values or
the largest possible denominator used
to define the fractional value.
pfcDrawing.Drawing. Checks if the dimension or reference
IsDimensionAssociative dimension is associative.
pfcDimension2D.Dimension2D. Determines whether the drawing
GetIsReference dimension is a reference dimension.
pfcDrawing.Drawing. Checks if the dimension is displayed in
IsDimensionDisplayed the drawing or solid.
pfcDrawing.Drawing. Retrieves the attachment points for the
GetDimensionAttachPoints dimension.
pfcDrawing.Drawing. Retrieves information about how the
GetDimensionSenses dimension is attached to each
attachment point of the model.
pfcDrawing.Drawing. Retrieves the orientation of the
GetDimensionOrientHint dimensions.
pfcDrawing.Drawing. Retrieves baseline dimension for an
GetBaselineDimension ordinate dimension.
pfcDrawing.Drawing. Retrieves the placement location of the
GetDimensionLocation dimension.
pfcDrawing.Drawing. Retrieves the drawing view in which
GetDimensionView the dimension is displayed.
pfcDrawing.Drawing. Checks if the tolerance of a dimension
IsDimensionToleranceDisplayed is displayed in the drawing or solid.
Dimension Operations

656 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
pfcDrawing.Drawing. Converts an ordinate dimension to a
ConvertOrdinateDimensionToLinear linear dimension.
pfcDrawing.Drawing. Converts a linear dimension to an
ConvertLinearDimensionToOrdinate ordinate baseline dimension.
pfcDrawing.Drawing. Changes the view where a dimension
SwitchDimensionView created in the drawing or solid is
displayed.
pfcDrawing.Drawing.EraseDimension Permanently erases the dimension from
the drawing or solid.
Modifying Dimensions
wfcDimension.WDimension.SetBound Sets the bound status of the dimension.
wfcDimension.WDimension. Sets the basic notation of the
SetAsBasic dimension.
wfcDimension.WDimension. Sets the inspection notation of the
SetAsInspection dimension.
wfcDimension.WDimension. Sets the override value for a dimension.
SetOverrideValue
wfcDimension.WDimension. Sets the type of value to be displayed
SetDisplayedValueType for a dimension.
wfcDimension.WDimension. Sets the length of the elbow for the
SetElbowLength specified dimension in a solid.
wfcDimension.WDimension. Creates a simple break on an existing
CreateSimpleBreak dimension witness line.
wfcDimension.WDimension.CreateJog Creates a jog on an existing dimension
witness line.
wfcDimension.WDimension. Erases a specified witness line from the
EraseWitnessLine dimension.
wfcDimension.WDimension. Shows the erased witness line for the
ShowWitnessLine specified dimension.
wfcDimension.WDimension. Depending on the value of the input
SetSignificantDigits argument Tolerance, sets the number of
decimal places for a decimal dimension
or for the upper and lower values of the
dimension tolerance.
wfcDimension.WDimension. Depending on the value of the input
SetDenominator argument Tolerance, sets the value for
the largest possible denominator for the
upper and lower tolerance values or for
fractional dimensions.
wfcDimension.WDimension. Sets the style for the arrow head of a

Technical Summary of Changes 657


New Function Description
SetDimensionArrowType leader for a specified dimension.
Cleaning Up Dimensions
wfcDrawing.WDrawing. Cleans up the dimensions in a drawing.
CleanupDimensions
Dimension Tolerances
wfcDimension.WDimension. Checks whether the tolerances of the
IsToleranceDisplayed specified dimension are currently being
displayed.
wfcDimension.WDimension. Retrieves the displayed rounded values
GetDisplayedUpperLimitTolerance of the upper limit of the specified
dimension.
wfcDimension.WDimension. Retrieves the displayed rounded values
GetDisplayedLowerLimitTolerance of the lower limit of the specified
dimension.
Dimension Location
wfcDimension.DimLocation. Returns the vector normal to the
GetNormal dimensioning plane for a radial or
diameter dimension. This normal vector
should correspond to the axis normal to
the arc being measured by the radial or
diameter dimension.
Dimension Entity Location
wfcDimension.DimLocation. Obtains the type of center leader used
GetCenterLeaderInformation for the dimension, if the dimension uses
a center leader.
wfcDimension.DimLocation. Obtains the endpoints of the first and
GetFirstZExtensionLineLocation second Z-extension lines created for a
wfcDimension.DimLocation. specified dimension.
GetSecondZExtensionLineLocation
wfcDimension.DimLocation. Returns the location of the first and
GetFirstArrowheadLocation second arrow heads for a dimension.
wfcDimension.DimLocation.
GetSecondArrowheadLocation
wfcDimension.DimLocation. Returns the length of the elbow for a
GetElbowLength dimension.
wfcDimension.DimLocation. Gets the location of the first and second
GetFirstWitnessLineLocation witness line end points for a dimension.
wfcDimension.DimLocation.
GetSecondWitnessLineLocation

658 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcDimension.DimLocation. Returns the location of the elements
GetLocation that make up a solid dimension or
reference dimension.
wfcDimension.DimLocation.HasElbow Specifies if a dimension has an elbow.
Dimension Orientation
wfcDimension.WDimension. Assigns an annotation plane as the
SetAnnotationPlane orientation of a specified dimension
stored in an annotation element.
wfcDimension.WDimension. Obtains the orientation of a specified
GetAnnotationPlane dimension stored in an annotation
element.
Driving Dimension Annotation Elements
wfcDimension.WDimension. Creates an annotation element for a
CreateAnnotationElement specified driving dimension based on
the specified annotation orientation.
wfcDimension.WDimension. Removes the annotation element
DeleteAnnotationElement containing the driving dimension.
Accessing Reference and Driven Dimensions
wfcDimension.WDimension. Checks if a driven dimension can be
CanRegenerate regenerated.
wfcDimension.WDimension.Delete Deletes the driven or reference
dimension.
wfcDimension.WDimension.IsDriving Checks if a dimension is driving
geometry or is driven by it.
wfcDimension.WDimension. Gets the entities to which a dimension
GetDimensionAttachPoints is attached.
wfcDimension.WDimension. Gets information on how dimensions
GetDimensionSenses attach to the entity, that is, to what part
of the entity and in what direction the
dimension runs.
wfcDimension.WDimension. Gets the orientation of the driven or
GetOrientationHint reference dimensions.
wfcDimension.WDimension. Sets the geometric references and
SetDimensionAttachPoints parameters of the driven or reference
dimension.
wfcSolid.WSolid.CreateDimension Creates a new driven dimension.
Dimension Prefix and Suffix
wfcDimension.WDimension.GetPrefix Retrieves the prefix assigned to a
wfcDimension.WDimension.SetPrefix specified dimension.

Technical Summary of Changes 659


New Function Description
Sets the prefix for a dimension.
wfcDimension.WDimension.GetSuffix Retrieves the suffix assigned to a
wfcDimension.WDimension.SetSuffix specified dimension.
Sets the suffix for a dimension.
Dimension Location
wfcDimension.WDimension.Move Moves the specified 3D ordinate
dimension to the specified location
within its owner model.
wfcDimension.WDimension. Retrieves the location of the elements
GetDimLocation that make up a solid dimension or a
reference dimension.
45 Degree Chamfer Dimensions
wfcDimension.WDimension. Retrieves and sets the style of the
GetChamferLeaderStyle leader for the specified 45-degree
wfcDimension.WDimension. chamfer dimension.
SetChamferLeaderStyle
wfcDimension.WDimension. Retrieves and sets the dimension
GetConfiguration configuration for chamfer dimensions.
wfcDimension.WDimension.
SetConfiguration
wfcDimension.WDimension. Retrieves and sets the dimension
GetChamferStyle scheme for the specified 45-degree
wfcDimension.WDimension. chamfer dimension.
SetChamferStyle
Baseline Dimensions
wfcDimension.WDimension.IsBaseline Checks whether a dimension is a
baseline dimension.
wfcDimension.WDimension. Retrieves the baseline dimension in a
GetBaselineDimension drawing.
wfcSelect.WSelection. Creates an ordinate baseline annotation
CreateAnnotationFeatBaseline element and corresponding dimension
as a wfcAnnotationElement
object.
Ordinate Dimensions
wfcDimension.WDimension.IsOrdinate Checks if a dimension is ordinate.
wfcDimension.WDimension. Retrieves and sets the display style for
GetOrdinateStandard the ordinate dimensions in the drawing.

660 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcDimension.WDimension.
SetOrdinateStandard
wfcDrawing.WDrawing. Creates ordinate dimensions
CreateAutoOrdinateDimensions automatically for the selected surfaces.
wfcDimension.WDimension. Sets the dimension attachments and
SetOrdinateReferences dimension senses.
wfcDimension.WDimension. Converts an existing ordinate
OrdinateDimensionToLinear dimension to a linear dimension in a
solid.
wfcDimension.WDimension. Converts a linear dimension to an
LinearDimensionToOrdinate ordinate dimension.
wfcSolid.WSolid. Creates a new model ordinate driven
CreateOrdinateDimension dimension or a model ordinate
reference dimension in a solid model.

Drawings
New Function Description
pfcTable.TableOwner. Retrieves and places a drawing table in
RetrieveTableByOrigin the drawing at the specified point. The
origin of the table is positioned at the
specified point.
Drawing Sheet Information
wfcDrawing.WDrawing.GetSheetName Gets the name of the specified drawing
sheet.
wfcDrawing.WDrawing. Gets the sheet number of the drawing
GetFormatSheet format which was used to create the
specified drawing.
Drawing Tables Operations
wfcTable.WTable.GetGrowthDirection Gets the growth direction of the table
using the enumerated type
wfcTable.TableGrowthDir
Type.
wfcTable.WTable.SetGrowthDirection Sets the growth direction of the table.
wfcTable.WTable.SetRowHeight Assigns the height of a specified row
depending on the size of the drawing
table.
wfcTable.WTable. Gets and sets the automatic row height
GetRowHeightAutoAdjustType adjustment property for a row of a

Technical Summary of Changes 661


New Function Description
drawing table.
wfcTable.WTable.
SetRowHeightAutoAdjustType
wfcTable.WTable.Save Saves a drawing table in different
formats.
wfcTable.WTable.SetSegmentOrigin Assigns the origin for a specified
drawing table segment.
wfcTable.WTable.SetColumnWidth Assigns the width of a specified column
depending upon the size of the drawing
table.
wfcTable.WTable.WrapCelltext Wraps the text in a cell.
Merge Drawings
wfcDrawing.WDrawing.Merge Merges two drawings.
Drawing Sheets
wfcModel.WModel2D. Creates a copy of a specified drawing
CopyDrawingSheet sheet.
wfcModel.WModel2D. Displays or hides the drawing format
ShowSheetFormat for a specified drawing sheet.
wfcModel.WModel2D. Returns the tolerance standard that is
GetToleranceStandard assigned to the specified drawing.
wfcModel.WModel2D. Sets the tolerance standard for a
SetToleranceStandard drawing.
wfcModel.WModel2D. Identifies if the drawing format of a
IsSheetFormatBlanked specified drawing sheet is blank.
wfcModel.WModel2D. Identifies if the drawing format of a
IsSheetFormatShown specified drawing sheet is shown.
Listing Drawing Views
wfcView2D.WView2D.GetParentView Gets the parent view of a specified
drawing view.
wfcView2D.WView2D.GetChildren Gets the child views of a drawing view.
wfcView2D.WView2D. Checks if the projection arrow flag has
GetProjectionArrow been set for a projected or detailed
drawing view.
wfcView2D.WView2D. Gets the eye-point distance from model
GetPerspectiveScaleEyePointDistance space for the perspective scale applied
to a drawing view.
wfcView2D.WView2D. Gets the view diameter in paper units
GetPerspectiveScaleViewDiameter such as mm for the perspective scale
applied to a drawing view.

662 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcView2D.WView2D. Gets information about color
GetColorSource designation of the drawing view .
wfcView2D.WView2D. Gets the reference of the Z-clipping on
GetZClippingReference the drawing view.
wfcView2D.WView2D.GetViewType Gets the type of a specified drawing
view.
wfcView2D.WView2D.GetViewId Retrieves the ID of the drawing view.
wfcView2D.WView2D.IsErased Checks if the drawing view is erased or
not.
wfcView2D.WView2D. Gets and sets the alignment of a
GetAlignmentInstructions drawing view with respect to a
wfcView2D.WView2D. reference view.
SetAlignmentInstructions
wfcViewAlignmentInstructions::Create Creates a data object that contains
information about view alignment.
wfcView2D. Get and set the reference view to which
ViewAlignmentInstructions. the drawing view is aligned.
GetReferenceView
wfcView2D.
ViewAlignmentInstructions.
SetReferenceView
wfcView2D. Get and set the alignment style.
ViewAlignmentInstructions.
GetAlignmentStyle
wfcView2D.
ViewAlignmentInstructions.
SetAlignmentStyle
wfcView2D. Get and set the geometry, such as an
ViewAlignmentInstructions. edge, on the reference view.
GetViewReference
wfcView2D.
ViewAlignmentInstructions.
SetViewReference
wfcView2D. Get and set the geometry, such as an
ViewAlignmentInstructions. edge, on the drawing view.
GetAlignedViewReference
wfcView2D.
ViewAlignmentInstructions.
SetAlignedViewReference

Technical Summary of Changes 663


New Function Description
wfcView2D.WView2D. Gets the selection reference for a
GetOriginSelectionRef specified drawing view.
wfcView2D.WView2D.GetOrigin Gets the location of the origin for a
specified drawing view.
wfcView2D.WView2D. Checks if a solid model datum has been
GetDatumDisplayStatus explicitly shown in a particular drawing
view.
wfcView2D.WView2D. Gets the piping display option for a
GetPipingDisplay drawing view.
wfcView2D.WView2D. Gets the sheet number which contained
GetErasedViewSheet the view that was erased.
wfcDrawing.WDrawing.NeedsRegen Checks if the drawing or the specified
drawing view needs to be regenerated.
wfcDrawing.WDrawing. Retrieves the drawing view handle
GetDrawingView based for the specified view ID.
wfcSession.WSession. Opens a drawing in the view only
OpenDrawingAsReadOnly mode.
wfcModel.WModel.VisitItems Finds the views, and conforms to the
usual form of visit functions.
Modifying Views
wfcView2D.WView2D. Sets the specified drawing view as a
SetViewAsProjection projection.
wfcView2D.WView2D. Sets the projection arrow flag to
SetProjectionArrow truefor a projected or detailed
drawing view.
wfcView2D.WView2D. Sets the Z-clipping on the drawing view
SetZClippingReference to reference a given edge, datum, or
point on the surface that is parallel to
the view.
wfcView2D.WView2D.Erase Removes the specified drawing view
from display.
wfcView2D.WView2D.Resume Displays a drawing view that was
erased from display.
wfcView2D.WView2D.SetOrigin Sets the location of the origin and the
selection reference for a specified
drawing view.
wfcView2D.WView2D. Sets the piping display option for a
SetPipingDisplay drawing view.
Drawing Dimensions Information

664 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcDrawing.WDrawing. Extracts the component path for a
GetDimensionPath dimension displayed in a drawing.
wfcDrawing.WDrawing. Gets information about the various
GetDualDimensionOptions options of dual dimensioning in a
drawing.
wfcDrawing. Gets the display style of dual
DualDimensionGlobalOptions. dimensions.
GetDualDimensionType
wfcDrawing. Gets the type of units used for the
DualDimensionGlobalOptions. secondary dimension.
GetSecondaryUnit
wfcDrawing. Gets the number of digits shown in the
DualDimensionGlobalOptions. secondary value, with respect to the
GetDigitsDifference primary.
wfcDrawing. Checks if brackets can be used in dual
DualDimensionGlobalOptions. dimensioning.
AreBracketsAllowed
Detailed Views
wfcDrawing.WDrawing. Creates a detailed view given the
CreateDetailView reference point on the parent view, the
spline curve data, and location of the
new view.
wfcView2D.WView2D. Gets and sets the information related to
GetDetailViewInstructions detailed views.
wfcView2D.WView2D.
SetDetailViewInstructions
wfcView2D.wfcView2D. Creates a data object that contains
DetailViewInstructions_Create information about the detailed view.
wfcView2D.DetailViewInstructions. Gets and sets the reference point on the
GetReference parent view for a specified detailed
wfcView2D.DetailViewInstructions. view.
SetReference
wfcView2D.DetailViewInstructions. Gets and sets the spline curve data for a
GetCurveData specified detailed view.
wfcView2D.DetailViewInstructions.
SetCurveData
wfcView2D.DetailViewInstructions. Gets and sets the boundary type for a
GetBoundaryType detailed view.

Technical Summary of Changes 665


New Function Description
wfcView2D.DetailViewInstructions.
SetBoundaryType
wfcView2D.DetailViewInstructions. Displays the boundary of the detailed
ShowBoundary view in the parent view.
wfcView2D.DetailViewInstructions. Checks if the boundary of the detailed
IsBoundaryShown view is displayed in the parent view.
Drawing Tree
wfcModel.WModel2D.CollapseTree Collapses all nodes of the drawing tree
in the Creo Parametric window and
makes its child nodes invisible.
wfcModel.WModel2D.ExpandTree Expands the drawing tree in the Creo
Parametric window and makes all
drawing sheets and drawing items in
the active drawing sheet visible.
wfcModel.WModel2D.RefreshTree Rebuilds the drawing tree in the Creo
Parametric window that contains the
drawing.
Reading Drawing Tables
pfcTable.TableOwner.GetTable Returns a table specified by the table
identifier in the model.
Auxiliary Views
wfcDrawing.WDrawing. Creates an auxiliary view given the
CreateAuxiliaryView selection reference and the point
location.
wfcView2D.WView2D. Gets information about the auxiliary
GetAuxiliaryViewInstructions view.
wfcAuxiliaryViewInstructions::Create Creates a data object that contains
information about the auxiliary view.
wfcView2D.AuxiliaryViewInstructions. Get and set the selection reference for
GetReference the auxiliary view.
wfcView2D.AuxiliaryViewInstructions.
SetReference
wfcView2D.AuxiliaryViewInstructions. Get and set the centerpoint of the
GetLocation auxiliary view.
wfcView2D.AuxiliaryViewInstructions.
SetLocation
wfcView2D.WView2D. Sets a specified drawing view as the
SetViewAsAuxiliary auxiliary view.

666 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
Revolved Views
wfcDrawing.WDrawing. Creates a revolved view given a cross
CreateRevolveView section, the selection reference, and the
point location.
wfcView2D.WView2D. Gets information about the revolved
GetRevolveViewInstructions view.
wfcRevolveViewInstructions::Create Creates a data object that contains
information about the revolved view.
wfcView2D.RevolveViewInstructions. Get and set the selection reference for
GetReference the revolved view.
wfcView2D.RevolveViewInstructions.
SetReference
wfcView2D.RevolveViewInstructions. Get and set the cross section of the
GetXSec revolved view.
wfcView2D.RevolveViewInstructions.
SetXSec
wfcView2D.RevolveViewInstructions. Get and set the centerpoint of the
GetLocation revolved view.
wfcView2D.RevolveViewInstructions.
SetLocation
View Orientation
wfcView2D.WView2D.SetOrientation Orients the specified drawing view
using saved views from the model.
wfcView2D.WView2D. Orients the view using geometric
SetOrientationFromReference references.
wfcView2D.WView2D. Orients the specified drawing view
SetOrientationFromAngle using angles of selected references or
custom angles.
Sections of a View
wfcView2D.WView2D. Gets the section type for a specified
GetDrawingViewSectionType drawing view.
wfcView2D.WView2D. Gets and sets the 2D cross section for a
GetSection2DInstructions specified drawing view.
wfcView2D.WView2D.
SetSection2DInstructions
wfcSection2DInstructions::Create Creates a data object that contains
information about the 2D cross section.
wfcView2D.Section2DInstructions. Get and set the type of section area.
GetSectionAreaType

Technical Summary of Changes 667


New Function Description
wfcView2D.Section2DInstructions.
SetSectionAreaType
wfcView2D.Section2DInstructions. Get and set the name of the 2D cross
GetSectionName section.
wfcView2D.Section2DInstructions.
SetSectionName
wfcView2D.Section2DInstructions. Get and set the selection reference
GetReference
wfcView2D.Section2DInstructions.
SetReference
wfcView2D.Section2DInstructions. Get and set the spline curve data
GetCurveData
wfcView2D.Section2DInstructions.
SetCurveData
wfcView2D.Section2DInstructions. Get and set the drawing view, that is,
GetArrowDisplayView either the parent or child view, where
wfcView2D.Section2DInstructions. the section arrow is to be displayed.
SetArrowDisplayView
wfcView2D.WView2D. Sets the reference selection for the solid
SetSinglePartSection surface or datum quilt that is used to
create the section in the view.
wfcView2D.WView2D. Gets the section created out of a solid
GetSinglePartSection surface or a datum quilt in the model
for a specified drawing view.
wfcView2D.WView2D. Gets the 3D cross section for a
Get3DSectionName specified drawing view.
wfcView2D.WView2D. Checks if Xhatching is displayed in the
Is3DSectionXHatchingShown 3D cross-sectional view.
wfcView2D.WView2D.Set3DSection Sets a 3D cross section for a view
Visible Areas of Views
wfcView2D.WView2D. Gets and sets the type of visible area for
GetVisibleAreaInstructions a specified drawing view.
wfcView2D.WView2D.SetVisibleArea
View States
wfcView2D.WView2D. Displays the specified drawing view in
SetExplodedState the exploded state.
wfcView2D.WView2D. Checks if the specified view is set to be
IsExplodedState displayed in the exploded state.

668 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcView2D.WView2D.SetSimpRep Gets the simplified representation for a
specified drawing view.
Drawing Models
wfcDrawing.WDrawing. Visits the solids in the specified
VisitDrawingModels drawing.
Drawing Edges
wfcDrawing.WDrawing. Gets and sets the display properties of a
GetEdgeDisplay specified model edge in a drawing
wfcDrawing.WDrawing. view.
SetEdgeDisplay
wfcModel.WModel2D.GetFormatSize Retrieve and set the size of the drawing
wfcModel.WModel2D.SetFormatSize format in the specified drawing.
wfcEdgeDisplay::Create Creates a data object that contains
information about the display properties
of an edge in a drawing view.
wfcGeometry.EdgeDisplay.GetColor Get and set the color to be used for the
wfcGeometry.EdgeDisplay.SetColor display of a specified model edge.
wfcGeometry.EdgeDisplay.GetFont Get and set the line font to be used for
wfcGeometry.EdgeDisplay.SetFont the display of a specified model edge.
wfcGeometry.EdgeDisplay.GetWidth Get and set the width to be used for the
wfcGeometry.EdgeDisplay.SetWidth display of a specified model edge.
wfcDrawing.WDrawing. Checks if the model edge display
IsEdgeDisplayGlobal properties such as color, line font, and
width have been applied globally to all
the drawing views in the drawing sheet.
wfcDrawing.WDrawing. Sets the flag that assigns the model
SetEdgeDisplayGlobal edge display properties such as color,
line font, and width globally to all the
drawing views in the drawing sheet.
wfcModel.WModel2D.GetFormatSize Retrieve and set the size of the drawing
wfcModel.WModel2D.SetFormatSize format in the specified drawing.
Access Drawing Location in Grid
wfcModel.WModel2D. Specifies the position of a point,
GetLocationGridColumnFromPosition expressed in screen coordinates.

Technical Summary of Changes 669


New Function Description
Retrieving Symbol Definitions
pfcDetail.DetailItemOwner. Retrieves a symbol definition from the
RetrieveSymbolDefItem system directory and also from the
user-defined location designated by the
configuration option pro_symbol_
dir.

Export Options
New Function Description
pfcModel.DXFExportInstructions. Gets and sets the options that are used
GetOptionValue to export multiple sheets of a drawing
pfcModel.DXFExportInstructions. to DXF format.
SetOptionValue

Features
New Function Description
wfcFeature.WFeature.IsInFooter Checks if the specified feature is
currently located in the model tree
footer.
wfcFeature.WFeature.MoveToFooter Moves the specified feature into the
model tree footer.
wfcFeature.WFeature.MoveFromFooter Moves the specified feature out of the
model tree footer.
wfcSession.WSession. Adds the variable dimensions and
GetUDFDataDefaultVariableParame- parameters to the instructions.
ters
wfcUDFCreate.UDFVariableParameter. Obtain or set the name or the symbol of
GetName the variant parameter or annotation
wfcUDFCreate.UDFVariableParameter. value.
SetName
wfcUDFCreate.UDFVariableParameter. Obtain or set the item type of the
GetItemType variant parameter or annotation value.
wfcUDFCreate.UDFVariableParameter.
SetItemType
wfcUDFCreate.UDFVariableParameter. Obtain or set the item id of the variant
GetItemId parameter or annotation value.
wfcUDFCreate.UDFVariableParameter.
SetItemId

670 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcUDFCreate.UDFVariableParameter. Obtain or set the default value for the
GetValue variant parameter or annotation value.
wfcUDFCreate.UDFVariableParameter.
SetValue
wfcFeature.WFeature.VisitItems Visits the annotation elements in the
specified feature.

Macros
New Function Description
pfcSession.BaseSession.RunMacro Runs a macro string.
wfcWSession.WSession.ExecuteMacro Executes the macros previously loaded
using the method
pfcSession.BaseSession.Run
Macro.

Models
New Function Description
wfcModel.WLayout.Declare Declares a notebook name to the
specified Creo Parametric model or
notebook.
wfcModel.WLayout.Undeclare Undeclares the notebook name to the
specified Creo Parametric model or
notebook.

Notes
New Function Description
Note Properties
wfcDetail.WDetailNoteItem. Retrieves the elbow direction of elbow
GetElbowDirection in a note in the model coordinate
system
wfcDetail.WDetailNoteItem. Retrieve and set the leader style used
GetLeaderStyle for the note.
wfcDetail.WDetailNoteItem.
SetLeaderStyle
wfcDetail.WDetailNoteItem. Retrieves the envelope of a line for a
Get3DLineEnvelope specified note.
wfcDetail.WDetailNoteItem. Retrieves the length of a leader line in a
note.

Technical Summary of Changes 671


New Function Description
GetLegacyLeaderNoteLength
wfcDetail.WDetailNoteItem. Retrieves the direction of the leader line
GetLegacyLeaderNoteDirection in a note.
Accessing Note Placement
wfcDetail.WDetailNoteItem. Retrieves the type of arrowhead used
GetLeaderArrowTypes for leaders attached to the note.
wfcDetail.WDetailNoteItem. Retrieves the annotation plane assigned
GetAnnotationPlane to the note attachment data.
Modifying 3D Note Attachments
wfcDetail.WDetailNoteItem. Sets a new leader to the end of the array
SetLeadersWithArrowType of current leaders on a note and
specifies the type of arrowhead that is
to be used for the attached leader.
wfcDetail.WDetailNoteItem. Adds a new leader to the end of the
AddLeader array of current leaders on a note.
wfcDetail.WDetailNoteItem. Adds a new leader to the end of the
AddLeaderWithArrowType array of current leaders on a note and
specifies the type of arrowhead that is
to be used for the attached leader.
pfcDetail.DetailLeaderAttachment. Get and set the leader attachment.
GetLeaderAttachment
pfcDetail.DetailLeaderAttachment.
SetLeaderAttachment
pfcDetail.DetailLeaderAttachment. Retrieves and sets the type of
GetType attachment.
pfcDetail.DetailLeaderAttachment.
SetType
wfcDetail.WDetailNoteItem. Removes a leader from the note
RemoveLeader attachment data.
wfcDetail.WDetailNoteItem. Sets the annotation plane for the note.
SetAnnotationPlane
wfcSolid.WSolid.CreateOnItemNote Sets the location of an "On Item" note
placement.
wfcSolid.WSolid.CreateFreeNote Sets the location of the note text.
Text Style Properties
pfcbase.TextStyle.GetAngle Retrieves and sets the angle of rotation
pfcbase.TextStyle.SetAngle for the text style object.
pfcTextStyle::GetFontName Retrieves and sets the font used to

672 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
display the text style object.
pfcTextStyle::SetFontName
pfcTextStyle::GetHeight Retrieves and sets the height of the text
pfcTextStyle::SetHeight style object.
pfcTextStyle::GetIsMirrored Retrieves and sets the mirroring option
pfcTextStyle::SetIsMirrored for the text style object.
pfcTextStyle::GetSlantAngle Retrieves and sets the slant angle of the
pfcTextStyle::SetSlantAngle text style object.
pfcTextStyle::GetThickness Retrieves and sets the line thickness of
pfcTextStyle::SetThickness the text style object.
pfcTextStyle::GetWidthFactor Retrieves and sets the width factor of
pfcTextStyle::SetWidthFactor the text style object.
pfcTextStyle::GetIsUnderlined Retrieves and sets the underline option
pfcTextStyle::SetIsUnderlined for the text style object.

Registry File Data


New Function Description
wfcWSession.WSession. Retrieves the path to the Creo Object
GetApplicationPath TOOLKIT Java executable file.
wfcWSession.WSession. Retrieves the path to the directory
GetApplicationTextPath containing the text folder for the
application.

Relations
New Function Description
wfcModelItem.WRelationOwner. Evaluates a line of a relation set and
EvaluateExpressionWithUnits returns the resulting value with its unit.

Tessellation
New Function Description
wfcSolid.WSolid.Tessellate Tessellates all the surfaces of a part or
the surfaces that belong to the
assembly.

Technical Summary of Changes 673


Visit Methods
New Function Description
wfcFeature.WFeatureGroup. Traverses the members of the feature
VisitDimensions group.
wfcModel.WModel.VisitDetailItems Visits the pfcDetailType objects
in the model for the specified drawing
and sheet of a detail item.

Superseded Functions
This section describes the superseded functions for Creo Object TOOLKIT Java
for Creo 4.0.

Action listeners
Superseded Function New Function
wfcSession.WSession. wfcSession.WSession.AddBe
AddModelRetrievePreListener foreModelRetrieveListener
wfcSession. wfcSession.BeforeModelRe
BeforeModelRetrieveListener. trieveActionListener.OnBe
OnBeforeModelRetrieve foreModelRetrieve

Dimensions
Superseded Function New Function
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
GetIsAssociative IsDimensionAssociative
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.GetIsReference
GetIsReference
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
GetIsDisplayed IsDimensionDisplayed
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
GetAttachmentPoints GetDimensionAttachPoints
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
GetDimensionSenses GetDimensionSenses
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
GetOrientationHint GetDimensionOrientHint
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
GetBaselineDimension GetBaselineDimension
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
GetLocation GetDimensionLocation
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.

674 Creo Object TOOLKIT JavaUser’s Guide


Superseded Function New Function
GetView GetDimensionView
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
GetIsToleranceDisplayed IsDimensionToleranceDisplayed
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
ConvertToLinear ConvertOrdinateDimensionToLinear
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
ConvertToOrdinate ConvertLinearDimensionToOrdinate
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.
SwitchView SwitchDimensionView
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.SetTolerance
SetTolerance
pfcDimension2D.Dimension2D. pfcDrawing.Drawing.EraseDimension
EraseFromModel2D

Drawings
Superseded Function New Function
pfcDetail.DetailItemOwner. pfcDetail.DetailItemOwner.
RetrieveSymbolDefinition RetrieveSymbolDefItem

Relations
Superseded Function New Function
wfcModelItem.WRelationOwner. wfcModelItem.WRelationOwn
EvaluateExpression er.
EvaluateExpressionWithU
nits

Tessellation
Superseded Function New Function
wfcPart.WPart.Tessellate wfcSolid.WSolid.
Tessellate

Support for Windchill ProductPoint


From Creo Parametric 3.0 F000 onward, the module WPP along with its methods
has been obsoleted as Windchill ProductPoint is no longer supported.

Technical Summary of Changes 675


Miscellaneous Technical Changes
The following changes in Creo 4.0 can affect the functional behavior of Creo
Object TOOLKIT Java. PTC does not anticipate that these changes cause critical
issues with existing Creo Object TOOLKIT Java applications.

Display Style for Views


From Creo 3.0 M010 onward, a new display type DISPSTYLE_SHADED_
WITH_EDGES has been added to the enumerated data type
pfcBase.DisplayStyle. This option allows you to display the model as a
shaded solid along with its edges.
The enumerated data type wfcQuickPrint.DisplayStyle was a duplicate
of pfcBase.DisplayStyle. In Creo 3.0 M010,
wfcQuickPrint.DisplayStyle has been obsoleted. Use the enumerated
data type pfcBase.DisplayStyle instead.

Importing Solid Edge Part and Sheet Metal Part as Features


From Creo 3.0 M040 onward, you can import Soild Edge part and sheet metal part
as features. To import, use the following values added to enumerated data type
pfcModel.IntfType:
• INTF_SE_PART
• INTF_SE_SHEETMETAL_PART

Importing Solid Edge Sheet Metal Part to Creo Parametric


From Creo 3.0 M040 onward, you can import a Solid Edge sheet metal part to
Creo Parametric. To import, use the value IMPORT_NEW_SEDGE_
SHEETMETAL_PART added to the enumerated data type
pfcImport.NewModelImportType.

Technical Summary of Changes for Creo


4.0 M030
This chapter describes the critical and miscellaneous technical changes in Creo 4.0
M030 and Creo Object TOOLKIT Java. It also lists the new and superseded
functions for this release.

Critical Technical Changes


This section describes the changes in Creo 4.0 M030 and Creo Object TOOLKIT
Java that might require alteration of existing Creo Object TOOLKIT Java
applications.

676 Creo Object TOOLKIT JavaUser’s Guide


AllowConfirm Parameter Deprecated
From Creo Parametric 4.0 M030 onward, the parameter AllowConfirm has
been deprecated. Creo Parametric displays a warning message which gives details
of failed features. The previous behavior where an interactive dialog box provided
an option to retain failed features and children of failed features, if regeneration
fails, is no longer supported.

Exporting to Other File Formats Using the Export Profile


Option
It is recommended to use the method pfcModel.Model.ExportIntf3D to
export Creo Parametric models to other file formats. The export options must be
set using the export profile option in Creo Parametric.
The following interfaces along with their methods will be deprecated in a future
release of Creo Parametric:
• STEP3DExportInstructions
• VDA3DExportInstructions
• IGES3DNewExportInstructions
• CATIAModel3DExportInstructions
• ACIS3DExportInstructions
• CatiaPart3DExportInstructions
• CatiaProduct3DExportInstructions
• CatiaCGR3DExportInstructions
• JT3DExportInstructions
• ParaSolid3DExportInstructions
• UG3DExportInstructions
• DWG3DExportInstructions
• DXF3DExportInstructions
• TriangulationInstructions

New Functions
This section describes new functions for Creo Object TOOLKIT Java for Creo
Object TOOLKIT Java 4.0 M030.

Technical Summary of Changes 677


Data Exchange
New Function Description
pfcModel.Model.ExportIntf3D Exports a Creo Parametric model to the
specified output format using the
default export profile.

Features
New Function Description
pfcSession.BaseSession. Lists all the features that are currently
QueryFeatureEdit being edited by the Edit Definition
command.

Feature Element Tree


New Function Description
wfcElementTree.ELementTree. Populates the required elements in the
CreateDtmCsysElemTreeFromFile element tree to create a coordinate
system from a transformation file.

Layer Operations
New Function Description
wfcModel.WModel.ExecuteLayerRules Executes the layer rules on the
specified model.
wfcModel.WModel.CopyLayerRules Copies the rules from the reference
model to the current model for the
specified layer.
wfcModel.WModel.MatchLayerRules Compare the rules between the current
and reference model for the specified
layer.

Technical Summary of Changes for Creo


4.0 M040
This chapter describes the critical and miscellaneous technical changes in Creo 4.0
M040 and Creo Object TOOLKIT Java. It also lists the new and superseded
functions for this release.

678 Creo Object TOOLKIT JavaUser’s Guide


New Functions
This section describes new functions for Creo Object TOOLKIT Java for Creo 4.0
M040.
New Function Description
pfcSimpRep.pfcSimpRep. Creates an object that represents the
SimpRepDefaultEnvelope_Create component in default envelope type of
simplified representation.
pfcSimpRep.pfcSimpRep. Creates an object that represents the
SimpRepBoundBox_Create component in boundary box type of
simplified representation.
pfcSimpRep.pfcSimpRep. Creates an object that represents the
SimpRepLightWeightGraphics_Create component in lightweight type of
simplified representation.

Miscellaneous Technical Changes


The following changes in Creo 4.0 M040 can affect the functional behavior of
Creo Object TOOLKIT Java. PTC does not anticipate that these changes cause
critical issues with existing Creo Object TOOLKIT Java applications.

Plotting a Layout Without BorderSize


From Creo 4.0 M040 onward, you can plot a layout without adding a border on
the paper. To plot, use the following paper sizes defined in the enumerated data
type pfcModel.PlotPaperSize:
• CEEMPTYPLOT—The paper size is 22.5 x 36 in
• CEEMPTYPLOT_MM—The paper size is 625 x 1000 mm

Technical Summary of Changes for Creo


4.0 M050
This chapter describes the critical and miscellaneous technical changes in Creo 4.0
M050 and Creo Object TOOLKIT Java. It also lists the new and superseded
functions for this release.

New Functions
This section describes new functions for Creo Object TOOLKIT Java for Creo 4.0
M050.

Technical Summary of Changes 679


View Owner
New Function Description
pfcView.ViewOwner. Retrieves the transformation for a
GetCurrentViewTransform model in the current view.
pfcView.ViewOwner. Sets the transformation for a model in
SetCurrentViewTransform the current view.
pfcView.ViewOwner. Rotates the object in the current view
CurrentViewRotate relative to X, Y, or Z axis.

Technical Summary of Changes for Creo


4.0 M060
This chapter describes the critical and miscellaneous technical changes in Creo 4.0
M060 and Creo Object TOOLKIT Java. It also lists the new and superseded
functions for this release.

New Functions
This section describes new functions for Creo Object TOOLKIT Java for Creo 4.0
M060.

Assembly
New Function Description
wfcFeature.Wfeature.ListVariedItems Visits the variant items and parameters
wfcFeature.Wfeature. owned by an inheritance feature or
ListVariedParameters flexible component.

Feature Element Tree


New Function Description
wfcSelect.Wfeature.CreateFeature Creates a feature from the Feature
Element Tree.

Selection
New Function Description
pfcSelect.pfcSelect. Creates a pfcSelect.Selection
CreateModelSelection object, based on a pfcModel.Model
object.

680 Creo Object TOOLKIT JavaUser’s Guide


Technical Summary of Changes for Creo
5.0.0.0
This chapter describes the critical and miscellaneous technical changes in Creo
5.0.0.0 and Creo Object TOOLKIT Java. It also lists the new and superseded
functions for this release.

New Functions
This section describes new functions for Creo Object TOOLKIT Java for Creo
5.0.0.0.

Data Exchange
New Function Description
pfcModel.Model.ExportIntf3D Exports a Creo Parametric model to the
specified output format using the
default export profile.

Geometric Tolerances
New Function Description
Reading and Creating Geometric Tolerances
wfcGTol.GTol.GetGTolName Retrieves the name of the geometric
tolerance.
wfcGTol.GTol.IsAllAround Checks if the All Around symbol has
been set for the specified geometric
tolerance.
wfcGTol.GTol.SetAllAround Sets the All Around symbol for the
specified geometric tolerance.
wfcGTol.GTol.IsAllOver Checks if the All Over symbol has been
set for the specified geometric
tolerance.
wfcGTol.GTol.SetAllOver Sets the All Over symbol for the
specified geometric tolerance.
wfcGTol.GTol.IsAddlTextBoxed Checks if a box has been created
around the specified additional text in a
geometric tolerance.
wfcGTol.GTol.IsAddlTextBoxed Creates a box around the specified
additional text in a geometric tolerance.
wfcGTol.GTol.IsBoundaryDisplay Checks and sets the boundary modifier
for the specified geometric tolerance.

Technical Summary of Changes 681


New Function Description
wfcGTol.GTol.SetBoundaryDisplay
wfcGTol.GTol.GetUnilateralModifier Checks and sets the profile boundary as
wfcGTol.GTol.SetUnilateralModifier unilateral for the specified geometric
tolerance.
wfcGTol.GTol.GetIndicators Retrieves and sets all the indicators
wfcGTol.GTol.SetIndicators assigned to the specified geometric
tolerance.
wfcGTol.GTol.GetComposite Retrieves and sets the value and datum
references for the specified composite
wfcGTol.GTol.SetComposite
geometric tolerance.
wfcGTol.GTol. Checks if the datum references are
GetCompositeSharedReference shared between all the rows defined in
the composite geometric tolerance.
wfcGTol.GTol. Specifies if datum references in a
SetCompositeSharedReference composite geometric tolerance must be
shared between all the defined rows.
wfcGTol.GTol.GetDatumReferences Retrieves and sets the primary,
secondary, and tertiary datum
wfcGTol.GTol.SetDatumReferences
references for a geometric tolerance.
wfcGTol.GTol.GetTopModel Retrieves the top model that owns the
specified geometric tolerance.
wfcGTol.GTol.GetReferences Retrieves the geometric entities
referenced by the specified geometric
tolerance.
wfcGTol.GTol.AddReferences Adds the datum references for the
specified geometric tolerance.
wfcGTol.GTol.DeleteReference Deletes the specified datum references
in the geometric tolerance.
wfcGTol.GTol.GetGTolType Retrieves and sets the type of geometric
tolerance.
wfcGTol.GTol.SetGTolType
wfcGTol.GTol.GetValueString Retrieves and sets the value string for
the specified geometric tolerance.
wfcGTol.GTol.SetValueString
wfcGTol.wfcGTol.GTolComposite_ Creates a composite tolerance for a
Create specified gtol.
wfcGTol.GTolComposite.GetPrimary Retrieves and sets the primary datum
strings of the composite tolerance.
wfcGTol.GTolComposite.SetPrimary
wfcGTol.GTolComposite. Retrieves and sets the secondary datum
GetSecondary strings of the composite tolerance.
wfcGTol.GTolComposite.SetSecondary

682 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcGTol.GTolComposite.GetTertiary Retrieves and sets the tertiary datum
strings of the composite tolerance.
wfcGTol.GTolComposite.SetTertiary
wfcGTol.GTolComposite.GetValue Retrieves and sets the value datum
wfcGTol.GTolComposite.SetValue strings of the composite tolerance.
wfcGTol.wfcGTol. Creates a datum reference for a
GTolDatumReferences_Create specified gtol.
wfcGTol.GTolDatumReferences. Retrieves and sets the primary datum
GetPrimary references of the gtol.
wfcGTol.GTolDatumReferences.
SetPrimary
wfcGTol.GTolDatumReferences. Retrieves and sets the secondary datum
GetSecondary references of the gtol.
wfcGTol.GTolDatumReferences.
SetSecondary
wfcGTol.GTolDatumReferences. Retrieves and sets the tertiary datum
GetTertiary references of the gtol.
wfcGTol.GTolDatumReferences.
SetTertiary
wfcGTol.wfcGTol.GTolElbow_Create Creates an elbow for a specified gtol.
wfcGTol.GTolElbow.GetDirection Retrieves and sets the direction of the
wfcGTol.GTolElbow.SetDirection elbow in a specified gtol.
wfcGTol.GTolElbow.GetLength Retrieves and sets the length of the
elbow in a specified gtol.
wfcGTol.GTolElbow.SetLength
wfcGTol.wfcGTol.GTolIndicator_ Creates an indicator for a specified gtol.
Create
wfcGTol.GTolIndicator.GetDFS Retrieves and sets the strings for datum
feature symbol in a specified gtol.
wfcGTol.GTolIndicator.SetDFS
wfcGTol.GTolIndicator.GetSymbol Retrieves and sets the strings for
wfcGTol.GTolIndicator.SetSymbol indicator symbols in a specified gtol.
wfcGTol.GTolIndicator.GetType Retrieves and sets the type of indicators
in a specified gtol.
wfcGTol.GTolIndicator.SetType
wfcGTol.wfcGTol. Creates a unilateral modifier for a
GTolUnilateralModifier_Create specified gtol.
wfcGTol.GTolUnilateralModifier. Retrieves and sets the tolerance
GetOutside disposition to outward direction for the
specified gtol.

Technical Summary of Changes 683


New Function Description
wfcGTol.GTolUnilateralModifier.
SetOutside
wfcGTol.GTolUnilateralModifier. Retrieves and sets the boundary
GetUnilateral modifier as unilateral for the specified
wfcGTol.GTolUnilateralModifier. gtol.
SetUnilateral
Deleting a Geometric Tolerance
wfcGTol.GTol.Delete Permanently removes a gtol.
Validating a Geometric Tolerance
wfcGTol.GTol.Validate Checks if the specified geometric
tolerance is syntactically correct.
Additional Text for Geometric Tolerances
wfcGTol.GTol.GetLeftText Retrieves and assigns the text added to
the left of the specified geometric
wfcGTol.GTol.SetLeftText
tolerance control frame.
wfcGTol.GTol.GetBottomText Retrieves and assigns the text added to
the bottom of the specified geometric
wfcGTol.GTol.SetBottomText
tolerance.
wfcGTol.GTol.GetRightText Retrieves and assigns the text added to
wfcGTol.GTol.SetRightText the right of the specified geometric
tolerance control frame.
wfcGTol.GTol.GetTopText Retrieves and assigns the text added to
wfcGTol.GTol.SetTopText the top of the specified geometric
tolerance.
Geometric Tolerance Text Style
wfcGTol.GTol. Retrieves and assigns the horizontal
GetBottomTextHorizJustification justification for the additional text
wfcGTol.GTol. applied to the specified geometric
tolerance at the bottom.
SetBottomTextHorizJustification
wfcGTol.GTol. Retrieves and assigns the horizontal
GetTopTextHorizJustification justification for the additional text
wfcGTol.GTol. applied to the specified geometric
SetTopTextHorizJustification tolerance at the top.
wfcGTol.GTol. Retrieves and assigns the text style of
GetAdditionaltextTextStyle the additional text applied to the
specified geometric tolerance.
wfcGTol.GTol.
SetGTolAdditionaltextTextStyle
Geometric Tolerance Layout
wfcGTol.GTol.GetElbow Retrieves and sets the length and

684 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
direction of the geometric tolerance
wfcGTol.GTol.SetElbow
leader elbow.
wfcGTol.GTol.GetRightTextEnvelope Retrieves the bounding box coordinates
for the right text in a specified
geometric tolerance.
wfcGTol.GTol.Get3DLineEnvelope Retrieves the bounding box coordinates
for one line from the geometric
tolerance.
Attaching the Geometric Tolerances
wfcGTol.GTol.GetGTolAttach Retrieves all the attachment options for
the specified geometric tolerance.
wfcGTol.GTolAttach.GetType Retrieves the type of attachment for a
geometric tolerance using the
enumerated data type
wfcGTolAttachType.
wfcGTol.GTol.SetAttachOffset Sets the offset references for the
specified geometric tolerance .
wfcGTol.GTol.SetAttachFree Sets the attachment options for free
type of geometric tolerance.
wfcGTol.GTol.SetAttachLeader Sets the attachment options for leader
type of geometric tolerance.
wfcGTol.GTol.SetAttachDatum Sets the attachment options for datum
symbol type of geometric tolerance.
wfcGTol.GTol.SetAttachAnnotation Sets the attachment options for
annotation type of geometric tolerance.
wfcGTol.GTol. Sets the options for a geometric
SetAttachMakeDimension tolerance created with Make Dim type of
reference.
wfcGTol.wfcGTol.GTolAttachFree_ Creates an attachment for a gtol that is
Create placed free.
wfcGTol.GTolAttachFree.GetLocation Retrieves and sets the location of the
gtol text in a specified gtol.
wfcGTol.GTolAttachFree.SetLocation
wfcGTol.GTolAttachFree. Retrieves and sets the annotation plane
GetAnnotationPlane in a specified gtol.
wfcGTol.GTolAttachFree.
SetAnnotationPlane
wfcGTol.wfcGTol.GTolAttachLeader_ Creates an attachment for leader type of
Create gtol.
wfcGTol.GTolAttachLeader. Retrieves and sets the location of the
GetLocation gtol text in a specified gtol.

Technical Summary of Changes 685


New Function Description
wfcGTol.GTolAttachLeader.
SetLocation
wfcGTol.GTolAttachLeader. Retrieves and sets the leaders in a
GetLeaders specified gtol.
wfcGTol.GTolAttachLeader.SetLeaders
wfcGTol.GTolAttachLeader. Retrieves and sets the type of leaders
GetLeaderAttachType that can be attached in a specified gtol.
wfcGTol.GTolAttachLeader.
SetLeaderAttachType
wfcGTol.GTolAttachLeader. Retrieves and sets the annotation plane
GetAnnotationPlane on which the leader is attached to the
wfcGTol.GTolAttachLeader. specified gtol.
SetAnnotationPlane
wfcGTol.wfcGTol.GTolAttachDatum_ Creates an attachment for a specified
Create datum inside a gtol.
wfcGTol.GTolAttachDatum.GetDatum Retrieves and sets the attachments for
datum type of gtol.
wfcGTol.GTolAttachDatum.SetDatum
wfcGTol.wfcGTol. Creates an attachment for a specified
GTolAttachAnnotation_Create annotation inside a gtol.
wfcGTol.GTolAttachAnnotation. Retrieves and sets the attachments for
GetAnnotation annotation type of gtol.
wfcGTol.GTolAttachAnnotation.
SetAnnotation
wfcGTol.wfcGTol.AttachOffset_Create Creates an attachment for a gtol with
offset references.
wfcGTol.GTol.AttachOffset.GetOffset Retrieves and sets the position of the
offset reference as model coordinates.
wfcGTol.GTol.AttachOffset.SetOffset
wfcGTol.GTol.AttachOffset. Retrieves and sets the offset reference
GetOffsetRef in a specified gtol.
wfcGTol.GTol.AttachOffset.
SetOffsetRef
wfcGTol.wfcGTol. Creates an attachment for a gtol with
AttachMakeDimension_Create Make Dim type of reference.
wfcGTol.GTol.AttachMakeDimension. Retrieves and sets the location of the
GetLocation gtol text in a specified gtol.
wfcGTol.GTol.AttachMakeDimension.
SetLocation
wfcGTol.GTol.AttachMakeDimension. Retrieves and sets the orientation of the
GetOrientHint gtol.

686 Creo Object TOOLKIT JavaUser’s Guide


New Function Description
wfcGTol.GTol.AttachMakeDimension.
SetOrientHint
wfcGTol.GTol.AttachMakeDimension. Retrieves and sets the information
GetDimSenses about how the gtol attaches to each
wfcGTol.GTol.AttachMakeDimension. attachment point of the model or
drawing.
SetDimSenses
wfcGTol.GTol.AttachMakeDimension. Retrieves and sets the points on the
GetDimAttachments model or drawing where the gtol is
wfcGTol.GTol.AttachMakeDimension. attached.
SetDimAttachments
wfcGTol.GTol.AttachMakeDimension. Retrieves and sets the annotation plane
GetAnnotationPlane in a specified gtol
wfcGTol.GTol.AttachMakeDimension.
SetAnnotationPlane
wfcGTol.wfcGTol. Creates instructions for a leader type of
GTolLeaderInstructions_Create gtol.
wfcGTol.GTolLeaderInstructions. Retrieves and sets the selection of
GetSelection instructions for a leader type of gtol.
wfcGTol.GTolLeaderInstructions.
SetSelection
wfcGTol.GTolLeaderInstructions. Retrieves and sets the type of
GetType instructions for a leader type of gtol.
wfcGTol.GTolLeaderInstructions.
SetType
Cross-referencing 3D Notes and Drawing Annotations
wfcGTol.GTOl.GetDetailNote Retrieves the detail note that represents
a shown geometric tolerance.

Feature Element Tree


New Function Description
wfcElementTree.ElementTree. Populates the required elements in the
CreateDtmCsysElemTreeFromFile element tree to create a coordinate
system from a transformation file.

Technical Summary of Changes 687


Layer Operations
New Function Description
wfcModel.WModel.ExecuteLayerRules Executes the layer rules on the
specified model.
wfcModel.WModel.CopyLayerRules Copies the rules from the reference
model to the current model for the
specified layer.
wfcModel.WModel.MatchLayerRules Compare the rules between the current
and reference model for the specified
layer.

Simplified Representation
New Function Description
pfcSimpRep.pfcSimpRep.Sim Creates an object that represents the
pRepDefaultEnvelope_Create component in default envelope type of
simplified representation.
pfcSimpRep.pfcSimpRep.Sim Creates an object that represents the
pRepBoundBox_Create component in boundary box type of
simplified representation.
pfcSimpRep.pfcSimpRep.Sim Creates an object that represents the
pRepLightWeightGraphics_ component in lightweight type of
Create simplified representation.

View Owner
New Function Description
pfcView.ViewOwner. Retrieves the transformation for a
GetCurrentViewTransform model in the current view.
pfcView.ViewOwner. Sets the transformation for a model in
SetCurrentViewTransform the current view.
pfcView.ViewOwner. Rotates the object in the current view
CurrentViewRotate relative to X, Y, or Z axis.

Superseded Functions
This section describes the superseded functions for Creo Object TOOLKIT Java
for Creo 5.0.0.0.

688 Creo Object TOOLKIT JavaUser’s Guide


Data Exchange
Superseded Function New Function
pfcExport.Export3DInstructions. pfcModel.Model.ExportIntf3D
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.
STEP3DExportInstructions_Create
pfcExport.pfcExport.
VDA3DExportInstructions_Create
pfcExport.pfcExport.
IGES3DNewExportInstructions_Create
pfcExport.pfcExport.
CATIAModel3DExportInstructions_
Create
pfcExport.pfcExport.
ACIS3DExportInstructions_Create
pfcExport.pfcExport.
CatiaPart3DExportInstructions_Create
pfcExport.pfcExport.
CatiaProduct3DExportInstructions_
Create

Technical Summary of Changes 689


Superseded Function New Function
pfcExport.pfcExport.
CatiaCGR3DExportInstructions_Create
pfcExport.pfcExport.
DXF3DExportInstructions_Create
pfcExport.pfcExport.
DWG3DExportInstructions_Create
pfcExport.pfcExport.
JT3DExportInstructions_Create
pfcExport.pfcExport.
ParaSolid3DExportInstructions_Create
pfcExport.pfcExport.
UG3DExportInstructions_Create

From Creo Parametric 5.0.0.0, the following interfaces along with their methods
have been deprecated. Use the method pfcModel.Model.ExportIntf3D
instead to export Creo Parametric models to other file formats. The export options
must be set using the export profile option in Creo Parametric.
• Export3DInstructions
• ACIS3DExportInstructions
• CATIAModel3DExportInstructions
• CATIASession3DExportInstructions
• CatiaPart3DExportInstructions
• CatiaProduct3DExportInstructions
• CatiaCGR3DExportInstructions
• DXF3DExportInstructions
• DWG3DExportInstructions
• IGES3DNewExportInstructions
• JT3DExportInstructions
• ParaSolid3DExportInstructions
• STEP3DExportInstructions
• SWPart3DExportInstructions
• SWAsm3DExportInstructions
• UG3DExportInstructions
• VDA3DExportInstructions

690 Creo Object TOOLKIT JavaUser’s Guide


Detail Text
Superseded Function New Function
pfcDetail.DetailText.GetTextHeight pfcDetail.DetailText.GetTextStyle
pfcDetail.AnnotationTextStyle.
GetHeight
pfcDetail.DetailText.SetTextHeight pfcDetail.DetailText.SetTextStyle
pfcDetail.AnnotationTextStyle.
SetHeight
pfcDetail.DetailText. pfcDetail.DetailText.GetTextStyle
GetTextWidthFactor pfcDetail.AnnotationTextStyle.
GetWidth
pfcDetail.DetailText. pfcDetail.DetailText.SetTextStyle
SetTextWidthFactor pfcDetail.AnnotationTextStyle.
SetWidth
pfcDetail.DetailText. pfcDetail.DetailText.GetTextStyle
GetTextSlantAngle pfcDetail.AnnotationTextStyle.
GetSlantAngle
pfcDetail.DetailText.SetTextSlantAngle pfcDetail.DetailText.SetTextStyle
pfcDetail.AnnotationTextStyle.
SetSlantAngle
pfcDetail.DetailText.GetTextThickness pfcDetail.DetailText.GetTextStyle
pfcDetail.AnnotationTextStyle.
GetThickness
pfcDetail.DetailText.SetTextThickness pfcDetail.DetailText.SetTextStyle
pfcDetail.AnnotationTextStyle.
SetThickness
pfcDetail.DetailText.GetFontName pfcDetail.DetailText.GetTextStyle
pfcDetail.AnnotationTextStyle.GetFont
pfcDetail.DetailText.SetFontName pfcDetail.DetailText.SetTextStyle
pfcDetail.AnnotationTextStyle.SetFont
pfcDetail.DetailText.GetIsUnderlined pfcDetail.DetailText.GetTextStyle
pfcDetail.AnnotationTextStyle.
IsTextUnderlined
pfcDetail.DetailText.SetIsUnderlined pfcDetail.DetailText.SetTextStyle
pfcDetail.AnnotationTextStyle.
IsUnderlineText

Technical Summary of Changes 691


Technical Summary of Changes for Creo
5.0.1.0
This chapter describes the critical and miscellaneous technical changes in Creo
5.0.1.0 and Creo Object TOOLKIT Java. It also lists the new and superseded
functions for this release.

Miscellaneous Technical Changes


The following changes in Creo 5.0.1.0 can affect the functional behavior of Creo
Object TOOLKIT Java. PTC does not anticipate that these changes cause critical
issues with existing Creo Object TOOLKIT Java applications.

Support for Import and Export of 3D Manufacturing Format


(3MF)
You can import and export 3D Manufacturing Format (3MF) files using the
following values:
• IMPORT_NEW_3MF added in enumerated data type
NewModelImportType
• EXPORT_INTF_3MF added in enumerated data type ExportType

Technical Summary of Changes for Creo


5.0.2.0
This chapter describes the critical and miscellaneous technical changes in Creo
5.0.2.0 and Creo Object TOOLKIT Java. It also lists the new and superseded
functions for this release.

New Functions
This section describes new functions for Creo Object TOOLKIT Java for Creo
5.0.2.0.

Drawings
New Function Description
Details Notes Operations
pfcDetail.DetailNoteItem. Allows you to keep arrow type of the
KeepArrowTypeAsIs leader note as it is, after a note is
modified.

692 Creo Object TOOLKIT JavaUser’s Guide


Technical Summary of Changes 693
A
Advanced Licensing Options

Advance Licensing Options for Creo Object TOOLKIT Java........................................ 695

This appendix describes the licensing requirements for advanced options in Creo
Object TOOLKIT Java.

694 Creo Object TOOLKIT JavaUser’s Guide


Advance Licensing Options for Creo
Object TOOLKIT Java
To use some of the functionality in Creo Object TOOLKIT Java you must have
advanced development license options.
For every function that requires an advanced license, the comment “LICENSE:
222” has been added in the Creo Object TOOLKIT Java APIWizard. Advanced
licenses are required in the following situations.
• To run a locked application, Creo Parametric requires theCreo Parametric
TOOLKIT license and also the Creo Object TOOLKIT Java extension license,
or just the Creo Object TOOLKIT Java development license. Advanced toolkit
option is required by specific functions called by the application. If the
application contains calls to such functions, Creo Parametric checks out the
corresponding advanced license option on demand.
• To unlock an application, the unlock utility requires theCreo Parametric
TOOLKIT license and also the Creo Object TOOLKIT Java extension license,
or just the Creo Object TOOLKIT Java development license. and any
advanced toolkit options required by specific functions called by the
application. The utility will not hold any of the advanced options, as it does
the Creo Parametric TOOLKIT license, after unlock is completed.
• Creo Parametric requires Creo Object TOOLKIT Java runtime license to run a
properly unlocked application, in cases where Creo Parametric TOOLKIT
license along with the Creo Object TOOLKIT Java extension license, or just
the Creo Object TOOLKIT Java development license is not available.
Applications are assigned requirements for advanced options based on whether the
application is coded to use any functions requiring the advanced option. It does
not matter if an application does not use the function that requires licensing during
a particular invocation of the application. The licensing requirements are resolved
the moment the application is started by or connects to Creo Parametric, not at the
first time an advanced function is invoked.
For more information on how to unlock an application, refer to the section
Unlocking, Running, and Signing the Creo Object TOOLKIT Java Application on
page 23.

Advanced Licensing Options 695


B
Installing and Working with J-Link

Installing J-Link ....................................................................................................... 697


Domains of J-Link.................................................................................................... 697
Running J-Link Applications ..................................................................................... 697
Standalone Applications .......................................................................................... 698
Sample Applications for J-Link.................................................................................. 699

This chapter provides an overview of J-Link. It explains for to install J-Link and
run J-Link applications.

696 Creo Object TOOLKIT JavaUser’s Guide


Installing J-Link
From Creo Parametric 4.0 F000 onward, J-Link is no longer available as a
separate installation on the product CD. J-Link is automatically installed when
you install Creo Object TOOLKIT Java.
Creo Object TOOLKIT Java is available on the same CD as Creo. When Creo
application is installed, one of the optional components is API Toolkits. This
includes Creo Parametric TOOLKIT, Creo Object TOOLKIT C++, Creo Object
TOOLKIT Java and J-Link and so on.
When you select Creo Object TOOLKIT Java and Jlink option, the following
directories are created under the Creo loadpoint. J-Link is automatically installed
in these directories:
• <creo_loadpoint>\<datecode>\Common Files\otk\otk_
java—Contains all the libraries specific to Creo Object TOOLKIT Java,
which will be used by J-Link application.
• <creo_loadpoint>\<datecode>\Common Files\otk_java_
doc—Contains documentation files specific to Creo Object TOOLKIT Java,
which must be used as reference for J-Link.
• <creo_loadpoint>\<datecode>\Common Files\otk_java_
free—Contains all the example applications specific to J-Link.

Domains of J-Link
J-Link users can access methods available in the pfc domain. This domain
provides classes that support basic functionality.

Note
The wfc and uifc domains are not available for J-Link users. Creo Object
TOOLKIT Java supports pfc, wfc, and uifc domains.

Running J-Link Applications


To run the J-Link applications make the following changes:
• pfc.jar is no longer supported. The classpath should contain otk.jar
instead of pfc.jar.
• The registry should indicate startup as java. Refer to the section Registry
File on page 698, for more information.

Installing and Working with J-Link 697


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.
Using application programs you can make additions to the Creo Parametric user
interface, gather or change data associated with the models in session, or add
session-level ActionListener routines. See the chapter Action Listeners on
page 494 for more information on ActionListeners.

Registry File
A registry file contains Creo Parametric-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
java_app_start start
java_app_stop stop
allow_stop true
delay_start true
text_dir <path to text directory used by
message and menu related commands>
end
The fields of the registry file are as follows:
• 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 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.
• 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 on page 709 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).

698 Creo Object TOOLKIT JavaUser’s Guide


• java_app_start—Specifies the start method of your program. See the
section Start and Stop Methods on page 20 for more information.
• java_app_stop—Specifies the stop method of your program. See the
section Start and Stop Methods on page 20 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. Creo Parametric 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.
• text_dir—Specifies the location of the text directory that contains the
language-specific directories. The language-specific directories contain the
message files, menu files, resource files and UI bitmaps in the language
supported by the J-Link application. The files must be located under a
directory called text or text/<language>, if localized messages are
used in the application. This field has a character limit of 2047 wide characters
(wchar_t).
• end—Indicates the end of the description of the J-Link application. You can
define multiple J-Link applications in the registry files. All these applications
are started by Creo Parametric.

Sample Applications for J-Link


The J-Link sample applications are available in the location <creo_jlink_
loadpoint>\otk_java_appls.
The application otk_java_appls is a collection of example source files for J-
Link. It covers most of the areas of J-Link.
Refer to the section Sample Applications for J-Link on page 700, for more
information on J-Link sample applications.

Installing and Working with J-Link 699


C
Sample Applications for J-Link

Sample Applications ................................................................................................ 701


InstallTest ............................................................................................................... 701
InstallTest ............................................................................................................... 702
jlinkexamples .......................................................................................................... 704
jlinkasyncexamples ................................................................................................. 704
Parameter Editor ..................................................................................................... 704
Round Checker Utility .............................................................................................. 706
Save Check Utility ................................................................................................... 706

This appendix lists the sample applications provided with J-Link.

700 Creo Object TOOLKIT JavaUser’s Guide


Sample Applications
The J-Link sample applications are available in the location <creo_jlink_
loadpoint>.

Note
You must set the configuration option regen_failure_handling to
resolve_mode in the Creo Parametric session before running the sample
application install_test. From Creo Parametric 2.0 M060 onward, a
configuration file (config.pro) has been provided for the install_
test application. The config.pro contains the regen_failure_
handling option.

InstallTest
Location Main Class
<creo_jlink_loadpoint>/otk_java_ StartInstallTest
appls/install_test

The application StartInstallTest is used to check the J-Link synchronous


installation. It verifies the following:
• Application start and stop functions.
• Menubar functions.
• Custom UI functions.
• Sequences, arrays, exceptions, and action listener functions.

Testing the J-Link Synchronous Installation


After the system administrator has installed J-Link, compile, link, and run a
simple J-Link application on the machine you intend to use for development. Test
if the installation of J-Link is present, complete, and visible from your machine.
To test the synchronous J-Link installation:
1. Set the path and CLASSPATH variables to include the Java
Development Kit as described in Java Options and Debugging on page
707.
2. Set the CLASSPATH to include the J-Link synchronous archive and the
current directory.
On Windows set the CLASSPATH as:
set CLASSPATH=<creo_loadpoint>\<datecode>\Common Files
\text\java\otk.jar;%CLASSPATH%

Sample Applications for J-Link 701


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://support.ptc.com/partners/hardware/current/support.htm.

5. Run Creo Parametric.


The Creo Parametric File menu has a new button, added by the J-Link
application, called J-Link Install Test. When you choose this button,
the J-Link application displays a custom dialog indicating whether the
installation test has succeeded:

Note
On Windows the results dialog may appear behind the Creo Parametric
window. Use Atl-Tab to switch to the Java dialog.

InstallTest
Location Main Class
<creo_jlink_loadpoint>/otk_java_ AsyncInstallTest
appls/install_test

702 Creo Object TOOLKIT JavaUser’s Guide


The application AsyncInstallTest is used to check the J-Link asynchronous
installation. It verifies the following:
• Asynchronous J-Link setup
• Creo Parametric start and stop methods
• Menubar functions
• Custom UI functions
• Sequences, arrays, exceptions, and action listener functions

Testing the J-Link Asynchronous Installation


To test the asynchronous J-Link application:
1. Set the path and CLASSPATH variables to include the Java
Development Kit as described in Java Options and Debugging on page
707.
2. Set the CLASSPATH to include the J-Link asynchronous archive and the
current directory.
On Windows set the CLASSPATH as:
set CLASSPATH=<creo_loadpoint>\<datecode>\Common Files
\text\java\pfcasync.jar;%CLASSPATH%
3. Set the library path to include the asynchronous library and make sure that
PRO_COMM_MSG_EXE is set.
On Windows set the library path as:
set path=<creo_loadpoint>\<datecode>\Common Files\<machine type>\lib;%PATH%
set PRO_COMM_MSG_EXE=<creo_loadpoint>\<datecode>\Common Files
\<machine type>\obj\pro_comm_msg.exe
4. Compile the java files in the directory using the command javac *.java.

Sample Applications for J-Link 703


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 (creotk.dat, protk.dat, or
prodev.dat) from the location from where you are running the J-Link
asynchronous test.

5. Run the application java [asynchronous flags]


AsyncInstallTest <command to run Creo Parametric>.

jlinkexamples
Location Main Class
<creo_jlink_loadpoint>/otk_java_ pfcExamplesMenu.java, however note that not
appls/jlinkexamples all examples may be tied to this class.

The application jlinkexamples is a collection of the example source files for


J-Link. It covers most of the areas of J-Link.

jlinkasyncexamples
Location Main Class
<creo_jlink_loadpoint>/otk_java_ Many independent examples
appls/jlinkasyncexamples

The application jlinkasyncexamples is a collection of the asynchronous


example source files for J-Link.

Parameter Editor
Location Main Class
<creo_jlink_loadpoint>/otk_java_ com.ptc.jlinkdemo.parameditor.Para
appls/jlink_param mEditor

The parameter editor example demonstrates a synchronous J-Link user interface


that governs parameters and parameter values in the model. Setup and run the J-
Link Parameter Editor example using the following:

704 Creo Object TOOLKIT JavaUser’s Guide


1. Set the path and CLASSPATH variables to include the Java Development
Kit as described in Java Options and Debugging on page 707.
2. Set the CLASSPATH to include the jlink_param directory and the J-Link
synchronous Jar file (otk.jar). Refer to the section Testing the J-Link
Synchronous Installation on page 701 for more information on setting the
CLASSPATH.
3. Compile the code.
On Windows, execute the batch file compile.bat.
4. Start Creo Parametric 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.

The parameter editor also supports the following customized types of parameters:
• Use the editor to create parameters with descriptive names (user interface
names) of up to 80 characters. The value of the assigned user interface name
will be displayed as the parameter name in the J-Link user interface.
• Creating parameters that follow specific rules:
○ Enumerated lists
○ Specified ranges
○ Specified ranges, with values limited to a certain increment (for example,
any multiple of 5 between 0 and 100).
When you open the J-Link user interface, the parameter value is governed by the
rules assigned to it. If the parameter value is changed to fall outside the permitted
values it will be highlighted in red.

Sample Applications for J-Link 705


Round Checker Utility
Location Main Class
<creo_jlink_loadpoint>/otk_java_ com.ptc.jlinkdemo.round.RoundCheck
appls/jlink_elev er

The round checker example demonstrates a synchronous J-Link utility that


monitors the values assigned to round dimensions. If the value of any modified or
newly created round is reduced below a programmed limit, a J-Link user interface
will appear with information about the violation.
Use the following steps to setup and run the example:
1. Set the path and CLASSPATH variables to include the Java Development
Kit.
2. Set the CLASSPATH to include the jlink_elev directory and the J-Link
synchronous jar file (otk.jar).
3. Compile the code.
On Windows, execute the batch file compile.bat.
4. Load any Creo Parametric model with rounds. Modify the round to less than
0.5. A J-Link dialog that identifies the problem will be displayed. The same
dialog will appear if a new round that does not adhere to the specified
dimensions is created.

Save Check Utility


Location Main Class
<creo_jlink_loadpoint>/otk_java_ com.ptc.jlinkdemo.savecheck.Save
appls/jlink_elev Checker

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 is similar to the
instructions for the round checker utility. To access the interface, choose Tools ▶
Perform Release Checks.

706 Creo Object TOOLKIT JavaUser’s Guide


D
Java Options and Debugging

Supported Java Virtual Machine Versions.................................................................. 708


Synchronous Creo Object TOOLKIT Java ................................................................. 708
Debugging a Synchronous Mode Application............................................................. 708
CLASSPATH Variables ............................................................................................ 709
Synchronous Mode ................................................................................................. 709

This appendix describes how to control the procedure used by Creo applications to
invoke synchronous Creo Object TOOLKIT Java applications to enable you to use
a non-default JVM or to debug your applications.

707
Supported Java Virtual Machine Versions
The machine information for the JVM versions supported by Creo Object
TOOLKIT Java is available at http://support.ptc.com/partners/hardware/current/
support.htm.
The Creo installation includes a default JVM shipped as a part of its CD image.
For synchronous Creo Object TOOLKIT Java applications, Creo uses the shipped
JVM by default.
Creo application includes the ability to override the default JVM command used
to invoke Creo Object TOOLKIT Java applications. This allows you to:
• Use a non-standard JVM in your deployment, if that JVM has a feature or a fix
that is necessary for your application to work correctly.
• Apply command line flags to the Java invocation, thus allowing it to be used
for debugging or other customized purposes.

Synchronous Creo Object TOOLKIT Java


The JVM that is used can be overridden using one of the following mechanisms:
• The configuration option jlink_java_command, if set to the path to the
java executable, will determine the JVM be used to start synchronous Creo
Object TOOLKIT Java applications.
• The environment variable PRO_JAVA_COMMAND serves the same purpose as
the configuration option. The environment variable takes precedence over the
configuration option.

Note
The appropriate flags for synchronous Creo Object TOOLKIT Java as well as
the flags for the user-supplied JRE must be used. The synchronous Creo
Object TOOLKIT Java flags are listed on the Creo Object TOOLKIT Java
platform page. It is recommended that you update the version of the JVM on
your machine to the minimum supported version for the platform.

Debugging a Synchronous Mode


Application
As Creo application has control over the start and stop of Java processes used by
Creo Object TOOLKIT Java, you must use special controls to be able to debug an
application. The most typical deployment should do the following:

708 Creo Object TOOLKIT JavaUser’s Guide


1. Use the appropriate javac compiler flags to build the application
debuggable.
2. Use the technique described in the section Synchronous Creo Object
TOOLKIT Java on page 708 to set the Java command to the appropriate
debug command line, for example, [JDK_HOME]/bin/java.exe
-Xdebug
3. Start the Creo application and let it invoke the Java application.
4. Attach your Java debugger to the process that was started by the Creo
application.
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 Creo Object TOOLKIT Java
applications on your machine, you need to add only your application classes to the
classpath. The mechanisms to accomplish this are:
• Setting the environment variable CLASSPATH.
• Using the java_app_classpath field in the registry file. This field has a
character limit of 2047 wide characters (wchar_t).
• Loading a user-specified Jar file through the user interface (only available for
a model program).
Creo application will automatically add the Creo Object TOOLKIT Java archive
otk.jar to the CLASSPATH.
To compile Creo Object TOOLKIT Java applications, the environment variable
CLASSPATH must include the path to the locations of classes and archives that
you intend to use. Also, you must add Creo Object TOOLKIT Java archive
otk.jar to the CLASSPATH. This archive is located at <creo_
loadpoint>\<datecode>\Common Files\text\java\otk.jar.

Java Options and Debugging 709


E
Geometry Traversal

Example 1 .............................................................................................................. 711


Example 2 .............................................................................................................. 711
Example 3 .............................................................................................................. 712
Example 4 .............................................................................................................. 712
Example 5 .............................................................................................................. 713

This appendix illustrates the relationships between faces, contours, and edges.
Examples E-1 through E-5 show some sample parts and list the information about
their surfaces, faces, contours, and edges.

710 Creo Object TOOLKIT JavaUser’s Guide


Example 1

This part has 6 faces.


• Face A has 1 contour and 4 edges.
• Edge E2 is the intersection of faces A and B.
• Edge E2 is a component of contours C1 and C2.

Example 2

Face A has 2 contours and 6 edges.

Geometry Traversal 711


Example 3

This part was extruded from a rectangular cross section. The feature on the top
was added later as an extruded protrusion in the shape of a semicircle.
• Face A has 1 contour and 6 edges.
• Face B has 2 contours and 8 edges.
• Face C has 1 contour and 4 edges.

Example 4

This part was extruded from a cross section identical to Face A. In the Sketcher,
the top boundary was sketched with two lines and an arc. The sketch was then
extruded to form the base part, as shown.

712 Creo Object TOOLKIT JavaUser’s Guide


• Face A has 1 contour and 6 edges.
• Face B has 1 contour and 4 edges.
• Face C has 1 contour and 4 edges.
• Face D has 1 contour and 4 edges.

Example 5

This part was extruded from a rectangular cross section. The slot and hole features
were added later.
• Face A has 1 contour and 8 edges.
• Face B has 3 contours and 10 edges.

Geometry Traversal 713


F
Geometry Representations

Surface Parameterization......................................................................................... 715


Plane...................................................................................................................... 715
Cylinder .................................................................................................................. 716
Cone ...................................................................................................................... 717
Torus ...................................................................................................................... 717
General Surface of Revolution.................................................................................. 718
Ruled Surface ......................................................................................................... 719
Tabulated Cylinder................................................................................................... 719
Coons Patch ........................................................................................................... 720
Fillet Surface........................................................................................................... 720
Spline Surface ........................................................................................................ 721
NURBS Surface ...................................................................................................... 722
Cylindrical Spline Surface ........................................................................................ 723
Edge and Curve Parameterization ............................................................................ 724
Line........................................................................................................................ 725
Arc ......................................................................................................................... 725
Spline..................................................................................................................... 725
NURBS .................................................................................................................. 726

This appendix describes the geometry representations of the data used by Creo
Object TOOLKIT Java.

714 Creo Object TOOLKIT JavaUser’s Guide


Surface Parameterization
A surface in Creo 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.
This section describes the surface parameterization. The surfaces are listed in
order of complexity. For ease of use, the alphabetical listing of the data structures
is as follows:
• Cone on page 717
• Coons Patch on page 720
• Cylinder on page 716
• Cylindrical Spline Surface on page 723
• Fillet Surface on page 720
• General Surface of Revolution on page 718
• NURBS on page 726
• Plane on page 715
• Ruled Surface on page 719
• Spline Surface on page 721
• Tabulated Cylinder on page 719
• Torus on page 717

Plane

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:

Geometry Representations 715


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

The generating curve of a cylinder is a line, parallel to the axis, at a distance R


from the axis. The radial distance of a point is constant, and the height of the point
is 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 cylinder
radius Radius of the cylinder
Parameterization:
(x, y, z) = radius * [cos(u) * e1 + sin(u) * e2] +
v * e3 + origin
Engineering Notes:
For the cylinder, cone, torus, and general surface of revolution, a local coordinate
system is used that consists of three orthogonal unit vectors (e1, e2, and e3) and
an origin. The curve lies in the plane of e1 and e3, and is rotated in the direction
from e1 to e2. The u surface parameter determines the angle of rotation, and the
v parameter determines the position of the point on the generating curve.

716 Creo Object TOOLKIT JavaUser’s Guide


Cone

The generating curve of a cone is a line at an angle alpha to the axis of revolution
that intersects the axis at the origin. The v parameter is the height of the point
along the axis, and the radial distance of the point is v * tan(alpha).
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
Parameterization:
(x, y, z) = v * tan(alpha) * [cos(u) * e1 +
sin(u) * e2] + v * e3 + origin

Torus

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

Geometry Representations 717


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

General Surface of Revolution

A general surface of revolution is created by rotating a curve entity, usually a


spline, around an axis. The curve is evaluated at the normalized parameter v, and
the resulting point is rotated around the axis through an angle u. The surface of
revolution data structure consists of a local coordinate system and a curve
structure.
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.

(x, y, z) = [c1 * cos(u) - c2 * sin(u)] * e1 +


[c1 * sin(u) + c2 * cos(u)] * e2 +
c3 * e3 + origin

718 Creo Object TOOLKIT JavaUser’s Guide


Ruled Surface

A ruled surface is the surface generated by interpolating linearly between


corresponding points of two curve entities. The u coordinate is the normalized
parameter at which both curves are evaluated, and the v coordinate is the linear
parameter between the two points. The curves are not defined in the local
coordinate system of the part, so the resulting point must be transformed by the
local coordinate system of the surface.
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 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

A tabulated cylinder is calculated by projecting a curve linearly through space.


The curve is evaluated at the u parameter, and the z coordinate is offset by the v
parameter. The resulting point is expressed in local coordinates and must be
transformed by the local coordinate system to be expressed in part coordinates.
Data Format:
e1[3] Unit vector, in the u direction

Geometry Representations 719


e2[3] Unit vector, in the v direction
e3[3] Normal to the plane
origin[3] Origin of the tabulated cylinder
curve Generating curve
Parameterization:
(x', y', z') is the point in local coordinates.
(x', y', z') = C(u) + (0, 0, v)
(x, y, z) = x' * e1 + y' * e2 + z' * e3 + origin

Coons Patch

A Coons patch is used to blend surfaces together. For example, you would use a
Coons patch at a corner where three fillets (each of a different radius) meet.
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

720 Creo Object TOOLKIT JavaUser’s Guide


A fillet surface is found where a round or a fillet is placed on a curved edge, or on
an edge with non-constant arc radii. On a straight edge, a cylinder would be used
to represent the fillet.
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
axis of the fillet arcs
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

The parametric spline surface is a nonuniform bicubic spline surface that passes
through a grid with tangent vectors given at each point. The grid is curvilinear in
uv space. Use this for bicubic blending between corner points.
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
v_tan_arr[][3] Array of v tangent vectors at
interpolant points, of size
Nu x Nv
uvder_arr[][3] Array of mixed derivatives at
interpolant points, of size

Geometry Representations 721


Nu x Nv
Engineering Notes:
• Allows for a unique 3x3 polynomial around every patch.
• There is second order continuity across patch boundaries.
• The point and tangent vectors represent the ordering of an array of [i][j],
where u varies with , and v varies with j. In walking through the point_
arr[][3], you will find that the innermost variable representing v(j)
varies first.

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
wghts[] Array of weights for
rational NURBS, otherwise
NULL
c_point_arr[][3] Array of control points
Definition:

722 Creo Object TOOLKIT JavaUser’s Guide


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:
The weights and c_points_arr arrays represent matrices of size
wghts[N1+1] [N2+1] and c_points_arr [N1+1] [N2+1]. Elements of
the matrices are packed into arrays in row-major order.

Cylindrical Spline Surface


The cylindrical spline surface is a nonuniform bicubic spline surface that passes
through a grid with tangent vectors given at each point. The grid is curvilinear in
modeling space.

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

Geometry Representations 723


origin[3] Origin of the local coordinate
system
splsrf Spline surface data structure
The spline surface data structure contains the following fields:
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 points, in
cylindrical coordinates,
of size Nu x Nv. The array
components are as follows:
point_arr[i][0] - Radius
point_arr[i][1] - Theta
point_arr[i][2] - Z
u_tan_arr[][3] Array of u tangent vectors.
in cylindrical coordinates,
of size Nu x Nv
v_tan_arr[][3] Array of v tangent vectors,
in cylindrical coordinates,
of size Nu x Nv
uvder_arr[][3] Array of mixed derivatives,
in cylindrical coordinates,
of size Nu x Nv
Engineering Notes:
If the surface is represented in cylindrical coordinates (r, theta, z), the local
coordinate system values (x',y', z') are interpreted as follows:
x' = r cos (theta)
y' = r sin (theta)
z' = z
A cylindrical spline surface can be obtained, for example, by creating a smooth
rotational blend (shown in the figure on the previous page).
In some cases, you can replace a cylindrical spline surface with a surface such as a
plane, cylinder, or cone. For example, in the figure, the cylindrical spline surface
S1 was replaced with a cone (r1 = r2, r3 = r4, and r1 ¼ r3).
If a replacement cannot be done (such as for the surface S0 in the figure (ra ¼ rb
or rc ¼ rd)), leave it as a cylindrical spline surface representation.
Edge and Curve Parameterization
This parameterization represents edges (line, arc, and spline) as well as the curves
(line, arc, spline, and NURBS) within the surfaces.
This section describes edges and curves, arranged in order of complexity. For ease
of use, the alphabetical listing is as follows:

724 Creo Object TOOLKIT JavaUser’s Guide


• Arc on page 725
• Line on page 725
• NURBS on page 726
• Spline on page 725

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

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.

Geometry Representations 725


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:
x, y, and z are a series of unique cubic functions, one per segment, fully
determined by the starting and ending points, and tangents of each segment.
Let p_max be the parameter of the last spline point. Then, t, the unnormalized
parameter, is t * p_max.
Locate the spline segment such that:
par_arr[i] < t' < par_arr[i+1]
(If t < 0 or t > +1, use the first or last segment.)
t0 = (t' - par_arr[i]) / (par_arr[i+1] - par_arr[i])
t1 = (par_arr[i+1] - t') / (par_arr[i+1] - par_arr[i])

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:

726 Creo Object TOOLKIT JavaUser’s Guide


k = degree of basis function
N = (number of knots) - (degree) - 2
wi = weights
Ci = control points (x, y, z) * wi
Bi,k = basis functions
By this equation, the number of control points equals N+1.
References:
Faux, I.D., M.J. Pratt. Computational Geometry for Design and Manufacture. Ellis
Harwood Publishers, 1983.
Mortenson, M.E. Geometric Modeling. John Wiley & Sons, 1985.

Geometry Representations 727


G
Creo Object TOOLKIT Java
Classes

List of Creo Object TOOLKIT Java Classes ............................................................... 729

This appendix lists and briefly describes the classes that make up the Creo Object
TOOLKIT Java interface.

728 Creo Object TOOLKIT JavaUser’s Guide


List of Creo Object TOOLKIT Java
Classes
The following table briefly describes the classes in the Creo Object TOOLKIT
Java interface.
Class Package Returned by
ActionListener pfcBase Base class; not returned.

This class defines an action listener.


ActionListeners pfcBase ActionListeners.create()
This data type is used to specify a list of action listeners.
ActionSource pfcBase Base class; not returned.
This class specifies an action source.
ActionSources pfcBase ActionSources.create()
This type describes an array of action sources.
AnalysisFeat pfcAnalysisFeat Downcast of
pfcFeature.Feature.
This feature type specifies an analysis feature.
Arc pfcGeometry Downcast of
pfcGeometry.Curve.
This class defines an arc.
AreaNibbleFeat pfcAreaNibbleFeat Downcast of
pfcFeature.Feature.
This feature type specifies a nibble area. This feature type is used in sheetmetal applications.
Arrow pfcGeometry Downcast of
pfcGeometry.Curve.
This class defines an arrow.
Assembly pfcAssembly Session.CreateAssem
bly()
,
ComponentPath.GetRoot()
This class describes an assembly.
AssemblyCutCopyFeat pfcAssemblyCutCopyFeat Downcast of
pfcFeature.Feature.
This feature type specifies a cut and copied feature, which is used in the Assembly Design module.
AssemblyCutFeat pfcAssemblyCutFeat Downcast of
pfcFeature.Feature.
This feature type specifies a cutout feature, which is used in the Assembly Design module.
AttachFeat pfcAttachFeat Downcast of
pfcFeature.Feature.
This feature type specifies an attached feature.
AttachVolumeFeat pfcAttachVolumeFeat Downcast of
pfcFeature.Feature.
This feature type specifies an attached volume.
AuxiliaryFeat pfcAuxiliaryFeat Downcast of
pfcFeature.Feature.

Creo Object TOOLKIT Java Classes 729


Class Package Returned by
This feature type specifies an auxiliary feature.
Axis pfcGeometry Downcast of
pfcModelItem.ModelItem.
This class defines an axis.
BaseDimension pfcDimension Base class; not returned.
This class defines the base dimension.
BaseParameter pfcModelItem Base class; not returned.
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 Creo 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 pfcModel.BOMExport
Instructions_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.GetPoints()
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 cabling.
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.
CableParamsFileInstruc pfcModel pfcModel.CableParams

730 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
tions FileInstructions_
Create()
Used to export cable parameters from an assembly.
CableSegmentFeat pfcCableSegmentFeat Downcast of
pfcFeature.Feature.
This feature type specifies a cable segment.
CATIAExportInstructions pfcModel pfcModel.CATIAExport
Instructions_Create()
Used to export a part or assembly in CATIA format (as precise geometry)
CATIAFacetsExport pfcModel pfcModel.CATIAFacets
Instructions ExportInstructions
_Create()
Used to export a part or assembly in CATIA format (as a faceted model).
CavDeviationFeat pfcCavDeviationFeat Downcast of
pfcFeature.Feature.
This feature type specifies a deviation feature, which is used in the Verify module.
CavFitFeat pfcCavFitFeat Downcast of
pfcFeature.Feature.
This feature type specifies a fit feature, which is used in the Verify module.
CavScanSetFeat pfcCavScanSetFeat Downcast of
pfcFeature.Feature.
This feature type specifies a scanset feature, which is used in the Verify module.
CGMExportType pfcModel CGMExportType.FromInt()
or by using one of the static
instances (e.g., EXPORT_CGM_
CLEAR_TEXT)
Indicates whether a CGM export file should be ASCII (clear text) or binary (mil spec)
CGMFILEExportInstruc pfcModel pfcModel.CGMFILEExport
tions Instructions_Create()
Used to export a drawing in CGM format.
CGMScaleType pfcModel CGMScaleType.FromInt()
or by using any of the static
instances (e.g., EXPORT_CGM_
ABSTRACT)
Indicates whether a CGM export file should include abstract or metric units
ChamferFeat pfcChamferFeat Downcast of
pfcFeature.Feature.
This feature type specifies a chamfer.
ChannelFeat pfcChannelFeat Downcast of
pfcFeature.Feature.
This feature type specifies a channel.
Child pfcObject Parent.GetChild()
Describes a child feature.
Circle pfcGeometry Downcast of
pfcGeometry.Curve.
This class defines a circle.
CMMConstrFeat pfcCMMConstrFeat Downcast of

Creo Object TOOLKIT Java Classes 731


Class Package Returned by
pfcFeature.Feature.
This feature type specifies a construction feature used in the CMM module.
CMMMeasureStepFeat pfcCMMMeasureStepFeat Downcast of
pfcFeature.Feature.
This feature type specifies a measured step feature, which is used in the CMM module.
CMMVerifyFeat pfcCMMVerifyFeat Downcast of
pfcFeature.Feature.
This feature type specifies a verify feature, which is used in the CMM module.
ColorRGB pfcBase pfcBase.ColorRGB
_Create(),
Session.GetRGBFrom
StdColor()
Specifies the red, green, and blue (RGB) values of a color.
CompModelReplace pfcComponentFeat ComponentFeat.Create
ReplaceOp()
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.
ConnectorParamExportIn pfcModel pfcModel.ConnectorParam
structions ExportInstructions_
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.
Contour pfcGeometry Contours.get(),
Contour.FindContaining
Contour()
This class describes a contour.
Contours pfcGeometry Contours.create(),
Surface.ListContours()
This data type is used to describe an array of contours.
ContourTraversal pfcGeometry ContourTraversal.
FromInt() or by using any of

732 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
the static instances (e.g.,
CONTOUR_TRAV_INTERNAL)
This enumerated type lists the possible values for traversing the contour.
CoordAxis pfcBase CoordAxis.
FromInt() or by using any of
the static instances (e.g., COORD_
AXIS_X)
This enumerated type specifies the axes of a coordinate system.
CoordSysExportInstruc pfcModel Base class; not returned.
tions
Base class of classes that export files with information that describes faceted, solid models
CoordSysFeat pfcCoordSysFeat Downcast of
pfcFeature.Feature.
Describes a coordinate system feature, including constraint and translation information.
CoordSystem pfcGeometry Downcast of
pfcModelItem.ModelItem.
This class describes a coordinate system.
CoreFeat pfcCoreFeat Downcast of
pfcFeature.Feature.
This feature type specifies a core feature.
CornerChamferFeat pfcCornerChamferFeat Downcast of
pfcFeature.Feature.
This feature type specifies a corner chamfer.
CosmeticFeat pfcCosmeticFeat Downcast of
pfcFeature.Feature.
This feature type specifies a cosmetic feature.
CrossSectionFeat pfcCrossSectionFeat Downcast of
pfcFeature.Feature.
This feature type specifies a cross section.
CurvatureData pfcGeometry Surface.EvalPrincipal
Curv()
This class specifies the curvature data.
Curve pfcGeometry Downcast of
pfcGeometry.Curve.
This class defines a curve.
CurveFeat pfcCurveFeat Downcast of
pfcFeature.Feature.
Specifies a curve feature.
Curves pfcGeometry Curves.create(),
CompositeCurve.List
Elements()
This data type is used to specify an array of curves.
CurveStartPoint pfcCurveFeat CurveStartPoint.From
Int() or by using any of the
static instances (e.g., CURVE_
START)

Creo Object TOOLKIT Java Classes 733


Class Package Returned by
This enumerated type lists the possible starting points of the datum curve offset.
CurveXYZData pfcGeometry GeomCurve.Eval3DData(),
GeomCurve.EvalFrom
Length()
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 Creo 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.CreateDele
teOp()
This class defines a delete operation.
Dependencies pfcModel Dependencies.create(),
Model.ListDependen
cies()
This data type is used to specify the first-level dependencies for an object.
Dependency pfcModel Dependencies.get()

734 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
Describes the first-level dependency for an object.
Dimension pfcDimension Downcast of
pfcModelItem.ModelItem.
This class describes a dimension.
DimensionType pfcDimension DimensionType.FromInt()
or by using any of the static
instances (e.g., DIM_LINEAR)
This enumerated type lists the possible dimension types.
DimTolerance pfcDimension Dimension.GetToler
ance()
This class defines the dimension tolerance.
DimTolLimits pfcDimension DimTolLimits.Create()
This class displays the limits for the dimension tolerance.
DimTolPlusMinus pfcDimension DimTolPlusMinus.Create
This class displays the dimension tolerance in the form +/-x, where x is the plus tolerance. The value of
the minus tolerance is unused.
DimTolSymmetric pfcDimension DimTolSymmetric.
Create()
This class displays the dimension tolerance in symmetrical form.
DisplayStatus pfcLayer DisplayStatus.FromInt()
or by using any of the static
instances (e.g., LAYER_NORMAL).
This enumerated type lists the possible values for the display status of a layer.
Dome2Feat pfcDome2Feat Downcast of
pfcFeature.Feature.
This feature type specifies a section dome.
DomeFeat pfcDomeFeat Downcast of
pfcFeature.Feature.
This feature type specifies a radius dome.
DraftFeat pfcDraftFeat Downcast of
pfcFeature.Feature.
This feature type specifies a draft.
DraftLineFeat pfcDraftLineFeat Downcast of
pfcFeature.Feature.
This feature type specifies a line draft, which is used with the Legacy module.
Drawing pfcDrawing Session.CreateDrawing
This class describes a drawing.
DrillFeat pfcDrillFeat Downcast of
pfcFeature.Feature.
This feature type specifies a drill, which is used with the Creo NC module.
DrillGroupFeat pfcDrillGroupFeat Downcast of
pfcFeature.Feature.
This feature type specifies a drill group, which is used in the Creo NC module.
DrvToolCurveFeat pfcDrvToolCurveFeat Downcast of
pfcFeature.Feature.
This feature type specifies a driven-tool curve, which is used in the Creo NC module.
DrvToolEdgeFeat pfcDrvToolEdgeFeat Downcast of

Creo Object TOOLKIT Java Classes 735


Class Package Returned by
pfcFeature.Feature.
This feature type specifies a driven-tool edge, which is used in the Creo NC module.
DrvToolProfileFeat pfcDrvToolProfileFeat Downcast of
pfcFeature.Feature.
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.
DWGSetupExportInstruc pfcModel pfcModel.DWGSetupExport
tions Instructions_Create()
Used to export a drawing setup file.
DXFExportInstructions pfcModel pfcModel.DXFExport
Instructions_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.ListElements()
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.
This feature type specifies an etched feature.
ExplodeLineFeat pfcExplodeLineFeat Downcast of
pfcFeature.Feature.
This feature type specifies an explode line.
ExportInstructions pfcModel Base class; not returned.
Base class to all the export-instructions classes.

736 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
ExportType pfcModel ExportType.FromInt() or
by using any of the static instances
(e.g., EXPORT_IGES_SECTION)
Enumeration of the available export options.
ExpRatioFeat pfcExpRatioFeat Downcast of
pfcFeature.Feature.
This feature type specifies an exponential-ratio feature.
ExtendFeat pfcExtendFeat Downcast of
pfcFeature.Feature.
This feature type specifies an extend feature.
ExtractFeat pfcExtractFeat Downcast of
pfcFeature.Feature.
This feature type specifies an extraction.
FamColComp pfcFamily FamilyMember.Create
ComponentColumn()
This class describes a component column in a family table.
FamColCompModel pfcFamily FamilyMember.Create
CompModelColumn()
This class describes a component model column in a family table.
FamColDimension pfcFamily FamilyMember.Create
DimensionColumn()
This class specifies a dimension column in a family table.
FamColExternalRef pfcFamily Not returned.
This class describes an external reference column in a family table.
FamColFeature pfcFamily FamilyMember.Create
FeatureColumn()
This class specifies a family column feature.
FamColGroup pfcFamily FamilyMember.Create
GroupColumn()
This class describes a group column in a family table.
FamColGTol pfcFamily Not returned.
This class describes a geometric tolerance (gtol) column in a family table.
FamColMergePart pfcFamily FamilyMember.Create
MergePartColumn()
This class describes a merged part column in a family table.
FamColModelItem pfcFamily Base class; not returned.
This class specifies a column in the family table.
FamColParam pfcFamily FamilyMember.Create
ParamColumn()
This class specifies a parameter column in a family table.
FamColSystemParam pfcFamily Not returned.
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.GetPar
ent()

Creo Object TOOLKIT Java Classes 737


Class Package Returned by
This class describes a member in a family table.
FamilyTableColumn pfcFamily FamilyMember.AddCol
umn()
,
FamilyTableColumns.
get()
This class specifies a column in a family table.
FamilyTableColumns pfcFamily FamilyTableColumns.
create(),
FamilyMember.List
Columns()
This data type is used to specify a list of columns in a family table.
FamilyTableRow pfcFamily FamilyMember.AddRow(),
FamilyMember.GetRow(),
FamilyTableRows.get()
This class specifies a row in a family table.
FamilyTableRows pfcFamily FamilyTableRow
s.create()
,
FamilyMember.ListRows()
This data type is used to specify a list of rows in a family table.
FeatIdExportInstruc pfcModel Base class; not returned.
tions
Base class of instructions classes that export data for a single feature.
FeatInfoExportInstruc pfcModel pfcModel.FeatInfoExport
tions Instructions_Create()
Used to export information about one feature in a part or assembly.
Feature pfcFeature Solid.GetFeatureBy
Name()
, FeatureOperation.GetOp
Feature(). Also, by
downcasting
pfcModelItem.ModelItem.
This class defines the feature information.
FeatureActionListener_u pfcFeature Base class; not returned.
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(),
FeatureGroup.GetPattern
()

738 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
This class specifies a feature pattern.
FeaturePlacement pfcFeature Feature.GetPlacement()
Specifies the placement of a feature.
Features pfcFeature Features.create(),
Feature.ListChildren(),
Feature.ListParents(),
FeaturePattern.
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 pfcModel.FIATExport
Instructions_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.
FlatPatFeat pfcFlatPatFeat Downcast of
pfcFeature.Feature.
This feature type specifies a flat pattern.
FlatRibbonSegmentFeat pfcFlatRibbonSegment Downcast of
Feat pfcFeature.Feature.
This feature type is for flat ribbon segments.
FlattenFeat pfcFlattenFeat Downcast of
pfcFeature.Feature.
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.
GeomCopyFeat pfcGeomCopyFeat Downcast of
pfcFeature.Feature.
This feature type specifies a geometric copy feature.

Creo Object TOOLKIT Java Classes 739


Class Package Returned by
GeomCurve pfcGeometry RevolvedSurface.
GetProfile(),
RuledSurface.Get
Profile1(),
RuledSurface.Get
Profile2(),
TabulatedCylinder.Get
Profile()
This class provides information for a geometry curve.
GeomExportFlags pfcModel pfcModel.GeomExport
Flags
_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.
IGES3DExport pfcModel pfcModel.IGES3DExport
Instructions Instructions_Create()
Used to export a part or assembly in IGES format.
IGESFileExport pfcModel pfcModel.IGESFileExport
Instructions Instructions_Create()
Used to export a drawing in IGES format
ImportFeat pfcImportFeat Downcast of
pfcFeature.Feature.
This feature type specifies an import feature.
IntegerOId pfcObject Base class; not returned.
This class specifies an integer identifier. For internal use only.
InternalUDFFeat pfcInternalUDFFeat Downcast of
pfcFeature.Feature.
This feature type is for internal use only.
IntersectFeat pfcIntersectFeat Downcast of
pfcFeature.Feature.
This feature type specifies an intersection.
InventorExportInstruc pfcModel pfcModel.Inventor
tions ExportInstructions
_Create()
Used to export a part or assembly in Inventor format.
IPMQuiltFeat pfcIPMQuiltFeat Downcast of
pfcFeature.Feature.

740 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
Specifies an IPM Quilt feature.
ISegmentFeat pfcISegmentFeat Downcast of
pfcFeature.Feature.
This feature type specifies an ideal segment.
Layer pfcLayer Model.CreateLayer(). Also,
by downcasting
pfcModelItem.ModelItem.
This class describes a layer.
Line pfcGeometry Downcast of
pfcGeometry.Curve.
This class defines a line.
LineStockFeat pfcLineStockFeat Downcast of
pfcFeature.Feature.
This feature type specifies a line stock, which is used in the piping.
LipFeat pfcLipFeat Downcast of
pfcFeature.Feature.
This feature type specifies a lip feature.
LocPushFeat pfcLocPushFeat Downcast of
pfcFeature.Feature.
This feature type specifies a local push feature.
ManualMillFeat pfcManualMillFeat Downcast of
pfcFeature.Feature.
This feature type specifies a manual-mill feature.
Material pfcPart Materials.get(),
Part.GetCurrent
Material(),
Part.CreateMaterial(),
Part.RetrieveMaterial()
This class provides information about a material.
MaterialExport pfcModel pfcModel.MaterialExport
Instructions Instructions_Create()
Used to export a material from a part.
MaterialOId pfcPart
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.GetMatrix()
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

Creo Object TOOLKIT Java Classes 741


Class Package Returned by
pfcFeature.Feature.
This feature type specifies a merge feature.
MFG pfcMFG Session.CreateMFG(). Also,
by downcasting
pfcModel.Model.
This class describes a manufacturing object.
MFGCLExportInstructions pfcModel Base class; not returned.
Base class to classes that export cutter-location files.
MFGFeatCLExport pfcModel pfcModel.MFGFeatCL
Instructions ExportInstructions
_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.
MFGOperCLExportInstruc pfcModel pfcModel.MFGOperCL
tions ExportInstructions
_Create
()
Used to export a cutter location (CL) file for all the NC sequences in an operation.
MFGRefineFeat pfcMFGRefineFeat Downcast of
pfcFeature.Feature.
This feature type specifies a manufacturing refine feature.
MFGTrimFeat pfcMFGTrimFeat Downcast of
pfcFeature.Feature.
This feature type specifies a manufacturing trim feature.
MFGUseVolumeFeat pfcMFGUseVolumeFeat Downcast of
pfcFeature.Feature.
This feature type specifies a manufacturing use volumes feature.
MillFeat pfcMillFeat Downcast of
pfcFeature.Feature.
This feature type specifies a milling feature.
Model pfcModel Selection.GetSelModel(),
Window.GetModel(),
CompModelReplace.
GetNewModel(),Cable
Params
FileInstructions
.GetMdl()
This class specifies the information about a model.
ModelDescriptor pfcModel pfcModelDescriptor.
ModelDescriptor
_Create(),
Model.GetDescr()
This class describes the descriptor for a model.

742 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
ModelDescriptors pfcModel ModelDescriptors
.create(),
Model.ListDeclared
Models()
This data type is used to specify an array of model descriptors.
ModelInfoExport pfcModel pfcModel.ModelInfo
Instructions ExportInstructions
_Create()
Used to export information about a model, including units information, features, and children.
ModelItem pfcModelItem ModelItemOwner.GetItem
ById(),
ModelItemOwner.Get
ItemByName(),
Selection.GetSelItem(),
FamColModelItem.Get
RefItem()
This class defines a model item.
ModelItemOId pfcModelItem pfcModel.ModelItemOId
_Create()
This class specifies the owner of a model item. For internal use only.
ModelItemOwner pfcModelItem Base class; not returned.
This class specifies the owner of a model item.
ModelItems pfcModelItem ModelItems.create(),
Feature.ListSubItems(),
ModelItemOwner.List
Items(),
Layer.ListItems()
Specifies a list of model items.
ModelItemType pfcModelItem ModelItemType.FromInt()
or by using any of the static
instances (e.g., ITEM_SURFACE)
This enumerated type lists the different kinds of model item.
ModelItemTypes pfcModelItem ModelItemTypes.create(),
Solid.ExcludeTypes()
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.

Creo Object TOOLKIT Java Classes 743


Class Package Returned by
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.
Object pfcObject Base class; not returned.
Base classes to classes that represent Creo objects.
OffsetCurveDirection pfcCurveFeat OffsetCurveDirection
.FromInt() or by using any of
the static instances (e.g.,
OFFSET_SIDE_ONE)
This enumerated type specifies the direction of an offset.
OffsetFeat pfcOffsetFeat Downcast of
pfcFeature.Feature.
This feature type specifies an offset feature.
OId pfcObject Child.GetOId()
This class defines the owner identifier object. For internal use only.
OperationComponentFeat pfcOperationComponent Downcast of
Feat pfcFeature.Feature.
This feature type specifies an operation component feature.
OperationFeat pfcOperationFeat Downcast of
pfcFeature.Feature.
This feature type specifies an operation feature.
OptegraVisExport pfcModel pfcModel.OptegraVis
Instructions ExportInstructions
_Create()
Used to export a part or assembly in Optegra Vis format.
Outline2D pfcBase Outline2D.create(),
Contour.EvalOutline()
This data type is used to specify a two-dimensional outline.
Outline3D pfcBase Outline3D.create(),
Solid.GetGeomOutline(),
Solid.EvalOutline()
This data type is used to specify a three-dimensional outline.
Parameter pfcModelItem ParameterOwner.Create
Param(),
ParameterOwner.Get
Param(),
ParameterOwner.Select
Param(),
FamColParam.GetRef
Param(),
Parameters.get(),
pfcModelItem.Create
*ParamValue()
This class defines a parameter object.

744 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
ParameterOwner pfcModelItem Base class; not returned.
This class defines a parameter owner object.
Parameters pfcModelItem Parameters.create()
Specifies a list of parameters.
ParamOId pfcModelItem pfcModel.ParamOId
_Create(),
ParameterOwner
.ListParams()
This class specifies the owner of a parameter. For internal use only.
ParamType pfcSession ParamType.FromInt() or by
using any of the static instances (e.
g., DIMTOL_PARAM)
Enumeration of parameters types that is used to specify which parameters to display.
ParamValue pfcModelItem BaseParameter.GetVal
ue()
, FamilyMember.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.Fro
mInt() 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.

Creo Object TOOLKIT Java Classes 745


Class Package Returned by
PipeJointFeat pfcPipeJointFeat Downcast of
pfcFeature.Feature.
This feature type specifies a pipe joint.
PipeLineFeat pfcPipeLineFeat Downcast of
pfcFeature.Feature.
This feature type specifies a pipeline feature.
PipePointToPointFeat pfcPipePointToPointFeat Downcast of
pfcFeature.Feature.
This feature type specifies a point-to-point pipe feature.
PipeSetStartFeat pfcPipeSetStartFeat Downcast of
pfcFeature.Feature.
This feature type specifies a start feature, which is used in the piping.
PipeTrimFeat pfcPipeTrimFeat Downcast of
pfcFeature.Feature.
This feature type specifies a trim feature, which is used in the piping.
Placement pfcBase Placement.FromInt() or by
using any of the static instances (e.
g., PLACE_INSIDE)
This enumerated type lists the possible placement types for points on contours.
Plane pfcGeometry Downcast of
pfcGeometry.Surface.
This class defines a plane.
PlotInstructions pfcModel pfcModel.Plot
Instructions_Create()
Used with to plot a part, drawing, or assembly.
PlotPageRange pfcModel PlotPageRange.FromInt()
or by using any of the static
instances (e.g., PLOT_RANGE_
CURRENT)
This enumerated type specifies which pages to plot.
PlotPaperSize pfcModel PlotPaperSize.FromInt()
or by using any of the static
instances (e.g., BSIZEPLOT)
This enumerated type specifies the size of the paper used for the plot.
PlyFeat pfcPlyFeat Downcast of
pfcFeature.Feature.
This feature type specifies a ply feature.
Point pfcGeometry Downcast of
pfcModelItem.ModelItem.
This class defines a point.
Point2D pfcBase Point2D.create(),
Outline2D.get()
This data type is used to specify a two-dimensional point.
Point3D pfcBase Point3D.create(),
Outline3D.get(), and
additional methods that return
multiple points

746 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
This data type is used to specify a three-dimensional point.
Point3Ds pfcBase Point3Ds.create(),
Polygon.GetVertices()
Defines a list of three-dimensional points.
Polygon pfcGeometry Downcast of
pfcGeometry.Curve.
This class defines a polygon.
PositionFoldFeat pfcPositionFoldFeat Downcast of
pfcFeature.Feature.
This feature type specifies a position fold feature.
ProcessStepFeat pfcProcessStepFeat Downcast of
pfcFeature.Feature.
This feature type specifies a process step feature, which is used in the Manufacturing Process Planning
module.
ProgramExport pfcModel pfcModel.Program
Instructions ExportInstructions
_Create()
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.ModelItem.
This class defines a quilt.
RefDimension pfcDimension Downcast of
pfcModelItem.ModelItem.
This class describes a reference dimension.
RegenInstructions pfcSolid pfcSolid.Regen
Instructions_Create()
This class describes the regeneration instructions of a feature.
RelationExport pfcModel pfcModel.Relation
Instructions ExportInstructions
_Create()
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.
RenderExport pfcModel pfcModel.Render
Instructions ExportInstructions
_Create()
Used to export a part or assembly in RENDER format.
ReorderAfterOperation pfcFeature Feature.CreateReorder
AfterOp()
This class defines how to reorder the features in the regeneration order list.
ReorderBeforeOperation pfcFeature Feature.CreateReorder
BeforeOp()

Creo Object TOOLKIT Java Classes 747


Class Package Returned by
This class determines how to move the features backward in the regeneration order list.
ReplaceSurfaceFeat pfcReplaceSurfaceFeat Downcast of
pfcFeature.Feature.
This feature type specifies a replaced surface feature.
ResumeOperation pfcFeature Feature.CreateResu
meOp()
Specifies a resume operation for a feature.
RetrieveModelOptions pfcSession pfcSession.Retrieve
ModelOptions_Create()
This class determines what information about the simplified representations in a model to retrieve.
RevolvedSurface pfcGeometry Downcast of
pfcGeometry.Surface.
This class defines a revolved surface.
RibbonCableFeat pfcRibbonCableFeat Downcast of
pfcFeature.Feature.
This feature type specifies a ribbon cable.
RibbonExtendFeat pfcRibbonExtendFeat Downcast of
pfcFeature.Feature.
This feature type specifies a ribbon extension.
RibbonPathFeat pfcRibbonPathFeat Downcast of
pfcFeature.Feature.
This feature type specifies a ribbon path feature.
RibbonSolidFeat pfcRibbonSolidFeat Downcast of
pfcFeature.Feature.
This feature type specifies a solid ribbon.
RibFeat pfcRibFeat Downcast of
pfcFeature.Feature.
This feature type specifies a rib feature.
RipFeat pfcRipFeat Downcast of
pfcFeature.Feature.
This feature type specifies a rip feature, which is used in the Creo NC Sheetmetal module.
RoundFeat pfcRoundFeat Downcast of
pfcFeature.Feature.
This feature type specifies a round feature.
RuledSurface pfcGeometry Downcast of
pfcGeometry.Surface.
This class defines a ruled surface.
SawFeat pfcSawFeat Downcast of
pfcFeature.Feature.
This feature type specifies a saw feature.
Selection pfcSelect Selections.get(),
This class contains the selection information.
SelectionOptions pfcSelect pfcSelect.Selection
Options_Create()
This class describes the selection options.
Selections pfcSelect Selections.create(),

748 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
Session.Select()
This data type is used to specify an array of selections.
Session pfcSession pfcGloba.GetProE
Session()
This class defines the information about a session object.
SessionActionListener_u pfcSession Base class; not returned.
Abstract base class that all user-defined SessionActionListener classes must extend.
SessionActionListener pfcSession Base class; not returned.
Interface to be implemented by user-defined classes that respond to session events.
SETExportInstructions pfcModel pfcModel.SETExport
Instructions_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.
SheetmetalConversion pfcSheetmetalConversion Downcast of
Feat Feat pfcFeature.Feature.
This feature type specifies a conversion feature, which is used in the Creo NC Sheetmetal module.
SheetmetalCutFeat pfcSheetmetal Downcast of
CutFeat pfcFeature.Feature.
This feature type specifies a sheetmetal cut feature.
SheetmetalOptimizeFeat pfcSheetmetalOptimize Downcast of
Feat pfcFeature.Feature.
This feature type specifies an optimize feature, used in the Creo NC Sheetmetal module.
SheetmetalPopulateFeat pfcSheetmetalPopulate Downcast of
Feat pfcFeature.Feature.
This feature type specifies a populate feature, which is used in the Creo NC Sheetmetal module.
SheetmetalPunchPoint pfcSheetmetalPunch Downcast of
Feat PointFeat pfcFeature.Feature.
This feature type specifies a punch point, which is used in the Creo NC Sheetmetal module.
SheetmetalShearFeat pfcSheetmetalShearFeat Downcast of
pfcFeature.Feature.
This feature type specifies a sheetmetal shear feature.
SheetmetalZoneFeat pfcSheetmetalZone Downcast of
Feat 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

Creo Object TOOLKIT Java Classes 749


Class Package Returned by
pfcFeature.Feature.
This feature type specifies a shrinkage feature, which is used in the Mold Design and Casting modules.
ShrinkDimFeat pfcShrinkDimFeat Downcast of
pfcFeature.Feature.
This feature type specifies a shrink dimension feature, which is used in the Mold Design and Casting
modules.
SilhouetteTrimFeat pfcSilhouetteTrimFeat Downcast of
pfcFeature.Feature.
This feature type specifies a silhouette trim feature.
STLASCIIExport pfcModel pfcModel.SLAASCIIExport
Instructions Instructions_Create()
Used to export a part or assembly
to an ASCII STL file.
STLBinaryExport pfcModel pfcModel.SLABinaryEx
Instructions port
Instructions_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.
SMMFGMaterial pfcSMMFGMaterial Downcast of
RemoveFeat RemoveFeat pfcFeature.Feature.
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.

750 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
This feature type specifies a sheetmetal shape feature.
SMMFGSlotFeat pfcSMMFGSlotFeat Downcast of
pfcFeature.Feature.
This feature type specifies a sheetmetal slot.
Solid pfcSolid ComponentPath.GetLeaf()
This class defines a solid.
SolidActionListener _u pfcSolid Base class; not returned.
Abstract base class that all user-defined SolidActionListener classes must extend.
SolidActionListener pfcSolid Base class; not returned.
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.
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.GetPoints()
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(),
GetRGBFromStdColor(),
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(),

Creo Object TOOLKIT Java Classes 751


Class Package Returned by
StdLineStyle.FromInt(),
or by using any of the static
instances (e.g., LINE_SOLID)
This enumerated type lists the possible line styles.
STEPExportInstructions pfcModel pfcModel.STEPExport
Instructions_Create()
Used to export a part or assembly in STEP format.
StringOId pfcObject Base class; not returned.
This class specifies a string identifier. For internal use only.
SubHarnessFeat pfcSubHarnessFeat Downcast of
pfcFeature.Feature.
This feature type specifies a subharness.
SuppressOperation pfcFeature Feature.CreateSuppress
Op()
This class defines a suppress
operation.
Surface pfcGeometry Surfaces.get(),
Edge.GetSurface1(),
GetSurface2(). Also, by
downcasting
pfcModelItem.ModelItem.
This class defines a surface.
SurfaceModelFeat pfcSurfaceModelFeat Downcast of
pfcFeature.Feature.
This feature type specifies a surface model.
Surfaces pfcGeometry Surfaces.create(),
Quilt.ListElements(),
Surface.ListSameSurfa
ces().
This data type is used to describe an array of surfaces.
SurfXYZData pfcGeometry Surface.Eval3DData()
Stores the results of a surface evaluation.
TabulatedCylinder pfcGeometry Downcast of
pfcGeometry.Surface.
This class defines a tabulated cylinder.
Text pfcGeometry Downcast of
pfcGeometry.Curve.
This class defines the text information.
TextStyle pfcBase pfcBase.TextStyle
_Create(),
Text.GetStyle().
Note.GetStyle()
This class specifies the text attributes.
ThickenFeat pfcThickenFeat Downcast of
pfcFeature.Feature.
This feature type specifies a thicken feature, which is used in the Creo NC Sheetmetal module.
ThreadFeat pfcThreadFeat Downcast of
pfcFeature.Feature.

752 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
This feature type specifies a thread.
Torus pfcGeometry Downcast of
pfcGeometry.Surface.
This class defines a torus.
TorusFeat pfcTorusFeat Downcast of
pfcFeature.Feature.
This feature type is used for a torus.
Transform3D pfcBase pfcBase.Transform3D
_Create(),
ComponentPath.Get
Transform(),
CoordSystem.Get
CoordSys(),
TransformedSurface.
GetCoordSys(),
View.GetTransform(),
Window.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.

Creo Object TOOLKIT Java Classes 753


Class Package Returned by
UDFZoneFeat pfcUDFZoneFeat Downcast of
pfcFeature.Feature.
This feature type specifies a UDF zone feature.
UICommand pfcCommand Session.UICreate
Command()
An action-listener object for menu commands.
UICommandAction pfcCommand Base class; not returned.
Listener_u
Abstract base class that all user-defined UICommandActionListener classes must extend.
UICommandActionListener pfcCommand Base class; not returned.
Interface to be implemented by user-defined classes that respond to UI command events.
UnbendFeat pfcUnbendFeat Downcast of
pfcFeature.Feature.
This feature type specifies an unbend feature, which is used in the Creo NC Sheetmetal module.
UserFeat pfcUserFeat Downcast of
pfcFeature.Feature.
This feature type specifies a user feature.
UVParams pfcBase UVParams.create(),
EdgeEvalData.Get
Point*()
, Selection.GetParams(),
SurfXYZData.GetParams()
This data type is used to specify UV parameters.
UVVector pfcBase UVVector.create(),
EdgeEvalData.
GetDerivative*()
This data type is used to specify a UV-vector.
VDAExportInstructions pfcModel pfcModel.CATIAExport
Instructions_Create(),
VDAExportInstructions
_Create()
Used to export a part or assembly in VDA format.
VDAFeat pfcVDAFeat Downcast of
pfcFeature.Feature.
This feature type specifies a VDA file.
Vector2D pfcBase Vector2D.create()
This data type is used to specify a two-dimensional vector.
Vector3D pfcBase Vector3D.create(),
Vectors3D.get() and
additional methods that return
information about geometric
curves.
This data type is used to specify a three-dimensional vector.
Vector3Ds pfcBase Vector3Ds.create()
This data type is used to specify a list of three-dimensional vectors.
View pfcView ViewOwner.GetView()
ViewOwner.SaveView()
ViewOwner.Retrieve

754 Creo Object TOOLKIT JavaUser’s Guide


Class Package Returned by
View()
Views.get()
This class specifies information about a view.
ViewOId pfcView pfcView.ViewOId_
Create()
This class specifies the owner of a view. For internal use only.
ViewOwner pfcView Base class; not returned.
This class describes the owner of the view.
Views pfcView Views.create(),
ViewOwner.ListViews()
This data type is used to specify an array of views.
VolSplitFeat pfcVolSplitFeat Downcast of
pfcFeature.Feature.
This feature type specifies a split-volume feature.
WallFeat pfcWallFeat Downcast of
pfcFeature.Feature.
This feature type specifies a wall, which is used in the Creo 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 Welding Design 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 Welding Design module.
WeldSpotFeat pfcWeldSpotFeat Downcast of
pfcFeature.Feature.
This feature type specifies a welding spot.
Window pfcWindow Session.GetCurrent
Window(),
Session.CreateModel
Window(),
Session.OpenFile(),
Session.GetWindow(),
Windows.get()
This class describes the attributes of a window.
WindowOId pfcWindow pfcWindow.WindowOId

Creo Object TOOLKIT Java Classes 755


Class Package Returned by
_Create()
This class specifies a window identifier. For internal use only.
Windows pfcWindow Session.ListWindows(),
Windows.create()
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 Creo Object
TOOLKIT Java code.
This exception is thrown when you specify an invalid argument.
XBadGetParamValue pfcExceptions Created, thrown in Creo Object
TOOLKIT Java code.
This exception is thrown when you specify an invalid parameter type.
XBadOutlineExcludeType pfcExceptions Created, thrown in Creo Object
TOOLKIT Java code.
This exception is thrown when you specify an invalid outline exclusion type.
XInAMethod pfcExceptions Base class of most Creo Object
TOOLKIT Java exceptions.
This exception is thrown when you specify an invalid method name.
XInvalidEnumValue pfcExceptions Created, thrown in Creo Object
TOOLKIT Java code.
This exception is thrown when you specified an invalid enumerated value.
XPFC pfcExceptions Base class of most Creo Object
TOOLKIT Java exceptions.
This exception is thrown when a general usage error occurs.
XSequenceTooLong pfcExceptions Created, thrown in Creo Object
TOOLKIT Java code.
This exception is thrown when the sequence length exceeds the maximum allowable size.
XStringTooLong pfcExceptions Created, thrown in Creo Object
TOOLKIT Java code.
This exception is thrown when the specified string exceeds the maximum allowable length.
XToolkitError pfcExceptions Created, thrown in Creo Object
TOOLKIT Java code.
This exception is thrown when there is a toolkit error.
XUnimplemented pfcExceptions Created, thrown in Creo Object
TOOLKIT Java code.
This exception is thrown when there is a call to a function that is unimplemented.
XUnknownModelExtension pfcExceptions Created, thrown in Creo Object
TOOLKIT Java code.
This exception is thrown when you specify an invalid model extension.
ZoneFeat pfcZoneFeature Downcast of
pfcFeature.Feature
This feature type specifies a zone feature.

756 Creo Object TOOLKIT JavaUser’s Guide


Index

2-D registering, 17
sections running, 18
allocating, 375 setting up, 14
standalone, 14, 698
unlocking, 23
A Arcs
Access description, 394
to explode states, 474 representation, 725
Accuracy Area
getting and setting, 213 surface, 402
ActionListener Arrays, 31
creating, 495 sample class, 32
description of the class, 34 Arrows, 394
events, 495 Assemblies
feature-level, 504 active explode state, 474
session-level, 497 coordinate systems, 294
solid-level, 502 creating, 213
types, 495 explode states, 474
UI command, 498 hierarchy, 461
ActionSource interface, 496 structure of, 461
definition, 35 Axes, 404
Activate evaluating, 404
explode state, 474
window, 289
B
Add
external object data, 370 B-splines
items to a layer, 302 description, 394
section entities, 377
Allocate
C
2-D sections, 375
simplified representations, 569 Cells
APIWizard accessing, 490
defined, 58 Children, 320
Applications cipjava, 37
creating, 37 Circles, 394
hierarchy, 38 Classes

757
list of, 729 Copy
types, 25 models, 121
Clear Copying
window, 289 sections, 375
Close Create
window, 289 2-D sections, 374
Color action listeners, 495
alternate color scheme, 606 applications, 37
graphics, 605 assembly, 213
map buttons, 102
version, 605 cross sections, 358
Colors, 68 external objects, 364
Commands family table columns, 491
designating, 105 family table instance, 488
compatibility of deprecated methods, layer, 302
50 local group, 328
Composite curves material, 232
description, 394 menus, 102
Cones parameters, 422
class representation, 400 part, 213
geometry representation, 717 section models, 374
Configuration file simplified representations, 569
protkdat option, 17 UDFs, 332
toolkit_registry_file option, 17 window, 287
Configuration options, 66 Create Interactively Defined UDFs,
Contours 334
evaluating, 398 Creating UDFs, 333
traversing, 393 Creo
Contours, locating in a model, 398 license data, 64
Coons patches Creo Object TOOLKIT Java
geometry representation, 720 class types, 25
Coordinate systems, 404 menu option, 18
assemblies, 294 programs, 14
datum, 294 setting up, 22
drawing, 293 Creo Parametric
Drawing View, 294 accessing, 70
evaluating, 404 Cross section components
screen, 293 line patterns, 360
section, 294 Cross sections
solid, 293 creating and modifying, 358
window, 293 deleting, 358
Coordinate transformations, 292 geometry of, 356

758 Creo Object TOOLKIT JavaUser’s Guide


mass properties of, 360 information, 434
Curves, 394 modifying, 438
data structures, 724 prefix, 446
determining the type, 394 suffix, 446
t parameter, 394 tolerances, 444
types, 394 Display
reserved, 394 model in window, 287
Cylinders, 400 models, 121
geometry representation, 716 objects, 605
spline surfaces, 723 selection, 86
tabulated, 400 Display status
geometry representation, 719 of layers, 302
Documentation
see APIWizard, 58
D
Drawing
Data transformations, 297
external object, 365
Data types
enums, 33
E
Delete Edges, 394
cross sections, 358 determining the type, 394
feature pattern, 328 evaluating, 396
models, 121 t parameter, 394
section entities, 377 traversing, 393
simplified representations, 569 types, 394
deprecated methods compatibility, 50 reserved, 394
Depth Element
selection, 85 diagnostics, 318
Descriptors Ellipses, 394
model, 115 Entities
Designating adding to sections, 377
command, 107 Enumerated types, 33
commands, 105 sample class, 34
icon, 106 Epsilon
Designating commands, 105 specifying, 376
Detail.DetailEntityInstructions Erase
interface models, 121
description, 188 Evaluation
Dictionaries, 33 axes, 404
Dimension2D.Dimension2D interface contour, 398
description, 150 coordinate system, 404
Dimensions, 433 edge, 396

Index 759
point, 404 accessing, 488
surface, 401 symbols, 489
Event handling Features
try-catch-finally blocks, 38 accessing, 320
Examples creating, 325
normalizing a coordinate element paths, 312
transformation matrix, 297 element special values, 312
of ActionListeners, 35 element tree, 313
of arrays, 32 element values, 311
of dictionaries, 34 failed, 320
of sequences, 31 groups, 320, 328
of utilities, 37 identifiers, 320
Exceptions information, 321
ActionListener, 35 operations, 325
array, 32 parents, 320
Creo Parametric-related object, 28- patterns, 328
29 read-only, 321
enumerated type, 34 redefine, 318
handling in code, 38 resuming, 325
sequence, 31 suppressing, 325
utility, 37 user-defined, 332
Explode states WCreate, 314
access, 474 Fields
activating, 474 of ActionListeners, 35
Export of arrays, 32
files, 508 of Creo Parametric-related objects,
External objects 29
data, 365 of enumerated types, 33
manipulating, 370 of sequences, 30
information for, 363 of utilities, 36
summary, 363 Files
ExternalObjectData exporting, 508
description, 365 JAR, 19
message, 70
contents, 71
F
naming restrictions, 70
Faces Fillet surfaces
traversing, 393 geometry representation, 720
Family tables, 488
cells, 490
columns
G
accessing, 489 General surface of revolution, 718
instances Generic model

760 Creo Object TOOLKIT JavaUser’s Guide


getting, 488 See Creo Object TOOLKIT Java
Geometry Installing, 22
cross-sectional, 356 installation
solid edge, 397 testing, 22
terms, 393 Installation
traversal, 393 J-Link, 697
Graphics See Creo Object TOOLKIT Java
color, 605 Installing, 22
line styles, 607 Interactive selection, 83
Groups, 328, 332 Interactively Defined UDFs
create, 334
H
Hierarchy J
application, 38 J-Link
Highlight installing
selections, 86 test of, 701
Registry file, 698
JAR files, 19
I
Java
Import enumerated types, 33
packages, 37
Information
Drawing, 135 K
Inheritance Keyboard
of ActionListeners, 35 macros
of arrays, 32 execution rules, 67
of Creo Parametric-related objects, Keywords
28-29 instanceof
of enumerated types, 33 using, 394
of sequences, 30
of utilities, 37
L
Initialize
ActionListeners, 35 Layers, 302
arrays, 32 operations, 302
Creo Parametric-related objects, 27- License data, 64
28 licensing, 22
dictionaries, 33 Line styles
sequences, 30 graphics, 607
utilities, 36 Lines
Initializing objects, 69 description, 394
Install representation, 725
J-Link, 697 styles, 68

Index 761
Lists starting and stopping, 20
of children, 320 Model programs, 18
of current windows, 287 definition, 18
of layer items, 302 running, 18
of materials, 232 ModelItems
of ModelItems, 299 duplicating, 301
of pattern members, 320, 328 evaluating, 404
of rows in a family table, 488 getting, 299
of subitems, 299 information, 300
of views, 291 types, 299
of windows, 287 Models
Local groups descriptors, 115
creating, 328 Drawing
Locks, 488 Obtaining, 134
exporting, 508
getting, 115
M
operations, 121
Machines retrieving, 117
setting up, 14 section, 374
Macros, 66 Modify
Mass properties, 230 cross sections, 358
of cross sections, 360 simplified representations, 570
Materials, 232 Modifying, 438
Matrix
code example, 297
Matrix3D object, 297
N
Message files, 70 name field, 14
contents, 71 Normalize
restrictions, 70 matrix, 297
Message window NURBS
reading from, 72 representation, 726
writing to, 72 surface, 722
Method
visit, 51
O
Methods
of ActionListeners, 35 Objects
of arrays, 32 displaying, 605
of Creo Parametric-related objects, external, 363
27, 29 Open
of dictionaries, 33 file, 117
of sequences, 30 Operations
of utilities, 37 Drawing, 136
feature, 325

762 Creo Object TOOLKIT JavaUser’s Guide


layer, 302 Popup Menus, 108
model, 121 Accessing, 109
solid, 214, 561 Prefix, 446
view, 292 Principal curve, 402
window, 289, 564
Outlines
Q
contour, 398
Quick drawing instructions, 557
P
R
Packages
importing, 37 Refresh
Parameters, 422 window, 289, 564
information, 426 Regenerate
ParamValue objects, 421 events, 497
Parents, 320 solids, 214, 561
Parts, 232 Register
creating, 213 applications, 17
Pattern leaders, 320, 328 Registry file, 14
Patterns, 328 Registry file for J-Link, 698
create, 317 registry files
pfcExceptions. methods, 66
XToolkitDrawingCreateErrors Remove
description, 133 external object data, 370
pfcModel.Models items from a layer, 302
information, 117 Rename
pfcSelect.Selection.GetSelItem method models, 121
getting a ModelItem, 299 Repaint
pfcSelect.SelectionOptions argument events, 497
table of strings, 83 window, 289, 564
Planes, 400 Reset
geometry representation, 715 view, 292
Points, 404 Restrictions
evaluating, 404 on text message files, 70
Polygons, 394 on threads, 55
Popup Menu Retrieve
Adding to the Graphics Window, 2-D sections, 384
108 geometry of a simplified
Using Trail files to determine representation, 568
names, 109 graphics of a simplified
Popup menus representation, 568
Adding, 110 material, 232
simplified representations, 568

Index 763
view, 291 adding items, 571
Revolved surfaces, 400 creating, 569
Rotate deleting, 569
view, 292 items, 571
Ruled surfaces, 400 extracting information from, 569
geometry representation, 719 modifying, 570
Run retrieving
applications, 18 geometry, 568
model program, 18 graphics, 568
utilities, 572
Sketched features
S
create, 387
Save create with 2D sections, 388
models, 121 creating features with 3D sections,
view, 292 388
Screen coordinate system, 293 overview, 387
Sections Solids
allocating, 375 accuracy, 213
copying, 375 coordinate system, 293
creating geometry traversal, 299
2-D, 374 getting a solid object, 213
models, 374 information, 213
definition, 373 mass properties, 230
entities, 377 operations, 214, 561
mode, 374 Splines
retrieving, 384 cylindrical spline surface, 723
Selection, 83 description, 394
accessing data, 85 representation, 725
controlling display, 86 surface, 721
explode states, 474 Standalone applications, 14, 698
Sequences, 30 Start method, 20
sample class, 31 startup field, 14
Session objects Status
getting, 62 feature, 321
Set up layer, 302
applications, 14 Stop method, 20
machine, 14 Suffix, 446
model programs, 18 Surfaces, 400
Setting Up, 22 cylindrical spline, 723
Sheets data structures, 715
Drawing, 138 evaluating, 401
Simplified representations area, 402

764 Creo Object TOOLKIT JavaUser’s Guide


evaluating parameters, 402 try-catch-finally block
fillet description, 45
geometry representation, 720
general surface of revolution, 718
U
NURBS
geometry representation, 722 UDFs, 332
revolved, 400 creating, 332
ruled, 400, 719 Unlock
spline, 721 messages, 25
traversing, 393 object toolkit java application, 23
types, 400 User’s Guide
UV parameterization, 400 documentation
online, 58
Utilities, 36
T sample class, 37
t parameter simplified representations, 572
description, 394
Table
V
creating, 158-159
drawing cells, 158 Values
retrieving, 159 ParamValue, 421
selecting, 158 View2D.View2D interface
Table.Table interface description, 143
description, 158 Views
Tabulated cylinders, 400 display information, 147
geometry representation, 719 Drawing, 143
testing the installation, 22 getting a view object, 291
Text, 394 list of, 291
message files, 70 operations, 292
Threads retrieving, 291
restrictions, 55 saving, 292
Tolerance, 444 Visibility, 321
Torii, 400 Visit
Torus, 717 method
Transformations, 292, 294 description, 51
solid to coordinate system datum simplified representations, 569
coordinates, 297
solid to screen coordinates, 296
W
in a drawing, 297
Traversal wfcExternalObject object, 363
of a solid block, 393 Window coordinate system, 293
of geometry, 393 Windows, 287
activating, 289

Index 765
clearing, 289
closing, 289
create, 288
creating, 287
flush, 289
operations, 289, 564
repainting, 289
Write
to the message window, 72

766 Creo Object TOOLKIT JavaUser’s Guide

You might also like