htc

2478
Parametric Technology Corporation Creo™ Elements/Pro™ 5.0 Creo™ Elements/Pro™ TOOLKIT User’s Guide February 2011

Upload: avabhyankar9393

Post on 30-Oct-2014

430 views

Category:

Documents


11 download

DESCRIPTION

PRT

TRANSCRIPT

Parametric Technology Corporation

Creo Elements/Pro 5.0 Creo Elements/Pro TOOLKIT Users GuideFebruary 2011

Copyright 2010 Parametric Technology Corporation and/or Its Subsidiary Companies. All Rights Reserved. User and training guides and related documentation from Parametric Technology Corporation and its subsidiary companies (collectively "PTC") are subject to the copyright laws of the United States and other countries and are provided under a license agreement that restricts copying, disclosure, and use of such documentation. PTC hereby grants to the licensed software user the right to make copies in printed form of this documentation if provided on software media, but only for internal/personal use and in accordance with the license agreement under which the applicable software is licensed. Any copy made shall include the PTC copyright notice and any other proprietary notice provided by PTC. Training materials may not be copied without the express written consent of PTC. This documentation may not be disclosed, transferred, modified, or reduced to any form, including electronic media, or transmitted or made publicly available by any means without the prior written consent of PTC and no authorization is granted to make copies for such purposes. Information described herein is furnished for general information only, is subject to change without notice, and should not be construed as a warranty or commitment by PTC. PTC assumes no responsibility or liability for any errors or inaccuracies that may appear in this document. The software described in this document is provided under written license agreement, contains valuable trade secrets and proprietary information, and is protected by the copyright laws of the United States and other countries. It may not be copied or distributed in any form or medium, disclosed to third parties, or used in any manner not provided for in the software licenses agreement except with written prior approval from PTC. 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, Licensing, and Data Collection Information: See the About Box, or copyright notice, of your PTC software. UNITED STATES GOVERNMENT RESTRICTED RIGHTS LEGEND This document and the software described herein are Commercial Computer Documentation and Software, pursuant to FAR 12.212(a)-(b) (OCT95) or DFARS 227.7202-1(a) and 227.7202-3(a) (JUN95), and are provided to the US Government under a limited commercial license only. For procurements predating the above clauses, use, duplication, or disclosure by the Government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software Clause at DFARS 252.227-7013 (OCT88) or Commercial Computer Software-Restricted Rights at FAR 52.227-19(c)(1)-(2) (JUN87), as applicable. 09012010 Parametric Technology Corporation, 140 Kendrick Street, Needham, MA 02494 USA

Contents

About This GuidePurpose....................................................................................................................... ii Audience and Prerequisite Experience ....................................................................... ii Contents...................................................................................................................... iii Documentation ............................................................................................................ iii Conventions.......................................................................................................... iii

Chapter 1: FundamentalsIntroduction to Creo Elements/Pro TOOLKIT........................................................... 1-2 Online Documentation Creo Elements/Pro TOOLKIT APIWizard ....................... 1-2 To Install the APIWizard .................................................................................... 1-3 To Run the APIWizard ....................................................................................... 1-3 Web Browser Environments .............................................................................. 1-3 Troubleshooting................................................................................................. 1-5 Automatic Index Tree Updating ......................................................................... 1-6 The APIWizard Interface .......................................................................................... 1-6 Topic/Object/Category Selection Frame............................................................ 1-6 Display Frame ................................................................................................... 1-7 Navigating the Topic/Object/Category Selection Tree....................................... 1-8 APIWizard Search Feature (Find) .......................................................................... 1-15 Search Dialog .................................................................................................. 1-15 Supported Search Types................................................................................. 1-17 Performing an APIWizard Search.................................................................... 1-18 Creo Elements/Pro TOOLKIT Style ....................................................................... 1-19 Objects and Actions......................................................................................... 1-19 Function Prototyping........................................................................................ 1-21

Contents - iii

Function Error Statuses................................................................................... Installing Creo Elements/Pro TOOLKIT................................................................. Overview ......................................................................................................... Add or Update Creo Elements/Pro TOOLKIT Installation ............................... Testing the Creo Elements/Pro TOOLKIT Installation..................................... Building a Sample Application......................................................................... Developing a Creo Elements/Pro TOOLKIT Application ....................................... How Creo Elements/Pro TOOLKIT Works ...................................................... Compiling and Linking a Creo Elements/Pro TOOLKIT Application................ Registering a Creo Elements/Pro TOOLKIT Application................................. Version Compatibility: Creo Elements/Pro and Creo Elements/Pro TOOLKIT.......................................................................... Application Compatibility: Creo Elements/Pro and Creo Elements/Pro TOOLKIT on Different Architecture.................................. Stopping and Restarting a Creo Elements/Pro TOOLKIT Application ............ Structure of a Creo Elements/Pro TOOLKIT Application ................................ User-Supplied Main ............................................................................................... Asynchronous Mode .............................................................................................. Creo Elements/Pro TOOLKIT Techniques ............................................................ Object Handles................................................................................................ Expandable Arrays .......................................................................................... Visit Functions ...................................................................................................... Wide Strings .......................................................................................................... Defining wchar_t.............................................................................................. Setting the Hardware Type.............................................................................. Checking Your Declaration of wchar_t ............................................................ String and Widestring Functions............................................................................

1-21 1-22 1-22 1-25 1-25 1-29 1-32 1-33 1-35 1-36 1-39 1-40 1-41 1-45 1-52 1-53 1-53 1-54 1-57 1-63 1-69 1-69 1-69 1-70 1-71

Chapter 2: Core: Models and Model ItemsModes ...................................................................................................................... 2-2 Models ..................................................................................................................... 2-2 The ProMdl Object ............................................................................................ 2-3 Creating Models ................................................................................................ 2-3 Identifying Models ............................................................................................. 2-4 Models in Session ............................................................................................. 2-6 File Management Operations ............................................................................ 2-7 Model Items ............................................................................................................. 2-8 Version Stamps ..................................................................................................... 2-12 Layers .................................................................................................................... 2-14 Layouts .................................................................................................................. 2-20 Visiting Displayed Entities...................................................................................... 2-21

Contents - iv

Creo Elements/Pro TOOLKIT Users Guide

Chapter 3: Core: Solids, Parts, and MaterialsSolid Objects ............................................................................................................ 3-2 Creating a Solid ................................................................................................. 3-2 Contents of a Solid ............................................................................................ 3-2 Displaying a Solid .............................................................................................. 3-4 Regenerating a Solid ......................................................................................... 3-5 Evaluating Mathematical Expressions for a Solid.............................................. 3-8 Solid Outline ...................................................................................................... 3-8 Solid Accuracy................................................................................................. 3-10 Solid Units ....................................................................................................... 3-11 Mass Properties............................................................................................... 3-18 Solid Postfix Identifiers .................................................................................... 3-19 Part Objects ........................................................................................................... 3-19 Density............................................................................................................. 3-19 Material Objects ..................................................................................................... 3-22 Accessing Material Data .................................................................................. 3-22 Material Types and Properties......................................................................... 3-24 Material Input and Output ................................................................................ 3-27

Chapter 4: Core: FeaturesFeature Objects........................................................................................................ 4-3 Visiting Features ...................................................................................................... 4-3 Feature Inquiry ......................................................................................................... 4-4 Feature Geometry .................................................................................................... 4-8 Manipulating Features.............................................................................................. 4-8 Manipulating Features based on Regeneration Flags ........................................... 4-13 Feature Dimensions ............................................................................................... 4-14 Manipulating Patterns ............................................................................................ 4-15 Patterns as Features ....................................................................................... 4-15 Pro_Pattern Structure ...................................................................................... 4-17 Pro_pattern_dir Structure ................................................................................ 4-18 Pro_pattern_dim Structure .............................................................................. 4-19 Table-Driven Patterns...................................................................................... 4-20 Creating Local Groups ........................................................................................... 4-21 Read Access to Groups ......................................................................................... 4-22 Finding Groups ................................................................................................ 4-23 Group Information............................................................................................ 4-24 Creating Groups .............................................................................................. 4-24 Deleting Groups............................................................................................... 4-25 Updating or Replacing UDFs ................................................................................. 4-25Contents - v

Placing UDFs......................................................................................................... The UDF Input Data StructureProUdfdata ......................................................... Variable Parameters and Annotations............................................................. Variable Dimensions and Pattern Parameters ................................................ UDF References.............................................................................................. Assembly Intersections ................................................................................... External Symbol: Parameters.......................................................................... External Symbol: Dimensions ......................................................................... Copied Model Names...................................................................................... Reading UDF Properties........................................................................................ Variable Dimensions ....................................................................................... Variable Parameters........................................................................................ UDF References.............................................................................................. External Symbols ............................................................................................ Instance Names .............................................................................................. Notification on UDF Library Creation .....................................................................

4-26 4-28 4-30 4-32 4-33 4-34 4-35 4-35 4-36 4-36 4-37 4-37 4-38 4-39 4-39 4-40

Chapter 5: Core: 3D GeometryGeometry Objects.................................................................................................... 5-2 Visiting Geometry Objects ....................................................................................... 5-4 Visiting Feature Geometry................................................................................. 5-5 Visiting Solid Geometry ..................................................................................... 5-7 Tessellation............................................................................................................ 5-16 Curve and Edge Tessellation .......................................................................... 5-16 Surface Tessellation........................................................................................ 5-17 Part and Assembly Tessellation ...................................................................... 5-19 Evaluating Geometry ............................................................................................. 5-19 Evaluating Surfaces, Edges, and Curves........................................................ 5-20 Inverse Evaluation and Minimum Distances .................................................. 5-21 Geometry at Points.......................................................................................... 5-22 Geometry Equations .............................................................................................. 5-22 Geometry of Solid Edges ................................................................................ 5-24 Geometry of Surfaces ..................................................................................... 5-26 Geometry of Axes............................................................................................ 5-29 Geometry of Coordinate System Datums........................................................ 5-29 Geometry of Datum Planes ............................................................................. 5-29 Geometry of Quilts .......................................................................................... 5-30 Geometry of Datum Surfaces.......................................................................... 5-30 Geometry of Datum Points .............................................................................. 5-31 Geometry of Datum Curves............................................................................. 5-31 Geometry of Composite Curves ...................................................................... 5-31

Contents - vi

Creo Elements/Pro TOOLKIT Users Guide

Ray Tracing............................................................................................................ Editing Datum Points.............................................................................................. Measurement ......................................................................................................... Geometry as NURBS ............................................................................................. Interference ............................................................................................................ Faceted Geometry ................................................................................................. Visiting Facets and Facet Sets ........................................................................ Accessing Facet Properties .............................................................................

5-32 5-33 5-34 5-36 5-37 5-44 5-45 5-46

Chapter 6: Core: RelationsRelations ................................................................................................................. 6-2 Adding a Customized Function to the Relations Dialog in Creo Elements/Pro................................................................................................... 6-5

Chapter 7: Core: ParametersParameter Objects ................................................................................................... 7-2 Parameter Values .................................................................................................... 7-4 Accessing Parameters ............................................................................................. 7-5 Designating Parameters for Pro/INTRALINK or Windchill PDMLink...................... 7-11 Restricted Parameters ........................................................................................... 7-11 Table-Restricted Parameters ................................................................................. 7-12 Driven Parameters ................................................................................................. 7-14

Chapter 8: Core: Coordinate Systems and TransformationsCoordinate Systems................................................................................................. 8-2 Solid Coordinate System ................................................................................... 8-2 Screen Coordinate System................................................................................ 8-2 Window Coordinate System .............................................................................. 8-3 Drawing Coordinate System .............................................................................. 8-3 Drawing View Coordinate System ..................................................................... 8-3 Assembly Coordinate System ........................................................................... 8-3 Datum Coordinate System ................................................................................ 8-4 Section Coordinate System ............................................................................... 8-4 Coordinate System Transformations........................................................................ 8-4 Transforming Solid to Screen Coordinates........................................................ 8-6 Transforming Screen to Window Coordinates ................................................... 8-9 Transforming from Drawing View to Screen Coordinates in a Drawing ............ 8-9 Transforming from Screen to Drawing Coordinates in a Drawing ..................... 8-9 Transforming Coordinates of an Assembly Member ....................................... 8-12 Transforming to Coordinate System Datum Coordinates ................................ 8-12 Transforming Coordinates of Sketched Entities .............................................. 8-13

Contents - vii

Chapter 9: Core: Family TablesFamily Table Objects ............................................................................................... Family Table Utilities................................................................................................ Visiting Family Tables.............................................................................................. Operations on Family Table Instances .................................................................... Operations on Family Table Items........................................................................... 9-2 9-2 9-3 9-4 9-6

Chapter 10: Core: External DataIntroduction to External Data ................................................................................. 10-2 Storing External Data............................................................................................. 10-4 Retrieving External Data........................................................................................ 10-5

Chapter 11: Core: Cross SectionsListing Cross Sections ........................................................................................... Extracting Cross-Sectional Geometry.................................................................... Visiting Cross Sections .......................................................................................... Creating and Modifying Cross Sections................................................................. Mass Properties of Cross Sections........................................................................ 11-2 11-3 11-6 11-7 11-8 12-2 12-2 12-3 12-3 12-3 12-4 12-7 12-8 12-8 12-9

Chapter 12: Core: UtilitiesConfiguration Options ............................................................................................ Registry File Data .................................................................................................. Trail Files ............................................................................................................... Creo Elements/Pro License Data .......................................................................... Current Directory ................................................................................................... File Handling.......................................................................................................... Wide Strings .......................................................................................................... Freeing Integer Outputs......................................................................................... Running ModelCHECK .......................................................................................... Creating Custom Checks ................................................................................

Chapter 13: Core: Asynchronous ModeOverview................................................................................................................ 13-2 Setting up an Asynchronous Creo Elements/Pro TOOLKIT Application....................................................................................................... 13-3 Simple Asynchronous Mode .................................................................................. 13-3 Starting and Stopping Creo Elements/Pro ...................................................... 13-4 Connecting to a Creo Elements/Pro Process.................................................. 13-5 Status of a Creo Elements/Pro Process.......................................................... 13-9 Full Asynchronous Mode ....................................................................................... 13-9 Setting Up a Non-Interactive Session ........................................................... 13-10

Contents - viii

Creo Elements/Pro TOOLKIT Users Guide

Chapter 14: User Interface: MessagesWriting a Message Using a Popup Dialog.............................................................. Writing a Message to the Message Window .......................................................... Text Message File Format and Restrictions .................................................... Message Classification .......................................................................................... Writing a Message to an Internal Buffer................................................................. Getting Keyboard Input .......................................................................................... Using Default Values.............................................................................................. 14-2 14-4 14-5 14-7 14-9 14-9 14-9

Chapter 15: User Interface: Menus, Commands, and PopupmenusIntroduction ............................................................................................................ 15-2 Menu Bar Buttons and Menus................................................................................ 15-2 Using the Trail File to Determine UI Names .................................................... 15-4 Adding a PushButton to a Menu Bar Menu ..................................................... 15-5 Adding a Check Button to a Menu Bar Menu ................................................ 15-10 Adding a RadioButton Group to a Menu Bar Menu ....................................... 15-13 Adding a Menu to a Menu Bar Menu ............................................................. 15-15 Adding a Menu to the Menu Bar .................................................................... 15-16 Manipulating Existing Commands ................................................................. 15-19 Designating Commands....................................................................................... 15-20 Adding the Command .................................................................................... 15-20 Designating the Icon...................................................................................... 15-21 Designating the Command ............................................................................ 15-21 Placing the Toolbar Button ............................................................................ 15-22 Popup Menus ....................................................................................................... 15-31 Adding a Popup Menu to the Graphics Window ............................................ 15-31 Using the Trail File to Determine Existing Popup Menu Names.................... 15-32 Registering Notifications to Create and Destroy Popup Menus .................... 15-33 Accessing the Popup Menus ......................................................................... 15-33 Creating Commands for the New Popup Menu Buttons................................ 15-34 Checking the Access State of a Popup Menu Item ....................................... 15-34 Adding Creo Elements/Pro Popup Menus..................................................... 15-35 Adding a Button to the Model Tree Popup Menu .......................................... 15-36 Mode-Specific Buttons and Menus ...................................................................... 15-41 Menu Files ..................................................................................................... 15-42 Adding a Menu Button ................................................................................... 15-44 New Menus.................................................................................................... 15-47 Preempting Creo Elements/Pro Commands ................................................. 15-54 Submenus ..................................................................................................... 15-56 Manipulating Menus ...................................................................................... 15-56 Data Menus ................................................................................................... 15-57Contents - ix

Setting Menu Buttons .................................................................................... Controlling Accessibility of Menu Buttons ..................................................... Pushing and Popping Menus ........................................................................ Run-time Menus ............................................................................................ Customizing the Creo Elements/Pro Navigation Area ......................................... Adding Custom Web Pages .......................................................................... Adding Custom Dialog Box Components ...................................................... Registering Notifications to Add and Destroy Content to a New Pane.......... Entering Creo Elements/Pro Commands............................................................. Execution Rules ............................................................................................ Specifying Keyboard Input ............................................................................

15-58 15-59 15-59 15-60 15-61 15-61 15-62 15-69 15-70 15-71 15-74

Chapter 16: User Interface: DialogsIntroduction ............................................................................................................ 16-3 About Creo Elements/Pro TOOLKIT Support for User Interface..................... 16-3 UI Components...................................................................................................... 16-4 Naming Convention for UI Components.......................................................... 16-7 Menubars and Menubar Components............................................................. 16-8 Dialog Attributes .............................................................................................. 16-9 Dialog Operations.......................................................................................... 16-11 Adding and Removing Components.............................................................. 16-15 Dialog Action Callbacks................................................................................. 16-17 Cascade Button ................................................................................................... 16-18 Cascade Button Attributes............................................................................. 16-18 Checkbutton......................................................................................................... 16-19 Checkbutton Attributes .................................................................................. 16-19 Checkbutton Operations................................................................................ 16-20 Checkbutton Action Callbacks....................................................................... 16-20 Drawing Area ....................................................................................................... 16-21 Drawing Area Attributes ................................................................................ 16-21 Adding and Removing Components.............................................................. 16-22 Drawing Area Action Callbacks ..................................................................... 16-23 Drawing Area Operations .............................................................................. 16-26 Input Panel........................................................................................................... 16-30 Input Panel Attributes .................................................................................... 16-30 Input Panel Action Callbacks......................................................................... 16-31 Input Panel Operations.................................................................................. 16-32 Label .................................................................................................................... 16-33 Label Attributes ............................................................................................. 16-33 Label Operations ........................................................................................... 16-34 Layout .................................................................................................................. 16-35

Contents - x

Creo Elements/Pro TOOLKIT Users Guide

Layout Attributes............................................................................................ Adding and Removing Components .............................................................. Layout Operations ......................................................................................... List........................................................................................................................ List Attributes................................................................................................. List Action Callbacks ..................................................................................... List Operations .............................................................................................. Menubar ............................................................................................................... Menubar Attributes ........................................................................................ Menupane ............................................................................................................ Menupane Attributes ..................................................................................... Adding and Removing Components .............................................................. Optionmenu.......................................................................................................... Optionmenu Attributes................................................................................... Optionmenu Action Callbacks ....................................................................... Optionmenu Operations ................................................................................ Progressbar.......................................................................................................... Progressbar Attributes................................................................................... Progressbar Operations ................................................................................ Pushbutton ........................................................................................................... Pushbutton Attributes .................................................................................... Pushbutton Operations.................................................................................. Pushbutton Action Callbacks......................................................................... Radiogroup........................................................................................................... Radiogroup Attributes.................................................................................... Radiogroup Operations ................................................................................. Radiogroup Action Callback .......................................................................... Separator ............................................................................................................. Separator Attributes....................................................................................... Slider .................................................................................................................... Slider Attributes ............................................................................................. Slider Operations ........................................................................................... Slider Action Callbacks.................................................................................. Spinbox ................................................................................................................ Spinbox Attributes ......................................................................................... Spinbox Action Callbacks .............................................................................. Spinbox Operations ....................................................................................... Tab ....................................................................................................................... Tab Attributes ................................................................................................ Tab Operations..............................................................................................

16-35 16-36 16-37 16-38 16-38 16-39 16-40 16-45 16-45 16-46 16-46 16-47 16-47 16-47 16-48 16-49 16-50 16-50 16-51 16-52 16-52 16-53 16-53 16-56 16-56 16-57 16-58 16-58 16-58 16-59 16-59 16-60 16-60 16-65 16-65 16-66 16-67 16-68 16-68 16-69

Contents - xi

Tab Action Callbacks..................................................................................... 16-70 Table.................................................................................................................... 16-71 Table Attributes ............................................................................................. 16-71 Adding and Removing Components.............................................................. 16-72 Table Cell Functions...................................................................................... 16-73 Table Row Functions..................................................................................... 16-77 Table Column Functions ............................................................................... 16-78 Table Operations........................................................................................... 16-81 Table Action Callbacks.................................................................................. 16-82 Textarea............................................................................................................... 16-85 Textarea Attributes ........................................................................................ 16-85 Textarea Operations...................................................................................... 16-86 Textarea Action Callbacks............................................................................. 16-87 Thumbwheel ........................................................................................................ 16-87 Thumbwheel Attributes.................................................................................. 16-87 Thumbwheel Operations ............................................................................... 16-88 Thumbwheel Action Callbacks ...................................................................... 16-89 Tree ..................................................................................................................... 16-89 Tree Attributes............................................................................................... 16-89 Adding and Removing Components.............................................................. 16-92 Tree Column Functions ................................................................................. 16-92 Tree Node Functions..................................................................................... 16-93 Tree NodeType Functions............................................................................. 16-97 Tree Operations ............................................................................................ 16-98 Tree Action Callbacks ................................................................................... 16-99 Master Table of Resource File Attributes .......................................................... 16-101 Using Resource Files......................................................................................... 16-115 Location and Translation of Resource Files ................................................ 16-116 Syntax of Resource Files ............................................................................ 16-116

Chapter 17: User Interface: DashboardsIntroduction to Dashboards.................................................................................... Dashboard ............................................................................................................. Showing a Dashboard ..................................................................................... Accessing a Dashboard .................................................................................. Dashboard Page.................................................................................................... Dashboard Page Options ................................................................................ Accessing a Dashboard Page ......................................................................... Accessing Components in the Dashboard Pages ........................................... 17-2 17-3 17-3 17-4 17-5 17-5 17-6 17-7

Chapter 18: User Interface: Basic GraphicsManipulating Windows........................................................................................... 18-2Contents - xii Creo Elements/Pro TOOLKIT Users Guide

Resizing Windows ........................................................................................... 18-2 Manipulating the Embedded Browser in Windows .......................................... 18-3 Repainting Windows........................................................................................ 18-3 Controlling Which Window is Current .............................................................. 18-4 Creating and Removing Windows ................................................................... 18-4 Retrieving the Owner of a Window .................................................................. 18-5 Visiting Windows ............................................................................................. 18-6 Activating Windows ......................................................................................... 18-6 Solid Orientation..................................................................................................... 18-6 Getting and Setting the View Matrix ................................................................ 18-7 Storing Named Views ...................................................................................... 18-8 Graphics Colors and Line Styles.......................................................................... 18-10 Setting Colors to Desired Values................................................................... 18-11 Setting Colors to Match Existing Entities ....................................................... 18-12 Modifying the Creo Elements/Pro Color Map ................................................ 18-13 Creo Elements/Pro Color Schemes............................................................... 18-15 Setting Line Styles for Creo Elements/Pro TOOLKIT Graphics .................... 18-15 Displaying Graphics ............................................................................................. 18-16 Displaying Text..................................................................................................... 18-18 Controlling Text Attributes ............................................................................. 18-19 Controlling Text Fonts ................................................................................... 18-19 Display Lists ......................................................................................................... 18-20 Getting Mouse Input............................................................................................. 18-21 Cosmetic Properties............................................................................................. 18-24 Surface Properties......................................................................................... 18-24 Setting Light Sources .................................................................................... 18-27

Chapter 19: User Interface: SelectionThe Selection Object.............................................................................................. 19-2 Unpacking a ProSelection Object.................................................................... 19-3 Building a ProSelection Object ........................................................................ 19-4 ProSelection Function Examples..................................................................... 19-4 Interactive Selection............................................................................................... 19-5 Highlighting .......................................................................................................... 19-10 Selection Buffer.................................................................................................... 19-10 Introduction to Selection Buffers.................................................................... 19-10 Reading the Contents of the Selection Buffer ............................................... 19-11 Removing the Items from the Selection Buffer .............................................. 19-12 Adding Items to the Selection Buffer ............................................................. 19-13

Contents - xiii

Chapter 20: User Interface: Curve and Surface CollectionIntroduction to Curve and Surface Collection ........................................................ 20-2 The ProCollection object ................................................................................. 20-3 Interactive Collection ............................................................................................. 20-4 Accessing Collection object from Selection Buffer ................................................ 20-6 Adding a Collection Object to the Selection Buffer ................................................ 20-7 Programmatic Access to Collections ..................................................................... 20-7 Contents of Curve Collection........................................................................... 20-8 Creation and Modification of Curve Collections ............................................ 20-10 Contents of Surface Collection...................................................................... 20-11 Creation and Modification of Surface Collections.......................................... 20-14 Access of Collection Object from Feature Element Trees ................................... 20-15 Programmatic Access to Legacy Collections....................................................... 20-16

Chapter 21: User Interface: AnimationIntroduction ............................................................................................................ Animation Objects.................................................................................................. Animation Frames.................................................................................................. Playing Animations ................................................................................................ Single Animation ............................................................................................. Batch Animation .............................................................................................. 21-2 21-3 21-4 21-4 21-5 21-5

Chapter 22: Annotations: Annotation Features and AnnotationsOverview of Annotation Features .......................................................................... 22-3 Creating Annotation Features................................................................................ 22-4 Redefining Annotation Features ............................................................................ 22-4 Visiting Annotation Features.................................................................................. 22-5 Visiting Annotation Elements ................................................................................. 22-6 Accessing Annotation Elements ............................................................................ 22-7 Modification of Annotation Elements ................................................................... 22-10 Parameters Assigned to Annotation Elements.............................................. 22-12 Automatic Propagation of Annotation Elements .................................................. 22-12 Access to Annotations ......................................................................................... 22-15 Annotation Orientation ......................................................................................... 22-18 Annotation Associativity....................................................................................... 22-20 Interactive Selection ............................................................................................ 22-22 Display Modes ..................................................................................................... 22-22 Designating Dimensions and Symbols ................................................................ 22-22 Dimensions .......................................................................................................... 22-23 The ProDimension Object ............................................................................. 22-23 Visiting Dimensions ....................................................................................... 22-24

Contents - xiv

Creo Elements/Pro TOOLKIT Users Guide

Modifying Dimensions ................................................................................... Dimension Tolerances................................................................................... ISO/DIN Tolerance Table Use ....................................................................... Dimension Text.............................................................................................. Dimension Text Style..................................................................................... Dimension Location ....................................................................................... Dimension Orientation ................................................................................... Driving Dimension Annotation Elements ....................................................... Accessing Reference and Driven Dimensions .............................................. Accessing Ordinate and Baseline Dimensions .............................................. Notes.................................................................................................................... Creating and Deleting Notes ......................................................................... Note Properties.............................................................................................. Visiting Notes................................................................................................. Note Text Styles ............................................................................................ Text Style Properties ..................................................................................... Accessing the Note Placement...................................................................... Modifying 3D Note Attachments .................................................................... Geometric Tolerances.......................................................................................... Accessing Set Datum Tags.................................................................................. Accessing Set Datums for Datum Axes or Planes ............................................... Surface Finish Annotations .................................................................................. Symbol Annotations ............................................................................................. Creating, Reading and Modifying 3D Symbols .............................................. Locating 3D Symbols and Symbol Definitions ...............................................

22-29 22-35 22-38 22-38 22-39 22-39 22-47 22-48 22-48 22-51 22-53 22-53 22-54 22-55 22-55 22-56 22-57 22-58 22-60 22-60 22-61 22-62 22-64 22-64 22-65

Chapter 23: Annotations: Geometric TolerancesGeometric Tolerance Objects ................................................................................ 23-2 ProGtol ............................................................................................................ 23-2 ProGtoldata ..................................................................................................... 23-2 Visiting Geometric Tolerances ............................................................................... 23-2 Reading Geometric Tolerances ............................................................................. 23-3 Creating a Geometric Tolerance ............................................................................ 23-7 Editing a Geometric Tolerance............................................................................. 23-15 Deleting a Geometric Tolerance .......................................................................... 23-17 Geometric Tolerance Layout................................................................................ 23-17 Additional Text for Geometric Tolerances............................................................ 23-17 Geometric Tolerance Text Style........................................................................... 23-18 Prefix and Suffix for Geometric Tolerances ......................................................... 23-19 Parameters for Geometric Tolerance Attributes................................................... 23-19

Contents - xv

Chapter 24: Annotations: Designated Area FeatureIntroduction to Designated Area Feature............................................................... 24-2 Feature Element Tree for the Designated Area..................................................... 24-2 Accessing Designated Area Properties ................................................................. 24-5

Chapter 25: Data Management: Windchill and Pro/INTRALINK OperationsIntroduction ............................................................................................................ 25-2 Non-Interactive Mode Operations ................................................................... 25-2 Accessing a Windchill Server from a Creo Elements/Pro Session ........................ 25-3 Accessing Information Before Registering a Server........................................ 25-3 Registering and Activating a Server ................................................................ 25-5 Accessing Information From a Registered Server........................................... 25-5 Accessing the Workspace ..................................................................................... 25-6 Workspace Data.............................................................................................. 25-6 Creating and Modifying the Workspace .......................................................... 25-7 Workflow to Register a Server ............................................................................... 25-8 Aliased URL........................................................................................................... 25-9 Server Operations................................................................................................ 25-10 Save .............................................................................................................. 25-12 Upload ........................................................................................................... 25-12 CheckIn ......................................................................................................... 25-13 Retrieval ........................................................................................................ 25-15 Checkout and Download ............................................................................... 25-16 Undo Checkout.............................................................................................. 25-19 Import and Export.......................................................................................... 25-19 File Copy ....................................................................................................... 25-21 Server Object Status ..................................................................................... 25-22 Object Lock Status ........................................................................................ 25-23 Delete Objects............................................................................................... 25-25 Conflicts During Server Operations............................................................... 25-25 Utility APIs ........................................................................................................... 25-26 Sample Batch Workflow....................................................................................... 25-27

Chapter 26: Interface: Data ExchangeExporting Information Files .................................................................................... 26-2 Exporting 2D Models ............................................................................................. 26-6 Automatic Printing of 3D Models ......................................................................... 26-17 Exporting 3D Models ........................................................................................... 26-23 Shrinkwrap Export ............................................................................................... 26-33 Setting Shrinkwrap Options........................................................................... 26-34 Exporting to PDF and U3D .................................................................................. 26-39

Contents - xvi

Creo Elements/Pro TOOLKIT Users Guide

Importing Parameter Files.................................................................................... Importing 2D Models ............................................................................................ Importing 3D Models ............................................................................................ Modifying the Imported Layers ......................................................................

26-49 26-50 26-51 26-54

Chapter 27: Interface: Importing FeaturesCreating Import Features from Files ...................................................................... 27-2 Creating Import Features from Arbitrary Geometric Data ...................................... 27-4 Allocating ProInterfacedata ............................................................................. 27-4 Adding Surfaces .............................................................................................. 27-5 Adding Edges .................................................................................................. 27-9 Adding Quilts ................................................................................................. 27-12 Adding Datums .............................................................................................. 27-13 Creating Features from the Interface Data .................................................... 27-14 Import Feature Attributes............................................................................... 27-15 Redefining the Import Feature ............................................................................. 27-16 Import Feature Properties .................................................................................... 27-17 Extracting Creo Elements/Pro Geometry as Interface Data................................. 27-19

Chapter 28: Interface: Customized Plot DriverUsing the Plot Driver Functionality ......................................................................... 28-2

Chapter 29: Element Trees: Principles of Feature CreationOverview of Feature Creation ................................................................................ 29-2 References to Feature Creation Data.............................................................. 29-2 Feature Creation.............................................................................................. 29-2 Feature Element Values ................................................................................ 29-10 Feature Element Paths.................................................................................. 29-12 Feature Elements .......................................................................................... 29-14 Access to ProElement Data........................................................................... 29-15 Feature Element Diagnostics ........................................................................ 29-19 Calling ProFeatureCreate() ........................................................................... 29-20 Example of Complete Feature Creation ........................................................ 29-23 Feature Inquiry ..................................................................................................... 29-27 Feature Redefine ................................................................................................. 29-29 XML Representation of Feature Element Trees................................................... 29-29 Introduction to Feature Element Trees in XML .............................................. 29-30 Validation Using XML Schema ...................................................................... 29-31 XML Representations for Common Elements ............................................... 29-34 Tips for Recycling XML Output of Element Trees ......................................... 29-40

Chapter 30: Element Trees: ReferencesOverview of Reference Objects ............................................................................. 30-2Contents - xvii

Reading References .............................................................................................. 30-2 Modifying References ............................................................................................ 30-5

Chapter 31: Element Trees: Datum FeaturesDatum Plane Features........................................................................................... 31-2 Datum Point Features.......................................................................................... 31-10 Sketched Datum Point................................................................................... 31-10 Field Datum Point.......................................................................................... 31-20 Offset Csys Datum Point ............................................................................... 31-24 General Datum Point..................................................................................... 31-33 Datum Axis Features ........................................................................................... 31-56 Datum Coordinate System Features ................................................................... 31-68

Chapter 32: Element Trees: Datum CurvesDatum Curve Features .......................................................................................... Common Elements.......................................................................................... Datum Curve Types............................................................................................... Sketched Datum Curves ................................................................................. Trim Datum Curves ......................................................................................... Intersect Datum Curves................................................................................... Wrap Datum Curves........................................................................................ Offset Datum Curves....................................................................................... Tangent Offset Datum Curves......................................................................... Other Datum Curve Types..................................................................................... 32-2 32-2 32-2 32-3 32-3 32-3 32-6 32-6 32-8 32-8

Chapter 33: Element Trees: Edit Menu FeaturesMirror Feature ........................................................................................................ 33-2 The Feature Element Tree for Mirror feature in Creo Elements/Pro ............... 33-3 Creating a Mirror Feature ................................................................................ 33-4 Redefining a Mirror Feature ............................................................................ 33-4 Accessing a Mirror Feature ............................................................................. 33-4 Move Feature......................................................................................................... 33-4 The Feature Element Tree for Move feature in Creo Elements/Pro................ 33-6 Creating a Move Feature................................................................................. 33-7 Redefining a Move Feature ............................................................................. 33-7 Accessing a Move Feature.............................................................................. 33-8 Fill Feature............................................................................................................. 33-8 The Feature Element Tree for Fill feature in Creo Elements/Pro .................... 33-9 Creating a Fill Feature................................................................................... 33-10 Redefining a Fill Feature ............................................................................... 33-10 Accessing a Fill Feature ................................................................................ 33-10 Intersect Feature.................................................................................................. 33-10

Contents - xviii

Creo Elements/Pro TOOLKIT Users Guide

Merge Feature...................................................................................................... Feature Element Tree for Merge feature in Creo Elements/Pro .................... Creating a Merge Feature ............................................................................. Redefining a Merge Feature .......................................................................... Accessing a Merge Feature........................................................................... Pattern Feature .................................................................................................... Wrap Feature ....................................................................................................... Trim Feature......................................................................................................... The Feature Element Tree for Trim feature in Creo Elements/Pro................ Creating a Trim Feature ................................................................................ Redefining a Trim Feature ............................................................................. Accessing a Trim Feature.............................................................................. Offset Feature ...................................................................................................... Thicken Feature ................................................................................................... The Feature Element Tree for Thicken feature in Creo Elements/Pro .......... Creating a Thicken Feature ........................................................................... Redefining a Thicken Feature ....................................................................... Accessing a Thicken Feature ........................................................................ Solidify Feature .................................................................................................... The Feature Element Tree for Solidify Feature in Creo Elements/Pro .......... Creating a Solidify Feature ............................................................................ Redefining a Solidify Feature ........................................................................ Accessing a Solidify Feature ......................................................................... Remove Feature .................................................................................................. Feature Element Tree for the Remove Feature............................................. Creating the Remove Feature ....................................................................... Redefining the Remove Feature.................................................................... Accessing the Remove Feature ....................................................................

33-11 33-12 33-13 33-13 33-14 33-14 33-14 33-14 33-15 33-20 33-21 33-21 33-21 33-21 33-22 33-23 33-23 33-24 33-24 33-25 33-27 33-27 33-27 33-27 33-29 33-31 33-31 33-32

Chapter 34: Element Trees: ReplaceIntroduction ............................................................................................................ 34-2 The Feature Element Tree ..................................................................................... 34-2

Chapter 35: Element Trees: Draft FeaturesDraft Feature .......................................................................................................... 35-2 Feature Element Tree for the Draft Feature .................................................... 35-2 Creating a Draft ............................................................................................... 35-8 Redefining a Draft............................................................................................ 35-8 Accessing a Draft ............................................................................................ 35-9 Variable Pull Direction Draft Feature.................................................................... 35-37 Feature Element Tree for the Variable Pull Direction Draft Feature .............. 35-37

Contents - xix

Element Details of the Subtree PRO_E_VPDD_SET_CMP ......................... Creating a VPDD........................................................................................... Redefining a VPDD ....................................................................................... Accessing a VPDD ........................................................................................

35-40 35-41 35-42 35-42

Chapter 36: Element Trees: Round and ChamferRound Feature....................................................................................................... 36-2 Feature Element Tree for Round Feature ....................................................... 36-2 Creating a Round .......................................................................................... 36-12 Redefining a Round....................................................................................... 36-13 Accessing a Round ....................................................................................... 36-13 Auto Round Feature ............................................................................................ 36-21 Chamfer Feature.................................................................................................. 36-22 Feature Element Tree for Chamfer Feature .................................................. 36-22 Creating a Chamfer ....................................................................................... 36-30 Redefining a Chamfer ................................................................................... 36-30 Accessing a Chamfer .................................................................................... 36-31 Corner Chamfer Feature...................................................................................... 36-46 Feature Element Tree for Corner Chamfers.................................................. 36-46 Creating a Corner Chamfer ........................................................................... 36-47 Redefining a Corner Chamfer ....................................................................... 36-47 Accessing a Corner Chamfer ........................................................................ 36-48

Chapter 37: Element Trees: HoleOverview................................................................................................................ 37-2 Feature Element Tree for Hole Features ............................................................... 37-3 Feature Element Data Types................................................................................. 37-5 Common Element Values ...................................................................................... 37-9 PRO_E_HLE_COM Values ................................................................................... 37-9 Straight Hole.................................................................................................... 37-9 Sketched Hole ............................................................................................... 37-18 Standard Threaded Hole ............................................................................... 37-41 Standard Clearance Hole .............................................................................. 37-53 Custom Hole.................................................................................................. 37-64 Valid PRO_E_HLE_COM Sub-Elements............................................................. 37-65 Hole Placement Types......................................................................................... 37-70 Hole Placement ............................................................................................. 37-70 Linear Hole on a Plane.................................................................................. 37-71 Radial Hole on Plane with Radial Dimensioning ........................................... 37-72 Radial Hole on Plane with Diameter Dimensioning....................................... 37-72 Radial Hole on Plane with Linear Dimensioning ........................................... 37-72 Radial Hole on Cone or Cylinder................................................................... 37-73Contents - xx Creo Elements/Pro TOOLKIT Users Guide

Coaxial Hole with Axis as Primary Reference ............................................... Coaxial Hole with Primary Reference not Axis .............................................. Onpoint Hole.................................................................................................. Miscellaneous Information ................................................................................... Hole Parameter Files..................................................................................... Hole Diameter................................................................................................ Order of Element Specification ...................................................................... Hole-specific Functions .................................................................................

37-73 37-73 37-74 37-74 37-74 37-75 37-75 37-76 38-2 38-3 38-5 38-5 38-5

Chapter 38: Element Trees: ShellIntroduction to Shell Feature .................................................................................. Feature Element Tree for the Shell Feature........................................................... Creating a Shell Feature ........................................................................................ Redefining a Shell Feature..................................................................................... Accessing a Shell Feature .....................................................................................

Chapter 39: Element Trees: PatternsIntroduction ............................................................................................................ 39-2 The Element Tree for Pattern Creation .................................................................. 39-2 Reference Patterns.......................................................................................... 39-6 Dimension Patterns ......................................................................................... 39-7 Table Patterns ................................................................................................. 39-9 Fill Patterns.................................................................................................... 39-11 Direction Patterns .......................................................................................... 39-12 Axis Patterns ................................................................................................. 39-16 Curve Patterns............................................................................................... 39-18 Point Patterns ................................................................................................ 39-19 NC Sequence Pattern.................................................................................... 39-20 Obtaining the Element Tree for a Pattern ............................................................ 39-23 Visiting and Creating a Pattern ............................................................................ 39-23

Chapter 40: Element Trees: SectionsOverview ................................................................................................................ 40-2 Creating Section Models ........................................................................................ 40-3 Allocating a Two-Dimensional Section ............................................................ 40-3 Setting the Mode of a Section ......................................................................... 40-4 Copying the Current Section ........................................................................... 40-5 Section Constraints ......................................................................................... 40-5 Solving and Regenerating a Section ............................................................... 40-7 Automatic Section Dimensioning ..................................................................... 40-9 Adding Section Entities.................................................................................. 40-10 Accessing Selection Reference of the Entity ................................................. 40-11

Contents - xxi

Construction Entities ..................................................................................... Modifying Entities .......................................................................................... Adding Section Dimensions .......................................................................... Error Reporting.............................................................................................. Retrieving and Saving a Section ...................................................................

40-12 40-12 40-13 40-25 40-27

Chapter 41: Element Trees: Sketched FeaturesOverview................................................................................................................ 41-2 Element Tree for Sketched Features .............................................................. 41-2 Creating Features Containing Sections ................................................................. 41-4 Creating Features with 2D Sections ...................................................................... 41-5 Verifying Section Shapes....................................................................................... 41-5 Creating Features with 3D Sections ...................................................................... 41-6 3D Section Location in the Owning Model ...................................................... 41-7 Reference Entities and Use Edge.......................................................................... 41-8 Creating Geometry by Offsetting..................................................................... 41-9 Reusing Existing Sketches .................................................................................. 41-10

Chapter 42: Element Trees: Extrude and RevolveThe Element Tree for Extruded Features .............................................................. 42-2 The Element Tree for Revolved Features............................................................ 42-69 The Element Tree for First Features.................................................................. 42-108

Chapter 43: Element Trees: Basic SweepSweeps in Creo Elements/Pro............................................................................... 43-2 The Element Tree for Sweeps......................................................................... 43-2 Creating a Swept Feature...................................................................................... 43-5

Chapter 44: Element Trees: ECAD Area FeatureIntroduction to ECAD Area Feature ....................................................................... 44-2 Feature Element Tree for the ECAD Area ............................................................. 44-2

Chapter 45: Assembly: Basic Assembly AccessStructure of Assemblies and Assembly Objects .................................................... 45-2 Visiting Assembly Components ............................................................................. 45-5 Properties Related to Component Purpose..................................................... 45-5 Component Placement.................................................................................... 45-7 Simplified Representations.............................................................................. 45-7 Modifying Component Properties .................................................................... 45-8 Locations of Assembly Components ................................................................... 45-11 Assembling Components..................................................................................... 45-13 Redefining and Rerouting Components............................................................... 45-13 Deleting Components .......................................................................................... 45-13 Exploded Assemblies .......................................................................................... 45-14Contents - xxii Creo Elements/Pro TOOLKIT Users Guide

Exploded State Objects ................................................................................. Visiting Exploded States................................................................................ Accessing Exploded States ........................................................................... Manipulating Exploded States ....................................................................... Merge and Cutout ................................................................................................ Automatic Interchange .........................................................................................

45-14 45-15 45-15 45-17 45-17 45-18 46-2 46-2 46-2 46-2 46-3 46-3 46-3 46-5 46-6 46-6 46-8 46-9

Chapter 46: Assembly: Top-down DesignOverview ................................................................................................................ Defining Design Intent ..................................................................................... Defining Preliminary Product Structure ........................................................... Introducing Skeleton Models ........................................................................... Communicating Design Intent Throughout the Assembly Structure ................ Continued Population of the Assembly............................................................ Managing Part Interdependencies................................................................... Skeleton Model Functions...................................................................................... Assembly Component Functions ........................................................................... External Reference Control Functions ................................................................... Feature and CopyGeom Feature Functions........................................................... External Reference Data Gathering .......................................................................

Chapter 47: Assembly: Assembling ComponentsAssembling Components by Functions.................................................................. 47-2 Assembling a Component Parametrically .............................................................. 47-3 Redefining Components Interactively .................................................................. 47-16 Assembling Components by Element Tree.......................................................... 47-17 The Element Tree for an Assembly Component .................................................. 47-17 Model............................................................................................................. 47-18 Attributes ....................................................................................................... 47-18 Ini