Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed...

312
Parametric Technology Corporation Pro/ENGINEER ® Wildfire Netscape-based Pro/Web.Link User’s Guide

Transcript of Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed...

Page 1: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parametric Technology Corporation

Pro/ENGINEER® Wildfire

Netscape-based Pro/Web.LinkUser’s Guide

Page 2: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Copyright © 2002 Parametric Technology Corporation. All Rights Reserved.User and training documentation from Parametric Technology Corporation (PTC) is subject to the copyright laws of the United States and other countries and is provided under a license agreement that restricts copying, disclosure, and use of such documentation. PTC hereby grants to the licensed 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. 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.

Registered Trademarks of Parametric Technology Corporation or a SubsidiaryAdvanced Surface Design, CADDS, Computervision, Computervision Services, Electronic Product Definition, EPD, EPD.Connect, Expert Machinist, Flexible Engineering, HARNESSDESIGN, Info*Engine, InPart, Optegra, Parametric Technology, Parametric Technology Corporation, PHOTORENDER, Pro/DESKTOP, Pro/E, Pro/ENGINEER, Pro/HELP, Pro/INTRALINK, Pro/MECHANICA, Pro/TOOLKIT, PTC, PT/Products, Shaping Innovation, and Windchill.

Trademarks of Parametric Technology Corporation or a Subsidiary3DPAINT, Associative Topology Bus, Behavioral Modeling, CDRS, CounterPart, Create Collaborate Control, CV, CVact, CVaec, CVdesign, CV-DORS, CVMAC, CVNC, CVToolmaker, DataDoctor, DesignSuite, DIMENSION III, DIVISION, DVS, DVSAFEWORK, EDE, e/ENGINEER, Electrical Design Entry, EMX, eNC Explorer, Expert MoldBase, Expert Toolmaker, GRANITE, ISSM, KDiP, Knowledge Discipline in Practice, Knowledge System Driver, ModelCHECK, MoldShop, NC Builder, PartSpeak, Pro/ANIMATE, Pro/ASSEMBLY, Pro/CABLING, Pro/CASTING, Pro/CDT, Pro/CMM, Pro/COLLABORATE, Pro/COMPOSITE, Pro/CONCEPT, Pro/CONVERT, Pro/DATA for PDGS, Pro/DESIGNER, Pro/DETAIL, Pro/DIAGRAM, Pro/DIEFACE, Pro/DRAW, Pro/ECAD, Pro/ENGINE, Pro/FEATURE, Pro/FEM-POST, Pro/FICIENCY, Pro/FLY-THROUGH, Pro/HARNESS, Pro/INTERFACE, Pro/LANGUAGE, Pro/LEGACY, Pro/LIBRARYACCESS, Pro/MESH, Pro/Model.View, Pro/MOLDESIGN, Pro/NC-ADVANCED, Pro/NC-CHECK, Pro/NC-MILL, Pro/NCPOST, Pro/NC-SHEETMETAL, Pro/NC-TURN, Pro/NC-WEDM, Pro/NC-Wire EDM, Pro/NETWORK ANIMATOR, Pro/NOTEBOOK, Pro/PDM, Pro/PHOTORENDER, Pro/PIPING, Pro/PLASTIC ADVISOR, Pro/PLOT, Pro/POWER DESIGN, Pro/PROCESS, Pro/REPORT, Pro/REVIEW, Pro/SCAN-TOOLS, Pro/SHEETMETAL, Pro/SURFACE, Pro/VERIFY, Pro/Web.Link, Pro/Web.Publish, Pro/WELDING, Product Development Means Business, Product First, Products First, ProductView, PTC Precision, Shrinkwrap, The Product Development Company, The Way to Product First, Wildfire, Windchill DynamicDesignLink, Windchill PartsLink, Windchill PDMLink, Windchill ProjectLink, and Windchill SupplyLink.

Third-Party TrademarksAdobe is a registered trademark of Adobe Systems. Advanced ClusterProven, ClusterProven, and the ClusterProven design are trademarks or registered trademarks of International Business Machines Corporation in the United States and other countries and are used under license. IBM Corporation does not warrant and is not responsible for the operation of this software product. AIX is a registered trademark of IBM Corporation. Allegro, Cadence, and Concept are registered trademarks of Cadence Design Systems, Inc. AutoCAD is a registered trademark of Autodesk, Inc. Baan is a registered trademark of Baan Company. CADAM and CATIA are registered trademarks of Dassault Systemes. COACH is a trademark of CADTRAIN, Inc. DOORS is a registered trademark of Telelogic AB. FLEXlm is a registered trademark of GLOBEtrotter Software, Inc. Geomagic is a registered

Page 3: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

trademark of Raindrop Geomagic, Inc. EVERSYNC, GROOVE, GROOVEFEST, GROOVE.NET, GROOVE NETWORKS, iGROOVE, PEERWARE, and the interlocking circles logo are trademarks of Groove Networks, Inc. Helix is a trademark of Microcadam, Inc. HOOPS is a trademark of Tech Soft America, Inc. HP-UX is a registered trademark and Tru64 is a trademark of the Hewlett-Packard Company. I-DEAS, Metaphase, Parasolid, SHERPA, Solid Edge, and Unigraphics are trademarks or registered trademarks of Electronic Data Systems Corporation (EDS). InstallShield is a registered trademark and service mark of InstallShield Software Corporation in the United States and/or other countries. Intel is a registered trademark of Intel Corporation. IRIX is a registered trademark of Silicon Graphics, Inc. MatrixOne is a trademark of MatrixOne, Inc. Mentor Graphics and Board Station are registered trademarks and 3D Design, AMPLE, and Design Manager are trademarks of Mentor Graphics Corporation. Netscape and the Netscape N and Ship’s Wheel logos are registered trademarks of Netscape Communications Corporation in the U.S. and other countries. Oracle is a registered trademark of Oracle Corporation. OrbixWeb is a registered trademark of IONA Technologies PLC. PDGS is a registered trademark of Ford Motor Company. RAND is a trademark of RAND Worldwide. Rational Rose is a registered trademark of Rational Software Corporation. RetrievalWare is a registered trademark of Convera Corporation. RosettaNet is a trademark and Partner Interface Process and PIP are registered trademarks of "RosettaNet," a non-profit organization. SAP and R/3 are registered trademarks of SAP AG Germany. SolidWorks is a registered trademark of SolidWorks Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the United States and in other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. STHENO is a trademark of CAD Schroer GmbH. Sun, Sun Microsystems, the Sun logo, Solaris, UltraSPARC, Java and all Java based marks, and "The Network is the Computer" are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries. VisTools is a trademark of Visual Kinematics, Inc. (VKI). VisualCafé is a trademark of WebGain, Inc. WebEx is a trademark of WebEx Communications, Inc. Microsoft, Windows, Windows NT, Visual Basic, and the Visual Basic logo are registered trademarks of Microsoft Corporation in the United States and/or other countries. Licensed Third-Party Technology InformationCertain PTC software products contain licensed third-party technology: Rational Rose 2000E is copyrighted software of Rational Software Corporation. RetrievalWare is copyrighted software of Convera Corporation. VisualCafé is copyrighted software of WebGain, Inc. VisTools library is copyrighted software of Visual Kinematics, Inc. (VKI) containing confidential trade secret information belonging to VKI. HOOPS graphics system is a proprietary software product of, and is copyrighted by, Tech Soft America, Inc. G-POST is copyrighted software and a registered trademark of Intercim. VERICUT is copyrighted software and a registered trademark of CGTech. Pro/PLASTIC ADVISOR is powered by Moldflow technology. Moldflow is a registered trademark of Moldflow Corporation. The JPEG image output in the Pro/Web.Publish module is based in part on the work of the independent JPEG Group. DFORMD.DLL is copyrighted software from Compaq Computer Corporation and may not be distributed. METIS, developed by George Karypis and Vipin Kumar at the University of Minnesota, can be researched at http://www.cs.umn.edu/~karypis/metis. METIS is © 1997 Regents of the University of Minnesota. LightWork Libraries are copyrighted by LightWork Design 1990-2001. Visual Basic for Applications and Internet Explorer is copyrighted software of Microsoft Corporation. Adobe Acrobat Reader is copyrighted software of Adobe Systems. Parasolid © Electronic Data Systems (EDS). Windchill Info*Engine Server contains IBM XML Parser for Java Edition and the IBM Lotus XSL Edition. Pop-up calendar components Copyright © 1998 Netscape Communications Corporation. All Rights Reserved. TECHNOMATIX is copyrighted software and contains proprietary information of Technomatix Technologies Ltd. Apache Server, Tomcat, Xalan, and Xerces are technologies developed by, and are copyrighted software of, the Apache Software Foundation (http://www.apache.org/) – their use is subject to the terms and limitations at: http://www.apache.org/LICENSE.txt. UnZip (© 1990-2001 Info-ZIP, All Rights Reserved) is provided "AS IS" and WITHOUT WARRANTY OF ANY KIND. For the complete Info-ZIP license see ftp://ftp.info-zip.org/pub/infozip/license.html. Gecko and Mozilla components are subject to the Mozilla Public License Version 1.1 at http://www.mozilla.org/MPL/. Software distributed under the MPL is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the MPL for the specific language governing rights and limitations. Technology "Powered by Groove" is provided by Groove Networks, Inc. Technology "Powered by WebEx" is provided by WebEx Communications, Inc. Acrobat Reader is Copyright © 1998 Adobe Systems Inc. Oracle 8i run-time, Copyright © 2000 Oracle Corporation. The JavaTM Telnet Applet (StatusPeer.java, TelnetIO.java, TelnetWrapper.java, TimedOutException.java), Copyright © 1996, 97 Mattias L. Jugel, Marcus Meißner, is redistributed under the GNU General Public License. This license is from the original copyright

Page 4: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

holder and the Applet is provided WITHOUT WARRANTY OF ANY KIND. You may obtain a copy of the source code for the Applet at http://www.mud.de/se/jta (for a charge of no more than the cost of physically performing the source distribution), by sending an e-mail to [email protected] or [email protected]—you are allowed to choose either distribution method. The source code is likewise provided under the GNU General Public License. GTK+The GIMP Toolkit are licensed under the GNU LPGL. You may obtain a copy of the source code at http://www.gtk.org/, which is likewise provided under the GNU LPGL.

UNITED STATES GOVERNMENT RESTRICTED RIGHTS LEGENDThis document and the software described herein are Commercial Computer Documentation and Software, pursuant to FAR 12.212(a)-(b) (OCT’95) or DFARS 227.7202-1(a) and 227.7202-3(a) (JUN’95), is 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 (OCT’88) or Commercial Computer Software-Restricted Rights at FAR 52.227-19(c)(1)-(2) (JUN’87), as applicable. 110102

Parametric Technology Corporation, 140 Kendrick Street, Needham, MA 02494 USA

Page 5: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Contents - i

Contents

About This Guide i

Purpose ....................................................................................................................... iiAudience...................................................................................................................... iiContents ...................................................................................................................... iiPrerequisites............................................................................................................... iiiDocumentation............................................................................................................ iv

Conventions ......................................................................................................... ivFunction Synopsis................................................................................................. v

Software Product Concerns and Documentation Comments ..................................... vi

Chapter 1: Setting Up Pro/Web.Link 1-1

Supported Software ................................................................................................. 1-2Supported Hardware................................................................................................ 1-2Setting Up Your Machine......................................................................................... 1-2

Installing the Plug-In and Applet ....................................................................... 1-3Pro/Web.Link Environment Variable Settings ................................................... 1-3Setting Environment Variables on NT Systems ................................................ 1-4Setting Environment Variables on Windows 95 Systems ................................. 1-5

Setting Up Your HTML Page ................................................................................... 1-5The Configuration File ............................................................................................. 1-7Creating Trail Files................................................................................................... 1-8

Chapter 2: Introduction 2-1

Overview.................................................................................................................. 2-2Pro/Web.Link Functions........................................................................................... 2-2Error Codes ............................................................................................................. 2-3Access Control......................................................................................................... 2-5

Page 6: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Contents - ii Pro/Web.Link User’s Guide

Pro/Web.Link Examples .......................................................................................... 2-6JavaScript Header............................................................................................. 2-7Form Header File ............................................................................................ 2-10

Tips and Tricks ...................................................................................................... 2-11Troubleshooting ..................................................................................................... 2-13Books on JavaScript Programming ....................................................................... 2-14

Chapter 3: Pro/Web.Link Documentation 3-1

Online Documentation — Pro/Web.Link APIWizard ................................................ 3-1To Install the APIWizard.................................................................................... 3-2To Run the APIWizard....................................................................................... 3-2Web Browser Environments.............................................................................. 3-2

To Download and Install the JFC (Swing) Archive ..................................... 3-3To Modify the Java Class Path on UNIX Platforms .................................... 3-4To Modify the Java Class Path on NT Platforms ........................................ 3-4SGI Hardware Platforms............................................................................. 3-4

Automatic Index Tree Updating......................................................................... 3-5The APIWizard Interface.......................................................................................... 3-5

Topic/Category Selection Frame....................................................................... 3-5Display Frame ................................................................................................... 3-6Navigating the Topic/Category Selection Tree.................................................. 3-7To Browse with the Pro/Web.Link APIWizard ................................................... 3-7Categories and Methods ................................................................................... 3-7To Browse the Pro/Web.Link User’s Guide....................................................... 3-8

APIWizard Search Feature (Find)............................................................................ 3-9Supported Search Types................................................................................. 3-12

Performing an APIWizard Search............................................................. 3-14

Chapter 4: Application Management 4-1

Connecting to Pro/ENGINEER ................................................................................ 4-2pwlProEngineerStartAndConnect......................................................... 4-2pwlProEngineerConnect....................................................................... 4-2

Disconnecting from Pro/ENGINEER........................................................................ 4-3pwlProEngineerDisconnect .................................................................. 4-3pwlProEngineerDisconnectAndStop .................................................... 4-3

Starting an Application............................................................................................. 4-3pwlApplicationStart............................................................................... 4-3

Setting the Security Access ..................................................................................... 4-4pwlAccessRequest ............................................................................... 4-4

Chapter 5: Utilities 5-1

Environment Variables............................................................................................. 5-2

Page 7: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Contents - iii

pwlEnvVariableGet............................................................................... 5-2Manipulating Directories .......................................................................................... 5-3

pwlDirectoryCurrentGet........................................................................ 5-3pwlDirectoryCurrentSet ........................................................................ 5-3pwlDirectoryFilesGet ............................................................................ 5-3

Allocating Arrays...................................................................................................... 5-4pwluBooleanArrayAlloc ........................................................................ 5-4pwluDoubleArrayAlloc .......................................................................... 5-4pwluIntArrayAlloc ................................................................................. 5-4pwluStringArrayAlloc ............................................................................ 5-4

Chapter 6: Model and File Management 6-1

Model Management ................................................................................................. 6-2pwlMdlCurrentGet ................................................................................ 6-2pwlSessionMdlsGet.............................................................................. 6-2pwlMdlDependenciesGet ..................................................................... 6-2pwlMdlInfoGet ...................................................................................... 6-2pwlMdlIntralinkInfoGet.......................................................................... 6-2pwlMdlRegenerate ............................................................................... 6-2

File Management Operations .................................................................................. 6-4pwlMdlOpen ......................................................................................... 6-4pwlMdlSaveAs...................................................................................... 6-4pwlMdlErase......................................................................................... 6-4pwlMdlRename .................................................................................... 6-4

Checking Out Pro/INTRALINK Objects............................................................. 6-6pwlObjMdlsCheckOut........................................................................... 6-6

Model Example ........................................................................................................ 6-7Model Items ........................................................................................................... 6-16

pwlItemNameToID ............................................................................. 6-16pwlItemIDToName ............................................................................. 6-16pwlItemNameSetByID ........................................................................ 6-16

Chapter 7: Windows and Views 7-1

Windows .................................................................................................................. 7-2pwlWindowRepaint............................................................................... 7-2pwlSessionWindowsGet....................................................................... 7-2pwlWindowMdlGet ............................................................................... 7-2pwlWindowActiveGet ........................................................................... 7-2pwlWindowActivate .............................................................................. 7-2pwlWindowClose.................................................................................. 7-2

Views ....................................................................................................................... 7-4pwlViewSet........................................................................................... 7-4

Page 8: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Contents - iv Pro/Web.Link User’s Guide

pwlViewDefaultSet ............................................................................... 7-4pwlMdlViewsGet................................................................................... 7-4

View Example.................................................................................................... 7-4

Chapter 8: Selection 8-1

Selection Functions ................................................................................................. 8-2pwlSelect .............................................................................................. 8-2pwlSelectionCreate .............................................................................. 8-2pwlSelectionParse................................................................................ 8-2

Highlighting .............................................................................................................. 8-4pwlItemHighlight ................................................................................... 8-4pwlItemUnhighlight ............................................................................... 8-4

Selection Example ................................................................................................... 8-5

Chapter 9: Part Materials 9-1

Setting Materials ...................................................................................................... 9-2pwlPartMaterialCurrentGet................................................................... 9-2pwlPartMaterialCurrentSet ................................................................... 9-2pwlPartMaterialSet ............................................................................... 9-2pwlPartMaterialsGet ............................................................................. 9-2pwlPartMaterialdataGet........................................................................ 9-2pwlPartMaterialdataSet ........................................................................ 9-2

Chapter 10: Assemblies 10-1

Assembly Components.......................................................................................... 10-2pwlAssemblyComponentsGet ............................................................ 10-2pwlAssemblyComponentReplace....................................................... 10-2

Exploded Assemblies ............................................................................................ 10-4pwlAssemblyExplodeStatusGet ......................................................... 10-4pwlAssemblyExplodeStatusSet.......................................................... 10-4pwlAssemblyExplodeDefaultSet......................................................... 10-4pwlAssemblyExplodeStatesGet ......................................................... 10-4pwlAssemblyExplodeStateSet............................................................ 10-4

Assembly Example ................................................................................................ 10-5

Chapter 11: Features 11-1

Feature Inquiry....................................................................................................... 11-2pwlMdlFeaturesGet ............................................................................ 11-2pwlFeatureInfoGetByID ...................................................................... 11-2pwlFeatureInfoGetByName ................................................................ 11-2pwlFeatureParentsGet ....................................................................... 11-2pwlFeatureChildrenGet ...................................................................... 11-2pwlFeatureStatusGet.......................................................................... 11-2

Page 9: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Contents - v

Feature Names...................................................................................................... 11-5pwlFeatureNameGetByID .................................................................. 11-5pwlFeatureNameSetByID................................................................... 11-5

Manipulating Features ........................................................................................... 11-6Suppressing Features ..................................................................................... 11-6

pwlFeatureSuppressByID .................................................................. 11-6pwlFeatureSuppressByIDList ............................................................. 11-6pwlFeatureSuppressByLayer ............................................................. 11-6pwlFeatureSuppressByName ............................................................ 11-6

Resuming Features......................................................................................... 11-7pwlFeatureResumeByID .................................................................... 11-7pwlFeatureResumeByIDList............................................................... 11-7pwlFeatureResumeByLayer ............................................................... 11-7pwlFeatureResumeByName .............................................................. 11-7

Deleting Features............................................................................................ 11-8pwlFeatureDeleteByID ....................................................................... 11-8pwlFeatureDeleteByIDList.................................................................. 11-8pwlFeatureDeleteByLayer .................................................................. 11-8pwlFeatureDeleteByName ................................................................. 11-8

Displaying Parameters........................................................................................... 11-9pwlFeatureParametersDisplay ........................................................... 11-9

Feature Example ................................................................................................. 11-10

Chapter 12: Parameters 12-1

Listing Parameters................................................................................................. 12-2pwlMdlParametersGet........................................................................ 12-2pwlFeatureParametersGet ................................................................. 12-2

Identifying Parameters........................................................................................... 12-2Reading and Modifying Parameters ...................................................................... 12-3

pwlParameterValueGet ...................................................................... 12-3pwlParameterValueSet ...................................................................... 12-3pwlParameterCreate .......................................................................... 12-3pwlParameterDelete........................................................................... 12-3pwlParameterRename ....................................................................... 12-3pwlParameterReset............................................................................ 12-3

Designating Parameters ........................................................................................ 12-8pwlParameterDesignationAdd............................................................ 12-8pwlParameterDesignationRemove..................................................... 12-8pwlParameterDesignationVerify ......................................................... 12-8

Parameter Example ............................................................................................... 12-9

Page 10: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Contents - vi Pro/Web.Link User’s Guide

Chapter 13: Dimensions 13-1

Reading and Modifying Dimensions ...................................................................... 13-2pwlMdlDimensionsGet........................................................................ 13-2pwlFeatureDimensionsGet ................................................................. 13-2pwlDimensionInfoGetByID ................................................................. 13-2pwlDimensionInfoGetByName ........................................................... 13-2pwlDimensionValueSetByID............................................................... 13-2

Dimension Tolerance............................................................................................. 13-5pwlDimensionToleranceSetByID........................................................ 13-5

Dimension Example............................................................................................... 13-5

Chapter 14: Simplified Representations 14-1

Retrieving Simplified Representations................................................................... 14-2pwlSimprepOpen................................................................................ 14-2pwlGraphicsSimprepOpen ................................................................. 14-2pwlGeomSimprepOpen ...................................................................... 14-2pwlMdlSimprepsGet ........................................................................... 14-2

Activating Simplified Representations ................................................................... 14-4pwlSimprepActivate............................................................................ 14-4pwlSimprepMasterActivate................................................................. 14-4pwlGeomSimprepActivate .................................................................. 14-4pwlGraphicsSimprepActivate ............................................................. 14-4

Simplified Representation Example....................................................................... 14-5

Chapter 15: Solids 15-1

Mass Properties..................................................................................................... 15-2pwlSolidMassPropertiesGet ............................................................... 15-2

Cross Sections....................................................................................................... 15-3pwlSolidXSectionDisplay.................................................................... 15-3pwlSolidXSectionsGet ........................................................................ 15-3

Solid Example........................................................................................................ 15-4

Chapter 16: Family Tables 16-1

Overview................................................................................................................ 16-2Family Table Items ................................................................................................ 16-2

pwlFamtabItemsGet ........................................................................... 16-2pwlFamtabItemAdd ............................................................................ 16-2pwlFamtabItemRemove ..................................................................... 16-2

Adding and Deleting Family Table Instances ........................................................ 16-5pwlFamtabInstancesGet..................................................................... 16-5pwlFamtabInstanceAdd...................................................................... 16-5pwlFamtabInstanceRemove............................................................... 16-5

Page 11: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Contents - vii

Family Table Instance Values................................................................................ 16-6pwlFamtabInstanceValueGet ............................................................. 16-6pwlFamtabInstanceValueSet ............................................................. 16-6

Locking Family Table Instances ............................................................................ 16-9pwlFamtabInstanceLockGet............................................................... 16-9pwlFamtabInstanceLockAdd .............................................................. 16-9pwlFamtabInstanceLockRemove ....................................................... 16-9

File Management Functions for Instances........................................................... 16-10pwlInstanceOpen ............................................................................. 16-10pwlInstanceErase............................................................................. 16-10

Family Table Example ......................................................................................... 16-11

Chapter 17: Layers 17-1

Layer Functions ..................................................................................................... 17-2pwlMdlLayersGet ............................................................................... 17-2pwlLayerCreate .................................................................................. 17-2pwlLayerDelete .................................................................................. 17-2pwlLayerDisplayGet ........................................................................... 17-2pwlLayerDisplaySet............................................................................ 17-2pwlLayerItemsGet .............................................................................. 17-2pwlLayerItemAdd ............................................................................... 17-2pwlLayerItemRemove ........................................................................ 17-2

Layer Example....................................................................................................... 17-5

Chapter 18: Notes 18-1

Notes Inquiry.......................................................................................................... 18-2pwlMdlNotesGet ................................................................................. 18-2pwlFeatureNotesGet .......................................................................... 18-2pwlNoteOwnerGet .............................................................................. 18-2

Note Names........................................................................................................... 18-3pwlNoteNameGet ............................................................................... 18-3pwlNoteNameSet ............................................................................... 18-3

Note Text ............................................................................................................... 18-4pwlNoteTextGet ................................................................................. 18-4pwlNoteTextSet .................................................................................. 18-4

Note URLs ............................................................................................................. 18-5pwlNoteURLGet ................................................................................. 18-5pwlNoteURLSet.................................................................................. 18-5

Note Example ........................................................................................................ 18-5

Appendix A: Quick Reference A-1

Table of Functions ................................................................................................... A-2

Page 12: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Contents - viii Pro/Web.Link User’s Guide

Summary of Technical Changes............................................................................ A-13New Functions................................................................................................. A-13

Superseded Functions........................................................................................... A-15

Appendix B: Error Codes 17

Error Codes .............................................................................................................. 18

Appendix C: Pro/Web.Link Constants B-1

Dimension Styles ..................................................................................................... B-2Dimension Types ..................................................................................................... B-2Family Table Types ................................................................................................. B-2Feature Group Pattern Statuses.............................................................................. B-3Feature Group Statuses .......................................................................................... B-3Feature Pattern Statuses......................................................................................... B-3Feature Types.......................................................................................................... B-4Layer Display Types ................................................................................................ B-9Object Types.......................................................................................................... B-10Parameter Types ................................................................................................... B-12ParamType Field Values ....................................................................................... B-12ParamValue Values ............................................................................................... B-12Tolerance Types .................................................................................................... B-13

Appendix D: Sample Web Pages C-1

Using Views and Simplified Representations ......................................................... C-2Determining Model Dependencies.......................................................................... C-9

Index

Page 13: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

About This Guide - i

About This Guide

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

Topic Page

Purpose

Audience

Contents

Prerequisites

Documentation

Software Product Concerns and Documentation Comments

Page 14: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

ii - About This Guide Pro/Web.Link User’s Guide

PurposeThis manual describes how to use Pro/Web.Link™, a tool that links the World Wide Web (WWW, or Web) to Pro/ENGINEER®, enabling you to use the Web as a tool to automate and streamline parts of your engineering process.

AudienceThis manual is intended for experienced Pro/ENGINEER users who know HyperText Markup Language (HTML) and JavaScript™.

ContentsThis manual contains the following chapters:

• Setting Up Pro/Web.Link—Provides installation and set-up instructions for Pro/Web.Link.

• Introduction—Provides an overview of Pro/Web.Link.

• Pro/Web.Link Documentation—Describes how to use the online browser provided with Pro/Web.Link.

• Application Management—Describes the Pro/Web.Link functions that enable you to manage applications.

• Utilities—Describes the utility functions provided by Pro/Web.Link.

• Model and File Management—Describes the functions that enable you to access and manipulate models and model items.

• Windows and Views—Describes the Pro/Web.Link functions that enable you to access and manipulate windows and views.

• Selection—Describes the functions that enable you to highlight and select objects.

• Part Materials—Describes the Pro/Web.Link functions that enable you to access and manipulate parts and their contents.

• Assemblies—Describes the functions that enable you to access assemblies and their components.

• Features—Describes the Pro/Web.Link functions that enable you to access and manipulate features in Pro/ENGINEER.

Page 15: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

About This Guide - iii

Ab

ou

t Th

is Gu

ide

• Parameters—Describes the functions that enable you to access and manipulate Pro/ENGINEER parameters.

• Dimensions—Describes the Pro/Web.Link functions that enable you to access and manipulate dimensions in Pro/ENGINEER.

• Simplified Representations—Describes the Pro/Web.Link functions that enable you to access and manipulate simplified representations.

• Solids—Describes the functions that enable you to access and manipulate solids and their contents.

• Family Tables—Describes the functions that enable you to access and manipulate family tables.

• Layers—Describes the functions that enable you to access and manipulate layers.

• Notes—Describes the Pro/Web.Link functions that enable you to access the notes created in Pro/ENGINEER using the command Setup, Notes.

In addition, the manual contains the following appendixes:

• Quick Reference—Provides an alphabetical list of all the Pro/Web.Link functions and their access levels. This appendix also includes summary of technical changes for this release.

• Pro/Web.Link Constants—Provides a list of all the defined constants.

• Sample Web Pages—Provides detailed examples of how to use the Pro/Web.Link functions in a Web page.

PrerequisitesThis manual assumes you have the following knowledge:

• Pro/ENGINEER

• HTML

• JavaScript

Page 16: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

iv - About This Guide Pro/Web.Link™ User’s Guide

DocumentationThe documentation for Pro/Web.Link includes the following:

• Pro/Web.Link User’s Guide.

• An online browser that describes the syntax of the Pro/Web.Link functions and provides a link to the online version of this manual. Because 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

# The pound sign (#) is the convention used for a UNIX prompt.

UPPERCASE Pro/ENGINEER-type menu name (for example, PART).

Boldface Windows-type menu name or menu or dialog box option (for example, View), or utility (for example, promonitor). Function names also appear in boldface font.

Monospace(Courier)

Code samples appear in courier fontlike this. File names also appear in Courier font.

SMALLCAPS Key names appear in smallcaps (for example, ENTER).

Emphasis Important information appears in italics like this. Italic font is also used for function arguments.

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.

Page 17: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

About This Guide - v

Ab

ou

t Th

is Gu

ide

Notes:

• Important information that should not be overlooked appears in notes like this.

• All references to mouse clicks assume the use of a right-handed mouse.

Function Synopsis

In this manual, each function description includes the synopsis of the call. The synopsis includes the following information:

• Function name

• Names and data types of the arguments

• Names and data types of any additional return fields

Note that all arguments in Pro/Web.Link are input arguments. Any defined constants are included in the description of the function.

For example, the function pwlMdlViewsGet has the following syntax:

pwlMdlViewsGet (String MdlNameExt // The full name of the model

);Additional return fields:

int NumViews; // The number of viewsString ViewNames[]; // The names of the views

Mode An environment in Pro/ENGINEER in which you can perform a group of closely related functions (Drawing, for example).

Model An assembly, part, drawing, format, layout, case study, sketch, and so on.

Option An item in a menu or an entry in a configuration file or setup file.

Solid A part or an assembly.

Page 18: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

vi - About This Guide Pro/Web.Link User’s Guide

Software Product Concerns and Documentation Comments

For resources and services to help you with PTC software products, see the 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 [email protected].

• Fill out and mail the PTC Documentation Survey in the customer service guide.

Page 19: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

1 - 1

1Setting Up Pro/Web.Link

This chapter contains the set-up instructions for Pro/Web.Link.

Topic Page

Supported Software 1 - 2

Supported Hardware 1 - 2

Setting Up Your Machine 1 - 2

Setting Up Your HTML Page 1 - 5

The Configuration File 1 - 7

Creating Trail Files 1 - 8

Page 20: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

1 - 2 Pro/Web.Link User’s Guide

Supported SoftwarePro/Web.Link supports the following versions of Netscape Navigator™:

• Version 4.02—On Sun® systems

• Version 4.03—On all other supported platforms

Supported HardwareYou can run Pro/Web.Link on most of the platforms supported by Pro/ENGINEER. The supported platforms are as follows:

• Alpha UNIX systems (Netscape Navigator Version 4.05 or higher)

• Alpha NT systems (running through fx!32)

• Silicon Graphics, Incorporated®

• Sun Microsystems®

• Hewlett-Packard Company®

• Intel® Windows NT™

• International Business Machines

• Windows 95™

Setting Up Your MachineThis section describes how to set up your machine to run Pro/Web.Link. The topics are as follows:

• Installing the Plug-In and Applet

• Pro/Web.Link Environment Variable Settings

• Setting Environment Variables on NT Systems

• Setting Environment Variables on Windows 95 Systems

Page 21: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Setting Up Pro/Web.Link 1 - 3

Settin

g U

p

Pro

/Web

.Lin

k

Installing the Plug-In and Applet

Pro/Web.Link uses a Java™ applet and Netscape plug-in to define a JavaScript application programing interface (API), or set of commands. You can write HTML pages that interact with Pro/ENGINEER by using HTML form elements and JavaScript functions that use the Pro/Web.Link API. This section explains how to enable Web pages to use the Pro/Web.Link API.

The Pro/Web.Link plug-in and Java applets (.class files) must be accessible to the browser. The standard method is to install them in the plug-ins directory. On UNIX systems, this can be ~/.netscape/plugins or <Netscape Navigator loadpoint>/plugins. On NT or Windows 95 systems, this can be <Netscape Navigator loadpoint>\Program\plugins.

Additionally, on UNIX systems, the plug-in can be installed in a directory pointed to by the environment variable NPX_PLUGIN_PATH. If this variable is set, Netscape will look in this directory only for plug-ins. See the section Pro/Web.Link Environment Variable Settings for more information on this environment variable.

Recursively copy all the files from <proe_loadpoint>/weblink/netscape/<machine>/obj to your chosen plug-in directory, where <machine> is your machine type. Verify that the plug-in directory contains the following files and subdirectories (and their contents):

• ProCONNECT.class

• WebLink.class

• WebModeler.class

• npproconnect.so (UNIX systems) or npproconnect.dll (NT systems)

• pwcObjects

• pwmReturn

Pro/Web.Link Environment Variable Settings

You must set or unset the following environment variables:

• CLASSPATH—Unset this environment variable so Pro/Web.Link will work properly. On a UNIX system, use the following command:

#unsetenv CLASSPATH

Page 22: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

1 - 4 Pro/Web.Link User’s Guide

See the following sections for information on how to set this environment variable on NT and Windows 95 systems.

• PRO_COMM_MSG_EXE—Set this environment variable so Netscape will work properly. On a UNIX system, use the following command:

#setenv <lp>/<machine>/obj/pro_comm_msg

In this command, <lp> is the Pro/ENGINEER loadpoint, i.e., <proe_loadpoint>/weblink/netscape and <machine> is your machine type.

See the following sections for information on how to set this environment variable on NT and Windows 95 systems.

• NPX_PLUGIN_PATH (optionally used on UNIX systems)—Set this environment variable to point to the plug-ins installation directory, rather than copying the files to the Netscape plug-ins directory. The syntax is as follows:

#setenv NPX_PLUGIN_PATH <lp>/<machine>/objIn this command, <lp> is the Pro/ENGINEER loadpoint, i.e., <proe_loadpoint>/weblink/netscape and <machine> is your machine type.

Setting Environment Variables on NT Systems

To set environment variables on NT systems, do the following:

1. Click Start.

2. Click Settings.

3. Click Control Panel.

4. Double click System.

5. Click the Environment tab.

6. Enter the appropriate values in the Variable and Value fields.

7. Click Set to make the changes take effect.

After you have set or unset the appropriate environment variables, start Netscape. If you launch Netscape from a shell, the shell must have been created after you added the environment variables for Pro/Web.Link.

Page 23: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Setting Up Pro/Web.Link 1 - 5

Settin

g U

p

Pro

/Web

.Lin

k

Setting Environment Variables on Windows 95 Systems

To set environment variables on Windows 95 systems, you must edit your autoexec.bat file.

For example, to set the environment variable PRO_COMM_MSG_EXE, add the following line to the file:

set PRO_COMM_MSG_EXE=<lp>\<machine type>\obj\pro_comm_msg

where lp is <proe_loadpoint>/weblink/netscape

To unset the environment variable CLASSPATH, add the following line:

set CLASSPATH=You must reboot your machine for these environment settings to take effect.

Setting Up Your HTML PageYour JavaScript code must be inside the <SCRIPT> tag. For example:

<SCRIPT language = "JavaScript"> a = 10; // JavaScript code goes here. function SomeFunctionIWrote() { b = 20; } </SCRIPT>

One way to display data and initiate actions is by using forms. Forms go inside the <FORM> tag. The following code creates a button labeled “Button Text” that, when selected, calls the JavaScript function SomeFunctionIWrote.

<FORM NAME = "ui"> <input type = button value = "Button Text" onclick = ’SomeFunctionIWrote()’> </FORM>

Before the </HTML> tag, your page must load the plug-in. Include the following lines:

<EMBED TYPE = application/x-proconnect NAME = "mypwc" WIDTH=2 HEIGHT=2>

Page 24: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

1 - 6 Pro/Web.Link User’s Guide

</EMBED>Your page must also load the Java applet, using the following lines:

<APPLET CODE = WebLink.class NAME = "pwl" WIDTH=2 HEIGHT=2> </APPLET>

The minimum size for the applet and plug-in is 2 x 2.

The following example shows a simple Web page that has two buttons—one for connecting to a Pro/ENGINEER process that is already running, and another for retrieving a model.

<HTML><HEAD><TITLE>Simple Application</TITLE></HEAD>

<script language = "JavaScript">

function ProEConnect()

//Connect to a running Pro/ENGINEER session.{ var ret = document.pwl.pwlProEngineerConnect(); if (ret.Status) { alert ("pwlProEngineerConnect succeeded!"); } else { alert ("pwlProEngineerConnect failed (" + ret.ErrorCode + ")"); }}

function ModelOpen()//Open a Pro/ENGINEER model.{ if (document.simple.ModelName.value == "") return; var ret = document.pwl.pwlMdlOpen (document.simple.ModelName.value, document.simple.ModelPath.value, true); if (!ret.Status) { if (ret.ErrorCode == -4 && document.simple.ModelPath.value == "") return; else { alert ("pwlMdlOpen failed (" + ret.ErrorCode + ")"); return; } }}

Page 25: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Setting Up Pro/Web.Link 1 - 7

Settin

g U

p

Pro

/Web

.Lin

k

</SCRIPT><BODY><form name = simple><input type = button value = "Connect to Pro/E" onclick = 'ProEConnect()'><hr>Path:<input type = text name = "ModelPath" onchange = 'ModelOpen()'><spacer size = 20><p>Model:<input type = text name = "ModelName" onchange = 'ModelOpen()'><spacer size = 20><p><input type = button value = "Open Model" onclick = 'ModelOpen()'></FORM></BODY><EMBED TYPE = application/x-proconnect NAME = "mypwc" WIDTH=2 HEIGHT=2></EMBED><APPLET CODE = WebLink.class NAME = "pwl" WIDTH=2 HEIGHT=2></APPLET></HTML>

See the chapter Application Management for more information on how to connect to Pro/ENGINEER from your Web page.

The Configuration FileTo start Pro/ENGINEER from a Web page, you need to create a configuration file that gives the command to use to start Pro/ENGINEER. The name of the configuration file must be config.pwl.

On UNIX systems, the file can exist in either the directory from which you started Netscape or your home directory. You can also use the environment variable PRO_WEB_LINK_CONFIG to specify the directory that contains the config.pwl file.

On NT systems, you cannot use the current directory—the configuration file must be in your home directory, or in the directory pointed to by $PRO_WEB_LINK_CONFIG.

Note: On NT systems, $HOME must be set for Pro/Web.Link to be able to find the configuration file in your home directory.

Page 26: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

1 - 8 Pro/Web.Link User’s Guide

The syntax of the file is as follows:

option value

You can specify the following options in your configuration file:

• “TrailRecord”—If this is “yes,” Pro/Web.Link records a trail file of your session.

• “TrailDir”—If this is specified, it is the absolute or relative path to the directory in which to write the trail file. If it is not specified, Pro/Web.Link uses the current directory.

• “Pro/ENGINEER”—This is the command used to start Pro/ENGINEER.

• Any string—If you pass a matching string to the function pwlApplicationStart, this command will be started in the background.

Your configuration file might look like this:

Pro/ENGINEER /usr/local/ptc/pro19/bin/pro MyXterm xterm

See the chapter Application Management for more information on accessing Pro/ENGINEER from your Web page.

Creating Trail FilesPro/Web.Link supports trail files. By default, trail files are created in the current directory. To create trail files, add the following line to your config.pwl file:

TrailRecord Yes

When you run Pro/Web.Link, it creates an HTML page on-the-fly that contains the sequence of Pro/Web.Link JavaScript function calls used during the interactive session. When you then run this HTML file, it determines whether the output values from the functions match those returned when the trail was created. (To run the trail HTML files, start Netscape with the file as an argument.) The trail files are named pwl_trl.htm.XX, where XX is the version number.

Page 27: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

2 - 1

2Introduction

This chapter describes the fundamentals of Pro/Web.Link. For information on how to set up your environment, see Setting Up Pro/Web.Link.

Topic Page

Overview

Pro/Web.Link Functions

Error Codes

Access Control

Pro/Web.Link Examples

Tips and Tricks

Troubleshooting

Books on JavaScript Programming

Page 28: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

2 - 2 Pro/Web.Link User’s Guide

OverviewPro/Web.Link links the World Wide Web to Pro/ENGINEER, enabling you to use the Web as a tool to automate and streamline parts of your engineering process.

Pro/Web.Link enables you to build custom Web-based applications that interact with Pro/ENGINEER through a Netscape Communicator Web browser. Pro/Web.Link extends the capabilities of this browser so it can understand and execute JavaScript commands that communicate with a Pro/ENGINEER session.

Pro/Web.Link has numerous uses, including the following:

• Tutorial—A Web-based tutorial could lead a user through a task in Pro/ENGINEER. At several places throughout the tutorial, example models could be automatically retrieved, models could be turned to named views, and features and dimensions could be highlighted.

• Design wizard—A frequently used design technique could be automated through a Web-based design wizard that adjusts dimensions and parameters in a template part before prompting the user to continue with the design process.

• Standards enforcer—A Web page could be used to check the material, parameters, and mass properties of a part, recommend changes, and explain any subsequent procedures to users.

• Design documentation—A Web page could be constructed to explain why certain design decisions were made. The Web page could orient the model to a named view, switch to a simplified representation, then highlight some dimensions.

Pro/Web.Link FunctionsAll the functions in Pro/Web.Link begin with the prefix “pwl” and all the arguments to the functions are input arguments. You can access any information returned from the functions through the “return bundle.” This bundle has at least the following fields:

• Status (Boolean)—True or false. If this is true, the function was successful.

• ErrorCode (int)—The error code.

• ErrorString (String)—The error string.

Page 29: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Introduction 2 - 3

Intro

du

ction

Any additional return fields are listed with the function syntax. For example:

pwlSessionMdlsGet (int MdlType // The type of model to list.

// Use parseInt with this// argument.

);Additional return fields:

int NumMdls; // The number of models in// the list.

String MdlNameExt[]; // The full names of the// models of the specified// type.

Error CodesYou use error codes to test for conditions in your code. Note that you can use the Pro/Web.Link error codes as constants. This enables you to use symbolic constants in the form “pwl.ErrorCode”, which is good coding practice. For example:

if (!ret.Status && ret.ErrorCode != pwl.PWL_E_NOT_FOUND)

The possible values of the ErrorCode return field are as follows:

• PWL_NO_ERROR

• PWL_EXEC_NOT_FOUND

• PWL_NO_ACCESS

• PWL_GENERAL_ERROR

• PWL_BAD_INPUTS

• PWL_USER_ABORT

• PWL_E_NOT_FOUND

• PWL_E_FOUND

• PWL_LINE_TOO_LONG

• PWL_CONTINUE

• PWL_BAD_CONTEXT

• PWL_NOT_IMPLEMENTED

• PWL_OUT_OF_MEMORY

• PWL_COMM_ERROR

Page 30: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

2 - 4 Pro/Web.Link User’s Guide

• PWL_NO_CHANGE

• PWL_SUPP_PARENTS

• PWL_PICK_ABOVE

• PWL_INVALID_DIR

• PWL_INVALID_FILE

• PWL_CANT_WRITE

• PWL_INVALID_TYPE

• PWL_INVALID_PTR

• PWL_UNAV_SEC

• PWL_INVALID_MATRIX

• PWL_INVALID_NAME

• PWL_NOT_EXIST

• PWL_CANT_OPEN

• PWL_ABORT

• PWL_NOT_VALID

• PWL_INVALID_ITEM

• PWL_MSG_NOT_FOUND

• PWL_MSG_NO_TRANS

• PWL_MSG_FMT_ERROR

• PWL_MSG_USER_QUIT

• PWL_MSG_TOO_LONG

• PWL_CANT_ACCESS

• PWL_OBSOLETE_FUNC

• PWL_NO_COORD_SYSTEM

• PWL_E_AMBIGUOUS

• PWL_E_DEADLOCK

• PWL_E_BUSY

• PWL_NOT_IN_SESSION

• PWL_INVALID_SELSTRING

Page 31: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Introduction 2 - 5

Intro

du

ction

Access ControlThere are four types of access from your Web page:

• Read from a Pro/ENGINEER session.

• Make changes to a Pro/ENGINEER session.

• Read from the file system.

• Write to the file system.

From your Web page, you can have permission to do none, some, or all of these actions.

You can specify the access types using the Pro/ENGINEER configuration file (config.pro) options listed in the following table.

You can also use the function pwlAccessRequest to ask the user to change the permissions. See Setting the Security Access for more information about this function.

The online browser for Pro/Web.Link includes the required security level in the function description. The information is also available in Quick Reference in this manual. The notation used is as follows:

• PR—Pro/ENGINEER read

• PW—Pro/ENGINEER write

• DR—Disk read

• DW—Disk write

To set the security directly from your Pro/ENGINEER session, select Utilities from the menu bar, then choose Pro/Web.Link, Set Access Permissions. Any changes to the security levels affect new (future) pages only—the permissions for preexisting pages do not change. The system displays the following dialog box.

Option Valid Values

Default Value

WEB_LINK_PROE_READ Yes or no No

WEB_LINK_PROE_WRITE Yes or no No

WEB_LINK_FILE_READ Yes or no No

WEB_LINK_FILE_WRITE Yes or no No

Page 32: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

2 - 6 Pro/Web.Link User’s Guide

Figure 2-1

The boxes in the security dialog box are checked according to the current access permissions.

If autoprompting is on and you call a function that requires a security level beyond the current settings, Pro/Web.Link displays the security dialog box so you can change the security levels. If autoprompting is off, the function fails and the error code PWL_NO_ACCESS is displayed. In this case, Pro/Web.Link displays a slightly different dialog box, as shown in Setting the Security Access in Application Management.

You can set autoprompting using the configuration file option WEB_LINK_SECURITY_AUTOPROMPT. The valid values are “yes” (the default value) and “no.”

Note that if you have not defined the default security settings in your configuration file, the initial settings in the security dialog box are to allow no access.

Pro/Web.Link ExamplesThis manual includes numerous examples of HTML pages created using Pro/Web.Link. Most of the examples include a standard header that includes some standard options on every page. The header has buttons to start, connect, and stop Pro/ENGINEER. Some file operations are also provided. The header is a JavaScript file loaded using the following lines of HTML:

<script src = "wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script>

Page 33: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Introduction 2 - 7

Intro

du

ction

The first line includes the header file in your source file. If an error occurs (for example, the header file is not in the current directory), the second line causes an error message to be displayed.

To properly include this file, the Web server must map the .js suffix to the MIME type “application/x-javascript”. To map the suffix to the MIME type, add the following line to the mime.types files in the server's configuration directory, then restart the server:

type = application/x-javascript exts = js

Note: To avoid redundancy, the header is included but not explicitly listed in the examples themselves.

The following sections describe the header files used in the example programs:

• wl_header.js—Contains only the JavaScript functions. This file is included in the head of the HTML page.

• wl_header_form.js—Contains the JavaScript that generates the form elements that access the functions in the wl_header.js file.

JavaScript Header

The contents of the header file wl_header.js are as follows:

//Generate the standard Web.Link header.function WlProEStart()//Start Pro/ENGINEER.{

var ret = document.pwl.pwlProEngineerStartAndConnect();if (!ret.Status){alert ("pwlProEngineerStartAndConnect failed (" + ret.ErrorCode +

")");return;

}}

function WlProEConnect()//Connect to a running Pro/ENGINEER session.{

var ret = document.pwl.pwlProEngineerConnect();if (!ret.Status){

alert ("pwlProEngineerConnect failed (" + ret.ErrorCode + ")");return;

}}

Page 34: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

2 - 8 Pro/Web.Link User’s Guide

function WlProEStop()//Disconnect from and stop a Pro/ENGINEER session started with//the function pwlProEngineerStartAndConnect.{

var ret = document.pwl.pwlProEngineerDisconnectAndStop();if (!ret.Status){

alert ("pwlProEngineerDisconnectAndStop failed (" + ret.ErrorCode +")");

return;}

}

function WlModelOpen()//Open a Pro/ENGINEER model.{

if (document.main.ModelName.value == "")return;

var ret = document.pwl.pwlMdlOpen (document.main.ModelName.value,document.main.ModelPath.value, true);

if (!ret.Status){

if (ret.ErrorCode == -4 && document.main.ModelPath.value == "")return;

else{alert ("pwlMdlOpen failed (" + ret.ErrorCode + ")");return;

}}

}

function WlModelRegenerate()//Regenerate a Pro/ENGINEER model.{

var ret = document.pwl.pwlMdlRegenerate (document.main.ModelNameExt.value);

if (!ret.Status){

alert ("pwlMdlRegenerate failed (" + ret.ErrorCode + ")");return;

}}

Page 35: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Introduction 2 - 9

Intro

du

ction

function WlModelSave()//Save a Pro/ENGINEER model.{

var ret = document.pwl.pwlMdlSave(document.main.ModelNameExt.value);if (!ret.Status){alert ("pwlMdlSave failed (" + ret.ErrorCode + ")");return;

}}

function WlModelSaveAs()//Save a Pro/ENGINEER model under a new name.{

var NewPath = document.main.NewPath.value;var NewName = document.main.NewName.value;if (NewPath == ""){

NewPath = null;}if (NewName == ""){

NewName = null;}var ret = document.pwl.pwlMdlSaveAs (document.main.ModelNameExt.value,

NewPath, NewName);if (!ret.Status){alert ("pwlMdlSaveAs failed (" + ret.ErrorCode + ")");return;

}}

function WlWindowRepaint()//Repaint the active window.{

var get_ret = document.pwl.pwlWindowActiveGet();if (!get_ret.Status){

alert ("pwlWindowActiveGet failed (" + get_ret.ErrorCode + ")");return;

}/* You can also repaint the active window using -1 as the window ID. */var ret = document.pwl.pwlWindowRepaint (parseInt (get_ret.WindowID));if (!ret.Status){

alert ("pwlWindowRepaint failed (" + ret.ErrorCode + ")");return;

}}

Page 36: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

2 - 10 Pro/Web.Link User’s Guide

Form Header File

The contents of the header file wl_header_form.js are as follows:

// Form with all the buttons to perform the actions in the header filedocument.writeln("<form name='main'>");

document.writeln("<hr>");document.writeln("<h4>Main Controls</h4>");document.writeln("<p>");document.writeln("<center>");document.writeln("<input type='button' value='Start Pro/E'

onclick='WlProEStart()'>");document.writeln("<input type='button' value='Connect to Pro/E'

onclick='WlProEConnect()'>");document.writeln("<input type='button' value='Stop Pro/E'

onclick='WlProEStop()'>");document.writeln("<p>");document.writeln("Path: <input type='text' name='ModelPath'

onchange='WlModelOpen()'>");document.writeln("<spacer size=20>");document.writeln("Model: <input type='text' name='ModelName'

onchange='WlModelOpen()'>");document.writeln("<spacer size=20>");document.writeln("<input type='button' value='Open Model'

onclick='WlModelOpen()'>");document.writeln("<p>");document.writeln("<table>");document.writeln("<tr>");document.writeln("<td><center>Model:</center></td>");document.writeln("<td><center>New Path:</center></td>");document.writeln("<td><center>New Name:</center></td></tr>");document.writeln("<tr>");document.writeln("<td><input type='text' name='ModelNameExt'></td>");document.writeln("<td><input type='text' name='NewPath'></td>");document.writeln("<td><input type='text' name='NewName'></td></tr>");document.writeln("</table>");document.writeln("<input type='button' value='Regenerate Model'

onclick='WlModelRegenerate()'>");document.writeln("<spacer size=10>");document.writeln("<input type='button' value='Save Model'

onclick='WlModelSave()'>");document.writeln("<spacer size=10>");document.writeln("<input type='button' value='Save Model As'

onclick='WlModelSaveAs()'>");document.writeln("<p>");document.writeln("<input type='button' value='REPAINT SCREEN'

onclick='WlWindowRepaint()'>");document.writeln("</center>");document.writeln("<hr>");document.writeln("</form>");

Page 37: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Introduction 2 - 11

Intro

du

ction

The following figure shows the header as it appears in the browser.

Figure 2-2

Tips and TricksKeep the following hints in mind when you create Web pages that interact with Pro/ENGINEER:

• Variable typing.

When you call Pro/Web.Link functions that have integer and double argument types, use the JavaScript functions parseInt (argument) and parseFloat (argument) to force the arguments to be of the correct type.

As a good programming practice, use the following syntax for variables:

var <variable name> = <value>

For example:

var fail_reason = ret.ErrorString;

Note that JavaScript uses very loose variable typing, whereas Java uses very strong variable typing.

Page 38: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

2 - 12 Pro/Web.Link User’s Guide

• Keep your JavaScript functions short.

This makes your Web pages easier to debug.

• Always check the return status and error code after calling a Pro/Web.Link function.

This makes your Web pages easier to debug. In addition, if you provide meaningful feedback based on the return values, your Web pages will be easier for people to use.

• Do not use any of the JavaScript reserved words as variable or function names.

The reserved words are as follows:

• Whenever possible, use defined constants instead of hardcoding values. Use the syntax document.pwl.CONSTANT_NAME, where document.pwl defines the location of your applet.

abstract finally protected

boolean float public

break for return

byte function short

case goto static

catch if super

char implements switch

class import synchronized

const in this

continue instanceof throw

default int throws

delete interface transient

do long true

double native try

else new typeof

extends null var

false package void

final private

Page 39: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Introduction 2 - 13

Intro

du

ction

TroubleshootingThe following table describes some common errors and how to resolve them.

Error Correction

The Web page cannot connect to Pro/ENGINEER.

Make sure the environment variable PRO_COMM_MSG_EXE is set. Also make sure the name service is running.

The browser complains about not being able to find the plug-in or applet.

Make sure the plug-in and applets were recursively copied into the Netscape plug-ins directory....or...Check to make sure the Pro/Web.Link plug-in is being found. Use the command Help, About Plug-Ins.

The Web page cannot start Pro/ENGINEER.

Check to make sure the config.pwl file is in the right place and contains the correct information.

The browser crashes after using a Pro/Web.Link-enabled Web page several times.

Make sure you are using Netscape Communicator 4.0x.

The browser displays the method “No Java method found matching arguments.”

Make sure the Pro/Web.Link function call is passing the correct argument types. Use parseInt and parseFloat with integer and double arguments.

All the Pro/Web.Link commands fail. Make sure your Pro/ENGINEER session has a Pro/Web.Link license....or...Make sure the Pro/Web.Link security settings in Pro/ENGINEER allow the actions the Pro/Web.Link command is trying to perform.

Selection hang If Netscape hangs during a selection process, it’s because Netscape is blocked until the selection is complete. When you press Done-Sel, the page will reload.

Page 40: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

2 - 14 Pro/Web.Link User’s Guide

Books on JavaScript ProgrammingThere are numerous books that teach JavaScript programming. The following table lists some of the books that are available.

Title Author Publisher

The Complete Idiot’s Guide to JavaScript

Scott J. Walter andAaron Weiss

QUE

Instant JavaScript Brian K. Holman and William Lund

Prentice Hall

Java 1.2 and JavaScript for C/C++ Programmers

Mike Daconta Wiley

JavaScript and Netscape Wizardry

Dan Shafer Coriolis

JavaScript for Dummies, 2nd Edition

Emily Vander Ver IDG Books

Official Netscape JavaScript Book, Second Edition

Peter Kent and John Kent

Netscape Press

Practical JavaScript Programming

Reaz Hoque MIS/M&T Books Press

Special Edition Using JavaScript Mark Reynolds and Andrew Wooldridge

QUE

JavaScript Unleashed, 2nd Edition

Richard Wagner, et al. Sams.net

Page 41: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 1

3Pro/Web.Link Documentation

This chapter describes Pro/Web.Link documentation, both online and in PDF format.

Topic

Online Documentation — Pro/Web.Link APIWizard

To Install the APIWizard

To Run the APIWizard

Web Browser Environments

To Download and Install the JFC (Swing) Archive

Automatic Index Tree Updating

The APIWizard Interface

To Browse with the Pro/Web.Link APIWizard

APIWizard Search Feature (Find)

Online Documentation — Pro/Web.Link APIWizard

Pro/Web.Link provides an online browser called the APIWizard that displays detailed documentation data. This browser displays information from the Pro/Web.Link Users’ Guide and API specifications derived from Pro/Web.Link header file data.

The Pro/Web.Link APIWizard contains the following:

Page 42: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 2 Pro/Web.Link User’s Guide

• Definitions of Pro/Web.Link categories and their hierarchical relationships

• Definitions of Pro/Web.Link methods

• Declarations of data types used by Pro/Web.Link methods

• The Pro/Web.Link Users’ Guide, which users can browse by topic or by category

• Code examples for Pro/Web.Link methods (taken from applications provided as part of the Pro/Web.Link installation)

Review the Release Notes and README file for the most up-to-date information on documentation changes.

Note: The User’s Guide is also available in PDF format. This file is located at:

<proe_loadpoint>/weblink/netscape/weblinkug.pdf

To Install the APIWizard

The Pro/ENGINEER product CD installation procedure automatically installs the Pro/Web.Link APIWizard. The files reside in a directory under the Pro/ENGINEER load point. The location for the Pro/Web.Link APIWizard files is:

<proe_loadpoint>/weblink/netscape/weblinkdoc

To Run the APIWizard

Start the Pro/Web.Link APIWizard by pointing your browser to:

<proe_loadpoint>/weblink/netscape/weblinkdoc/index.html

Your web browser will display the Pro/Web.Link APIWizard data in a new window. See the Web Browser Environments section for more information on requirements for the APIWizard software environment.

Web Browser Environments

The APIWizard supports Netscape Navigator version 4 and later, and Internet Explorer version 5 and later according to the following requirements:

• Use of the APIWizard with Internet Explorer requires installation of the Java2 plug-in.

Page 43: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Documentation 3 - 3

Pro

/Web

.Lin

k D

ocu

men

tation

• Use of Netscape Navigator requires installation of the Java Swing foundation class. If this class is not loaded on your computer, the APIWizard loads it for you. Loading can take several minutes, and the library does not persist between sessions. See Loading the Swing Class Library for the procedure to load Swing permanently.

• SGI hardware platform users must install the Swing class. For more information, refer to the section on SGI Hardware Platforms. See Loading the Swing Class Library for the procedure to load Swing permanently.

• Loading the Swing Class Library

If you access the APIWizard with Internet Explorer, download and install Internet Explorer’s Java2 plug-in. This plug-in is preferred over installing the Swing archive for Internet Explorer because Swing degrades access time for the APIWizard Search feature.

If you access the APIWizard with Netscape Navigator use the following procedures in this section to download and install the Java Foundation Class (Swing) archive:

• To Download and Install the JFC (Swing) Archive

• To Modify the Java Class Path on UNIX Platforms

• To Modify the Java Class Path on NT Platforms

To Download and Install the JFC (Swing) Archive

1. Navigate to the Java Foundation Class Download Page.

2. Navigate to the heading Downloading the JFC/Swing X.X.X Release, where X.X.X is the latest JFC version.

3. Click the standard TAR or ZIP file link. The heading Download the Standard Version is displayed.

Note: Do not download the “installer” version.

4. Select a file format, click Continue, and follow the download instructions on the subsequent pages.

5. Uncompress the downloaded bundle.

6. After downloading the swing-X.X.Xfcs directory (where X.X.X is the version of the downloaded JFC) created when uncompressing the bundle, locate the swingall.jar archive.

7. Add the swingall.jar archive to the Java Class Path as shown in the following sections of this chapter.

Page 44: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 4 Pro/Web.Link User’s Guide

To Modify the Java Class Path on UNIX Platforms

To make the Java Foundation Class (Swing) available in UNIX shell environments copy file swingall.jar to

program files/netscape/communicator/program/java/classes

Note: If the APIWizard displays text data as illegible colored blocks, install the font.properties file as follows:

1. In the Netscape directory, look for the plugins directory. Create a plugins directory if one does not exist.

2. Download file font.properties from

http://devedge.netscape.com/software/jdk/i18n.html

3. Copy file font.properties into the Netscape plugins directory.

4. Restart the UNIX shell, then restart Netscape and the APIWizard.

To Modify the Java Class Path on NT Platforms

To make the Java Foundation Class (Swing) available on Windows NT Platforms:

For Netscape:

1. Copy swingall.jar from the location to which you downloaded it.

2. Paste swingall.jar into the following location:

[system_disk]/Program Files/Netscape/Communicator/Program/java/classes

Note: You do not need to reboot your machine for this change to take effect.

For Intenet Explorer

Install the APIWizard Internet Explorer Java2 plug-in.

SGI Hardware Platforms

SGI hardware platform users must download the Java Foundation Class (Swing) archive and install it in their CLASSPATH as described in Loading the Swing Class Library. On SGI platforms, if Netscape temporarily downloads the Swing archive and then starts the APIWizard, the following exception will be thrown, even though the class javax/swing/text/MutableAttributeSet exists in the downloaded archive.

Page 45: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Documentation 3 - 5

Pro

/Web

.Lin

k D

ocu

men

tation

java.lang.ClassNotFoundException: javax/swing/text/MutableAttributeSet

This exception is not thrown when the Swing archive is properly installed on the user's machine.

Automatic Index Tree Updating

With your browser environment configured correctly, following a link in an APIWizard HTML file causes the tree in the Selection frame to update and scroll the tree reference that corresponds to the newly displayed page. This feature is called automatic tree scrolling.

If you access the APIWizard through Netscape’s Java2 plug-in, this feature is not available. You must install the Java foundation class called Swing for this method to work. See Loading the Swing Class Library for the procedure on loading Swing.

If you access the APIWizard with Internet Explorer, download and install the Internet Explorer Java2 plug-in to make automatic tree scrolling available.

The APIWizard starts and displays pages stating it is checking for the proper environment, loading the data, or that you need to set up your environment as described in Web Browser Environments.

The APIWizard InterfaceThe APIWizard interface consists of two frames. The following sections describe how to display and use the.APIWizard frames in your Web browser.

Topic/Category Selection Frame

This frame, located on the left of the screen, controls what is presented in the Display frame. Specify the data to view by choosing either the Pro/Web.Link categories or Pro/Web.Link Users’ Guide menu items.

In Categories mode, this frame displays an alphabetical list of the Pro/Web.Link categories. It can also displayPro/Web.Link methods as subnodes of the categories.

In User’s Guide mode, this frame displays the Pro/Web.Link User’s Guide table of contents in a tree structure. All chapters are displayed as subnodes of the main Pro/Web.Link User’s Guide node.

Page 46: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 6 Pro/Web.Link User’s Guide

The Topic/Category Selection frame includes a Find button for data searches of the Pro/Web.Link User’s Guide or of API specifications taken from header files. See the section APIWizard Search Feature (Find) for more information on the Find feature.

Display Frame

This frame, located on the right of the screen, presents:

• Pro/Web.Link User's Guide content

• Pro/Web.Link category and category hierarchy descriptions

• Pro/Web.Link method descriptions

• Code examples for Pro/Web.Link methods

The next figure shows the APIWizard interface layout.

Page 47: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Documentation 3 - 7

Pro

/Web

.Lin

k D

ocu

men

tation

Navigating the Topic/Category Selection Tree

Use the Topic/Category Selection frame to access allPro/Web.Link APIWizard online documentation data for categories, methods, or the Pro/Web.Link Users’ Guide. This frame displays a tree structure of the data. Expand and collapse the tree to navigate this data.

To expand the tree structure, first select Categories orPro/Web.Link User’s Guide at the top of the Topic/Category Selection frame. The APIWizard displays the tree structure for the categories or User’s Guide in collapsed form. The Switch icon to the far left of a node (that is, an category or chapter name) signifies that this node contains subnodes. (If a node has no Switch icon, it has no subnodes.) Selecting the Switch icon (or double-clicking on the node text) toggles the switch to the down position. The APIWizard then expands the tree to display the subnodes. Select a node or subnode, and the APIWizard displays the online data in the Display frame.

To Browse with the Pro/Web.Link APIWizard

View Pro/Web.Link Categories by choosing Pro/Web.Link Categories at the top of the Topic/Category Selection frame. In this mode, the APIWizard displays Pro/Web.Link categories in alphabetical order.

Categories and Methods

The next figure shows the Pro/Web.Link category tree layout.

Page 48: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 8 Pro/Web.Link User’s Guide

The definition page displayed for each Pro/Web.Link category shows methods available for that category.

To Browse the Pro/Web.Link User’s Guide

View the Pro/Web.Link Users’ Guide by clicking Pro/Web.Link Users’ Guide at the top of the Topic/Category Selection frame. In this mode, the APIWizard displays the User’s Guide section headings.

Click Switch icon next to the section you wish to view by clicking the Switch icon next to the desired section name or double-clicking the section name text. The APIWizard then displays a tree of subsections under the selected section. The text for the selected section (or subsection) appears in the Display frame. Click Switch icon again (or double-click the node text) to collapse the subnode listing and display only the main nodes.

The following figure of the APIWizard User’s Guide table of contents shows the collapsed tree layout for the Pro/Web.Link Users’ Guide table of contents.

Page 49: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Documentation 3 - 9

Pro

/Web

.Lin

k D

ocu

men

tation

APIWizard Search Feature (Find)The APIWizard supports searches for specified strings against both the Pro/Web.Link User’s Guide and API definition files. Click Find on the Topic/Category Selection frame to display the APIWizard Search dialog box (see the following figure on the APIWizard Search dialog box).

Note: The APIWizard Search feature is slow when accessed through Internet Explorer’s Default Virtual Machine. For better performance, access the APIWizard through Internet Explorer’s Java2 plug-in.

Page 50: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 10 Pro/Web.Link User’s Guide

The Search dialog box contains the following fields, buttons, and frames:

• Enter Search String or Strings

Enter the specific search string or strings in this field. By default, the browser performs a noncase-sensitive search. Section Supported Search Types presents supported search types and search string syntax. The section Performing an APIWizard Search describes search procedures.

• Search/Stop

Click Search to begin a search. During a search, this button name changes to Stop. Click Stop to stop the search.

• Help

Click Help for help about the APIWizard search feature. The APIWizard presents this help data in the Display frame.

• Case Sensitive

Page 51: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Documentation 3 - 11

Pro

/Web

.Lin

k D

ocu

men

tation

Select this button to specify a case-sensitive search.

• Search API References

Click Search API References to search for data on API methods. Click API Names to search for method names only. Click Definitions to search the API method names and definitions for specific strings. The APIWizard displays method descriptions as shown in the following figure.

• Search Manuals

Click Search Manuals to search the Pro/Web.Link Users’ Guide data. Click Table of Contents to search on Table of Contents entries only. Click Index to search only the Index. Click Contents to search on all text in the Pro/Web.Link Users’ Guide.

• Name

This frame displays a list of strings found by the APIWizard search.

• Found Under

This frame displays the location in the online help data where the APIWizard found the string.

Page 52: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 12 Pro/Web.Link User’s Guide

Supported Search Types

The APIWizard Search supports the following:

• Case-sensitive searches

• Search of API definitions, Pro/Web.Link User’s Guide data, or both

• Search of API data by API names only or by API names and definitions

• Search of Pro/Web.Link User’s Guide by Table of Contents only, by TOC and section titles, or on the User’s Guide contents (the entire text)

• Wildcard searches—valid characters are:

Page 53: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Documentation 3 - 13

Pro

/Web

.Lin

k D

ocu

men

tation

– * (asterisk) matches zero or more nonwhite space characters

– ? (question mark) matches one and only one nonwhite space character

To match on an asterisk or a question mark character, place a \ (backslash) character before the desired character. For example, to search for *wchar_t, enter

\*wchar_t

To match on a double-quote character (“) or a single-quote character (’), place a \ (backslash) character before it.

To search for any string containing the characters Pwl, any number of other characters, and the characters NameGet

Pwl*NameGet

To search for any string containing the characters Pwl, one other character, and the characters NameGet

Pwl?NameGet

To search for any string containing the characters Pwl, one or more other characters, and the characters Name

Pwl?*Name

To search on the string PWL, followed by an *

PWL\*

To search on the string PWL, followed by a ?

PWL\?

To search on the string PWL, followed by a \

PWL\\

• Search strings containing white space— Search on strings that contain space characters (white space) by placing double- or single-quote characters around the string.

"family tables"’PwlFeature*methods’

Page 54: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 14 Pro/Web.Link User’s Guide

• Search on multiple strings—Separate multiple search strings with white space (tabs or spaces). Note that the default logical relationship between multiple search strings is OR.

To return all strings matching Pwl*Get OR PwlMdl*, enter:

Pwl*Get PwlMdl*

Note that this search specification also returns strings that match both specified search targets, for example:

PwlMdlCurrentGet

If a string matches two or more search strings, the APIWizard displays only one result in the search table, for example:

Pwl*Mdl Pwl*InfoGet

returns only one entry for PwlMdlInfoGet.

Mix quoted and nonquoted strings as follows:

Pwl*Get "family tables"

This syntax returns all instances of strings containing Pwl and Name, or strings containing asynchronous mode.

Performing an APIWizard Search

Follow these steps to search for information in the APIWizard online help data:

1. Click Find at the top of the Topic/Category Selection frame.

2. Specify the string or strings to be searched for in the Enter Search String field.

3. Click Case Sensitive to specify a case-sensitive search.

Note: The default search is non case-sensitive.

4. Click either or both of the Search API References and Search User’s Guide buttons. Select the desired options under these buttons.

5. Click Search. The APIWizard turns this button red and is renames it Stop for the duration of the search. Click Stop to stop a search.

6. If the APIWizard finds the search string in the specified search area or areas, it displays the string in the Name frame. In the Where Found frame, the APIWizard displays links to the online help data that contains the found string.

Page 55: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Documentation 3 - 15

Pro

/Web

.Lin

k D

ocu

men

tation

7. During the search or after the search ends, select an entry in the Name or Where Found frames to display the online help data for that string. The APIWizard first updates the Topic/Category Selection frame and tree, and then presents in the Display frame the online help data for the selected string.

Page 56: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

3 - 16 Pro/Web.Link User’s Guide

Page 57: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

4 - 1

4Application Management

This chapter describes the basic Pro/Web.Link functions that enable you to manage applications. The application management functions handle the startup, termination, and connection of a Pro/ENGINEER session, as well as the security requests and startup of other applications. You can call these functions with any level of security access.

Topic Page

Connecting to Pro/ENGINEER

Disconnecting from Pro/ENGINEER

Starting an Application

Setting the Security Access

Page 58: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

4 - 2 Pro/Web.Link User’s Guide

Connecting to Pro/ENGINEERFunctions introduced:

• pwlProEngineerStartAndConnect

• pwlProEngineerConnect

The pwlProEngineerStartAndConnect function starts a Pro/ENGINEER session and connects to it. The startup command for Pro/ENGINEER must be in the config.pwl file, or the command will fail. (See The Configuration File in Setting Up Pro/Web.Link for more information about the config.pwl file.) The function connects to the started Pro/ENGINEER session no matter what other sessions might be currently running. This function takes no arguments and does not return any additional fields.

The function pwlProEngineerConnect connects to a Pro/ENGINEER process that is already running. The function looks for a Pro/ENGINEER session running on the same display as the Web browser. If more than one session is running with the same user on the same machine, and displaying to the same display, the function fails. The function takes no arguments and does not return any additional fields.

Notes:

• If Pro/Web.Link is already connected to a Pro/ENGINEER session, calling this function will have no effect.

• Pro/Web.Link connects to the first Pro/ENGINEER session it finds, which is usually the first one started.

• If you start session 1 of Pro/ENGINEER, start session 2, exit session 1, and then try to connect, the connection will fail.

See Pro/Web.Link Examples for a code example that uses these functions.

Page 59: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Application Management 4 - 3

Ap

plicatio

n

Man

agem

ent

Disconnecting from Pro/ENGINEERFunctions introduced:

• pwlProEngineerDisconnect

• pwlProEngineerDisconnectAndStop

The function pwlProEngineerDisconnect disconnects from a Pro/ENGINEER session that was started with a call to the function pwlProEngineerConnect. Similarly, the function pwlProEngineerDisconnectAndStop disconnects and terminates a Pro/ENGINEER session that was started with a call to pwlProEngineerStartAndConnect.

Note: If you try to use pwlProEngineerDisconnect on a Pro/ENGINEER session that was started using pwlProEngineerStartAndConnect, the call is ignored.

Starting an ApplicationFunction introduced:

• pwlApplicationStart

The function pwlApplicationStart starts any application. The syntax is as follows:

pwlApplicationStart (String AppName // The name of the application

);

Note that you must have specified the AppName in the config.pwl file, using the following form:

AppName <command>

In this syntax, AppName is the argument passed to pwlApplicationStart and command is the command that will start the application.

For example, to be able to start an X terminal window, add the following line to your config.pwl file:

MyXterm xterm

Page 60: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

4 - 4 Pro/Web.Link User’s Guide

To create the X terminal window, you would then use code similar to the following in the script section of your HTML file:

.

.

.function StartXterm(){

ret = document.pwl.pwlApplicationStart ("MyXterm");if (!ret.Status){

alert ("pwlApplicationStart failed. Error code: " + ret.ErrorCode);}

}

Setting the Security AccessFunction introduced:

• pwlAccessRequest

The function pwlAccessRequest enables you to request a particular level of access from Pro/ENGINEER. The function causes the security dialog box that lists the requested levels of access to Pro/Web.Link to be displayed. You can then independently choose whether to give read and write access to Pro/ENGINEER and the disk.

The following figure shows the security dialog box. The boxes in the security dialog box are checked according to the current access permissions.

Page 61: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Application Management 4 - 5

Ap

plicatio

n

Man

agem

ent

Figure 4-1

Note: The required access levels for each Pro/Web.Link function are listed in the function synopsis in the online browser. The levels are also listed in Quick Reference.

Page 62: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

4 - 6 Pro/Web.Link User’s Guide

The syntax of the function is as follows:

pwlAccessRequest (boolean WantProERead, // Set this to true to

// grant read access to// Pro/ENGINEER.

boolean WantProEWrite, // Set this to true to// grant write access to// Pro/ENGINEER.

boolean WantDiskRead, // Set this to true to// grant read access to// the disk.

boolean WantDiskWrite // Set this to true to// grant write access to// the disk.

);Additional return fields:

boolean GotProERead; // Confirms the read access// to the Pro/ENGINEER// database.

boolean GotProEWrite; // Confirms the write access// to the Pro/ENGINEER// database.

boolean GotDiskRead; // Confirms the read access// to the disk.

boolean GotDiskWrite; // Confirms the write access// to the disk.

See Access Control for more information on security access.

Page 63: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

5 - 1

5Utilities

This chapter describes the utility functions provided by Pro/Web.Link. The utility functions enable you to manipulate directories and arrays, and to get the value of a given environment variable.

Topic Page

Environment Variables

Manipulating Directories

Allocating Arrays

Page 64: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

5 - 2 Pro/Web.Link User’s Guide

Environment VariablesFunction introduced:

• pwlEnvVariableGet

The function pwlEnvVariableGet returns the value of the specified environment variable. The syntax is as follows:

pwlEnvVariableGet (String VarName // The name of the environment

// variable whose value you want);Additional return field:

String Value; // The value

The following code fragment shows how to get the value of the environment variable NPX_PLUGIN_PATH.

<SCRIPT language = "JavaScript">...function EnvVar(){

ret = document.pwl.pwlEnvVariableGet ("NPX_PLUGIN_PATH");

if (ret.Status){

document.ui.RETVAL.value = "Success: Value is " + ret.Value;}else{

document.ui.RETVAL.value = stat.ErrorCode+": " + ret.ErrorString;}

}</script>

Page 65: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Utilities 5 - 3

Utilities

Manipulating DirectoriesFunctions introduced:

• pwlDirectoryCurrentGet

• pwlDirectoryCurrentSet

• pwlDirectoryFilesGet

The function pwlDirectoryCurrentGet provides the path to the current directory. The syntax is as follows:

pwlDirectoryCurrentGet();Additional return field:

String DirectoryPath; // The path to the// current directory

The pwlDirectoryCurrentSet function sets the current directory to the one specified by the argument DirectoryPath. The syntax is as follows:

pwlDirectoryCurrentSet (String DirectoryPath // The directory to make

// current);

The function pwlDirectoryFilesGet lists the files and subdirectories for the specified directory. Note that you can pass a filter to get only those files that have the specified extensions. The function returns the number of files found and a list of file names. The syntax is as follows:

pwlDirectoryFilesGet (String DirectoryPath, // The directory whose

// files and subdirectories// you want to find. If this// is null, the function// lists the files in the// current Pro/ENGINEER// directory.

String Filter // The filter string for the// file extensions,// separated by commas. For// example. "*.prt," "*.txt".// If this is null, the// function lists all the// files and directories.

);

Page 66: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

5 - 4 Pro/Web.Link User’s Guide

Additional return fields:int NumFiles; // The number of files in

// FileNames.String FileNames[]; // The list of file names.int NumSubdirs; // The number of

// subdirectories.String SubdirNames; // The list of subdirectory

// names.

Allocating ArraysFunctions introduced:

• pwluBooleanArrayAlloc

• pwluDoubleArrayAlloc

• pwluIntArrayAlloc

• pwluStringArrayAlloc

These functions allocate arrays of Boolean values, doubles, integers, and strings, respectively. Each function takes a single argument. Note that these functions return the allocated array.

The syntax of the functions is as follows:

boolean pwluBooleanArrayAlloc (int ArraySize // The size of the Boolean

// array to allocate. Use// parseInt with this argument.

);

double[] pwluDoubleArrayAlloc (int ArraySize // The size of the double array

// to allocate. Use parseInt// with this argument.

);

int[] pwluIntArrayAlloc (int ArraySize // The size of the integer array

// to allocate. Use parseInt// with this argument.

);

String[] pwluStringArrayAlloc (int ArraySize // The size of the string array

// to allocate. Use parseInt with// this argument.

);

Page 67: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Utilities 5 - 5

Utilities

See Feature Example for a code example that uses the pwluIntArrayAlloc function. See Selection Example for a code example that uses the pwluStringArrayAlloc function.

Page 68: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

5 - 6 Pro/Web.Link User’s Guide

Page 69: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 1

6Model and File Management

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate models.

Topic Page

Model Management

File Management Operations

Model Example

Model Items

Page 70: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 2 Pro/Web.Link User’s Guide

Model ManagementFunctions introduced:

• pwlMdlCurrentGet

• pwlSessionMdlsGet

• pwlMdlDependenciesGet

• pwlMdlInfoGet

• pwlMdlIntralinkInfoGet

• pwlMdlRegenerate

To retrieve the current model in session, call the function pwlMdlCurrentGet. The syntax is as follows:

pwlMdlCurrentGet();Additional return fields:

String MdlNameExt; // The full name of the// current model

The function pwlSessionMdlsGet provides a list of all the models with the specified type that are in session. The syntax is as follows:

pwlSessionMdlsGet (int MdlType // The type of model to list.

// Use parseInt with this// argument.

);Additional return fields:

int NumMdls; // The number of models in// the list.

String MdlNameExt[]; // The full names of the// models of the specified// type.

The valid model types are as follows:

• PWL_ASSEMBLY

• PWL_PART

• PWL_DRAWING

• PWL_2DSECTION

• PWL_LAYOUT

• PWL_DWGFORM

• PWL_MFG

• PWL_REPORT

Page 71: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Model and File Management 6 - 3

Mo

del an

d F

ile M

anag

emen

t

• PWL_MARKUP

• PWL_DIAGRAM

The function pwlMdlDependenciesGet lists all the top-level dependencies for the specified model (that is, all the models upon which the given model depends). If any of these models is an assembly, the function does not list the dependencies for that assembly. The syntax is as follows:

pwlMdlDependenciesGet (String MdlNameExt // The full name of the model

// whose dependencies you want);Additional return fields:

int NumMdls; // The number of models in the// returned array

String MdlNameExt[]; // The array of models upon// which the specified model// depends

For the specified model, the function pwlMdlInfoGet provides the generic name and model type. The syntax is as follows:

pwlMdlInfoGet (String NameExt // The full name of the model

);Additional return fields:

String ImmediateGeneralName; // The immediate// general name

String TopGenericName; // The top-level// generic name of// the model

int MdlType; // The model type

The function pwlMdlIntralinkInfoGet provides Pro/INTRALINK™ information about the specified model. Given the name of the model, this function provides the version, revision, branch, and release level. The syntax is as follows:

pwlMdlIntralinkInfoGet (String NameExt // The full name of the model

);Additional return fields:

String Version; // The versionString Revision; // The model revisionString Branch; // The branchString ReleaseLevel; // The release level

Note: Markups and sections are not supported.

Page 72: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 4 Pro/Web.Link User’s Guide

The pwlMdlRegenerate function regenerates the specified model. The syntax is as follows:

pwlMdlRegenerate (String MdlNameExt // The full name of the model

);

File Management OperationsFunctions introduced:

• pwlMdlOpen

• pwlMdlSaveAs

• pwlMdlErase

• pwlMdlRename

The function pwlMdlOpen retrieves the specified model. The syntax is as follows:

pwlMdlOpen (String MdlNameExt, // The full name of the

// model.String Path, // The full directory

// path to the model.boolean DisplayInWindow // If this is true, display

// the retrieved model in// a Pro/ENGINEER window.

);Additional return field:

int WindowID; // The identifier of the// window in which the// model is displayed.

The Path argument is the full directory path to the model. If the model is already in memory, the function ignores this argument. If you try to open a model that is already in memory and supply an invalid Path, pwlMdlOpen successfully opens the model anyway.

If Path is an empty string, the function uses the default Pro/ENGINEER search path, including the current Workspace if Pro/INTRALINK is being used.

You can use the function pwlMdlOpen to open a family table instance by specifying the name of the generic instance as the MdlNameExt argument.

Page 73: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Model and File Management 6 - 5

Mo

del an

d F

ile M

anag

emen

t

The function pwlMdlSaveAs saves the model in memory to disk, under a new name. The syntax is as follows:

pwlMdlSaveAs (String OrigNameExt, // The original name of the

// model, including the// extension

String NewPath, // The new path to the modelString NewNameExt // The new name of the model,

// including the extension);

Note: Pro/Web.Link does not currently support the Pro/ENGINEER methods of saving subcomponents under new names, so NewPath and NewNameExt are optional.

The function pwlMdlErase removes the specified model from memory. The syntax is as follows:

pwlMdlErase (String MdlNameExt // The full name of the model

// to erase from memory);

To rename a model in memory and on disk, use the function pwlMdlRename. Note that the model must be in the current directory for the model to be renamed on disk. The syntax is as follows:

pwlMdlRename (String OrigNameExt, // The original name of the

// model, including the// extension

String NewNameExt // The new name of the model,// including the extension

);

Page 74: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 6 Pro/Web.Link User’s Guide

Checking Out Pro/INTRALINK Objects

Function introduced:

• pwlObjMdlsCheckOut

To check out Pro/INTRALINK objects from the Commonspace to a Workspace, call the function pwlObjMdlsCheckOut. The syntax is as follows:

pwlObjMdlsCheckOut (boolean LinkOrCopy, // If this is true, check

// out the object as a// link.

String WorkspaceName, // The name of the// Workspace to which the// objects are checked out.

int NumObj, // The number of objects// to check out. Use// parseInt with this// argument.

String ObjNames[], // An array of names (and// extensions) of the// objects to check out.

int ObjVersions[], // The object versions.// If this is null, the// default action is to// use the latest versions.// Use parseInt with this// argument.

int RelCriteria // The relationship// criteria. Use parseInt// with this argument.

);

The RelCriteria argument identifies which dependents should be checked out along with the ObjNames[]. The possible values are as follows:

• 1—Include all the dependents.

• 2—Include the required dependents only.

• 3—Do not include any dependents.

Page 75: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Model and File Management 6 - 7

Mo

del an

d F

ile M

anag

emen

t

Model ExampleThe following example shows how to use the Pro/Web.Link model functions.

<html><head><title>Web.Link Models Functionality</title>

<script src="wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script>

<script language="JavaScript">

function WlModelOpenWindowless()//Open a Pro/ENGINEER model without a window.{

var ret = document.pwl.pwlMdlOpen (document.open.ModelName.value,document.open.ModelPath.value, false);

if (!ret.Status){alert ("pwlMdlOpen failed (" + ret.ErrorCode + ")");return;

}}

function WlModelErase()//Erase a model from memory.{

var ret = document.pwl.pwlMdlErase (document.erase.ModelNameExt.value);if (!ret.Status){

alert ("pwlMdlErase failed (" + ret.ErrorCode + ")");return;

}}

function WlModelRename()//Rename a model in memory only.{

var ret = document.pwl.pwlMdlRename (document.rename.ModelNameExt.value,document.rename.NewNameExt.value);

if (!ret.Status){alert ("pwlMdlRename failed (" + ret.ErrorCode + ")");return;

}}

Page 76: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 8 Pro/Web.Link User’s Guide

function WlModelCopy()//Copy a model in memory only.{

var ret = document.pwl.pwlMdlCopy (document.copy.ModelNameExt.value,document.copy.NewNameExt.value, document.copy.Display.checked);

if (!ret.Status){

alert ("pwlMdlCopy failed (" + ret.ErrorCode + ")");return;

}}

function WlModelsList()//List all the models in the current session.{

var ModelType = document.pwl.eval (document.list_mdls.ModelType.options[document.list_mdls.ModelType.selectedIndex].value);

var ret = document.pwl.pwlSessionMdlsGet (parseInt (ModelType));if (!ret.Status){

alert ("pwlSessionMdlsGet failed (" + ret.ErrorCode + ")");return;

}document.list_mdls.ModelNameExts.value = "";for (var i = 0; i < ret.NumMdls; i++){document.list_mdls.ModelNameExts.value += ret.MdlNameExt[i] + "\n";

}}

function WlModelGetCurrent()//Get the current model.{

var ret = document.pwl.pwlMdlCurrentGet();if (!ret.Status){

alert ("pwlMdlCurrentGet failed (" + ret.ErrorCode + ")");return;

}document.get_cur.ModelNameExt.value = ret.MdlNameExt;

}

function WlModelGetDependencies()//Get the dependencies of the model.{

var ret = document.pwl.pwlMdlDependenciesGet (document.get_deps.ModelNameExt.value);

if (!ret.Status){

alert ("pwlMdlDependenciesGet failed (" + ret.ErrorCode + ")");

Page 77: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Model and File Management 6 - 9

Mo

del an

d F

ile M

anag

emen

t

return;}document.get_deps.ModelNameExts.value = "";for (var i = 0; i < ret.NumMdls; i++){

document.get_deps.ModelNameExts.value += ret.MdlNameExt[i] + "\n";}

}

function WlModelGetInfo()//Get information about the model from Pro/INTRALINK.{

var info_ret = document.pwl.pwlMdlInfoGet (document.get_info.ModelNameExt.value);

if (!info_ret.Status){alert ("pwlMdlInfoGet failed (" + info_ret.ErrorCode + ")");return;

}document.get_info.Generic.value = info_ret.TopGenericName;

// Use the model select list to convert the type to a string.var ModelType = "Undefined";for (var i = 0; i < document.list_mdls.ModelType.length; i++){

if (parseInt (document.pwl.eval (document.list_mdls.ModelType.options[i].value)) ==info_ret.MdlType)

{ModelType = document.list_mdls.ModelType.options[i].text;

}}

document.get_info.ModelType.value = ModelType;

document.get_info.Version.value = "";document.get_info.Revision.value = "";document.get_info.Branch.value = "";document.get_info.ReleaseLevel.value = "";var ret = document.pwl.pwlMdlIntralinkInfoGet (

document.get_info.ModelNameExt.value);if (!ret.Status){if (ret.ErrorCode != parseInt(document.pwl.PWL_NOT_IN_SESSION)){

alert("pwlMdlIntralinkInfoGet failed (" + ret.ErrorCode + ")");}return;

}

document.get_info.Version.value = ret.Version;document.get_info.Revision.value = ret.Revision;

Page 78: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 10 Pro/Web.Link User’s Guide

document.get_info.Branch.value = ret.Branch;document.get_info.ReleaseLevel.value = ret.ReleaseLevel;

}</script></head>

<body><script src="wl_header_form.js">document.writeln ("Error loading Web.Link header form<p>");</script>

<form name="open"><h4>Open Model Without a Window</h4><p><center><!-- Input arguments -->Path: <input type="text" name="ModelPath"><spacer size=20>Model: <input type="text" name="ModelName"><spacer size=20>

<!-- Buttons --><input type="button" value="Open Model"

onclick="WlModelOpenWindowless()"><p></center><hr></form>

<form name="erase"><h4>Erase Model</h4><p><center><!-- Input arguments -->Model: <input type="text" name="ModelNameExt">

<!-- Buttons --><input type="button" value="Erase Model" onclick="WlModelErase()"><p></center><hr></form>

<form name="rename"><h4>Rename Model</h4><p><center><!-- Input arguments -->Model: <input type="text" name="ModelNameExt"><spacer size=20>New Name: <input type="text" name="NewNameExt"><p>

Page 79: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Model and File Management 6 - 11

Mo

del an

d F

ile M

anag

emen

t

<!-- Buttons --><input type="button" value="Rename Model" onclick="WlModelRename()"><p></center><hr></form>

<form name="copy"><h4>Copy Model</h4><p><center><!-- Input arguments -->Model: <input type="text" name="ModelNameExt"><spacer size=20>New Name: <input type="text" name="NewNameExt"><br><input type="checkbox" name="Display"> Display Window<p><!-- Buttons --><input type="button" value="Copy Model" onclick="WlModelCopy()"><p></center><hr></form>

<form name="list_mdls"><h4>List Models</h4><p><center><!-- Input arguments -->Model Type:<select name="ModelType">

<option value="PWL_ASSEMBLY">Assembly</option><option value="PWL_PART">Part</option><option value="PWL_DRAWING">Drawing</option><option value="PWL_2DSECTION">2D Section</option><option value="PWL_LAYOUT">Layout</option><option value="PWL_DWGFORM">Drawing Form</option><option value="PWL_MFG">Manufaturing</option><option value="PWL_REPORT">Report</option><option value="PWL_MARKUP">Markup</option>

</select><p><!-- Buttons --><input type="button" value="List Models" onclick="WlModelsList()"><p><!-- Output arguments -->Models:<br><textarea name="ModelNameExts" rows=4 cols=50></textarea><p></center><hr></form>

Page 80: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 12 Pro/Web.Link User’s Guide

<form name="get_cur"><h4>Get Current Model</h4><p><center><!-- Buttons --><input type="button" value="Get Current Model"

onclick="WlModelGetCurrent()"><p><!-- Output arguments -->Model: <input type="text" name="ModelNameExt"><p></center><hr></form>

<form name="get_deps"><h4>Get Model Dependencies</h4><p><center><!-- Input arguments -->Model: <input type="text" name="ModelNameExt"><p><!-- Buttons --><input type="button" value="Get Dependencies"

onclick="WlModelGetDependencies()"><p><!-- Output arguments -->Models:<br><textarea name="ModelNameExts" rows=4 cols=50></textarea><p></center><hr></form>

<form name="get_info"><h4>Get Model Information</h4><p><center><!-- Input arguments -->Model: <input type="text" name="ModelNameExt"><p><!-- Buttons --><input type="button" value="Get Info" onclick="WlModelGetInfo()"><p><!-- Output arguments --><table><tr>

<td>Generic:</td><td><input type="text" name="Generic"></td><td>Model Type:</td><td><input type="text" name="ModelType"></td>

Page 81: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Model and File Management 6 - 13

Mo

del an

d F

ile M

anag

emen

t

</tr><tr>

<td>Version:</td><td><input type="text" name="Version"></td><td>Revision:</td><td><input type="text" name="Revision"></td>

</tr><tr>

<td>Branch:</td><td><input type="text" name="Branch"></td><td>Release Level:</td><td><input type="text" name="ReleaseLevel"></td>

</tr></table></center><hr></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Figure 6-1

Page 82: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 14 Pro/Web.Link User’s Guide

Figure 6-2

Page 83: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Model and File Management 6 - 15

Mo

del an

d F

ile M

anag

emen

t

Figure 6-3

Figure 6-4

Page 84: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

6 - 16 Pro/Web.Link User’s Guide

Model ItemsFunctions introduced:

• pwlItemNameToID

• pwlItemIDToName

• pwlItemNameSetByID

The function pwlItemNameToID returns the identifier of the specified model item, given its name. The syntax is as follows:

pwlItemNameToID (String MdlNameExt, // The full name of the modelString ItemName, // The name of the model itemint ItemType // The type of model item

);Additional return field:

int ItemID; // The identifier of the// model item

Similarly, to get the name of a model item given its identifier, use the function pwlItemIDToName. The syntax is as follows:

pwlItemIDToName (String MdlNameExt, // The full name of the modelint ItemID, // The item identifierint ItemType // The type of model item

);Additional return field:

String ItemName; // The name of the model item

You can change the name of an item using the function pwlItemNameSetByID function. The syntax is as follows:

pwlItemNameSetByID (String MdlNameExt, // The full name of the modelint ItemID, // The identifier of the

// model itemint ItemType, // The type of model itemString ItemName // The new name for the model

// item);

The value of the ItemType argument should be PWL_FEATURE.

Page 85: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

7 - 1

7Windows and Views

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate windows and views.

Topic Page

Windows

Views

Page 86: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

7 - 2 Pro/Web.Link User’s Guide

WindowsFunctions introduced:

• pwlWindowRepaint

• pwlSessionWindowsGet

• pwlWindowMdlGet

• pwlWindowActiveGet

• pwlWindowActivate

• pwlWindowClose

The function pwlWindowRepaint repaints the window and removes highlights. Use the value –1 for the WindowID to repaint the current window. The syntax is as follows:

pwlWindowRepaint (int WindowID // The window identifier. Use -1

// to repaint the current window.// Use parseInt with this argument.

);

The function pwlSessionWindowsGet provides a count and the list of window identifiers for the current Pro/ENGINEER session. The syntax is as follows:

pwlSessionWindowsGet();Additional return fields:

int NumWindows; // The number of windowsint WindowIDs[]; // The list of window identifiers

The function pwlWindowMdlGet retrieves the model associated with the specified window. Use the value –1 for the current window. The syntax is as follows:

pwlWindowMdlGet (int WindowID // The window identifier.

// Use -1 for the current// window. Use parseInt with// this argument.

);Additional return field:

String MdlNameExt; // The full name of the// model associated with// the specified window.

Page 87: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Windows and Views 7 - 3

Win

do

ws an

d V

iews

The function pwlWindowActiveGet provides the identifier of the currently active window. The syntax is as follows:

pwlWindowActiveGet();Additional return field:

int WindowID; // The identifier of the currently// active window. Use parseInt// with this argument.

The function pwlWindowActivate makes the specified window active. This is equivalent to selecting Window, Activate from the Pro/ENGINEER menu bar. The syntax is as follows:

pwlWindowActivate (int WindowID // The identifier of the window to

// make active. Use parseInt with// this argument.

);

To close a window, call pwlWindowClose. Use the value –1 to close the current window. The syntax is as follows:

pwlWindowClose (int WindowID // The identifier of the window

// to close. Use parseInt with this// argument.

);

Note: If you are in the middle of an operation, such as creating a feature, Pro/ENGINEER might display a dialog box asking you to confirm the cancellation of that operation.

Use any of the following functions to get the window identifier:

• pwlGeomSimprepOpen

• pwlGraphicsSimprepOpen

• pwlInstanceOpen

• pwlMdlOpen

• pwlSessionWindowsGet

• pwlSimprepOpen

• pwlWindowActiveGet

See Pro/Web.Link Examples for a code example that uses some of the Pro/Web.Link window functions.

Page 88: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

7 - 4 Pro/Web.Link User’s Guide

ViewsFunctions introduced:

• pwlViewSet

• pwlViewDefaultSet

• pwlMdlViewsGet

The function pwlViewSet sets the view for the specified model. The syntax is as follows:

pwlViewSet (String MdlNameExt, // The full name of the modelString NamedView // The name of the view

);

The pwlViewDefaultSet function sets the specified model to the default view for that model. The syntax is as follows:

pwlViewDefaultSet (String MdlNameExt // The full name of the model

);

The function pwlMdlViewsGet provides the number and names of all the views in the specified model. The syntax is as follows:

pwlMdlViewsGet (String MdlNameExt // The full name of the model

);Additional return fields:

int NumViews; // The number of viewsString ViewNames[]; // The list of view names

View Example

The following example shows how to use the Pro/Web.Link view functions.

See Sample Web Pages for another example that uses the view functions.

<html><head><title>Web.Link Views Sample</title>

<script src = "wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script><script language="JavaScript">

Page 89: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Windows and Views 7 - 5

Win

do

ws an

d V

iews

function ViewSet()//Set the display to a user-defined view.{

var view_name = document.set_view.input_view.value;if (view_name == "" ){return;

}var ret = document.pwl.pwlViewSet (document.main.ModelName.value,

view_name);if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("ViewSet has failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt (fail_error_code));}

}

function MdlViewsGet()//Get the names of the user-defined views in the model.{

var ret = document.pwl.pwlMdlViewsGet (document.main.ModelName.value);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("MdlViewsGet has failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt (fail_error_code));}for (i = 0; i < ret.NumViews; i++){

document.get_views.list_named_views.value += "View#" + (i+1) + "= "+ ret.ViewNames[i] + "\n";

}}

function ViewDefaultSet()//Display the default view of the model.{

var ret = document.pwl.pwlViewDefaultSet (document.main.ModelName.value);

if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;

Page 90: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

7 - 6 Pro/Web.Link User’s Guide

alert ("ViewsDefaultSet has failed.\nError string: " + fail_reason+ "\n" + "Error Code: " + parseInt (fail_error_code));

}}</script></head><body>

<title>Web.Link Views Example</title><script src="wl_header_form.js">document.writeln ("Error loading Web.Link header form<p>");</script>

<form name="get_views"><h4>Get Named Model Views</h4><p><!-- Buttons --><input type="button" value="Get Named Views" onclick="MdlViewsGet()"><p><!-- Output Arguments --><textarea name="list_named_views" value="" rows=4 cols=50></textarea></center><hr></form>

<form name="set_view"><h4>Set a Named View</h4><p><!-- Input Arguments --><input type="text" name="input_view"><!-- Buttons --><input type="button" value="Set Selected View" onclick="ViewSet()"><p><hr></form>

<form name="set_default_view"><h4>Set the Default View for the Model</h4><p><!-- Buttons --><input type="button" value="Set Default Model View"

onclick="ViewDefaultSet()"><p><hr></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

Page 91: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Windows and Views 7 - 7

Win

do

ws an

d V

iews

The following figure shows the results of this example, as seen in the browser. Note that the figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Figure 7-1

Page 92: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

7 - 8 Pro/Web.Link User’s Guide

Page 93: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

8 - 1

8Selection

This chapter describes the Pro/Web.Link functions that enable you to highlight and select objects.

Topic Page

Selection Functions

Highlighting

Selection Example

Page 94: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

8 - 2 Pro/Web.Link User’s Guide

Selection FunctionsFunctions introduced:

• pwlSelect

• pwlSelectionCreate

• pwlSelectionParse

The function pwlSelect enables the user to perform interactive selection on a Pro/ENGINEER object. The syntax is as follows:

pwlSelect (String SelectableFilter, // The selection filter.int MaxSelectable // The maximum number

// of items that can be// selected. If this is// a negative number,// there is an unlimited// number of selections.// Use parseInt with// this argument.

);Additional return fields:

int NumSelections; // The number of// selections made.

String Selections[]; // The selections.

The valid selection filter is one or more of the following in a comma-separated list (with no spaces):

• “feature”

• “dimension”

• “part”

• “prt_or_asm”

Any other filter option causes a PWL_GENERAL_ERROR.

Page 95: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Selection 8 - 3

Selectio

n

The function pwlSelectionCreate creates a selection string. The function syntax is as follows:

pwlSelectionCreate (String TopModel, // The top-level model.int NumComponents, // The number of

// components in the// component path. Use// parseInt with this// argument.

String ComponentPath[], // The model names for// each level of the// component path.

int ComponentIDs[], // The model identifiers// for each level of the// component path. Use// parseInt with this// argument.

int ItemType, // The type of selection// item. Use parseInt// with this argument.

int ItemID // The identifier of// the selection item.// Use parseInt with this// argument.

);Additional return field:

String Selection; // The selection string.

The “component path” is the path down from the root assembly to the model that owns the database item being referenced.

The possible values for ItemType are as follows:

• PWL_DIMENSION

• PWL_FEATURE

• PWL_TYPE_UNUSED

Note that you must always pass the TopModel. If the selection does not involve an assembly, NumComponents should be 0, and ComponentPath and ComponentIDs can be null. The ComponentIDs argument can also be null if the ComponentPath is enough to describe the selection. If ItemType and ItemID are PWL_TYPE_UNUSED, the selection will be the model itself.

Page 96: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

8 - 4 Pro/Web.Link User’s Guide

The function pwlSelectionParse separates the specified selection string. The syntax is as follows:

pwlSelectionParse (String SelString // The selection string

// to parse);Addition return fields:

String TopModel; // The top-level modelint NumComponents; // The number of

// components in the// component path

String ComponentPath[]; // The model names for// each level of the// component path

int ComponentIDs[]; // The model identifiers// for each level of the// component path

int ItemType; // The type of selection// item

int ItemID; // The identifier of the// selection item

HighlightingFunctions introduced:

• pwlItemHighlight

• pwlItemUnhighlight

The function pwlItemHighlight highlights the specified item, whereas pwlItemUnhighlight removes the highlighting. Each function requires the full path to the item, and returns no additional fields. The syntax of the two functions is as follows:

pwlItemHighlight (String SelString // The selection string that

// identifies the item);

pwlItemUnhighlight (String SelString // The selection string that

// identifies the item);

Page 97: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Selection 8 - 5

Selectio

n

Selection ExampleThe following example shows how to use the Pro/Web.Link selection functions.

<HTML><HEAD><title>Web.Link Selection Example</title><script src="wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script><script language="JavaScript">

// This variable is used to store the current selection.var current_selection = "";

function WlSelect()//Display a list of selected objects.{

var filter_string = "";for (var i = 0; i < document.select.Filter.length; i++){

if (document.select.Filter.options[i].selected){

if (filter_string != ""){

filter_string += ",";}

filter_string += document.select.Filter.options[i].value;}

}var ret = document.pwl.pwlSelect (

filter_string, parseInt (document.select.Number.value));if (!ret.Status){alert ("pwlSelect failed (" + ret.ErrorCode + ")");return;

}else{

WlSelectionGetInfo (ret);}

}

function WlSelectionGetInfo (sel_struct)//Get information about a particular selection structure.{

for (j = 0; j < sel_struct.NumSelections; j++){

if (confirm ("Press Confirm to see info about next selection.")){

Page 98: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

8 - 6 Pro/Web.Link User’s Guide

current_selection = sel_struct.Selections[j];ret = document.pwl.pwlSelectionParse (sel_struct.Selections[j]);if (!ret.Status){

alert ("pwlSelectionParse failed (" + ret.ErrorCode + ")");return;

}document.get_info.TopModel.value = ret.TopModel;document.get_info.Components.value = "";for (var i = 0; i < ret.NumComponents; i++){

document.get_info.Components.value += ret.ComponentPath[i] +" (#" + ret.ComponentIDs[i] + ")\n";

}document.get_info.ItemType.value = ret.ItemType;document.get_info.ItemID.value = ret.ItemID;

}}

}

function WlSelectionHighlight()//Highlight a particular selection.{

ret = document.pwl.pwlItemHighlight (current_selection);if (!ret.Status){

alert ("pwlItemHighlight failed (" + ret.ErrorCode + ")");return;

}}

function WlSelectionUnhighlight()//Remove the highlighting from a selection.{

var ret = document.pwl.pwlItemUnhighlight (current_selection);if (!ret.Status){

alert ("pwlItemUnhighlight failed (" + ret.ErrorCode + ")");return;

}}

function WlSelectionCreate()//Create a selection string.{

Components = document.create_selec.Components.value.split(")\n");NumComponents = 0;ComponentPath = document.pwl.pwluStringArrayAlloc (Components.length);ComponentID = document.pwl.pwluIntArrayAlloc (Components.length);ItemID = parseInt (document.create_selec.ItemID.value);

Page 99: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Selection 8 - 7

Selectio

n

ItemType = parseInt (document.pwl.eval (document.create_selec.ItemType.options[document.create_selec.ItemType.selectedIndex].value));

if (ItemType == parseInt(document.pwl.PWL_TYPE_UNUSED)){ItemID = parseInt (document.pwl.PWL_TYPE_UNUSED);

}for (i = 0; i < Components.length; i++){

if (Components[i] != ""){

pieces = Components[i].split ("(#");ComponentPath[NumComponents] = pieces[0];ComponentID[NumComponents] = parseInt (pieces[1]);NumComponents++;

}}ret = document.pwl.pwlSelectionCreate (

document.create_selec.TopModel.value, NumComponents,ComponentPath, ComponentID, ItemType, ItemID);

if (!ret.Status){alert ("pwlSelectionCreate failed (" + ret.ErrorCode + ")");return;

}current_selection = ret.Selection;

}

function WlFeatureParametersDisplay()//Display dimensions, geometric tolerances, and so on for a particular//feature.{

var ret = document.pwl.pwlFeatureParametersDisplay (current_selection, parseInt (document.pwl.eval(document.feat_disp.ItemType.options[document.feat_disp.ItemType.selectedIndex].value)));

if (!ret.Status){alert ("pwlFeatureParametersDisplay failed (" + ret.ErrorCode

+ ")");return ;

}}

function NotApplicable (form)//Print N\A in the Item ID field when a component is selected.{

if (form.ItemType.options[form.ItemType.selectedIndex].value =="PWL_TYPE_UNUSED")

{form.ItemID.value = "N\\A";

Page 100: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

8 - 8 Pro/Web.Link User’s Guide

}else if (form.ItemID.value == "N\\A"){

form.ItemID.value = "";}

}</script></HEAD>

<BODY><form name="select"><h4>Select</h4><p><center><!-- Input arguments --><table><tr>

<td><center>Selectable Item:</center></td><td><center>Number of Selections:</center></td>

</tr><tr>

<td><select name="Filter" multiple><option value="dimension">Dimension</option><option value="feature">Feature</option><option value="part">Part</option><option value="prt_or_asm">Part or Subassembly</option></select></td><td><input type="text" name="Number"></td>

</tr></table>

<!-- Buttons --><input type="button" value="Select Items" onclick="WlSelect()"><p></center></form>

<form name="get_info"><hr><h4>Get Information on the Current Selection</h4><p><center><!-- Buttons --><input type="button" value="Highlight Current Selection"

onclick="WlSelectionHighlight()"><input type="button" value="Unhighlight Current Selection"

onclick="WlSelectionUnhighlight()"><p>

Page 101: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Selection 8 - 9

Selectio

n

<!-- Output arguments --><table><tr>

<td>Top Model:</td><td>Item Type:</td><td>Item ID:</td>

</tr><tr>

<td><input type="text" name="TopModel"></td><td><input type="text" name="ItemType"></td><td><input type="text" name="ItemID"></td>

</tr></table>Components:<br><textarea name="Components" rows=4 cols=50></textarea></center><hr></form>

<form name="create_selec"><h4>Create a Selection to Become the Current Selection</h4><p><center><!-- Input arguments --><table><tr>

<td>Top Model:</td><td>Item Type:</td><td>Item ID:</td>

</tr><tr>

<td><input type="text" name="TopModel"></td><td><select name="ItemType"

onchange="NotApplicable(document.create_selec)"><option value="PWL_TYPE_UNUSED" selected>Component</option><option value="PWL_DIMENSION">Dimension</option><option value="PWL_FEATURE">Feature</option></select></td><td><input type="text" name="ItemID" value="N\A"></td>

</tr></table>Components:<br><textarea name="Components" rows=4 cols=50></textarea><p><!-- Buttons --><input type="button" value="Create String"

onclick="WlSelectionCreate()"><p></center><hr></form>

Page 102: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

8 - 10 Pro/Web.Link User’s Guide

<form name="feat_disp"><h4>Display Feature Dimensions, Geometric Tolerances, and so on for theCurrent Selection</h4><p>NOTE:This must be a feature.

<center><!-- Input arguments --><spacer size=20><select name="ItemType">

<option value="PWL_ALL_PARAMS">All Parameters</option><option value="PWL_DIM_PARAM">Dimension</option><option value="PWL_DIMTOL_PARAM">Dimension Tolerance</option><option value="PWL_GTOL_PARAM">Geometric Tolerance</option><option value="PWL_USER_PARAM">Parameter</option><option value="PWL_PATTERN_PARAM">Pattern Parameter</option><option value="PWL_REFDIM_PARAM">Reference Dimension</option><option value="PWL_SURFFIN_PARAM">Surface Finish</option>

</select><p><!-- Buttons --><input type="button" value="Display"

onclick="WlFeatureParametersDisplay()"><p></center><hr></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></HTML>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Page 103: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Selection 8 - 11

Selectio

n

Figure 8-1

Page 104: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

8 - 12 Pro/Web.Link User’s Guide

Figure 8-2

Page 105: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

9 - 1

9Part Materials

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate part materials.

Topic Page

Setting Materials

Page 106: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

9 - 2 Pro/Web.Link User’s Guide

Setting MaterialsFunctions introduced:

• pwlPartMaterialCurrentGet

• pwlPartMaterialCurrentSet

• pwlPartMaterialSet

• pwlPartMaterialsGet

• pwlPartMaterialdataGet

• pwlPartMaterialdataSet

The material properties functions are used to manipulate material properties and material property data for a Pro/ENGINEER part.

The function pwlPartMaterialCurrentGet gets the name of the current material used by the specified model. (The function pwlPartMaterialGet is identical to pwlPartMaterialCurrentGet, and is maintained for backwards compatibility.) The syntax of the function is as follows:

pwlPartMaterialCurrentGet (String MdlNameExt // The full name of the model

);Additional return field:

String MaterialName; // The name of the current// material

To set the material for a part from a file, call the function pwlPartMaterialSet. The material must be defined, or the function will fail. The syntax is as follows:

pwlPartMaterialSet (String MdlNameExt, // The full name of the modelString MaterialName // The name of the material

// file);

To set the material for a part, call the function pwlPartMaterialCurrentSet. Note that the material must already be associated with the part, or the function will fail. The syntax is as follows:

pwlPartMaterialCurrentSet (String MdlNameExt, // The full name of the modelString MaterialName // The name of the material

);

Page 107: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Part Materials 9 - 3

Part M

aterials

The function pwlPartMaterialsGet provides the number and the list of all the materials used in the specified part. The syntax is as follows:

pwlPartMaterialsGet (String MdlNameExt // The full name of the

// model);Additional return fields:

int NumMaterials; // The number of materials// used in the part

String Materials[]; // The list of materials

The pwlPartMaterialdataGet function gets the material data for the specified part and material. The syntax is as follows:

pwlPartMaterialdataGet (String MdlNameExt, // The full name of the

// modelString MaterialName // The name of the

// material);Additional return fields:

double YoungModulus; // The young modulusdouble PoissonRatio; // The Poisson ratiodouble ShearModulus; // The shear modulusdouble MassDensity; // The mass densitydouble ThermExpCoef; // The thermal expansion

// coefficientdouble ThermExpRefTemp; // The thermal expansion

// reference temperaturedouble StructDampCoef; // The structural

// damping coefficientdouble StressLimTension; // The stress limit

// for tensiondouble StressLimCompress; // The stress limit for

// compressiondouble StressLimShear; // The stress limit for

// sheardouble ThermConductivity; // The thermal

// conductivitydouble Emissivity; // The emissivitydouble SpecificHeat; // The specific heatdouble Hardness; // The hardnessString Condition; // The conditiondouble InitBendYFactor; // The initial bend

// Y factorString BendTable; // The bend table

Page 108: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

9 - 4 Pro/Web.Link User’s Guide

To set the values of the material data elements, call the function pwlPartMaterialdataSet. The syntax is as follows:

pwlPartMaterialdataSet (String MdlNameExt, // The full name of the

// modelString MaterialName, // The name of the

// materialdouble YoungModulus, // The young modulusdouble PoissonRatio, // The Poisson ratiodouble ShearModulus, // The shear modulusdouble MassDensity, // The mass densitydouble ThermExpCoef, // The thermal expansion

// coefficientdouble ThermExpRefTemp, // The thermal expansion

// reference temperaturedouble StructDampCoef, // The structural

// damping coefficientdouble StressLimTension, // The stress limit

// for tensiondouble StressLimCompress, // The stress limit for

// compressiondouble StressLimShear, // The stress limit for

// sheardouble ThermConductivity, // The thermal

// conductivitydouble Emissivity, // The emissivitydouble SpecificHeat, // The specific heatdouble Hardness, // The hardnessString Condition, // The conditiondouble InitBendYFactor, // The initial bend

// Y factorString BendTable // The bend table

);

See the Introduction to Pro/ENGINEER for more information about material data.

Page 109: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

10 - 1

10Assemblies

This chapter describes the Pro/Web.Link functions that enable you to access assemblies and their components.

Topic Page

Assembly Components

Exploded Assemblies

Assembly Example

Page 110: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

10 - 2 Pro/Web.Link User’s Guide

Assembly ComponentsFunctions introduced:

• pwlAssemblyComponentsGet

• pwlAssemblyComponentReplace

The function pwlAssemblyComponentsGet provides a list of all the components in the specified assembly. This is a subset of the dependency list. (To get the entire list of dependencies, use the function pwlMdlDependenciesGet.) The syntax is as follows:

pwlAssemblyComponentsGet (String AsmNameExt // The full name of the

// assembly);Additional return fields:

int NumMdls; // The number of componentsString MdlNameExt[]; // The full names of the

// assembly componentsint ComponentID[]; // The array of component

// identifiers

The function pwlAssemblyComponentReplace enables you to replace one component for another. The syntax is as follows:

pwlAssemblyComponentReplace (String AsmNameExt, // The full name of

// the assembly.String NewComponentNameExt, // The full name of the

// new component.int NumComponentIDs, // The number of

// components to be// replaced. Use// parseInt with this// argument.

int ComponentIDs[]) // The identifiers of// the components to// be replaced. Use// parseInt with this// argument.

The ComponentIDs argument is an array of component identifiers. If the parent has multiple occurrences of the component, this argument specifies which components to replace. The component identifiers are the feature identifiers. If this argument is an empty or null array, the function replaces all occurrences of the component.

Page 111: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Assemblies 10 - 3

Assem

blies

The pwlAssemblyComponentReplace function uses the following techniques, in order of precedence:

1. Automatic assembly from Layout mode

2. Family table membership

3. Interchange assembly

Note that if you want to use an interchange assembly, you must first load it into memory. Use the function pwlMdlOpen and set the argument DisplayInWindow to false.

The following code fragment shows how to call pwlAssemblyComponentReplace. In this example, base2.prt replaces base1.prt in assembly.asm (the parent of base1.prt). All the parts and assemblies were declared in a layout to allow automatic replacement.

<script>...function AssemblyComponentReplace()// Replace the assembly components.{

var CompID = document.pwl.pwluIntArrayAlloc(1);CompID[0] = 9;

ret = document.pwl.pwlAssemblyComponentReplace ("assembly.asm","base2.prt", 1, CompID);

if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("AssemblyComponentReplace has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));}

}...</script>

Page 112: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

10 - 4 Pro/Web.Link User’s Guide

Exploded AssembliesFunctions introduced:

• pwlAssemblyExplodeStatusGet

• pwlAssemblyExplodeStatusSet

• pwlAssemblyExplodeDefaultSet

• pwlAssemblyExplodeStatesGet

• pwlAssemblyExplodeStateSet

These functions deal with the explode status and explode states of assemblies. The “explode status” specifies whether the given assembly is exploded, whereas the “explode state” describes what the assembly looks like when it is exploded.

The function pwlAssemblyExplodeStatusGet provides the explode status of the specified assembly. The ExplodeStatus is a Boolean value. If it is true, the assembly is exploded.

The syntax is as follows:

pwlAssemblyExplodeStatusGet (String AsmNameExt // The full name of the

// assembly.);Additional return field:

boolean ExplodeStatus; // If this is true, the// assembly is exploded.

Similarly, the pwlAssemblyExplodeStatusSet function enables you to set the explode status for the specified assembly. The syntax is as follows:

pwlAssemblyExplodeStatusSet (String AsmNameExt, // The full name of the

// assemblyboolean ExplodeStatus // The new explode status

);

The function pwlAssemblyExplodeDefaultSet sets the assembly’s explode state to use the default component locations. The syntax is as follows:

pwlAssemblyExplodeDefaultSet (String AsmNameExt // The full name of the assembly

);

Page 113: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Assemblies 10 - 5

Assem

blies

The function pwlAssemblyExplodeStatesGet provides the number and list of explode states for the specified assembly. The syntax is as follows:

pwlAssemblyExplodeStatesGet (String AsmNameExt // The full name of the

// assembly);Additional return fields:

int NumExpldstates; // The number of explode// states

String ExpldstateNames[]; // The names of the// explode states

To set the explode state for a given assembly, call the function pwlAssemblyExplodeStateSet. The syntax is as follows:

pwlAssemblyExplodeStateSet (String AsmNameExt, // The full name of the

// assemblyString ExpldstateName // The name of a predefined

// explode state);

Assembly ExampleThe following example shows how to use the Pro/Web.Link assembly functions.

<html><head><title>Web.Link Assembly Functions</title>

<script src="wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script><script language="JavaScript">

function AssemblyComponentsGet()//Get the assembly components.{

ret = document.pwl.pwlAssemblyComponentsGet (ocument.main.ModelName.value);

if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;

Page 114: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

10 - 6 Pro/Web.Link User’s Guide

alert ("AssemblyComponentsGet has failed.\nError string: " +fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}for (i = 0; i < ret.NumMdls; i++){

document.get_comp.list_assembly_components.value += "components#"+ (i+1) + "= " + ret.MdlNameExt[i] +"\n";

}}

function AssemblyExplodeStatusSet()//Set the explode state of the assembly.{

ret = document.pwl.pwlAssemblyExplodeStatusSet (document.main.ModelName.value, true);

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("ExplodeStatusSet has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}

function AssemblyExplodeStatusGet()//Determine whether the state of the assembly is exploded.{

ret = document.pwl.pwlAssemblyExplodeStatusGet (document.main.ModelName.value);

var expl_status = ret.ExplodeStatus;if (expl_status == true){

document.explode_state.display_status.value ="The assembly is exploded";

}if (expl_status == false){

document.explode_state.display_status.value ="The assembly is not exploded";

}if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("ExplodeStatusSet has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}

Page 115: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Assemblies 10 - 7

Assem

blies

function AssemblyExplodeStateSet(expl_state)//Set a specific explode state in an assembly.{

ret = document.pwl.pwlAssemblyExplodeStateSet (document.main.ModelName.value, expl_state);

if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("ExplodeStatusSet has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}

function AssemblyExplodeDefaultSet()//Set the explode to use the default component location.{

ret = document.pwl.pwlAssemblyExplodeDefaultSet (document.main.ModelName.value);

if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("ExplodeDefaultStatusSet has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}

function AssemblyExplodeStatesGet()//Get the assembly explode states.{

ret = document.pwl.pwlAssemblyExplodeStatesGet (document.main.ModelName.value);

for (i = 0; i < ret.NumExpldstates; i++){document.explode_state.list_explode_states.value +=

"Explode states:" + ret.ExpldstateNames[i] +"\n";}if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;

alert ("ExplodeStatusSet has failed.\nError string: " +fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}

Page 116: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

10 - 8 Pro/Web.Link User’s Guide

function AssemblyComponentReplace()//Replace the assembly components.{

var CompID = document.pwl.pwluIntArrayAlloc(1);CompID[0] = 9;

ret = document.pwl.pwlAssemblyComponentReplace ("assembly.asm","base2.prt", 1, CompID);

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("AssemblyComponentReplace has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}</script></head><body>

<script src="wl_header_form.js">document.writeln("Error loading Web-Link header form<p>");</script>

<title>Web.Link Assembly Example</title><form name="get_comp"><h4>Get Component</h4><p><center><!-- Buttons --><input type="button" value="Get Component"

onclick="AssemblyComponentsGet()"><p><!-- Output Arguments --><textarea name="list_assembly_components" value="" rows=4

cols=50></textarea></center><hr></form>

<form name="explode_state"><h4>Manipulate Assembly Explode State</h4><p><center><!-- Buttons --><input type="button" value="Explode Assembly"

onclick="AssemblyExplodeStatusSet()"><p><input type="button" value="Get Explode Status"

onclick="AssemblyExplodeStatusGet()"><p>

Page 117: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Assemblies 10 - 9

Assem

blies

<!-- Output Arguments --><input type="text" name="display_status" value=""><p></center><hr>

<h4>Get and Set Explode State</h4><p><center>Input Explode State:<!-- Input Arguments --><input type="text" name="expl_name" size="8"

onchange="AssemblyExplodeStateSet(this.value)"><p><!-- Buttons --><input type="button" value="Get Explode States"

onclick="AssemblyExplodeStatesGet()"><p><!-- Output Arguments --><textarea name="list_explode_states" value="" rows=4

cols=50></textarea><p><!-- Buttons --><input type="button" value="Set Default Explode State"

onclick="AssemblyExplodeDefaultSet()"><p><hr></center></form>

<form name="component_replace"><h4>Replace Assembly Components</h4><p><center><!-- Buttons --><input type="button" value="Automatically Replace Component"

onclick="AssemblyComponentReplace()"><p></center></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Page 118: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

10 - 10 Pro/Web.Link User’s Guide

Figure 10-1

Figure 10-2

Page 119: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 1

11Features

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate features in Pro/ENGINEER.

Topic Page

Feature Inquiry

Feature Names

Manipulating Features

Displaying Parameters

Feature Example

Page 120: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 2 Pro/Web.Link User’s Guide

Feature InquiryFunctions introduced:

• pwlMdlFeaturesGet

• pwlFeatureInfoGetByID

• pwlFeatureInfoGetByName

• pwlFeatureParentsGet

• pwlFeatureChildrenGet

• pwlFeatureStatusGet

The pwlMdlFeaturesGet function returns all the features that are known to the end user, including suppressed features. The syntax is as follows:

pwlMdlFeaturesGet (String MdlNameExt, // The full name of the model.int FeatureType // The type of feature to

// list. Use parseInt with// this argument.

);Additional return fields:

int NumFeatures; // The number of features.int FeatureIDs[]; // The list of feature

// identifiers.

Use –1 for the FeatureType argument to get a list of all the features. See Pro/Web.Link Constants for a complete list of the possible feature types.

The function pwlFeatureInfoGetByID gets the information about the specified feature, given its identifier. The syntax is as follows:

pwlFeatureInfoGetByID (String MdlNameExt, // The full name of the model.int FeatureID // The feature identifier.

// Use parseInt with this// argument.

);Additional return fields:

int FeatureType; // The feature type.int FeatureID; // The feature identifier.String FeatureName; // The name of the feature.String FeatTypeName; // The string name of the

// feature type, such as// "Hole."

Page 121: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 3

Featu

res

The pwlFeatureInfoGetByName is identical to pwlFeatureInfoGetByID, except you specify the name of the feature instead of its identifier. The syntax is as follows:

pwlFeatureInfoGetByName (String MdlNameExt, // The full name of the modelString FeatureName // The name of the feature

);Additional return fields:

int FeatureType; // The feature typeint FeatureID; // The feature identifierString FeatureName; // The name of the featureString FeatTypeName; // The string name of the

// feature type, such as// "Hole"

To get the parents of a feature, call the function pwlFeatureParentsGet. The syntax is as follows:

pwlFeatureParentsGet (String MdlNameExt, // The full name of the model.int FeatureID // The identifier of the

// child feature. Use// parseInt with this// argument.

);Additional return fields:

int NumParents; // The number of parents.int ParentIDs[]; // The list of feature

// identifiers for the// parents.

Similarly, the function pwlFeatureChildrenGet provides the children of the specified feature. The syntax is as follows:

pwlFeatureChildrenGet (String MdlNameExt, // The full name of the model.int FeatureID // The identifier of the

// parent feature. Use// parseInt with this// argument.

);Additional return fields:

int NumChildren; // The number of children.int ChildIDs[]; // The list of feature

// identifiers for the// children.

Page 122: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 4 Pro/Web.Link User’s Guide

The function pwlFeatureStatusGet gets the status of the specified feature. The syntax is as follows:

pwlFeatureStatusGet (String MdlNameExt, // The full name of the model.int FeatureID // The feature identifier.

// Use parseInt with this// argument.

);Additional return fields:

int FeatureStatus; // The feature status.int PatternStatus; // The pattern status.int GroupStatus; // The group status.int GroupPatternStatus; // The group pattern

// status.

The extra return fields are as follows:

• FeatureStatus—The feature status. The defined constants are as follows:

– PWL_FEAT_ACTIVE—An ordinary feature.

– PWL_FEAT_INACTIVE—A feature that is not suppressed, but is not currently in use for another reason. For example, a family table instance that excludes this feature.

– PWL_FEAT_FAMTAB_SUPPRESSED—A feature suppressed by family table functionality.

– PWL_FEAT_SIMP_REP_SUPPRESSED—A feature suppressed by simplified representation functionality.

– PWL_FEAT_PROG_SUPPRESSED—A feature suppressed by Pro/PROGRAM™ functionality.

– PWL_FEAT_SUPPRESSED—A suppressed feature.

– PWL_FEAT_UNREGENERATED—A feature that is active, but not regenerated due to a regeneration failure that has not been fixed. This regeneration failure might result from an earlier feature.

• PatternStatus—The pattern status. The defined constants are as follows:

– PWL_NONE—The feature is not in a pattern.

– PWL_LEADER—The feature is the leader of a pattern.

– PWL_MEMBER—The feature is a member of the pattern.

Page 123: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 5

Featu

res

• GroupStatus—The group status. The defined constants are as follows:

– PWL_NONE—The feature is not in a group pattern.

– PWL_MEMBER—The feature is in a group that is a group pattern member.

• GroupPatternStatus—The group pattern status. The defined constants are as follows:

– PWL_NONE—The feature is not in a group pattern.

– PWL_LEADER—The feature is the leader of the group pattern.

– PWL_MEMBER—The feature is a member of the group pattern.

Feature NamesFunctions introduced:

• pwlFeatureNameGetByID

• pwlFeatureNameSetByID

The function pwlFeatureNameGetByID provides the name of the specified feature, given its identifier. The syntax is as follows:

pwlFeatureNameGetByID (String MdlNameExt, // The full name of the model.int FeatureID // The feature identifier. Use

// parseInt with this// argument.

);Additional return field:

String FeatureName; // The name of the feature.

To change the name of a feature, use the function pwlFeatureNameSetByID. The syntax is as follows:

pwlFeatureNameSetByID (String MdlNameExt, // The full name of the model.int FeatureID, // The feature identifier.

// Use parseInt with this// argument.

String FeatureName // The new name of the// feature.

);

Page 124: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 6 Pro/Web.Link User’s Guide

Manipulating FeaturesThe following sections describe the Pro/Web.Link functions that enable you to suppress, resume, and delete features.

Suppressing Features

Functions introduced:

• pwlFeatureSuppressByID

• pwlFeatureSuppressByIDList

• pwlFeatureSuppressByLayer

• pwlFeatureSuppressByName

These functions enable you to suppress features by specifying their identifiers, identifier lists, layers, or names. The syntax for the functions is as follows:

pwlFeatureSuppressByID (String MdlNameExt, // The full name of the model.int FeatureID // The identifier of the

// feature to suppress. Use// parseInt with this// argument.

);

pwlFeatureSuppressByIDList (String MdlNameExt, // The full name of the model.int NumFeatures, // The number of feature

// identifiers in the list.// Use parseInt with this// argument.

int FeatureIDs[] // The list of identifiers// of features to suppress.// Use parseInt with this// argument.

);

pwlFeatureSuppressByLayer (String MdlNameExt, // The full name of the modelString LayerName // The name of the layer

// to suppress);

Page 125: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 7

Featu

res

pwlFeatureSuppressByName (String MdlNameExt, // The full name of the

// modelString FeatureName // The name of the feature

// to suppress);

Resuming Features

Functions introduced:

• pwlFeatureResumeByID

• pwlFeatureResumeByIDList

• pwlFeatureResumeByLayer

• pwlFeatureResumeByName

These functions enable you to resume features by specifying their identifiers, identifier lists, layers, or names. These functions take the additional argument ResumeParents, of type Boolean. If you set this argument to true, the functions also resume the parents of the specified feature, if they are suppressed.

The syntax of the functions is as follows:

pwlFeatureResumeByID (String MdlNameExt, // The full name of the

// model.int FeatureID, // The identifier of the

// feature to resume. Use// parseInt with this// argument.

boolean ResumeParents // Specifies whether to// resume the parents of// the feature.

);

Page 126: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 8 Pro/Web.Link User’s Guide

pwlFeatureResumeByIDList (String MdlNameExt, // The full name of the

// model.int NumFeatures, // The number of identifiers

// in the list. Use parseInt// with this argument.

int FeatureIDs[], // The list of identifiers// of features to resume.// Use parseInt with this// argument.

boolean ResumeParents // Specifies whether to// resume the parents of// the features.

);

pwlFeatureResumeByLayer (String MdlNameExt, // The full name of the

// modelString LayerName, // The name of the layer

// to resumeboolean ResumeParents // Specifies whether to

// resume the parents of// the features

);

pwlFeatureResumeByName (String MdlNameExt, // The full name of the

// modelString FeatureName, // The name of the feature

// to resumeboolean ResumeParents // Specifies whether to

// resume the parents of// the feature

);

Deleting Features

Functions introduced:

• pwlFeatureDeleteByID

• pwlFeatureDeleteByIDList

• pwlFeatureDeleteByLayer

• pwlFeatureDeleteByName

These functions enable you to delete features by specifying their identifiers, identifier lists, layers, or names.

Note: If the feature has children, the children are also deleted.

Page 127: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 9

Featu

res

The syntax of the functions is as follows:

pwlFeatureDeleteByID (String MdlNameExt, // The full name of the model.int FeatureID // The identifier of the

// feature to delete. Use// parseInt with this// argument.

);

pwlFeatureDeleteByIDList (String MdlNameExt, // The full name of the model.int NumFeatures, // The number of identifiers

// in the list. Use parseInt// with this argument.

int FeatureIDs[] // The list of identifiers// of features to delete. Use// parseInt with this// argument.

);

pwlFeatureDeleteByLayer (String MdlNameExt, // The full name of the modelString LayerName // The name of the layer to

// delete);

pwlFeatureDeleteByName (String MdlNameExt, // The full name of the modelString FeatureName // The name of the feature

// to delete);

Displaying ParametersFunction introduced:

• pwlFeatureParametersDisplay

The function pwlFeatureParametersDisplay shows the specified parameter types for a feature in the graphics window. The syntax is as follows:

pwlFeatureParametersDisplay (String SelString, // The selection string that

// identifies the feature.int ItemType // The type of parameter to

// display. Use parseInt with// this argument.

);

Page 128: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 10 Pro/Web.Link User’s Guide

The possible values for ItemType are as follows:

• PWL_USER_PARAM

• PWL_DIM_PARAM

• PWL_PATTERN_PARAM

• PWL_REFDIM_PARAM

• PWL_ALL_PARAMS

• PWL_GTOL_PARAM

• PWL_SURFFIN_PARAM

Feature ExampleThe following example shows how to use the Pro/Web.Link feature functions.

<html><head><title>Web.Link Features Example</title>

<script src="wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script>

<SCRIPT language="JavaScript">function MdlFeaturesGet()//Get the features that exist in the model.{

ret = document.pwl.pwlMdlFeaturesGet (document.main.ModelName.value,-1);

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureInfoGetByID has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}for (i = 0; i < ret.NumFeatures; i++){

document.model_features.feature_list.value +="Feature" + (i+1) + ": " + ret.FeatureIDs[i] +"\n";

}}

Page 129: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 11

Featu

res

function FeatureInfoGetByID()//Get the feature information, given the identifier.{

var feat_id = document.feature_info.get_feat_id.value;

if (feat_id == ""){return;

}ret = document.pwl.pwlFeatureInfoGetByID (

document.main.ModelName.value, parseInt (feat_id));if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureInfoGetByID has failed.\nError string: " + fail_reason

+ "\n" + "Error Code: " + parseInt (fail_error_code));}document.feature_info.info_by_id_display.value = ("Feature Type: "

+ ret.FeatureType + "\n" + "Feature ID: " +parseInt (ret.FeatureID) + "\n" + "Feature Name: " +ret.FeatureName + "\n" + "Feature Type Name: " +ret.FeatTypeName);

}

function FeatureInfoGetByName()//Get the feature information, given the name.{

var feat_name = document.feature_info.get_feat_name.value;

if (feat_name == ""){

return;}ret = document.pwl.pwlFeatureInfoGetByName (

document.main.ModelName.value, feat_name);if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureInfoGetByName has failed.\nError string: "

+ fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}document.feature_info.info_by_name_display.value = ("Feature Type: "

+ ret.FeatureType + "\n" + "Feature ID: " +parseInt (ret.FeatureID) + "\n" + "Feature Name: " +ret.FeatureName + "\n" + "Feature Type Name: " +ret.FeatTypeName);

}

Page 130: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 12 Pro/Web.Link User’s Guide

function FeatureNameGetByID()//Get the feature name, given its identifier.{

var feat_id = document.feature_name.get_feat_id.value;

if (feat_id == ""){

return;}ret = document.pwl.pwlFeatureNameGetByID (

document.main.ModelName.value, parseInt (feat_id));if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureNameGetByID has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}document.feature_name.feature_name_display.value = ret.FeatureName;

}

function FeatureNameSetByID()//Set a feature name by specifying its identifier.{

var feat_name = document.feature_name.get_new_name.value;var feat_id = document.feature_name.feat_id_set.value;

if (feat_name == "" || feat_id == ""){

return;}ret = document.pwl.pwlFeatureNameSetByID (

document.main.ModelName.value, parseInt (feat_id), feat_name);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureNameSetByID has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

function FeatureSuppressByID()//Suppress a feature by specifying the internal identifier of the//feature.{

var feat_id = document.feature_suppress.get_feat_id.value;

Page 131: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 13

Featu

res

if (feat_id == ""){

return;}ret = document.pwl.pwlFeatureSuppressByID (

document.main.ModelName.value, parseInt (feat_id));if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureSuppressByID has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

function FeatureSuppressByName()//Suppress a feature using the feature name assigned by the user.{

var feat_name = document.feature_suppress.get_feat_name.value;

if (feat_name == ""){

return;}ret = document.pwl.pwlFeatureSuppressByName (

document.main.ModelName.value, feat_name);if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureSuppressByName has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

function FeatureSuppressByIDList (id1, id2, id3, id4)//Suppress multiple features by supplying a list of feature identifiers.{

var list_ids = document.pwl.pwluIntArrayAlloc(4);list_ids[0] = parseInt(id1);list_ids[1] = parseInt(id2);list_ids[2] = parseInt(id3);list_ids[3] = parseInt(id4);

var ret = document.pwl.pwlFeatureSuppressByIDList (document.main.ModelName.value, 4, list_ids);

if (!ret.Status){var fail_reason = ret.ErrorString;

Page 132: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 14 Pro/Web.Link User’s Guide

var fail_error_code = ret.ErrorCode;alert ("FeatureSuppressByIDList has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

function FeatureResumeByID()//Resume a suppressed feature using the internal identifier of the//feature.{

var feat_id = document.feature_resume.get_feat_id.value;

if (feat_id == ""){

return;}

ret = document.pwl.pwlFeatureResumeByID (document.main.ModelName.value, parseInt (feat_id), true);

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureResumeByID has failed.\nError string: " + fail_reason

+ "\n" + "Error Code: " + parseInt (fail_error_code));}

}

function FeatureResumeByName()//Resume a suppressed feature using the feature name assigned by the//user.{

var feat_name = document.feature_resume.get_feat_name.value;

if (feat_name == ""){

return;}ret = document.pwl.pwlFeatureResumeByName (

document.main.ModelName.value, feat_name, true);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureResumeByName has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

Page 133: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 15

Featu

res

function FeatureResumeByIDList (id1, id2, id3, id4)//Resume multiple features by supplying a list of feature identifiers.{

var list_ids = document.pwl.pwluIntArrayAlloc(4);list_ids[0] = parseInt(id1);list_ids[1] = parseInt(id2);list_ids[2] = parseInt(id3);list_ids[3] = parseInt(id4);

var ret = document.pwl.pwlFeatureResumeByIDList (document.main.ModelName.value, 4, list_ids, true);

if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureResumeByIDList has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

function FeatureDeleteByID()//Delete a feature by specifying the internal identifier of the feature.{

var feat_id = document.feature_delete.get_feat_id.value;

if (feat_id == ""){

return;}ret = document.pwl.pwlFeatureDeleteByID (document.main.ModelName.value,

parseInt (feat_id));if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureDeleteByID has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

function FeatureDeleteByName()//Delete a feature using the name assigned to it by the user.{

var feat_name = document.feature_delete.get_feat_name.value;

if (feat_name == ""){

return;}

Page 134: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 16 Pro/Web.Link User’s Guide

ret = document.pwl.pwlFeatureDeleteByName (document.main.ModelName.value, feat_name);

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureDeleteByName has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

function FeatureDeleteByIDList (id1, id2, id3, id4)//Delete multiple features by specifying a list of feature identifiers.{

var list_ids = document.pwl.pwluIntArrayAlloc(4);list_ids[0] = parseInt(id1);list_ids[1] = parseInt(id2);list_ids[2] = parseInt(id3);list_ids[3] = parseInt(id4);

var ret = document.pwl.pwlFeatureDeleteByIDList (document.main.ModelName.value, 4, list_ids);

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureDeleteByIDList has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}}

function FeatureStatusGet()//Get the feature status information, given the feature identifier.{

var feat_id = document.feature_status.get_feat_id.value;if (feat_id == ""){

return;}ret = document.pwl.pwlFeatureStatusGet (document.main.ModelName.value,

parseInt (feat_id));if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureStatusGet has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}

Page 135: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 17

Featu

res

var feat_state;var pattern_state;var group_state;

if (ret.FeatureStatus == parseInt (document.pwl.PWL_FEAT_ACTIVE)){

feat_state = "ACTIVE";}else if (ret.FeatureStatus == parseInt (

document.pwl.PWL_FEAT_INACTIVE)){feat_state = "INACTIVE";

}else if (ret.FeatureStatus == parseInt (

document.pwl.PWL_FEAT_FAMTAB_SUPPRESSED)){feat_state = "FAMTAB_SUPPRESSED";

}else if (ret.FeatureStatus == parseInt (

document.pwl.PWL_FEAT_SIMP_REP_SUPPRESSED)){feat_state = "SIMP_REP_SUPPRESSED";

}else if (ret.FeatureStatus == parseInt (

document.pwl.PWL_FEAT_PROG_SUPPRESSED)){feat_state = "PROG_SUPPRESSED";

}else if (ret.FeatureStatus == parseInt (

document.pwl.PWL_FEAT_SUPPRESSED)){feat_state = "SUPPRESSED";

}else if (ret.FeatureStatus == parseInt (

document.pwl.PWL_FEAT_UNREGENERATED)){feat_state = "UNREGENERATED";

}else if (ret.FeatureStatus == parseInt (

document.pwl.PWL_FEAT_INVALID)){feat_state = "INVALID";

}

if (ret.PatternStatus == parseInt (document.pwl.PWL_PATTERN_INVALID)){

pattern_state = "INVALID PATTERN";}

Page 136: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 18 Pro/Web.Link User’s Guide

else if (ret.PatternStatus == parseInt (document.pwl.PWL_PATTERN_NONE)){

pattern_state = "NOT PART OF A PATTERN";}else if (ret.PatternStatus == parseInt (

document.pwl.PWL_PATTERN_LEADER)){

pattern_state = "PATTERN LEADER";}else if (ret.PatternStatus == parseInt (

document.pwl.PWL_PATTERN_MEMBER)){

feat_state = "PATTERN MEMBER";}

if (ret.GroupStatus == parseInt (document.pwl.PWL_GROUP_INVALID)){

group_state = "INVALID";}else if (ret.GroupStatus == parseInt (document.pwl.PWL_GROUP_NONE)){

group_state = "NO GROUP";}else if (ret.GroupStatus == parseInt (document.pwl.PWL_GROUP_MEMBER)){

group_state = "GROUP MEMBER";}

document.feature_status.list_feature_status.value = ("Feature Status: "+ feat_state + "\n" + "Pattern Status: " + pattern_state + "\n" +"Group Status: " + group_state);

}

function FeatureParentsGet()//Get information about the feature's parent.{

var feat_id = document.parent_info.feat_id.value;

if (feat_id == ""){

return;}ret = document.pwl.pwlFeatureParentsGet (document.main.ModelName.value,

parseInt (feat_id));if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureDeleteByIDList has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

Page 137: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 19

Featu

res

}if (ret.NumParents == 0){

document.child_info.list_children.value = "NO PARENT FOR FEATURE";}for (i = 0; i < ret.NumParents; i++){

document.parent_info.list_parents.value += "Parent ID: " +ret.ParentIDs[i] + "\n";

}}

function FeatureChildrenGet()//Get information about the feature's child.{

var feat_id = document.child_info.feat_id.value;

if (feat_id == ""){

return;}ret = document.pwl.pwlFeatureChildrenGet (

document.main.ModelName.value, parseInt (feat_id));if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureDeleteByIDList has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}if (ret.NumChildren == 0){document.child_info.list_children.value = "NO CHILDREN FOR FEATURE";

}for (i = 0; i < ret.NumChildren; i++){

document.child_info.list_children.value += "Child ID: " +ret.ChildIDs[i] + "\n";

}}</script></head>

<body><script src="wl_header_form.js">document.writeln ("Error loading Web.Link header form<p>");</script>

Page 138: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 20 Pro/Web.Link User’s Guide

<title>Feature Functionality</title><p><form name="model_features"><h4> Get Model Features</h4><p><center><!-- Buttons --><input type="button" value="Get Features" onclick="MdlFeaturesGet()"><p><!-- Output Arguments --><textarea name="feature_list" value="" rows=4 cols=32> </textarea><p><p></center></form><hr>

<form name="feature_info"><h4>Get Feature Information</h4><p><center><table><tr><td><center>Feature ID:</center></td><td><center><input type="text" name="get_feat_id"></center></td><td><center>Feature Name:</center></td><td><center><input type="text" name="get_feat_name"></center></td></tr></table>

<table><tr><td><center><input type="button" value="Get Feature Info by ID"

onclick="FeatureInfoGetByID()"><br><textarea name="info_by_id_display" value="" rows=4 cols=32></textarea></center></td>

<td><center><input type="button" value="Get Feature Info By Name"onclick="FeatureInfoGetByName()"><br>

<textarea name="info_by_name_display" value="" rows=4 cols=32></textarea></center></td></tr></table></center><p><hr></form>

<form name="feature_name"><h4>Get and Set the Feature Name</h4><p>

Page 139: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 21

Featu

res

<center>Feature ID:<!-- Input Arguments --><input type="text" name="get_feat_id" size="8"

onchange="FeatureNameGetByID(this.value)"><p>Feature Name (output):<!-- Output Arguments --><input type="text" name="feature_name_display" value=""><p><hr><br>

<table><tr><td><center>Current Feature ID:</center></td><td><center><input type="text" name="feat_id_set"></center></td><td><center>New Feature Name:</center></td><td><center><input type="text" name="get_new_name"></center></td></tr></table>

<input type="button" value="Set New Feature Name"onclick="FeatureNameSetByID()">

<p></center><hr></form>

<form name="feature_suppress"><h4>Suppress Feature</h4><p><center><table><tr><td><center>Feature ID:</center></td><td><center><input type="text" name="get_feat_id" size="8"

onchange="FeatureSuppressByID(this.value)"></center></td><td><center>Feature Name:</center></td><td><center><input type="text" name="get_feat_name" size="8"

onchange="FeatureSuppressByName(this.value)"></center></td></tr></table>Feature ID List:<input type="button" name="feat_id_list" value="Suppress by List"

onclick="FeatureSuppressByIDList(document.feature_suppress.id1.value,document.feature_suppress.id2.value,document.feature_suppress.id3.value,document.feature_suppress.id4.value)">

<input type="text" name="id1"><input type="text" name="id2">

Page 140: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 22 Pro/Web.Link User’s Guide

<input type="text" name="id3"><input type="text" name="id4"><p></center><hr></form><form name="feature_resume"><h4>Resume Feature</h4><p><center><table><tr><td><center>Feature ID:</center></td><td><center><input type="text" name="get_feat_id" size="10"

onchange="FeatureResumeByID(this.value)"></center></td><td><center>Feature Name:</center></td><td><center><input type="text" name="get_feat_name" size="8"

onchange="FeatureResumeByName(this.value)"></center></td></tr></table>

Feature ID List:<input type="button" name="feat_id_list" value="Resume by List"

onclick="FeatureResumeByIDList(document.feature_resume.id1.value,document.feature_resume.id2.value,document.feature_resume.id3.value,document.feature_resume.id4.value)">

<input type="text" name="id1"><input type="text" name="id2"><input type="text" name="id3"><input type="text" name="id4"><p></center><p><hr></form>

<form name="feature_delete"><h4>Delete Feature</h4><p><center><table><tr><td><center>Feature ID:</center></td><td><center><input type="text" name="get_feat_id" size="8"onchange="FeatureDeleteByID(this.value)"></center></td><td><center>Feature Name:</center></td><td><center><input type="text" name="get_feat_name" size="8"onchange="FeatureDeleteByName(this.value)"></center></td></tr></table>

Page 141: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 23

Featu

res

Feature ID List:<input type="button" name="feat_list" value="Delete by List"

onclick="FeatureDeleteByIDList(document.feature_delete.id1.value,document.feature_delete.id2.value,document.feature_delete.id3.value,document.feature_delete.id4.value)">

<input type="text" name="id1"><input type="text" name="id2"><input type="text" name="id3"><input type="text" name="id4"><p></center><p><hr></form>

<form name="feature_status"><h4>Get Feature Status Information</h4><p><center>Input Feature ID:<!-- Input Arguments --><input type="text" name="get_feat_id"><p><!-- Buttons --><input type="button" value="Feature Status"

onclick="FeatureStatusGet()"><p>

<!-- Output Arguments --><textarea name="list_feature_status" value="" rows=4 cols=50> </textarea></center><hr></form>

<form name="parent_info"><h4>Get Parent Information</h4><p><center>Input Feature ID:<!-- Input Arguments --><input type="text" name="feat_id"><p><!-- Buttons --><input type="button" value="Parent Info"

onclick="FeatureParentsGet()"><p><!-- Output Arguments --><textarea name="list_parents" value="" rows=4 cols=32></textarea><p></center><hr>

Page 142: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 24 Pro/Web.Link User’s Guide

</form>

<form name="child_info"><h4>Get Child Information</h4><p><center>Input Feature ID:<!-- Input Arguments --><input type="text" name="feat_id"><p><!-- Buttons --><input type="button" value="Children Info"

onclick="FeatureChildrenGet()"><p><!-- Output Arguments --><textarea name="list_children" value="" rows=4 cols=32></textarea><p></center><hr></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Page 143: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 25

Featu

res

Figure 11-1

Page 144: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 26 Pro/Web.Link User’s Guide

Figure 11-2

Figure 11-3

Page 145: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Features 11 - 27

Featu

res

Figure 11-4

Figure 11-5

Page 146: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

11 - 28 Pro/Web.Link User’s Guide

Page 147: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 1

12Parameters

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate user parameters.

Topic Page

Listing Parameters

Identifying Parameters

Reading and Modifying Parameters

Designating Parameters

Parameter Example

Page 148: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 2 Pro/Web.Link User’s Guide

Listing ParametersFunctions introduced:

• pwlMdlParametersGet

• pwlFeatureParametersGet

The function pwlMdlParametersGet retrieves all model parameters, given the name of the model. This does not include parameters on a feature. The syntax is as follows:

pwlMdlParametersGet (String MdlNameExt // The full name of the model

);Additional return fields:

int NumParams; // The number of parameters// in the array ParamNames

String ParamNames[]; // The list of parameter// names

The function pwlFeatureParametersGet retrieves the parameters for the specified feature. The syntax is as follows:

pwlFeatureParametersGet (String MdlNameExt, // The full name of the

// model (part or assembly).int FeatureID // The identifier for which

// parameters should be// found. Use parseInt with// this argument.

);Additional return fields:

int NumParams; // The number of parameters// in the array ParamNames.

String ParamNames[]; // The list of parameter// names.

Note that this function applies only to parts and assemblies.

Identifying ParametersUniquely identifying a parameter requires more than simply the model and parameter names because the parameter name could be used by the model and several features. Therefore, two additional arguments are required for all parameter functions—the item type and item identifier. The item type is either PWL_FEATURE or PWL_MODEL.

Page 149: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parameters 12 - 3

Param

eters

The item identifier does not apply to model parameters, but contains the feature identifier for feature parameters. Remember that the item identifier must be an integer value even if it is not used.

Reading and Modifying ParametersFunctions introduced:

• pwlParameterValueGet

• pwlParameterValueSet

• pwlParameterCreate

• pwlParameterDelete

• pwlParameterRename

• pwlParameterReset

To retrieve the value of a parameter, use the function pwlParameterValueGet. The syntax is as follows:

pwlParameterValueGet (String MdlNameExt, // The full name of the

// model.int ItemType, // Specifies whether it

// is a model (PWL_MODEL)// or a feature parameter// (PWL_FEATURE). Use// parseInt with this// argument.

int ItemID, // The feature identifier.// This is unused for// model parameters. Use// parseInt with this// argument.

String ParamName // The name of the// parameter.

);Additional return fields:

int ParamType; // Specifies the data// type of the// parameter.

int ParamIntVal; // The integer value.double ParamDoubleVal; // The double value.string ParamStringVal; // The string value.boolean ParamBooleanVal; // The Boolean value.

Page 150: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 4 Pro/Web.Link User’s Guide

The function returns five additional fields, but only two will be set. The field ParamType is always set, and its value determines what other field should be used, according to the following table.

The following code fragment shows how to use this function.

<script language = "JavaScript">

function WlParameterGetValue(){

var mdl_ret = document.pwl.pwlMdlInfoGet (document.get_value.ModelNameExt.value);

if (!mdl_ret.Status){

alert ("pwlMdlInfoGet failed (" + mdl_ret.ErrorCode + ")");return;

}var ret = document.pwl.pwlParameterValueGet (

document.get_value.ModelNameExt.value, parseInt (mdl_ret.MdlType),0 /* unused */, document.get_value.ParamName.value);

if (!ret.Status){

alert ("pwlParameterValueGet failed (" + ret.ErrorCode + ")");return;

}if (ret.ParamType == parseInt (document.pwl.PWL_VALUE_DOUBLE)){

document.get_value.Value.value = ret.ParamDoubleVal;}else if (ret.ParamType == parseInt (document.pwl.PWL_VALUE_STRING)){

document.get_value.Value.value = ret.ParamStringVal;}else if (ret.ParamType == parseInt (document.pwl.PWL_VALUE_INTEGER)){

document.get_value.Value.value = ret.ParamIntVal;}

Value of the ParamType Additional Fields

PWL_VALUE_INTEGER ParamIntVal

PWL_VALUE_DOUBLE ParamDoubleVal

PWL_VALUE_STRING ParamStringVal

PWL_VALUE_BOOLEAN ParamBooleanVal

Page 151: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parameters 12 - 5

Param

eters

else if (ret.ParamType == parseInt (document.pwl.PWL_VALUE_BOOLEAN)){

document.get_value.Value.value = ret.ParamBooleanVal;}

}</script>

<form name = "get_value"><h4>Get a Value for a Parameter (Model Parameters Only)</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt">Parameter: <input type = "text" name = "ParamName"><p><!-- Buttons --><input type = "button" value = "Get Value"

onclick = "WlParameterGetValue()"><p><!-- Output arguments -->Value: <input type = "text" name = "Value"></center><hr></form>

Setting a parameter using the function pwlParameterValueSet requires several arguments to allow for all the possibilities. The syntax is as follows:

pwlParameterValueSet (String MdlNameExt, // The full name of the model.int ItemType, // Specifies whether it is a

// model (PWL_MODEL) or a// feature parameter// (PWL_FEATURE). Use parseInt// with this argument.

int ItemID, // The feature identifier.// This is unused for model// parameters. Use parseInt// with this argument.

String ParamName, // The name of the parameter.int ValueType, // Specifies the data type of

// the value. Use parseInt// with this argument.

int IntVal, // The integer value. Use// parseInt with this argument.

double DoubleVal, // The double value. Use// parseFloat with this// argument.

Page 152: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 6 Pro/Web.Link User’s Guide

String StringVal, // The string value.Boolean BooleanVal // The Boolean value.

);

The value of ValueType determines which of the other four values will be used. Although only one of IntVal, DoubleVal, StringVal, and BooleanVal will be used, all must be the proper data types or an error will occur.

Creating and setting parameters are very similar. The function pwlParameterCreate takes the same arguments and has the same return fields as pwlParameterValueSet. However, creation fails if the parameter already exists, whereas setting the value succeeds only on existing parameters.

The following code fragment shows how to create a string parameter.

<script language = "JavaScript">

function WlParameterCreate(){

var mdl_ret = document.pwl.pwlMdlInfoGet (document.create.ModelNameExt.value);

if (!mdl_ret.Status){

alert ("pwlMdlInfoGet failed (" + mdl_ret.ErrorCode + ")");return;

}var ret = document.pwl.pwlParameterCreate (

document.create.ModelNameExt.value, parseInt (mdl_ret.MdlType),0 /* unused */, document.create.ParamName.value,parseInt (document.pwl.PWL_VALUE_STRING), 0 /* unused */,0.0 /* unused */, document.create.Value.value, false /* unused */);

if (!ret.Status){

alert ("pwlParameterCreate failed (" + ret.ErrorCode + ")");return;

}}</script>

<form name = "create"><h4>Create Parameter (Model Parameter with String Value Only)</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt">Parameter: <input type = "text" name = "ParamName">Value: <input type = "text" name = "Value"><p>

Page 153: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parameters 12 - 7

Param

eters

<!-- Buttons --><input type = "button" value = "Create Parameter"onclick = "WlParameterCreate()"><p></center><hr></form>

The function pwlParameterDelete deletes the specified parameter. The syntax is as follows:

pwlParameterDelete (String MdlNameExt, // The full name of the

// model.int ItemType, // Specifies whether it is

// a model (PWL_MODEL) or// a feature parameter// (PWL_FEATURE). Use// parseInt with this// argument.

int ItemID, // The feature identifier.// This is unused for model// parameters. Use parseInt// with this argument.

String ParamName // The name of the parameter.);

To rename a parameter, call the pwlParameterRename function. The syntax is as follows:

pwlParameterRename (String MdlNameExt, // The full name of the

// model.int ItemType, // Specifies whether it is

// a model (PWL_MODEL) or// a feature parameter// (PWL_FEATURE). Use// parseInt with this// argument.

int ItemID, // The feature identifier.// This is unused for model// parameters. Use parseInt// with this argument.

String ParamName, // The old name of the// parameter.

String NewName // The new name of the// parameter.

);

Page 154: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 8 Pro/Web.Link User’s Guide

The function pwlParameterReset restores the parameter's value to the one it had at the end of the last regeneration. The syntax is as follows:

pwlParameterReset (String MdlNameExt, // The full name of the

// model.int ItemType, // Specifies whether it is

// a model (PWL_MODEL) or// a feature parameter// (PWL_FEATURE). Use// parseInt with this// argument.

int ItemID, // The feature identifier.// This is unused for model// parameters. Use parseInt// with this argument.

String ParamName // The name of the parameter.);

Designating ParametersFunctions introduced:

• pwlParameterDesignationAdd

• pwlParameterDesignationRemove

• pwlParameterDesignationVerify

These functions control the designation of model parameters for Pro/PDM™ and Pro/INTRALINK. A designated parameter will become visible within Pro/PDM or Pro/INTRALINK as an attribute when the model is next submitted.

The function pwlParameterDesignationAdd designates an existing parameter. The syntax is as follows:

pwlParameterDesignationAdd (String MdlNameExt, // The full name of the modelString ParamName // The name of the parameter

);

The pwlParameterDesignationRemove function removes the designation. The syntax is as follows:

pwlParameterDesignationRemove (String MdlNameExt, // The full name of the modelString ParamName // The name of the parameter

);

Page 155: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parameters 12 - 9

Param

eters

To verify whether a parameter is currently designated, call pwlParameterDesignationVerify. The syntax is as follows:

pwlParameterDesignationVerify (String MdlNameExt, // The full name of the model.String ParamName // The name of the parameter.

);Additional return field:

boolean Exists; // If this is true, the// parameter is currently// designated.

Parameter ExampleThe following example shows how to use the Pro/Web.Link parameter functions.

<html><head><title>Web.Link Parameters Functionality</title>

<script src="wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script>

<script language="JavaScript">

function WlParametersGet()//Get the parameter list from the model or feature.{

var ret;var FunctionName;var ItemType;

if (document.list_parm.ModelNameExt.value == ""){return;

}if (document.list_parm.ParmType.options[

document.list_parm.ParmType.selectedIndex].value == "PWL_MODEL"){ItemType = document.pwl.PWL_MODEL;FeatID = 0;ret = document.pwl.pwlMdlParametersGet (

document.list_parm.ModelNameExt.value);FunctionName = "pwlMdlParametersGet";

}

Page 156: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 10 Pro/Web.Link User’s Guide

else{

ItemType = document.pwl.PWL_FEATURE;FeatID = document.list_parm.FeatureID.value;if (document.list_parm.FeatureID.value == ""){return;

}ret = document.pwl.pwlFeatureParametersGet (

document.list_parm.ModelNameExt.value, parseInt (FeatID));FunctionName = "pwlFeatureParametersGet";

}if (!ret.Status){

alert (FunctionName + " failed (" + ret.ErrorCode + ")");return;

}document.list_parm.Parameters.value = "";for (var i = 0; i < ret.NumParams; i++){var val_ret = document.pwl.pwlParameterValueGet (

document.list_parm.ModelNameExt.value, parseInt (ItemType),parseInt (FeatID), ret.ParamNames[i]);

if (!val_ret.Status){alert ("pwlParameterValueGet failed (" + val_ret.ErrorCode + ")");return;

}var answer = "Undefined";if (val_ret.ParamType == parseInt (document.pwl.PWL_VALUE_DOUBLE)){answer = val_ret.ParamDoubleVal;

}else if (val_ret.ParamType == parseInt (

document.pwl.PWL_VALUE_STRING)){answer = val_ret.ParamStringVal;

}else if (val_ret.ParamType == parseInt (

document.pwl.PWL_VALUE_INTEGER)){answer = val_ret.ParamIntVal;

}else if (val_ret.ParamType == parseInt (

document.pwl.PWL_VALUE_BOOLEAN)){answer = (val_ret.ParamBooleanVal) ? "true" : "false";

}

Page 157: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parameters 12 - 11

Param

eters

document.list_parm.Parameters.value += ret.ParamNames[i] + ": " +answer +"\n";

}}

function WlParameterSetValue (FunctionName)//Set a parameter or create a new parameter depending on the function//name.{

var ItemType;var StringValue = document.set_value.Value.value;var FloatValue = parseFloat (document.set_value.Value.value);var IntValue = parseInt (document.set_value.Value.value);var BoolValue = (document.set_value.Value.value.toLowerCase() ==

"true") ? true : false;var ValueType = document.pwl.eval (

document.set_value.ValueType.options[document.set_value.ValueType.selectedIndex].value);

// To create a usable trail file, FloatValue cannot be NaN.if (isNaN (FloatValue)){FloatValue = 1.1;

}if (document.set_value.ParmType.options[

document.set_value.ParmType.selectedIndex].value == "PWL_MODEL"){ItemType = document.pwl.PWL_MODEL;

}else{

ItemType = document.pwl.PWL_FEATURE;}var ret = document.pwl.eval (FunctionName)(

document.set_value.ModelNameExt.value, parseInt (ItemType),parseInt (document.set_value.FeatureID.value),document.set_value.Parameter.value, parseInt (ValueType),IntValue, FloatValue, StringValue, BoolValue);

if (!ret.Status){alert (FunctionName + " failed (" + ret.ErrorCode + ")");return;

}}

function WlParameterMisc (FunctionName)//Run miscellaneous parameter functions that take only the model name,//item type, item identifier, and parameter name as arguments.{

var ItemType;

Page 158: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 12 Pro/Web.Link User’s Guide

if (document.misc_parm.ParmType.options[document.misc_parm.ParmType.selectedIndex].value == "PWL_MODEL")

{ItemType = document.pwl.PWL_MODEL;

}else{

ItemType = document.pwl.PWL_FEATURE;}var ret = document.pwl.eval (FunctionName) (

document.misc_parm.ModelNameExt.value, parseInt (ItemType),parseInt (document.misc_parm.FeatureID.value),document.misc_parm.Parameter.value);

if (!ret.Status){

alert (FunctionName + " failed (" + ret.ErrorCode + ")");return;

}}

function WlParameterRename()//Rename a parameter.{

var ItemType;

if (document.misc_parm.ParmType.options[document.misc_parm.ParmType.selectedIndex].value == "PWL_MODEL")

{ItemType = document.pwl.PWL_MODEL;

}else{

ItemType = document.pwl.PWL_FEATURE;}var ret = document.pwl.pwlParameterRename (

document.misc_parm.ModelNameExt.value, parseInt (ItemType),parseInt (document.misc_parm.FeatureID.value),document.misc_parm.Parameter.value,document.misc_parm.NewName.value);

if (!ret.Status){

alert ("pwlParameterRename failed (" + ret.ErrorCode + ")");return;

}}

Page 159: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parameters 12 - 13

Param

eters

function WlParameterDesignate (FunctionName)//Run the designate parameter functions that take only the model name//and parameter name as arguments.{

var ret = document.pwl.eval (FunctionName) (document.desg_parm.ModelNameExt.value,document.desg_parm.Parameter.value);

if (!ret.Status){alert (FunctionName + " failed (" + ret.ErrorCode + ")");return;

}}

function WlParameterVerifyDesignation()//Verify that a parameter has been designated.{

var ret = document.pwl.pwlParameterDesignationVerify (document.desg_parm.ModelNameExt.value,document.desg_parm.Parameter.value);

if (!ret.Status){alert ("pwlParameterDesignationVerify failed (" + ret.ErrorCode +

")");return;

}document.misc_parm.Exist.value = ret.Exists;

}

function NotApplicable (form)//Print N\A in the feature ID field when a model is selected.{

if (form.ParmType.options[form.ParmType.selectedIndex].value =="PWL_MODEL")

{form.FeatureID.value = "N\\A";

}else if (form.FeatureID.value == "N\\A"){

form.FeatureID.value = "";}

}</script></head><body>

<script src="wl_header_form.js">document.writeln ("Error loading Web.Link header form<p>");</script>

Page 160: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 14 Pro/Web.Link User’s Guide

<form name="list_parm"><h4>List Parameters</h4><p><center><!-- Input arguments --><table><tr>

<td><center>Model:</center></td><td><center>Display:</center></td><td><center>Feature ID:</center></td>

</tr><tr>

<td><input type="text" name="ModelNameExt"></td><td><select name="ParmType"

onchange="NotApplicable(document.list_parm)"><option value="PWL_MODEL" selected>By Model</option><option value="PWL_FEATURE">By Feature ID</option></select></td>

<td><input type="text" name="FeatureID" value="N\A"></td></tr></table>

<!-- Buttons --><input type="button" value="Get Parameters"

onclick="WlParametersGet()"><p><!-- Output arguments -->Parameters:<br><textarea name="Parameters" rows=4 cols=50></textarea></center><hr></form>

<form name="set_value"><h4>Create or Set a Parameter</h4><p><center><!-- Input arguments --><table><tr>

<td>Model:</td><td><input type="text" name="ModelNameExt"></td><td>Parameter Type:</td><td><select name="ParmType"

onchange="NotApplicable(document.set_value)"><option value="PWL_MODEL" selected>By Model</option><option value="PWL_FEATURE">By Feature ID</option></select></td>

</tr>

Page 161: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parameters 12 - 15

Param

eters

<tr><td>Feature ID:</td><td><input type="text" name="FeatureID" value="N\A"></td><td>Parameter:</td><td><input type="text" name="Parameter"></td>

</tr><tr>

<td>Value Type:</td><td><select name="ValueType">

<option value="PWL_VALUE_BOOLEAN">Boolean</option><option value="PWL_VALUE_DOUBLE">Double</option><option value="PWL_VALUE_INTEGER">Integer</option><option value="PWL_VALUE_STRING">String</option>

</select></td><td>Value:</td><td><input type="text" name="Value"></td>

</tr></table>

<!-- Buttons --><input type="button" value="Create"

onclick="WlParameterSetValue('pwlParameterCreate')"><input type="button" value="Set Value"onclick="WlParameterSetValue('pwlParameterValueSet')">

<p></center><hr></form>

<form name="misc_parm"><h4>Miscellaneous Parameters</h4><p><center><!-- Input arguments --><table><tr>

<td><center>Model:</center></td><td><center>Display:</center></td><td><center>Feature ID:</center></td>

</tr><tr>

<td><input type="text" name="ModelNameExt"></td><td><select name="ParmType"

onchange="NotApplicable(document.misc_parm)"><option value="PWL_MODEL" selected>By Model</option><option value="PWL_FEATURE">By Feature ID</option></select></td>

<td><input type="text" name="FeatureID" value="N\A"></td></tr></table>

Page 162: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 16 Pro/Web.Link User’s Guide

Parameter: <input type="text" name="Parameter"><p><!-- Buttons --><input type="button" value="Delete"

onclick="WlParameterMisc('pwlParameterDelete')"><input type="button" value="Reset"onclick="WlParameterMisc('pwlParameterReset')">

<p><!-- Extra input arguments and a button for rename -->New Name: <input type="text" name="NewName"><spacer size=20><input type="button" value="Rename" onclick="WlParameterRename()"><p></center><hr></form>

<form name="desg_parm"><h4>Designate Model Parameters</h4><p><center><!-- Input arguments -->Model: <input type="text" name="ModelNameExt"><spacer size=20>Parameter: <input type="text" name="Parameter"><p><!-- Buttons --><input type="button" value="Add Designation"

onclick="WlParameterDesignate('pwlParameterDesignationAdd')"><input type="button" value="Remove Designation"onclick="WlParameterDesignate('pwlParameterDesignationRemove')"><p>

<!-- Extra output arguments and a button for verifying designations --><input type="button" value="Verify Designation"

onclick="WlParameterVerifyDesignation()"><spacer size=20>Exists: <input type="text" name="Exist"><p></center><hr></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Page 163: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Parameters 12 - 17

Param

eters

Figure 12-1

Page 164: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

12 - 18 Pro/Web.Link User’s Guide

Figure 12-2

Page 165: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

13 - 1

13Dimensions

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate dimensions in Pro/ENGINEER.

Note that these functions are supported for parts, assemblies, and drawings, but are not supported for sections.

Topic Page

Reading and Modifying Dimensions

Dimension Tolerance

Dimension Example

Page 166: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

13 - 2 Pro/Web.Link User’s Guide

Reading and Modifying DimensionsFunctions introduced:

• pwlMdlDimensionsGet

• pwlFeatureDimensionsGet

• pwlDimensionInfoGetByID

• pwlDimensionInfoGetByName

• pwlDimensionValueSetByID

To retrieve the dimensions or reference dimensions on a model, use the function pwlMdlDimensionsGet. The syntax is as follows:

pwlMdlDimensionsGet (String MdlNameExt, // The full name of the model

// to which the dimensions// belong.

int DimType // The dimension type. Use// parseInt with this argument.

);Additional return fields:int NumDims; // The number of dimensions.int DimIDs[]; // The dimension identifiers.

The valid values for DimType are PWL_DIMENSION and PWL_REF_DIMENSION, which determine whether the function should retrieve standard (geometry) or reference dimensions, respectively.

The function pwlFeatureDimensionsGet gets the dimensions for the specified feature. Note that this function does not return any reference dimensions. (Features do not own reference dimensions—the model does.) The syntax is as follows:

pwlFeatureDimensionsGet (String MdlNameExt, // The full name of the model

// to which the dimensions// belong.

int FeatID // The feature to which the// dimensions belong. Use// parseInt with this argument.

);Additional return fields:

int NumDims; // The number of dimensions.int DimIDs[]; // The dimension identifiers.

Page 167: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Dimensions 13 - 3

Dim

ensio

ns

Pro/Web.Link provides two powerful functions to retrieve information about dimensions— pwlDimensionInfoGetByID and pwlDimensionInfoGetByName. The syntax for the functions is as follows:

pwlDimensionInfoGetByID (String MdlNameExt, // The full name of the

// model to which the// dimension belongs.

int DimensionID, // The integer identifier// of the dimension. Use// parseInt with this// argument.

int DimensionType // The dimension type// (PWL_DIMENSION or// PWL_REF_DIMENSION). Use// parseInt with this// argument.

);

pwlDimensionInfoGetByName (String MdlNameExt, // The full name of the

// model to which the// dimension belongs.

String DimensionName, // The name of the// dimension.

int DimensionType // The dimension type// (PWL_DIMENSION or// PWL_REF_DIMENSION). Use// parseInt with this// argument.

);

Both functions return the following additional fields:

double DimValue; // The value of the dimensionint DimID; // The dimension identifierString DimName; // The name of the dimensionint DimStyle; // The dimension style

int TolType, // The tolerance typedouble TolPlus; // The tolerance amount above

// the nominal valuedouble TolMinus // The tolerance amount below

// the nominal value

Page 168: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

13 - 4 Pro/Web.Link User’s Guide

The possible values for the DimStyle field are as follows:

• PWL_LINEAR_DIM—Linear dimension

• PWL_RADIAL_DIM—Radial dimension

• PWL_DIAMETRICAL_DIM—Diametrical dimension

• PWL_ANGULAR_DIM—Angular dimension

The possible values for TolType are as follows:

• PWL_TOL_DEFAULT—Displays the nominal tolerance.

• PWL_TOL_PLUS_MINUS—Displays the nominal tolerance with a plus/minus.

• PWL_TOL_LIMITS—Displays the upper and lower tolerance limits.

• PWL_TOL_PLUS_MINUS_SYM—Displays the tolerance as , +/-x, +/-, where x is the plus tolerance. The value of the minus tolerance is irrelevant and unused.

The function pwlDimensionValueSetByID enables you to set the value of a dimension. The syntax is as follows:

pwlDimensionValueSetByID (String MdlNameExt, // The full name of the model

// to which the dimension// belongs.

int DimensionID, // The integer identifier of// the dimension. Use parseInt// with this argument.

double Value // The new value of the// dimension. Use parseFloat// with this argument.

);

The function pwlDimensionValueSetByID does not require a dimension type because you cannot set reference dimensions.

Note: This function works for solids only (parts, assemblies, and derivative types).

Page 169: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Dimensions 13 - 5

Dim

ensio

ns

Dimension ToleranceFunction introduced:

• pwlDimensionToleranceSetByID

To set the dimension tolerance, call the function pwlDimensionToleranceSetByID. The syntax is as follows:

pwlDimensionToleranceSetByID (String MdlNameExt, // The full name of the model

// to which the dimension// belongs.

int DimensionID, // The integer identifier// of the dimension. Use// parseInt with this argument.

double TolPlus, // The positive element of// the tolerance. Use// parseFloat with this// argument.

double TolMinus // The negative element of// the tolerance. Use// parseFloat with this// argument.

);

Note: This function works for solids only (parts, assemblies, and derivative types).

Dimension ExampleThe following example shows how to use the Pro/Web.Link dimension functions.

<html><head><title>Web.Link Dimensions Functions</title>

<script src="wl_header.js">document.writeln ("Error loading Web-Link header<p>");</script>

<script language="JavaScript">

function WlDimensionGet()//Get the dimensions, reference dimensions, or feature dimensions.{

var ret;var FunctionName;

Page 170: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

13 - 6 Pro/Web.Link User’s Guide

var DimType;

if (document.list_dim.ModelNameExt.value == ""){

return;}if (document.list_dim.DimType.options[

document.list_dim.DimType.selectedIndex].value == "BY_FEATURE"){

if (document.list_dim.FeatureID.value == ""){return;

}ret = document.pwl.pwlFeatureDimensionsGet (

document.list_dim.ModelNameExt.value,parseInt (document.list_dim.FeatureID.value));

FunctionName = "pwlFeatureDimensionsGet";DimType = document.pwl.PWL_DIMENSION;

}else{

DimType = document.pwl.eval (document.list_dim.DimType.options[document.list_dim.DimType.selectedIndex].value);

ret = document.pwl.pwlMdlDimensionsGet (document.list_dim.ModelNameExt.value, parseInt (DimType));

FunctionName = "pwlMdlDimensionsGet";}if (!ret.Status){

alert (FunctionName + " failed (" + ret.ErrorCode + ")");return;

}document.list_dim.DimValues.value = "";for (var i = 0; i < ret.NumDims; i++){var info_ret = document.pwl.pwlDimensionInfoGetByID (

document.list_dim.ModelNameExt.value,ret.DimIDs[i], parseInt (DimType));

if (!info_ret.Status){alert("pwlDimensionInfoGetByID failed (" + info_ret.ErrorCode + ")");return;

}document.list_dim.DimValues.value += info_ret.DimName +

" (#" + info_ret.DimID + "): " + info_ret.DimValue +((info_ret.DimStyle == parseInt(document.pwl.PWL_ANGULAR_DIM)) ?" degrees" : "") + " (-" + info_ret.TolMinus + "/+" +info_ret.TolPlus + ")\n";

}}

Page 171: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Dimensions 13 - 7

Dim

ensio

ns

function WlDimensionGetByName()//Get a dimension, given its name.{

if (document.get_value_name.ModelNameExt.value == "" ||document.get_value_name.DimName.value == "")

{return;

}var DimType = document.pwl.eval (

document.get_value_name.DimType.options[document.get_value_name.DimType.selectedIndex].value);

var ret = document.pwl.pwlDimensionInfoGetByName (document.get_value_name.ModelNameExt.value,document.get_value_name.DimName.value,parseInt(DimType));

if (!ret.Status){alert ("pwlDimensionInfoGetByName failed (" + ret.ErrorCode + ")");return;

}document.get_value_name.DimValue.value = ret.DimName + " (#" +

ret.DimID + "): " + ret.DimValue +((ret.DimStyle == parseInt(document.pwl.PWL_ANGULAR_DIM)) ?" degrees" : "") + " (-" + ret.TolMinus + "/+" + ret.TolPlus + ")";

}

function WlDimensionSetByID()//Set the value of the specified dimension.{

if (document.set_value_id.ModelNameExt.value == "" ||document.set_value_id.DimID.value == "" ||document.set_value_id.DimValue.value == "")

{return;

}var ret = document.pwl.pwlDimensionValueSetByID (

document.set_value_id.ModelNameExt.value,parseInt (document.set_value_id.DimID.value),parseFloat (document.set_value_id.DimValue.value));

if (!ret.Status){alert ("pwlDimensionValueSetByID failed (" + ret.ErrorCode + ")");return;

}}

Page 172: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

13 - 8 Pro/Web.Link User’s Guide

function WlDimensionSetToleranceByID()//Set the tolerance of the specified dimension.{

var ret = document.pwl.pwlDimensionToleranceSetByID (document.set_tol.ModelNameExt.value,parseInt (document.set_tol.DimID.value),parseFloat (document.set_tol.TolPlus.value),parseFloat (document.set_tol.TolMinus.value));

if (!ret.Status){

alert ("pwlDimensionValueToleranceByID failed (" + ret.ErrorCode +")");

return;}

}

function NotApplicable(form)//Print N\A in the feature ID field when a model is selected.{

if (form.DimType.options[form.DimType.selectedIndex].value !="BY_FEATURE")

{form.FeatureID.value = "N\\A";

}else if (form.FeatureID.value == "N\\A"){

form.FeatureID.value = "";}

}</script></head>

<body><script src="wl_header_form.js">document.writeln ("Error loading Web.Link header form<p>");</script>

<form name="list_dim"><h4>List Dimensions</h4><p><center><!-- Input arguments --><table><tr>

<td><center>Model:</center></td><td><center>Display:</center></td><td><center>Feature ID:</center></td>

</tr><tr>

<td><input type="text" name="ModelNameExt"></td><td><select name="DimType" onchange="NotApplicable(document.list_dim)">

Page 173: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Dimensions 13 - 9

Dim

ensio

ns

<option value="PWL_DIMENSION" selected>Dimensions</option><option value="PWL_REF_DIMENSION">Reference Dimensions</option><option value="BY_FEATURE">By Feature ID</option>

</select></td><td><input type="text" name="FeatureID" value="N\A"></td>

</tr></table>

<!-- Buttons --><input type="button" value="Get Dimensions"

onclick="WlDimensionGet()"><p><!-- Output arguments -->Dimensions<br><textarea name="DimValues" rows=4 cols=50></textarea></center><hr></form>

<form name="get_value_name"><h4>Get Dimension Value by Name</h4><p><center><!-- Input arguments --><table><tr>

<td><center>Model:</center></td><td><center>Dimension Name:</center></td><td><center>Type:</center></td>

</tr><tr>

<td><input type="text" name="ModelNameExt"></td><td><input type="text" name="DimName"></td><td><select name="DimType">

<option value="PWL_DIMENSION" selected>Dimensions</option><option value="PWL_REF_DIMENSION">Reference Dimensions</option>

</select></td></tr></table>

<!-- Buttons --><input type="button" value="Get Dimension Value"

onclick="WlDimensionGetByName()"><p><!-- Output arguments -->Value: <input type="text" name="DimValue"></center><hr></form>

<form name="set_value_id">

Page 174: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

13 - 10 Pro/Web.Link User’s Guide

<h4>Set Dimension Value by ID</h4><p><center><!-- Input arguments --><table><tr>

<td><center>Model:</center></td><td><center>Dimension ID:</center></td><td><center>Value:</center></td>

</tr><tr>

<td><input type="text" name="ModelNameExt"></td><td><input type="text" name="DimID"></td><td><input type="text" name="DimValue"></td>

</tr></table>

<!-- Buttons --><input type="button" value="Set Dimension Value"

onclick="WlDimensionSetByID()"></center><hr></form>

<form name="set_tol"><h4>Set Dimension Tolerance by ID</h4><p><center><!-- Input arguments --><table><tr>

<td>Model:</td><td><input type="text" name="ModelNameExt"></td><td>Dimension ID:</td><td><input type="text" name="DimID"></td>

</tr><tr>

<td>Plus Tolerance:</td><td><input type="text" name="TolPlus"></td><td>Minus Tolerance:</td><td><input type="text" name="TolMinus"></td>

</tr></table>

<!-- Buttons --><input type="button" value="Set Dimension Tolerance"

onclick="WlDimensionSetToleranceByID()"></center><hr></form></body>

Page 175: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Dimensions 13 - 11

Dim

ensio

ns

<applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Figure 13-1

Page 176: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

13 - 12 Pro/Web.Link User’s Guide

Figure 13-2

Page 177: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

14 - 1

14Simplified Representations

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate simplified representations.

Topic Page

Retrieving Simplified Representations

Activating Simplified Representations

Simplified Representation Example

Page 178: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

14 - 2 Pro/Web.Link User’s Guide

Retrieving Simplified RepresentationsFunctions introduced:

• pwlSimprepOpen

• pwlGraphicsSimprepOpen

• pwlGeomSimprepOpen

• pwlMdlSimprepsGet

The function pwlSimprepOpen opens the specified simplified representation. The syntax is as follows:

pwlSimprepOpen (String AsmNameExt, // The full name of

// the part or assembly.String Path, // The full path to the

// model.String RepName, // The name of

// the simplified// representation.

boolean DisplayInWindow // If this is true,// display the simplified// representation in a// window.

);Additional return field:

int WindowID; // The identifier of// the window in which// the simplified// representation is// displayed.

Note that there is a difference between opening a simplified representation and activating it. Opening a simplified representation requires Pro/ENGINEER to read from disk and open the appropriate representation of the specified model. Activating a simplified representation does not require Pro/ENGINEER to read from the disk because the model containing the simplified representation is already open. This operation is analogous to the Pro/ENGINEER operation of setting a view to be current (the model is already in session; only the model display changes).

Page 179: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Simplified Representations 14 - 3

Sim

plified

R

epresen

tation

s

The function pwlGraphicsSimprepOpen retrieves the graphics of the specified assembly. The syntax is as follows:

pwlGraphicsSimprepOpen (String AsmNameExt, // The full name of the

// part or assemblyString Path, // The full path to the

// modelboolean DisplayInWindow // Specifies whether to

// display the simplified// representation in a// window

);Additional return field:

int WindowID; // The identifier of the// window in which// the simplified// representation is// displayed

The pwlGeomSimprepOpen function provides the geometry of the specified part or assembly. The syntax is as follows:

pwlGeomSimprepOpen (String AsmNameExt, // The full name of

// the part or assemblyString Path, // The full path to

// the modelboolean DisplayInWindow // Specifies whether to

// display the simplified// representation in a// window

);Additional return field:

int WindowID; // The identifier of the// window in which// the simplified// representation is// displayed

If you try to open a model that already exists in memory, the open functions ignore the Path argument. Note that the open functions will successfully open the simplified representation that is in memory—even if the specified Path is incorrect.

Page 180: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

14 - 4 Pro/Web.Link User’s Guide

Use the function pwlMdlSimprepsGet to list all the simplified representations in the specified model. The syntax is as follows:

pwlMdlSimprepsGet (String MdlNameExt // The full name of the model

);Additional return fields:

int NumSimpreps; // The number of simplified// representations

String Simpreps[]; // The list of simplified// representations

Activating Simplified RepresentationsFunctions introduced:

• pwlSimprepActivate

• pwlSimprepMasterActivate

• pwlGeomSimprepActivate

• pwlGraphicsSimprepActivate

The function pwlSimprepActivate activates the specified simplified representation. The syntax is as follows:

pwlSimprepActivate (String MdlNameExt, // The full name of the modelString SimprepName // The name of the simplified

// representation);

To activate the master simplified representation, call the function pwlSimprepMasterActivate. The syntax is as follows:

pwlSimprepMasterActivate (String MdlNameExt // The full name of the model

);

The function pwlGeomSimprepActivate activates the geometry simplified representation of the specified model. The syntax is as follows:

pwlGeomSimprepActivate (String MdlNameExt // The full name of the model

);

Page 181: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Simplified Representations 14 - 5

Sim

plified

R

epresen

tation

s

The pwlGraphicsSimprepActivate function activates the graphics simplified representation of the specified model. The syntax is as follows:

pwlGraphicsSimprepActivate (String MdlNameExt // The full name of the model

);

Simplified Representation ExampleThe following example shows how to use the simplified representation functions.

See Sample Web Pages for another example that uses the simplified representation functions.

<html><head><title>Web.Link Simplified Representation Functions</title>

<script src="wl_header.js">document.writeln("Error loading Web.Link header<p>");</script>

<script language="JavaScript">

function SimprepOpen()//Open the simplified representation.{

var simprep_name = document.open_reps.get_rep_name.value;var model_path = document.open_reps.model_path.value;var model_name = document.open_reps.model_name.value;

if (simprep_name == "" || model_path == "" || model_name == ""){return;

}ret = document.pwl.pwlSimprepOpen (model_name, model_path,

simprep_name, true);if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("Retrieve SimpRep has failed.\nError string: " + fail_reason

+ "\n" + "Error Code: " + parseInt(fail_error_code));}

}

Page 182: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

14 - 6 Pro/Web.Link User’s Guide

function GeomSimprepOpen()//Open the geometry representation.{

var model_path = document.open_reps.model_path.value;var model_name = document.open_reps.model_name.value;

if (model_path == "" || model_name == ""){

return;}ret = document.pwl.pwlGeomSimprepOpen (model_name, model_path, true);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("Open GeomRep has failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt(fail_error_code));}

}

function GraphicsSimprepOpen()//Open the graphics representation.{

var model_path = document.open_reps.model_path.value;var model_name = document.open_reps.model_name.value;

if (model_path == "" || model_name == ""){

return;}ret = document.pwl.pwlGraphicsSimprepOpen (model_name, model_path,

true);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("Open Graphics Rep has failed.\nError string: " + fail_reason

+ "\n" + "Error Code: " + parseInt(fail_error_code));}

}

function MdlSimprepsGet()//Get the simplified representation created in the model.{

var model_name = document.simprep_get.model_name.value;

if (model_name == ""){

return;}ret = document.pwl.pwlMdlSimprepsGet (model_name);

Page 183: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Simplified Representations 14 - 7

Sim

plified

R

epresen

tation

s

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("Get SimpRep has failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt (fail_error_code));}for (i = 0; i < ret.NumSimpreps; i++){

document.simprep_get.list_simpreps.value += "SimpReps: " +ret.Simpreps[i] + "\n";

}}

function SimprepActivate()//Activate a simplified representation.{

var rep_name = document.activate_reps.rep_name.value;

if (rep_name == ""){

return;}ret = document.pwl.pwlSimprepActivate (document.main.ModelName.value,

rep_name);if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("Activate SimpRep has failed.\nError string: " + fail_reason

+ "\n" + "Error Code: " + parseInt (fail_error_code));}

}

function SimprepMasterActivate()//Activate the master representation.{

ret = document.pwl.pwlSimprepMasterActivate (document.main.ModelName.value);

if (!ret.Status){var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("Activate MasterRep has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}

Page 184: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

14 - 8 Pro/Web.Link User’s Guide

function GeomSimprepActivate()//Activate the geometry representation.{

ret = document.pwl.pwlGeomSimprepActivate (document.main.ModelName.value);

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("Activate GeomSimpRep has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}

function GraphicsSimprepActivate()//Activate the graphics representation.{

ret = document.pwl.pwlGraphicsSimprepActivate (document.main.ModelName.value);

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("Activate GraphicsSimpRep has failed.\nError string: " +

fail_reason + "\n" + "Error Code: " + parseInt (fail_error_code));

}}</script></head><body>

<script src="wl_header_form.js">document.writeln("Error loading Web.Link header form<p>");</script>

<title>Web.Link Simplified Representation Example</title><form name="open_reps"><h4>Open Simplified Representation</h4><p><center><!-- Input arguments --><table><tr>

<td><center>Simplified Representation:</center></td><td><center>Model Name:</center></td><td><center>Full Path to the Model:</center></td>

</tr>

Page 185: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Simplified Representations 14 - 9

Sim

plified

R

epresen

tation

s

<tr><td><input type="text" name="get_rep_name"></td><td><input type="text" name="model_name"></td><td><input type="text" name="model_path"></td>

</tr></table><!-- Buttons --><table><tr>

<td><center><input type="button" value="Open Simp Rep"onclick="SimprepOpen()"></center>

</td><td><center><input type="button" value="Open Geom Rep"

onclick="GeomSimprepOpen()"></center></td><td><center><input type="button" value="Open Graphics Rep"

onclick="GraphicsSimprepOpen()"></center></td></tr></table><hr></center></form>

<form name="simprep_get"><h4>Get Existing Simplified Representations</h4><p><center><!-- Input Arguments -->Input Model Name: <input type="text" name="model_name"><p><!-- Buttons --><input type="button" value="Get SimpRep" onclick="MdlSimprepsGet()"><p><!-- Output Arguments --><textarea name="list_simpreps" value="" rows=4 cols=50></textarea><p><hr></center></form>

<form name="activate_reps"><h4>Activate Simplified Representation</h4><p><center>

<b>Note:</b>You must open the model using the Main Controls. Provide the path<br>and model name.

<p><!-- Input Arguments -->Simplified Representation:<input type="text" name="rep_name">

Page 186: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

14 - 10 Pro/Web.Link User’s Guide

<p><!-- Buttons --><table><tr>

<td><center><input type="button" value="Activate Rep"onclick="SimprepActivate()"></center></td>

<td><center><input type="button" value="Activate MasterRep"onclick="SimprepMasterActivate()"></center></td>

<td><center><input type="button" value="Activate GeomRep"onclick="GeomSimprepActivate()"></center></td>

<td><center><input type="button" value="Activate GraphicsRep"onclick="GraphicsSimprepActivate()"></center></td>

</tr></table><hr></center></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Page 187: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Simplified Representations 14 - 11

Sim

plified

R

epresen

tation

s

Figure 14-1

Figure 14-2

Page 188: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

14 - 12 Pro/Web.Link User’s Guide

Page 189: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

15 - 1

15Solids

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate solids and their contents.

Topic Page

Mass Properties

Cross Sections

Solid Example

Page 190: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

15 - 2 Pro/Web.Link User’s Guide

Mass PropertiesFunction introduced:

• pwlSolidMassPropertiesGet

The function pwlSolidMassPropertiesGet provides information about the distribution of mass in the specified part or assembly. It can provide the information relative to a coordinate system datum, which you name, or the default one if you provide an empty string or null as the name. The syntax is as follows:

pwlSolidMassPropertiesGet (String MdlNameExt, // The full name of

// the model.String CoordinateSys // The coordinate

// system used to get// the mass properties.

);Additional return fields:

double Volume; // The volume.double SurfaceArea; // The surface area.double Density; // The density. The

// density value is// 1.0, unless a// material has been// assigned.

double Mass; // The mass.double CenterOfGravity[3]; // The center of

// gravity (COG).double Inertia[9]; // The inertia matrix.double InertiaTensor[9]; // The inertia tensor.double CogInertiaTensor[9]; // The inertia about

// the COG.double PrincipalMoments[3]; // The principal

// moments of inertia// (the eigenvalues// of the COG inertia).

double PrincipalAxes[9]; // The principal// axes (the// eigenvectors of// the COG inertia).

Page 191: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Solids 15 - 3

So

lids

Cross SectionsFunctions introduced:

• pwlSolidXSectionDisplay

• pwlSolidXSectionsGet

To display a cross section, use the function pwlSolidXSectionDisplay. The syntax is as follows:

pwlSolidXSectionDisplay (String MdlNameExt, // The full name of

// the modelString CrossSectionName // The name of the

// cross section to// display

);

The function pwlSolidXSectionGet returns all the cross sections on the specified part or assembly. The syntax is as follows:

pwlSolidXSectionsGet (String MdlNameExt // The full name of the

// model (part or// assembly)

);Additional return fields:

int NumCrossSections; // The number of cross// sections

String CrossSectionNames[]; // The names of the// cross sections

Page 192: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

15 - 4 Pro/Web.Link User’s Guide

Solid ExampleThe following example shows how to use the mass properties and cross section functions.

<html><head><title>Web.Link Cross-Sectional Functions</title><title>Web.Link Solids</title>

<script src="wl_header.js">document.writeln("Error loading Web-Link header<p>");</script>

<script language="JavaScript">//Names of all the arrays returned by the function//pwlSolidMassPropertiesGet()ArrayNames = new Array ("Inertia", "InertiaTensor", "CogInertiaTensor",

"PrincipalMoments", "PrincipalAxes");

function WlSolidGetMassProperties()//Get the mass properties of a solid.{

var CoordSys = document.get_mass.CoordinateSys.value;if (CoordSys == ""){CoordSys = null;

}var ret = document.pwl.pwlSolidMassPropertiesGet (

document.get_mass.ModelNameExt.value, CoordSys);if (!ret.Status){

alert("pwlSolidMassPropertiesGet failed (" + ret.ErrorCode + ")");return;

}document.get_mass.Volume.value = ret.Volume;document.get_mass.SurfaceArea.value = ret.SurfaceArea;document.get_mass.Density.value = ret.Density;document.get_mass.Mass.value = ret.Mass;document.get_mass.CenterOfGravity.value = "(" + ret.CenterOfGravity[0]

+ ", " + ret.CenterOfGravity[1] +", " + ret.CenterOfGravity[2] + ")";

document.get_mass.Others.value = "";for (var i = 0; i < ArrayNames.length; i++){var matrix = ret.eval (ArrayNames[i]);

Page 193: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Solids 15 - 5

So

lids

for (var k = 0; k < matrix.length; k++){

document.get_mass.Others.value += ArrayNames[i] + "[" + k +"]: " + matrix[k] + "\n";

}}

}

function WlSolidGetXSections()//Get a list of the cross sections of a solid.{

var ret = document.pwl.pwlSolidXSectionsGet (document.get_xsec.ModelNameExt.value);

if (!ret.Status){alert ("pwlSolidXSectionsGet failed (" + ret.ErrorCode + ")");return;

}document.get_xsec.XSectionNames.value = "";for (var i = 0; i < ret.NumCrossSections; i++){

document.get_xsec.XSectionNames.value += ret.CrossSectionNames[i] +"\n";

}}

function WlSolidDisplayXSection()//Display a cross section of a solid.{

var ret = document.pwl.pwlSolidXSectionDisplay (document.disp_xsec.ModelNameExt.value,document.disp_xsec.XSectionName.value);

if (!ret.Status){alert ("pwlSolidXSectionDisplay failed (" + ret.ErrorCode + ")");return;

}}</script></head>

<body><script src="wl_header_form.js">document.writeln ("Error loading Web.Link header form<p>");</script>

<form name="get_mass"><h4>Get Mass Properties</h4><p><center>

Page 194: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

15 - 6 Pro/Web.Link User’s Guide

<!-- Input arguments -->Model: <input type="text" name="ModelNameExt"><spacer size=20>Coordinate System: <input type="text" name="CoordinateSys"><p><!-- Buttons --><input type="button" value="Get Mass Properties"

onclick="WlSolidGetMassProperties()"><p><!-- Output arguments --><table><tr>

<td>Volume:</td><td><input type="text" name="Volume"></td><td>Surface Area:</td><td><input type="text" name="SurfaceArea"></td>

</tr><tr>

<td>Density:</td><td><input type="text" name="Density"></td><td>Mass:</td><td><input type="text" name="Mass"></td>

</tr><tr>

<td>Center of Gravity:</td><td><input type="text" name="CenterOfGravity"></td>

</tr></table><!-- All matrix output is just dumped to this text area --><textarea name="Others" rows=4 cols=50></textarea></center><hr></form>

<form name="get_xsec"><h4>Get Cross Sections</h4<p><center><!-- Input arguments -->Model: <input type="text" name="ModelNameExt"><p><!-- Buttons --><input type="button" value="Get Cross Sections"

onclick="WlSolidGetXSections()"><p><!-- Output arguments -->Coordinate System:<br><textarea name="XSectionNames" rows=4 cols=50></textarea></center><hr></form>

Page 195: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Solids 15 - 7

So

lids

<form name="disp_xsec"><h4>Display Cross Section</h4><p><center><!-- Input arguments -->Model: <input type="text" name="ModelNameExt"><spacer size=20>Cross Section Name: <input type="text" name="XSectionName"><p><!-- Buttons --><input type="button" value="Display Cross Sections"

onclick="WlSolidDisplayXSection()"><p></center><hr></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Figure 15-1

Page 196: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

15 - 8 Pro/Web.Link User’s Guide

Figure 15-2

Page 197: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 1

16Family Tables

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate family tables.

Topic Page

OverviewFamily Table ItemsAdding and Deleting Family Table InstancesFamily Table Instance ValuesFile Management Functions for InstancesFamily Table Example

Page 198: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 2 Pro/Web.Link User’s Guide

OverviewFamily table functions are divided into three groups, distinguished by the prefix of the function name:

• pwlFamtabItem—Functions that modify table-driven items

• pwlFamtabInstance—Functions that modify an instance in the family table

• pwlInstance—Functions that perform file-management operations for family table instances

The following sections describe these functional groups in detail.

Family Table ItemsFunctions introduced:

• pwlFamtabItemsGet

• pwlFamtabItemAdd

• pwlFamtabItemRemove

Every item in a family table is uniquely identified by two values—its name and the family item type. The following table lists the possible values of the family item type.

Constant Description

PWL_FAM_USER_PARAM A user-defined parameter

PWL_FAM_DIMENSION A dimension

PWL_FAM_IPAR_NOTE A parameter in a pattern

PWL_FAM_FEATURE A feature

PWL_FAM_ASMCOMP A single instance of a component in an assembly

PWL_FAM_UDF A user-defined feature

PWL_FAM_ASMCOMP_MODEL All instances of a component in an assembly

PWL_FAM_GTOL A geometric tolerance

PWL_FAM_TOL_PLUS The plus value of a tolerance

PWL_FAM_TOL_MINUS The minus value of a tolerance

PWL_FAM_TOL_PLUSMINUS A tolerance

Page 199: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 3

Fam

ily Tab

les

The function pwlFamtabItemsGet returns a list of all the table-driven elements currently in the family table. The syntax is as follows:

pwlFamtabItemsGet (String MdlNameExt // The full name of the

// model);Additional return fields:

int NumItems; // The number of itemsint FamItemTypes[]; // The types of itemsString Items[]; // The list of table-driven

// elements

The first item in the table would have the item type FamItemTypes[0] and name Items[0]. Similar correspondence between the two arrays exist for every item in the table.

The following code fragment shows how to use this function.

<script language = "JavaScript">...function WlFamilyTableGet(){

var ret = document.pwl.pwlFamtabItemsGet (document.list_items.ModelNameExt.value);

if (!ret.Status){

alert ("pwlFamtabItemsGet failed (" + ret.ErrorCode + ")");return;

}document.list_items.Items.value = "";for (var i = 0; i < ret.NumItems; i++){

document.list_items.Items.value +=ret.Items[i] + “ (" + ret.FamItemTypes[i] + “)\n";

}}</script>

PWL_FAM_SYSTEM_PARAM A system parameter

PWL_FAM_EXTERNAL_REFERENCE An external reference

Constant Description

Page 200: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 4 Pro/Web.Link User’s Guide

<form name = "list_items">

<h4>List Items</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt">

<!-- Buttons --><input type = "button" value = "List Items"

onclick = "WlFamilyTableGet()"><p>

<!-- Output arguments -->Items:<br><textarea name = "Items" rows = 4 cols = 50></textarea></center><hr></form>

To add or remove items from a family table, use the functions pwlFamtabItemAdd and pwlFamtabItemRemove, respectively. The syntax of the functions is as follows:

pwlFamtabItemAdd (String MdlNameExt, // The full name of the model.int FamItemType, // The type of family item.

// Use parseInt with this// argument.

String Name // The name of the item to add.);

pwlFamtabItemRemove (String MdlNameExt, // The full name of the

// model.int FamItemType, // The type of family item.

// Use parseInt with this// argument.

String Name // The name of the item to// remove.

);

Page 201: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 5

Fam

ily Tab

les

Adding and Deleting Family Table InstancesFunctions introduced:

• pwlFamtabInstancesGet

• pwlFamtabInstanceAdd

• pwlFamtabInstanceRemove

To get a list of all the instances of a generic, call the function pwlFamtabInstancesGet. The syntax is as follows:

pwlFamtabInstancesGet (String MdlNameExt // The full name of the

model);Additional return fields:

int NumInstances; // The number of instancesString InstanceNames[]; // The names of the

// instances

The function pwlFamtabInstanceAdd creates a new instance. The syntax is as follows:

pwlFamtabInstanceAdd (String MdlNameExt, // The full name of the modelString Name // The name of the instance

// to add);

Initially, a new instance will have all asterisks in the family table, making it equal to the generic.

To remove an existing instance from a family table, call the function pwlFamtabInstanceRemove. The syntax is as follows:

pwlFamtabInstanceRemove (String MdlNameExt, // The full name of the modelString Name // The name of the instance to

// remove);

If the instance has been opened, the object continues to exist but will no longer be associated with the family table.

Page 202: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 6 Pro/Web.Link User’s Guide

Family Table Instance ValuesFunctions introduced:

• pwlFamtabInstanceValueGet

• pwlFamtabInstanceValueSet

The function pwlFamtabInstanceValueGet provides the value for the specified instance and item. The syntax is as follows:

pwlFamtabInstanceValueGet (String MdlNameExt, // The full name of the

// model.String Name, // The name of the instance.int FamItemType, // The type of family item.

// Use parseInt with this// argument.

String ItemName // The name of the item.);Additional return fields:

int ValueType; // Specifies which value// argument to use.

int IntVal; // The integer value.double DoubleVal; // The double value.String StringVal; // The string value.boolean BooleanVal; // The Boolean value.

The function returns five additional fields, but only two will be set to anything. The field ValueType is always set and its value determines what other field should be used, according to the following table.

Value of the ValueType Additional Field Used

PWL_VALUE_INTEGER IntVal

PWL_VALUE_DOUBLE DoubleVal

PWL_VALUE_STRING StringVal

PWL_VALUE_BOOLEAN BooleanVal

Page 203: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 7

Fam

ily Tab

les

The following code fragment shows how to use this function.

<script language = "JavaScript">

function WlInstanceGetValue(){

var ret = document.pwl.pwlFamtabInstanceValueGet(document.get_value.ModelNameExt.value,document.get_value.InstanceName.value,parseInt (document.pwl.PWL_FAM_USER_PARAM),document.get_value.ItemName.value);

if (!ret.Status){

alert ("pwlFamtabInstanceValueGet failed (" + ret.ErrorCode +")");

return;}if (ret.ValueType == parseInt (document.pwl.PWL_VALUE_DOUBLE)){

document.get_value.ItemValue.value = ret.DoubleVal;}else if (ret.ValueType == parseInt (document.pwl.PWL_VALUE_STRING)){

document.get_value.ItemValue.value = ret.StringVal;}else if (ret.ValueType == parseInt (document.pwl.PWL_VALUE_INTEGER)){

document.get_value.ItemValue.value = ret.IntVal;}else if (ret.ValueType == parseInt (document.pwl.PWL_VALUE_BOOLEAN)){

document.get_value.ItemValue.value = ret.BooleanVal;}

}</script>

<form name = "get_value"><h4>Get a Value for an Instance (Parameter Item Only)</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt">Instance: <input type = "text" name = "InstanceName">Parameter: <input type = "text" name = "ItemName"><p>

<!-- Buttons --><input type = "button" value = "Get Value"

onclick = "WlInstanceGetValue()"><p>

Page 204: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 8 Pro/Web.Link User’s Guide

<!-- Output arguments -->Value: <input type = "text" name = "ItemValue"></center><hr></form>

Setting the value of an instance item using the function pwlFamtabInstanceValueSet requires several arguments to allow for all the possibilities. The syntax is as follows:

pwlFamtabInstanceValueSet (String MdlNameExt, // The full name of the

// model.String Name, // The name of the instance.int FamItemType, // The type of the family

// table item. Use parseInt// with this argument.

String ItemName, // The name of the item.int ValueType, // Specifies which value

// argument to use. Use// parseInt with this// argument.

int IntVal, // The integer value. Use// parseInt with this// argument.

double DoubleVal, // The double value. Use// parseFloat with this// argument.

String StringVal, // The string value.boolean BooleanVal // The Boolean value.

);

The value of ValueType determines which of the other four values will be used. Although only one of IntVal, DoubleVal, StringVal, and BooleanVal will be used, all must be the proper data types or the Java function will not be found, and an error will occur.

Page 205: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 9

Fam

ily Tab

les

Locking Family Table InstancesFunctions introduced:

• pwlFamtabInstanceLockGet

• pwlFamtabInstanceLockAdd

• pwlFamtabInstanceLockRemove

The function pwlFamtabInstanceLockGet determines whether the specified model is locked for modification. The function returns this information in the Boolean field Locked. A locked instance cannot be modified. The syntax is as follows:

pwlFamtabInstanceLockGet (String MdlNameExt, // The full name of the model.String Name // The name of the instance.

);Additional return fields:

boolean Locked; // If this is true, the model// is locked for modification.

To add a lock, call the function pwlFamtabInstanceLockAdd. The syntax is as follows:

pwlFamtabInstanceLockAdd (String MdlNameExt, // The full name of the modelString Name // The name of the instance

// to which to add the lock);

Call the function pwlFamtabInstanceLockRemove to remove the specified lock. The syntax is as follows:

pwlFamtabInstanceLockRemove (String MdlNameExt, // The full name of the modelString Name // The name of the instance

// from which to remove the// lock

);

Page 206: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 10 Pro/Web.Link User’s Guide

File Management Functions for InstancesFunctions introduced:

• pwlInstanceOpen

• pwlInstanceErase

The function pwlInstanceOpen enables you to open an instance in a manner similar to pwlMdlOpen. The syntax is as follows:

pwlInstanceOpen (String MdlNameExt, // The full name of the

// model.String InstanceName, // The name of the instance

// to open.boolean DisplayInWindow // If this is true, display

// the instance in a window.);Additional return fields:

int WindowID; // The identifier of the// window in which the// instance is displayed.

The generic must already reside in memory. The Boolean argument determines whether the instance should be displayed. If the instance is to be displayed in a window, the function returns the additional field, WindowID.

To erase an instance from memory, use the function pwlInstanceErase. The syntax is as follows:

pwlInstanceErase (String MdlNameExt, // The full name of the modelString Name // The name of the instance to

// erase from memory);

Page 207: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 11

Fam

ily Tab

les

Family Table ExampleThe following example shows an HTML page that uses the family table functions.

<html><head><title>Web.Link Family Table Functions</title><script src="wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script><script language = "JavaScript">

function WlInstancesList()//Lists all the instances for a model.{

var ret = document.pwl.pwlFamtabInstancesGet (document.list_table.ModelNameExt.value);

if (!ret.Status){

alert ("pwlFabtabInstanceGet failed (" + ret.ErrorCode + ")");return;

}document.list_table.InstanceNames.value = "";for (var i = 0; i < ret.NumInstances; i++){

document.list_table.InstanceNames.value += ret.InstanceNames[i]+ "\n";

}}

function WlInstanceOpen()//Opens an instance in a window. The generic must be in memory.{

var ret = document.pwl.pwlInstanceOpen (document.file_inst.ModelNameExt.value,document.file_inst.InstanceName.value, true);

if (!ret.Status){

alert ("pwlInstanceOpen failed (" + ret.ErrorCode + ")");return;

}}

Page 208: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 12 Pro/Web.Link User’s Guide

function WlInstanceErase()//Erases an instance from memory.{

var ret = document.pwl.pwlInstanceErase (document.file_inst.ModelNameExt.value,document.file_inst.InstanceName.value);

if (!ret.Status){

alert ("pwlInstanceErase failed (" + ret.ErrorCode + ")");return;

}}

function WlInstanceGetValues()//Gets all the values in the family table for a given instance.{

var ret = document.pwl.pwlFamtabItemsGet (document.get_values.ModelNameExt.value);

if (!ret.Status){

alert ("pwlFamtabItemsGet failed (" + ret.ErrorCode + ")");return;

}document.get_values.InstanceValues.value = "";for (var i = 0; i < ret.NumItems; i++){

var val_ret = document.pwl.pwlFamtabInstanceValueGet (document.get_values.ModelNameExt.value,document.get_values.InstanceName.value,parseInt(ret.FamItemTypes[i]), ret.Items[i]);

if (!val_ret.Status){

alert ("pwlFamtabInstanceValueGet failed (" +val_ret.ErrorCode + ")");

return;}var answer = "Undefined";if (val_ret.ValueType == parseInt (document.pwl.PWL_VALUE_DOUBLE)){

answer = val_ret.DoubleVal;}else if (val_ret.ValueType ==

parseInt (document.pwl.PWL_VALUE_STRING)){

answer = val_ret.StringVal;}else if (val_ret.ValueType ==

parseInt (document.pwl.PWL_VALUE_INTEGER)){

answer = val_ret.IntVal;}

Page 209: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 13

Fam

ily Tab

les

else if (val_ret.ValueType ==parseInt (document.pwl.PWL_VALUE_BOOLEAN))

{answer = val_ret.BooleanVal;

}

// Uses the set value select list to convert the type to a string.var ItemType = "Undefined";for (var k = 0; k < document.set_value.ItemType.length; k++){

if (parseInt (document.pwl.eval (document.set_value.ItemType.options[k].value)) ==ret.FamItemTypes[i])

{ItemType = document.set_value.ItemType.options[k].text;

}}

document.get_values.InstanceValues.value += ret.Items[i] +" (" + ItemType + "): " + answer + "\n";

}}

function WlInstanceSetValue()//Sets a value in the family table.{

var StringValue = document.set_value.Value.value;var FloatValue = parseFloat (document.set_value.Value.value);var IntValue = parseInt (document.set_value.Value.value);var BoolValue = (document.set_value.Value.value.toLowerCase() ==

"true") ? true : false;var ValueType = document.pwl.eval

(document.set_value.ValueType.options[document.set_value.ValueType.selectedIndex].value);

var ret = document.pwl.pwlFamtabInstanceValueSet (document.set_value.ModelNameExt.value,document.set_value.InstanceName.value,parseInt (document.pwl.eval (document.set_value.ItemType[document.set_value.ItemType.selectedIndex].value)),document.set_value.ItemName.value, parseInt (ValueType),IntValue, FloatValue, StringValue, BoolValue);

if (!ret.Status){

alert ("pwlFamtabInstanceValueSet failed (" + ret.ErrorCode +")");

return;}

}

Page 210: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 14 Pro/Web.Link User’s Guide

function WlInstanceAdd()//Creates a new instance.{

var ret = document.pwl.pwlFamtabInstanceAdd (document.instance.ModelNameExt.value,document.instance.InstanceName.value);

if (!ret.Status){

alert ("pwlFamtabInstanceAdd failed (" + ret.ErrorCode + ")");return;

}}

function WlInstanceRemove()//Deletes an instance.{

var ret = document.pwl.pwlFamtabInstanceRemove (document.instance.ModelNameExt.value,document.instance.InstanceName.value);

if (!ret.Status){

alert ("pwlFamtabInstanceRemove failed (" + ret.ErrorCode + ")");return;

}}

function WlInstanceLock()//Locks an instance.{

var ret = document.pwl.pwlFamtabInstanceLockAdd (document.instance.ModelNameExt.value,document.instance.InstanceName.value);

if (!ret.Status){

alert ("pwlFamtabInstanceLockAdd failed (" + ret.ErrorCode + ")");return;

}}

function WlInstanceUnlock()//Removes the lock on an instance.{

var ret = document.pwl.pwlFamtabInstanceLockRemove (document.instance.ModelNameExt.value,document.instance.InstanceName.value);

if (!ret.Status){

alert ("pwlFamtabInstanceLockRemove failed (" + ret.ErrorCode +")");

Page 211: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 15

Fam

ily Tab

les

return;}

}

function WlInstanceCheckLock()//Checks if an instance is locked.{

var ret = document.pwl.pwlFamtabInstanceLockGet (document.instance.ModelNameExt.value,document.instance.InstanceName.value);

if (!ret.Status){

alert ("pwlFamtabInstanceLockGet failed (" + ret.ErrorCode + ")");return;

}document.instance.Locked.value = ret.Locked;

}

function WlFamilyTableAdd()//Adds a new column to the family table.{

var ItemType = document.pwl.eval (document.column.ItemType.options[document.column.ItemType.selectedIndex].value);

var ret = document.pwl.pwlFamtabItemAdd (document.column.ModelNameExt.value,parseInt (ItemType), document.column.ItemName.value);

if (!ret.Status){

alert ("pwlFamtabItemAdd failed (" + ret.ErrorCode + ")");return;

}}

function WlFamilyTableRemove()//Removes a column from the family table.{

var ItemType = document.pwl.eval (document.column.ItemType.options[document.column.ItemType.selectedIndex].value);

var ret = document.pwl.pwlFamtabItemRemove (document.column.ModelNameExt.value,parseInt (ItemType), document.column.ItemName.value);

if (!ret.Status){

alert ("pwlFamtabItemRemove failed (" + ret.ErrorCode + ")");return;

}}</script></head>

Page 212: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 16 Pro/Web.Link User’s Guide

<body><script src="wl_header_form.js">document.writeln("Error loading Web-Link header form<p>");</script>

<form name = "list_table"><h4>List Instances</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt"><p>

<!-- Buttons --><input type = "button" value = "List Instances"

onclick = "WlInstancesList()"><p>

<!-- Output arguments -->Instances:<br><textarea name = "InstanceNames" rows = 4 cols = 50></textarea></center><hr></form>

<form name = "file_inst"><h4>File Operations for Instances</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt"><spacer size = 20>Instance: <input type = "text" name = "InstanceName"><p><!-- Buttons --><input type = "button" value = "Open Instance"

onclick = "WlInstanceOpen()"><input type = "button" value = "Erase Instance"

onclick = "WlInstanceErase()"><p></center><hr></form>

<form name = "get_values"><h4>Get Values for an Instance</h4><p><center>

<!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt"><spacer size = 20>Instance: <input type = "text" name = "InstanceName"><p>

<!-- Buttons --><input type = "button" value = "List Values"

onclick = "WlInstanceGetValues()"><p>

Page 213: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 17

Fam

ily Tab

les

<!-- Output arguments -->Values:<br><textarea name = "InstanceValues" rows = 4 cols = 50></textarea></center><hr></form>

<form name = "set_value"><h4>Set a Value for an Instance</h4><p><center>

<!-- Input arguments --><table><tr><td>Model:</td>

<td><input type = "text" name = "ModelNameExt"></td><td>Instance:</td><td><input type = "text" name = "InstanceName"></td></tr>

<tr><td>Item Type:</td><td><select name = "ItemType"><option value = "PWL_FAM_ASMCOMP_MODEL">Assembly Component

(All)</option><option value = "PWL_FAM_ASMCOMP">Assembly Component

(Single)</option><option value = "PWL_FAM_DIMENSION">Dimension</option><option value = "PWL_FAM_EXTERNAL_REFERENCE">External

Reference</option><option value = "PWL_FAM_FEATURE">Feature</option><option value = "PWL_FAM_GTOL">Geometric Tolerance</option><option value = "PWL_FAM_TOL_MINUS">Minus Tolerance</option><option value = "PWL_FAM_IPAR_NOTE">Pattern Parameter</option><option value = "PWL_FAM_TOL_PLUSMINUS">Plus/Minus

Tolerance</option><option value = "PWL_FAM_TOL_PLUS">Plus Tolerance</option><option value = "PWL_FAM_SYSTEM_PARAM">System Parameter</option><option value = "PWL_FAM_UDF">User Defined Feature</option><option value = "PWL_FAM_USER_PARAM">User Parameter</option></select></td><td>Item Name:</td><td><input type = "text" name = "ItemName"></td>

</tr><tr><td>Value Type:</td>

<td><select name = "ValueType"><option value = "PWL_VALUE_BOOLEAN">Boolean</option><option value = "PWL_VALUE_DOUBLE">Double</option><option value = "PWL_VALUE_INTEGER">Integer</option><option value = "PWL_VALUE_STRING">String</option></select></td><td>Value:</td><td><input type = "text" name = "Value"></td></tr>

</table>

<!-- Buttons --><input type = "button" value = "Set Value"

onclick = "WlInstanceSetValue()"><p>

Page 214: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 18 Pro/Web.Link User’s Guide

</center><hr></form>

<form name = "instance"><h4>Add/Remove/Lock an Instance</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt"><spacer size = 20>Instance: <input type = "text" name = "InstanceName"><p>

<!-- Buttons --><input type = "button" value = "Add Instance" onclick = "WlInstanceAdd()"><input type = "button" value = "Remove Instance"

onclick = "WlInstanceRemove()"><input type = "button" value = "Lock Instance"

onclick = "WlInstanceLock()"><input type = "button" value = "Unlock Instance"

onclick = "WlInstanceUnlock()"><p>

<!-- Extra output arguments and a button for verifying lock status --><input type = "button" value = "Check Lock"

onclick = "WlInstanceCheckLock()"><p><spacer size = 20>Locked: <input type = "text" name = "Locked"><p></center><hr></form>

<form name = "column"><h4>Add/Remove Columns from a Family Table</h4><p><center><!-- Input arguments --><table><tr><td><center>Model:</center></td>

<td><center>Item Type:</center></td><td><center>Item Name:</center></td></tr>

<tr><td><input type = "text" name = "ModelNameExt"></td><td><select name = "ItemType"><option value = "PWL_FAM_ASMCOMP_MODEL">Assembly Component

(All)</option><option value = "PWL_FAM_ASMCOMP">Assembly Component

(Single)</option><option value = "PWL_FAM_DIMENSION">Dimension</option><option value = "PWL_FAM_EXTERNAL_REFERENCE">External

Reference</option><option value = "PWL_FAM_FEATURE">Feature</option><option value = "PWL_FAM_GTOL">Geometric Tolerance</option><option value = "PWL_FAM_TOL_MINUS">Minus Tolerance</option><option value = "PWL_FAM_IPAR_NOTE">Pattern Parameter</option><option value = "PWL_FAM_TOL_PLUSMINUS">Plus/Minus

Tolerance</option>

Page 215: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 19

Fam

ily Tab

les

<option value = "PWL_FAM_TOL_PLUS">Plus Tolerance</option><option value = "PWL_FAM_SYSTEM_PARAM">System Parameter</option><option value = "PWL_FAM_UDF">User Defined Feature</option><option value = "PWL_FAM_USER_PARAM">User Parameter</option></select></td><td><input type = "text" name = "ItemName"></td></tr>

</table>

<!-- Buttons --><input type = "button" value = "Add Column"

onclick = "WlFamilyTableAdd()"><input type = "button" value = "Remove Column"

onclick = "WlFamilyTableRemove()"><p></center><hr></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the top figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Figure 16-1

Page 216: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 20 Pro/Web.Link User’s Guide

Figure 16-2

Page 217: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Family Tables 16 - 21

Fam

ily Tab

les

Figure 16-3

Page 218: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

16 - 22 Pro/Web.Link User’s Guide

Page 219: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

17 - 1

17Layers

This chapter describes the Pro/Web.Link functions that enable you to access and manipulate layers.

Topic Page

Layer Functions

Layer Example

Page 220: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

17 - 2 Pro/Web.Link User’s Guide

Layer FunctionsFunctions introduced:

• pwlMdlLayersGet

• pwlLayerCreate

• pwlLayerDelete

• pwlLayerDisplayGet

• pwlLayerDisplaySet

• pwlLayerItemsGet

• pwlLayerItemAdd

• pwlLayerItemRemove

The function pwlMdlLayersGet provides the number and a list of all the layers in the specified model. The syntax is as follows:

pwlMdlLayersGet (String MdlNameExt // The full name of the model

);Additional return fields:

int NumLayers; // The number of layers in// the returned array

String LayerNames[]; // The array of layer names

The function pwlLayerCreate enables you to create a new layer. The syntax is as follows:

pwlLayerCreate (String MdlNameExt, // The full name of the modelString LayerName // The name of the layer to

// create);

To delete a layer, call the function pwlLayerDelete. The syntax is as follows:

pwlLayerDelete (String MdlNameExt, // The full name of the modelString LayerName // The name of the layer to

// delete);

Page 221: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Layers 17 - 3

Layers

The function pwlLayerDisplayGet provides the display type of the specified layer. The syntax is as follows:

pwlLayerDisplayGet (String MdlNameExt, // The full name of the modelString LayerName // The name of the layer

);Additional return field:

int DisplayType; // The display type

The valid values for DisplayType are as follows:

• PWL_DISPLAY_TYPE_NORMAL—A normal layer.

• PWL_DISPLAY_TYPE_DISPLAY—A layer selected for display.

• PWL_DISPLAY_TYPE_BLANK—A blanked layer.

• PWL_DISPLAY_TYPE_HIDDEN—A hidden layer. This applies to Assembly mode only.

To set the display type of a layer, use the function pwlLayerDisplaySet. The syntax is as follows:

pwlLayerDisplaySet (String MdlNameExt, // The full name of the model.String LayerName, // The name of the layer.int DisplayType // The new display type. Use

// parseInt with this argument.);

The function pwlLayerItemsGet lists the items assigned to the specified layer. The syntax is as follows:

pwlLayerItemsGet (String MdlNameExt, // The full name of the modelString LayerName // The name of the layer

);Additional return fields:

int NumItems; // The number of items in// ItemIDs

ItemType ItemTypes[]; // The array of item typesint ItemIDs[]; // The array of item

// identifiersString ItemOwners[]; // The array of item owners

The possible values for ItemType are as follows:

• PWL_PART

• PWL_FEATURE

• PWL_DIMENSION

Page 222: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

17 - 4 Pro/Web.Link User’s Guide

• PWL_REF_DIMENSION

• PWL_GTOL

• PWL_ASSEMBLY

• PWL_QUILT

• PWL_CURVE

• PWL_POINT

• PWL_NOTE

• PWL_IPAR_NOTE

• PWL_SYMBOL_INSTANCE

• PWL_DRAFT_ENTITY

• PWL_DIAGRAM_OBJECT

To add an item to a layer, call the function pwlLayerItemAdd. The syntax is as follows:

pwlLayerItemAdd (String MdlNameExt, // The full name of the model.String LayerName, // The name of the layer.int ItemType, // The type of layer item. Use

// parseInt with this// argument.

int ItemID, // The identifier of the item// to add. Use parseInt with// this argument.

String ItemOwner // The owner of the item.);

If ItemOwner is null or an empty string, the item owner is the same as the layer. Otherwise, it is a selection string to the component that owns the item.

Page 223: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Layers 17 - 5

Layers

To delete an item from a layer, call the function pwlLayerItemRemove. The syntax is as follows:

pwlLayerItemRemove (String MdlNameExt, // The full name of the model.String LayerName, // The name of the layer.int ItemType, // The type of layer item. Use

// parseInt with this// argument.

int ItemID, // The identifier of the item// to remove. Use parseInt// with this argument.

String ItemOwner // The item owner. If this is// null or an empty string,// the item owner is the same// as the layer. Otherwise,// it is a selection string// to the component that// owns the item.

);

Layer ExampleThe following example shows an HTML page that uses the layer functions.

<html><head><title>Web.Link Layers</title><script src="wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script><script language = "JavaScript">

function WlLayersGet()//Gets the list of layers and their current display type.{

var ret = document.pwl.pwlMdlLayersGet (document.list_layer.ModelNameExt.value);

if (!ret.Status){

alert ("pwlMdlLayersGet failed (" + ret.ErrorCode + ")");return;

}document.list_layer.Layers.value = "";

Page 224: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

17 - 6 Pro/Web.Link User’s Guide

for (var i = 0; i < ret.NumLayers; i++){

var disp_ret = document.pwl.pwlLayerDisplayGet (document.list_layer.ModelNameExt.value,ret.LayerNames[i]);

if (!ret.Status){

alert ("pwlLayerDisplayGet failed (" + ret.ErrorCode + ")");return;

}var DisplayType = "";if (disp_ret.DisplayType ==

parseInt (document.pwl.PWL_DISPLAY_TYPE_DISPLAY)){

DisplayType = " (display)";}else if (disp_ret.DisplayType ==

parseInt (document.pwl.PWL_DISPLAY_TYPE_HIDDEN)){

DisplayType = " (hidden)";}else if (disp_ret.DisplayType ==

parseInt (document.pwl.PWL_DISPLAY_TYPE_BLANK)){

DisplayType = " (blank)";}document.list_layer.Layers.value += ret.LayerNames[i] +

DisplayType + "\n";}

}

function WlLayerSetDisplay()//Sets the display type of a layer.{

var DisplayType = document.pwl.eval (document.set_display.DisplayType.options[document.set_display.DisplayType.selectedIndex].value);

var ret = document.pwl.pwlLayerDisplaySet (document.set_display.ModelNameExt.value,document.set_display.LayerName.value,parseInt (DisplayType));

if (!ret.Status){

alert ("pwlLayerDisplaySet failed (" + ret.ErrorCode + ")");return;

}}

Page 225: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Layers 17 - 7

Layers

function WlLayerCreate()//Creates a layer.{

var ret = document.pwl.pwlLayerCreate (document.layer.ModelNameExt.value,document.layer.LayerName.value);

if (!ret.Status){

alert ("pwlLayerCreate failed (" + ret.ErrorCode + ")");return;

}}

function WlLayerDelete()//Deletes a layer.{

var ret = document.pwl.pwlLayerDelete(document.layer.ModelNameExt.value,document.layer.LayerName.value);

if (!ret.Status){

alert ("pwlLayerDelete failed (" + ret.ErrorCode + ")");return;

}}

function WlLayerGetItems()//Gets the items in the layer.{

var ret = document.pwl.pwlLayerItemsGet (document.get_items.ModelNameExt.value,document.get_items.LayerName.value);

if (!ret.Status){

alert ("pwlLayerItemsGet failed (" + ret.ErrorCode + ")");return;

}document.get_items.Items.value = "";for (var i = 0; i < ret.NumItems; i++){

var ItemType = "Undefined";for (var k = 0; k < document.items.ItemType.length; k++){

if (parseInt (document.pwl.eval(document.items.ItemType.options[k].value)) ==ret.ItemTypes[i])

{ItemType = document.items.ItemType.options[k].text;

}}

Page 226: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

17 - 8 Pro/Web.Link User’s Guide

document.get_items.Items.value += ret.ItemOwners[i] + "/" +ItemType + "(#" + ret.ItemIDs[i] + ")\n";

}}

function WlLayerAddItem()//Adds an item to a layer.{

var ItemType = document.pwl.eval (document.items.ItemType.options[document.items.ItemType.selectedIndex].value);

var ret = document.pwl.pwlLayerItemAdd (document.items.ModelNameExt.value,document.items.LayerName.value, parseInt (ItemType),parseInt (document.items.ItemID.value),document.items.ItemOwner.value);

if (!ret.Status){

alert ("pwlLayerItemAdd failed (" + ret.ErrorCode + ")");return;

}}

function WlLayerRemoveItem()//Removes an item from a layer.{

var ItemType = document.pwl.eval (document.items.ItemType.options[document.items.ItemType.selectedIndex].value);

var ret = document.pwl.pwlLayerItemRemove (document.items.ModelNameExt.value,document.items.LayerName.value, parseInt (ItemType),parseInt (document.items.ItemID.value),document.items.ItemOwner.value);

if (!ret.Status){

alert ("pwlLayerItemRemove failed (" + ret.ErrorCode + ")");return;

}}</script></head><body>

<script src="wl_header_form.js">document.writeln("Error loading Web-Link header form<p>");</script>

Page 227: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Layers 17 - 9

Layers

<form name = "list_layer"><h4>List Layers</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt"><p>

<!-- Buttons --><input type = "button" value = "Get Layers" onclick = "WlLayersGet()"><p>

<!-- Output arguments -->Layers:<br><textarea name = "Layers" rows = 4 cols = 50></textarea></center><hr></form>

<form name = "layer"><h4>Create/Delete Layers</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt">Layer: <input type = "text" name = "LayerName"><p>

<!-- Buttons --><input type = "button" value = "Create Layer" onclick = "WlLayerCreate()"><input type = "button" value = "Delete Layer"

onclick = "WlLayerDelete()"><p></center><hr></form>

<form name = "set_display"><h4>Set Display Type</h4><p><center><!-- Input arguments --><table><tr><td><center>Model:</center></td>

<td><center>Layer:</center></td><td><center>Display Type:</center></td></tr>

<tr><td><input type = "text" name = "ModelNameExt"></td><td><input type = "text" name = "LayerName"></td><td><select name = "DisplayType"><option value = "PWL_DISPLAY_TYPE_NORMAL">Normal</option><option value = "PWL_DISPLAY_TYPE_DISPLAY">Display</option><option value = "PWL_DISPLAY_TYPE_BLANK">Blank</option><option value = "PWL_DISPLAY_TYPE_HIDDEN">Hidden</option></select></td></tr>

</table>

<!-- Buttons --><input type = "button" value = "Set Display Type"

onclick = "WlLayerSetDisplay()"><p>

Page 228: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

17 - 10 Pro/Web.Link User’s Guide

</center><hr></form>

<form name = "get_items"><h4>List the Items in a Layer</h4><p><center><!-- Input arguments -->Model: <input type = "text" name = "ModelNameExt">Layer: <input type = "text" name = "LayerName"><p>

<!-- Buttons --><input type = "button" value = "Get Items"

onclick = "WlLayerGetItems()"><p>

<!-- Output arguments -->Items:<br><textarea name = "Items" rows = 4 cols = 50></textarea></center><hr></form>

<form name = "items"><h4>Add/Remove an Item in a Layer</h4><p><center><!-- Input arguments --><table><tr><td>Model:</td>

<td><input type = "text" name = "ModelNameExt"></td><td>Layer:</td><td><input type = "text" name = "LayerName"></td></tr>

<tr><td>Item Type:</td><td><select name = "ItemType"><option value = "PWL_CURVE">Curve</option><option value = "PWL_DATUM_PLANE">Datum Plane</option><option value = "PWL_DIAGRAM_OBJECT">Diagram Object</option><option value = "PWL_DIMENSION">Dimension</option><option value = "PWL_DRAFT_ENTITY">Draft Entity</option><option value = "PWL_DRAFT_GROUP">Draft Group</option><option value = "PWL_DRAW_TABLE">Drawing Table</option><option value = "PWL_FEATURE">Feature</option><option value = "PWL_GTOL">Geometric Tolerance</option><option value = "PWL_LAYER">Layer</option><option value = "PWL_NOTE">Note</option><option value = "PWL_PART">Part</option><option value = "PWL_POINT">Point</option><option value = "PWL_QUILT">Quilt</option><option value = "PWL_REF_DIMENSION">Reference Dimension</option><option value = "PWL_SUB_ASSEMBLY">Sub-Assembly</option><option value = "PWL_SYMBOL_INSTANCE">Symbol</option></select></td><td>Item ID:</td><td><input type = "text" name = "ItemID"></td></tr>

Page 229: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Layers 17 - 11

Layers

<tr><td>Item Owner:</td><td><input type = "text" name = "ItemOwner"</td></tr>

</table>

<!-- Buttons --><input type = "button" value = "Add Items" onclick = "WlLayerAddItem()"><input type = "button" value = "Remove Items"

onclick = "WlLayerRemoveItem()"><p></center><hr>

</form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Page 230: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

17 - 12 Pro/Web.Link User’s Guide

Figure 17-1

Page 231: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Layers 17 - 13

Layers

Figure 17-2

Page 232: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

17 - 14 Pro/Web.Link User’s Guide

Page 233: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 1

18Notes

This chapter describes the Pro/Web.Link functions that enable you to access the notes created in Pro/ENGINEER using the command Setup, Notes.

Topic Page

Notes Inquiry

Note Names

Note Text

Note URLs

Note Example

Page 234: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 2 Pro/Web.Link User’s Guide

Notes InquiryFunctions introduced:

• pwlMdlNotesGet

• pwlFeatureNotesGet

• pwlNoteOwnerGet

The function pwlMdlNotesGet returns the number and a list of all the note identifiers in the specified model. The syntax is as follows:

pwlMdlNotesGet (String MdlNameExt // The full name of the model

);Additional return fields:

int NumNotes; // The number of notes in// the array NoteIDs

int NoteIDs[]; // The array of note// identifiers

The function pwlFeatureNotesGet provides the number and a list of all the note identifiers for the specified feature in the model. Note that this function does not apply to drawings. The syntax is as follows:

pwlFeatureNotesGet (String MdlNameExt, // The full name of the model.int FeatureID // The feature whose notes

// should be found. Use// parseInt with this// argument.

);Additional return fields:

int NumNotes; // The number of notes in// the array NoteIDs.

int NoteIDs[]; // The array of note// identifiers.

The pwlNoteOwnerGet function gets the owner of the specified note. The syntax is as follows:

pwlNoteOwnerGet (String MdlNameExt, // The full name of the

// model.int NoteID // The identifier of the

// note whose owner you want.// Use parseInt with this// argument.

);

Page 235: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Notes 18 - 3

No

tes

Additional return fields:int ItemType; // The item type.int NoteOwnerID; // The identifier of the

// note’s owner. This// field is not applicable// if ItemType is PWL_MODEL.

Notes:

• You cannot modify the owner of the note.

• The function pwlNoteOwnerGet does not apply to drawings.

Note NamesFunctions introduced:

• pwlNoteNameGet

• pwlNoteNameSet

The pwlNoteNameGet function returns the name of the specified note, given its identifier. The syntax is as follows:

pwlNoteNameGet (String MdlNameExt, // The full name of the model.int NoteID // The note identifier. Use

// parseInt with this// argument.

);Additional return field:

String NoteName; // The name of the note.

To set the name of a note, call the function pwlNoteNameSet. The syntax is as follows:

pwlNoteNameSet (String MdlNameExt, // The full name of the model.int NoteID, // The note identifier. Use

// parseInt with this// argument.

String NewName // The new name of the note.);

Note: These functions do not apply to drawings.

Page 236: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 4 Pro/Web.Link User’s Guide

Note TextFunctions introduced:

• pwlNoteTextGet

• pwlNoteTextSet

The function pwlNoteTextGet returns the number of lines and the text strings for the specified note in the model. Symbols are replaced by an asterisk (*). The syntax is as follows:

pwlNoteTextGet (String MdlNameExt, // The full name of the model.int NoteID // The note identifier. Use

// parseInt with this// argument.

);Additional return fields:

int NumTextLines; // The number of lines of// text in the note.

String NoteText[]; // The text of the note.

To set the text of a note, call the function pwlNoteTextSet. This function supports standard ASCII characters only. The syntax is as follows:

pwlNoteTextSet (String MdlNameExt, // The full name of the

// model.int NoteID, // The note identifier. Use

// parseInt with this// argument.

int NumTextLines, // The number of lines of// text in the note. Use// parseInt with this// argument.

String NewNoteText[] // The text of the new note.);

Note: You cannot set symbols.

Page 237: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Notes 18 - 5

No

tes

Note URLsFunctions introduced:

• pwlNoteURLGet

• pwlNoteURLSet

The pwlNoteURLGet provides the Uniform Resource Locator (URL) of the specified note, given its identifier. The syntax is as follows:

pwlNoteURLGet (String MdlNameExt, // The full name of the model.int NoteID // The note identifier. Use

// parseInt with this argument.);Additional return field:

String NoteURL; // The URL of the note.

To set the URL, call the function pwlNoteURLSet. The syntax is as follows:

pwlNoteURLSet (String MdlNameExt, // The full name of the model.int NoteID, // The note identifier. Use

// parseInt with this argument.String NoteURL // The URL of the note.

);

Note: These functions do not apply to drawings.

Note ExampleThe following example shows an HTML page that uses the note functions.

<html><head><title>Web.Link 3D Notes</title>

<script src="wl_header.js">document.writeln ("Error loading Web.Link header<p>");</script>

<SCRIPT language = "JavaScript">

Page 238: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 6 Pro/Web.Link User’s Guide

function MdlNotesGet()//Gets the notes contained in the model.

{ret = document.pwl.pwlMdlNotesGet (document.main.ModelName.value);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("MdlNotesGet has Failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt (fail_error_code));}for (i = 0; i < ret.NumNotes; i++){

document.get_notes.list_model_notes.value += "Note ID: " +ret.NoteIDs[i] + "\n";

}}

function FeatureNotesGet()//Gets the notes associated to features.

{var feat_id = document.get_notes.get_feat_id.value;if (feat_id == ""){

return;}ret = document.pwl.pwlFeatureNotesGet (document.main.ModelName.value,

parseInt (feat_id) );if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("FeatureNotesGet has Failed.\nError string: " +

fail_reason + "\n" + "Error Code: " +parseInt (fail_error_code));

}

for (i = 0; i < ret.NumNotes; i++){

document.get_notes.list_feature_notes.value += "Note ID: " +ret.NoteIDs[i] + "\n";

}}

function NoteNameGet()//Gets the name of a note using the note_id.

{var note_id = document.get_set_note_name.get_note_id.value;

Page 239: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Notes 18 - 7

No

tes

if (note_id == ""){

return;}ret = document.pwl.pwlNoteNameGet (document.main.ModelName.value,

parseInt (note_id));if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("NoteNameGet has Failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt (fail_error_code));}

document.get_set_note_name.list_note_name.value = "Name of Note: " +ret.NoteName;

}

function NoteNameSet (note_id)//Sets the name of the note.

{var note_name = document.get_set_note_name.new_note_name.value;if (note_name == "" || note_id == ""){

return;}ret = document.pwl.pwlNoteNameSet (document.main.ModelName.value,

parseInt (note_id), note_name);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("NoteNameSet has Failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt(fail_error_code));}

}

function NoteTextGet()//Gets the note text, given the note identifier.

{var note_id = document.get_set_note_text.get_note_id.value;

if (note_id == ""){

return;}ret = document.pwl.pwlNoteTextGet (document.main.ModelName.value,

parseInt (note_id));

Page 240: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 8 Pro/Web.Link User’s Guide

if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("NoteTextGet has Failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt (fail_error_code));}for (i = 0; i < ret.NumTextLines; i++){

document.get_set_note_text.list_note_text.value +="Note Text: " + ret.NoteText[i] + "\n";

}}

function NoteTextSet()//Sets the new note text.

{var note_id = document.get_set_note_text.get_id_to_change.value;var new_note_text = document.pwl.pwluStringArrayAlloc(1);new_note_text[0] = "New Note Text";

if (note_id == ""){

return;}ret = document.pwl.pwlNoteTextSet (document.main.ModelName.value,

parseInt (note_id), 1, new_note_text);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("NoteTextSet has Failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt(fail_error_code));}

}

function NoteURLGet()//Gets the note URL, given the note identifier.

{var note_id = document.get_set_note_url.get_note_id.value;if (note_id == ""){

return;}ret = document.pwl.pwlNoteURLGet (document.main.ModelName.value,

parseInt (note_id));if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;

Page 241: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Notes 18 - 9

No

tes

alert ("NoteURLGet has Failed.\nError string: " + fail_reason +"\n" + "Error Code: " + parseInt (fail_error_code));

}document.get_set_note_url.list_note_url.value = ("Note URL: " +

ret.NoteURL);}

function NoteURLSet (new_note_url)//Sets the note URL, given the note identifier.

{var note_id = document.get_set_note_url.get_id_to_change.value;

if (note_id == "" || new_note_url == ""){

return;}ret = document.pwl.pwlNoteURLSet (document.main.ModelName.value,

parseInt (note_id), new_note_url);if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("NoteURLSet has Failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt(fail_error_code));}

}

function NoteOwnerGet()//Gets the note owner information, given the note identifier.

{var note_id = document.get_note_owner.get_note_id.value;

if (note_id == ""){

return;}ret = document.pwl.pwlNoteOwnerGet (document.main.ModelName.value,

parseInt (note_id));if (!ret.Status){

var fail_reason = ret.ErrorString;var fail_error_code = ret.ErrorCode;alert ("NoteOwnerGet has Failed.\nError string: " + fail_reason +

"\n" + "Error Code: " + parseInt(fail_error_code));}document.get_note_owner.note_owner.value = ("Note ItemType: " +

ret.ItemType + "\n" + "Note Owner ID: " + ret.NoteOwnerID );}

</script></head><body>

Page 242: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 10 Pro/Web.Link User’s Guide

<script src="wl_header_form.js">document.writeln("Error loading Web-Link header form<p>");</script>

<title>Web.Link 3D Notes</title><form name = "get_notes"><h4>Get Notes</h4><p><center>

<!-- Buttons --><input type = "button" value = "Get Model Notes"

onclick = "MdlNotesGet()"><p><!-- Output Arguments --><textarea name = "list_model_notes" value = "" rows = 4

cols = 50></textarea><p></center><hr>

<b>Get Feature Notes</b><p><center>Feature ID:

<!-- Input Arguments --><input type = "text" name = "get_feat_id"><p><!-- Buttons --><input type = "button" value = "Get Feature Note IDs"

onclick = "FeatureNotesGet()"><p>

<!-- Output Arguments --><textarea name = "list_feature_notes" value = "" rows = 4

cols = 50></textarea></center><p><hr></form>

<form name = "get_set_note_name"><h4>Get and Set Note Names</h4><p><center>

Note ID:<!-- Input Arguments --><input type = "text" name = "get_note_id" size = "8"><input type = "button" name="get_note_id_triger" value="Get Name"

onClick = "NoteNameGet(get_note_id.value)"><p>

<!-- Output Arguments --><input type = "text" name = "list_note_name" value = ""><p>

Note ID:<input type = "text" name = "get_id_to_change" size = "8">

Page 243: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Notes 18 - 11

No

tes

New Note Name:<input type = "text" name = "new_note_name"><p><input type = "button" name="set_note_name_triger" value="Set Name"

onClick = "NoteNameSet(get_id_to_change.value)"><p><hr></center></form>

<form name = "get_set_note_text"><h4>Get and Set Note Text</h4><p><center>Note ID:

<!-- Input Arguments --><input type = "text" name = "get_note_id" size = "8"><input type = "button" value = "Get Note Text"

onClick = "NoteTextGet(get_note_id.value)"><p>

<!-- Output Arguments --><textarea name = "list_note_text" value = "" rows = 4 cols = 50></textarea><br>

Note ID:

<!-- Input Arguments --><input type = "text" name = "get_id_to_change">

<!-- Buttons --><input type = "button" value = "Set Note Text to Generic Note"

onclick = "NoteTextSet()"><p><hr></center></form>

<form name = "get_set_note_url"><h4>Get and Set Note URLs</h4><p><center>Note ID:

<!-- Input Arguments --><input type = "text" name = "get_note_id" size = "8"><input type = "button" value = "Get Note URL"

onClick = "NoteURLGet(get_note_id.value)"><p>

<!-- Output Arguments --><input type = "text" name = "list_note_url" value = ""><p><br>

Note ID:

Page 244: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 12 Pro/Web.Link User’s Guide

<!-- Input Arguments --><input type = "text" name = "get_id_to_change"><br>

New Note URL:<input type = "text" name = "new_note_url" size = "60"><input type = "button" value = "Set Note URL"

onClick = "NoteURLSet(new_note_url.value)"><p><hr></center></form>

<form name = "get_note_owner"><h4>Get Note Owner</h4><p><center>Note ID:

<!-- Input Arguments --><input type = "text" name = "get_note_id" size = "8"><input type = "button" value = "Get Note Owner"

onClick = "NoteOwnerGet(get_note_id.value)"><p>

<!-- Output Arguments --><input type = "text" name = "note_owner" value = ""><p></center></form></body><applet code=WebLink.class name='pwl' width=2 height=2></applet><embed type=application/x-proconnect name='pwc' width=2 height=2></embed></html>

The following figures show the results of this example, as seen in the browser. Note that the first figure (the top of the Web page) does not include the standard header. See Pro/Web.Link Examples for more information on the wl_header.js header.

Page 245: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Notes 18 - 13

No

tes

Figure 18-1

Page 246: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 14 Pro/Web.Link User’s Guide

Figure 18-2

Page 247: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Notes 18 - 15

No

tes

Figure 18-3

Page 248: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

18 - 16 Pro/Web.Link User’s Guide

Page 249: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 1

AQuick Reference

This appendix provides a quick reference to all the Pro/Web.Link functions and a summary of technical changes for the current release of the product.

Topic Page

Table of Functions

Summary of Technical Changes

Page 250: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 2 Pro/Web.Link User’s Guide

Table of FunctionsThe following table lists all the Pro/Web.Link functions. For ease of use, the functions are presented in alphabetical order.

The security access codes are as follows:

• PR—Pro/ENGINEER read

• PW—Pro/ENGINEER write

• DR—Disk read

• DW—Disk write

Function Description

pwlAccessRequestin Setting the Security Access

Requests some level of access from Pro/ENGINEER.Access: Any

pwlApplicationStartin Starting an Application

Starts any application defined in the config.pwl file.Access: Any

pwlAssemblyComponentsGetin Assembly Components

Lists the member components of the assembly.Access: PR

pwlAssemblyComponentReplace in Assembly Components

Enables you to replace one component for another.Access: PR, PW

pwlAssemblyExplodeDefaultSet in Exploded Assemblies

Sets the assembly to use the default component locations when it is exploded.Access: PR, PW

pwlAssemblyExplodeStateSet in Exploded Assemblies

Sets the explode state for the specified assembly.Access: PR, PW

pwlAssemblyExplodeStatesGet in Exploded Assemblies

Gets the number and names of the explode states for the specified model.Access: PR

pwlAssemblyExplodeStatusGet in Exploded Assemblies

Gets the explode status for the specified assembly (true or false).Access: PR

Page 251: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Quick Reference A - 3

Qu

ick Referen

ce

pwlAssemblyExplodeStatusSet in Exploded Assemblies

Sets the explode status for the specified assembly.Access: PR, PW

pwlDimensionInfoGetByIDin Reading and Modifying Dimensions

Returns dimension information for the specified dimension, given its identifier.Access: PR

pwlDimensionInfoGetByName in Reading and Modifying Dimensions

Returns dimension information for the specified dimension, given its name.Access: PR

pwlDimensionToleranceSetByID in Dimension Tolerance

Sets the tolerance for the specified dimension.Access: PR, PW

pwlDimensionValueSetByID in Reading and Modifying Dimensions

Sets the dimension value of the specified dimension identifier.Access: PR, PW

pwlDirectoryCurrentGet in Manipulating Directories

Gets the current directory.Access: PR

pwlDirectoryCurrentSet in Manipulating Directories

Sets the current directory.Access: PW

pwlDirectoryFilesGet in Manipulating Directories

Lists the files and subdirectories in the specified directory.Access: PR, DR

pwlEnvVariableGet in Environment Variables

Gets the value of the specified environment variable.Access: Any

pwlFamtabInstanceAdd in Adding and Deleting Family Table Instances

Creates a new instance in the table.Access: PR, PW

pwlFamtabInstanceLockAddin Locking Family Table Instances

Locks the instance for modification.Access: PR, PW

pwlFamtabInstanceLockGetin Locking Family Table Instances

Specifies whether the specified instance is locked for modification (true or false).Access: PR

pwlFamtabInstanceLockRemovein Locking Family Table Instances

Removes the lock from the specified instance.Access: PR, PW

Function Description

Page 252: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 4 Pro/Web.Link User’s Guide

pwlFamtabInstanceRemove in Adding and Deleting Family Table Instances

Removes an existing instance from a family table.Access: PR, PW

pwlFamtabInstancesGet in Adding and Deleting Family Table Instances

Gets the instance names for the specified family table.Access: PR

pwlFamtabInstanceValueGet in Family Table Instance Values

Gets the values of the specified instance and item.Access: PR

pwlFamtabInstanceValueSet in Family Table Instance Values

Sets the values for the specified instance.Access: PR, PW

pwlFamtabItemAdd in Family Table Items

Adds an item to the family table.Access: PR, PW

pwlFamtabItemdataGet See Family Table Items

Parses the item string to extract the identifier and name.Access:

pwlFamtabItemRemove in Family Table Items

Removes the specified item from the family table.Access: PR, PW

pwlFamtabItemsGet in Family Table Items

Gets the items from the specified family table.Access: PR

pwlFeatureChildrenGet in Feature Inquiry

Gets the children of the specified feature.Access: PR

pwlFeatureDeleteByID in Deleting Features

Deletes a feature, given its identifier.Access: PR, PW

pwlFeatureDeleteByIDList in Deleting Features

Deletes the features in the specified list of identifiers.Access: PR, PW

pwlFeatureDeleteByLayer in Deleting Features

Delete the feature, given its layer.Access: PR, PW

pwlFeatureDeleteByName in Deleting Features

Deletes the feature, given its name.Access: PR, PW

pwlFeatureDimensionsGet in Reading and Modifying Dimensions

Gets all the dimensions for the specified feature.Access: PR

Function Description

Page 253: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Quick Reference A - 5

Qu

ick Referen

ce

pwlFeatureInfoGetByID in Feature Inquiry

Gets the feature information, given the feature identifier.Access: PR

pwlFeatureInfoGetByName in Feature Inquiry

Gets the feature information, given the feature name.Access: PR

pwlFeatureNameGetByID in Feature Names

Gets the name of the feature, given its identifier.Access: PR

pwlFeatureNameSetByID in Feature Names

Sets the name of the specified feature.Access: PR, PW

pwlFeatureNotesGet in Notes Inquiry

Provides the number and a list of all the note identifiers for the specified feature in the model.Access: PR

pwlFeatureParametersDisplayin Displaying Parameters

Shows the specified parameter types for a feature in the graphics window.Access: PR, PW

pwlFeatureParametersGet in Listing Parameters

Gets the parameters of the specified feature.Access: PR

pwlFeatureParentsGet in Feature Inquiry

Gets the parents of the specified feature.Access: PR

pwlFeatureResumeByID in Resuming Features

Resumes the feature with the specified identifier.Access: PR, PW

pwlFeatureResumeByIDList in Resuming Features

Resumes the features in the specified list of identifiers.Access: PR, PW

pwlFeatureResumeByLayer in Resuming Features

Resumes all the features on the specified layer.Access: PR, PW

pwlFeatureResumeByName in Resuming Features

Resumes the feature, given its name.Access: PR, PW

Function Description

Page 254: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 6 Pro/Web.Link User’s Guide

pwlFeatureStatusGet in Feature Inquiry

Gets the status of the specified feature.Access: PR

pwlFeatureSuppressByID in Suppressing Features

Suppresses the feature with the specified identifier.Access: PR, PW

pwlFeatureSuppressByIDList in Suppressing Features

Suppresses the features in the specified list of identifiers.Access: PR, PW

pwlFeatureSuppressByLayer in Suppressing Features

Suppresses all the features on the specified layer.Access: PR, PW

pwlFeatureSuppressByName in Suppressing Features

Suppresses the feature, given its name.Access: PR, PW

pwlGeomSimprepActivate in Activating Simplified Representations

Activates the geometry simplified representation of the specified part or assembly.Access: PR, PW

pwlGeomSimprepOpen in Retrieving Simplified Representations

Retrieves the geometry of the specified part or assembly.Access: PR, PW, DR

pwlGraphicsSimprepActivate in Activating Simplified Representations

Activates the graphics simplified representation of the specified part or assembly.Access: PR, PW

pwlGraphicsSimprepOpen in Retrieving Simplified Representations

Retrieves the graphics of the specified part or assembly.Access: PR, PW, DR

pwlInstanceErase in File Management Functions for Instances

Erases an instance model from memoryAccess: PR, PW

pwlInstanceOpen in File Management Functions for Instances

Opens an instance model in memory.Access: PR, PW

pwlItemHighlight in Highlighting

Highlights the specified item.Access: PR, PW

pwlItemIDToName in Model Items

Gets the name of the item, given its identifier and type.Access: PR

Function Description

Page 255: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Quick Reference A - 7

Qu

ick Referen

ce

pwlItemNameToID in Model Items

Gets the item identifier, given the item name and type.Access: PR

pwlItemNameSetByID in Model Items

Sets the name of an item.Access: PW

pwlItemUnhighlight in Highlighting

Removes the highlighting from the specified item.Access: PR, PW

pwlLayerCreate in Layer Functions

Creates a layer with the specified name.Access: PR, PW

pwlLayerDelete in Layer Functions

Deletes the specified layer.Access: PR, PW

pwlLayerDisplayGet in Layer Functions

Returns the display type of the specified layer.Access: PR, PW

pwlLayerDisplaySet in Layer Functions

Sets the display type of the specified layer.Access: PR, PW

pwlLayerItemAdd in Layer Functions

Adds an item to the specified layer.Access: PR, PW

pwlLayerItemRemove in Layer Functions

Removes an item from the specified layer.Access: PR, PW

pwlLayerItemsGet in Layer Functions

Lists the items assigned to the specified layer.Access: PR

pwlMdlCurrentGetin Model Management

Retrieves the current model in session.Access: PR

pwlLayerRename See Layer Functions

Renames the specified layer.

pwlMdlDependenciesGet in Model Management

Lists all the top-level dependencies.Access: PR

pwlMdlDimensionsGet in Reading and Modifying Dimensions

Gets the dimensions with the specified name and type.Access: PR

pwlMdlErase in File Management Operations

Removes the model from memory.Access: PR, PW

Function Description

Page 256: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 8 Pro/Web.Link User’s Guide

pwlMdlFeaturesGet in Feature Inquiry

Returns all the features that are visible to the end-user, including suppressed features.Access: PR

pwlMdlInfoGet in Model Management

Returns information about the specified model.Access: PR

pwlMdlIntralinkInfoGet in Model Management

Gets information about the Pro/INTRALINK model.Access: PR

pwlMdlLayersGet in Layer Functions

Gets the layers for the specified model.Access: PR

pwlMdlNotesGet in Notes Inquiry

Gets the notes for the specified model.Access: PR

pwlMdlOpen in File Management Operations

Retrieves a model from disk into memory.Access: PR, PW, DR

pwlMdlParametersGet in Listing Parameters

Gets the parameters for the specified model.Access: PR

pwlMdlRegenerate in Model Management

Regenerates the specified model.Access: PR

pwlMdlRename in File Management Operations

Renames a model on disk.Access: PR, PW, DR, DW

pwlMdlSave in File Management Operations

Saves the model in memory to disk.Access: PR, DW

pwlMdlSaveAs in File Management Operations

Saves the model in memory to disk under a new name. Access: PR, PW, DW

pwlMdlSimprepsGet in Retrieving Simplified Representations

Gets all the simplified representations in the specified model.Access: PR

pwlMdlViewsGet in Views

Gets all the named views.Access: PR

Function Description

Page 257: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Quick Reference A - 9

Qu

ick Referen

ce

pwlNoteNameGet in Note Names

Gets the name of the note, given its identifier.Access: PR

pwlNoteNameSet in Note Names

Sets the name of a note.Access: PR, PW

pwlNoteOwnerGet in Notes Inquiry

Gets the owner of the specified note.Access: PR

pwlNoteTextGet in Note Text

Gets the text of the specified note.Access: PR

pwlNoteTextSet in Note Text

Sets the text of a note.Access: PR, PW

pwlNoteURLGet in Note URLs

Gets the URL for the specified note.Access: PR

pwlNoteURLSet in Note URLs

Sets the URL for a note.Access: PR, PW

pwlObjMdlsCheckOutin Checking Out Pro/INTRALINK Objects

Checks out Pro/INTRALINK objects from the Commonspace to a Workspace.Access: DW

pwlParameterCreate in Reading and Modifying Parameters

Creates a parameter.Access: PR, PW

pwlParameterDelete in Reading and Modifying Parameters

Deletes the specified parameter.Access: PR, PW

pwlParameterDesignationAdd in Designating Parameters

Designates an existing parameter for use with Pro/INTRALINK or Pro/PDM.Access: PR, PW

pwlParameterDesignationRemove in Designating Parameters

Removes the designation from the specified parameter.Access: PR, PW

pwlParameterDesignationVerify in Designating Parameters

Specifies whether the parameter is designated for Pro/INTRALINK or Pro/PDM.Access: PR

pwlParameterRename in Reading and Modifying Parameters

Renames the specified parameter.Access: PR, PW

Function Description

Page 258: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 10 Pro/Web.Link User’s Guide

pwlParameterReset in Reading and Modifying Parameters

Resets the value of the previously modified parameter to the backup value.Access: PR, PW

pwlParameterValueGet in Reading and Modifying Parameters

Gets the value of the specified parameter.Access: PR

pwlParameterValueSet in Reading and Modifying Parameters

Sets the value of a parameter.Access: PR, PW

pwlPartMaterialCurrentGetin Setting Materials

Gets the name of the current material used by the specified model.Access: PR

pwlPartMaterialCurrentSetin Setting Materials

Sets the material for a part. Note that the material must already be associated with the part, or the function will fail.Access: PR, PW

pwlPartMaterialdataGet in Setting Materials

Gets the material data for the specified part.Access: PR

pwlPartMaterialdataSet in Setting Materials

Sets the material data for a part.Access: PR, PW

pwlPartMaterialSet in Setting Materials

Sets the current material.Access: PR, PW

pwlPartMaterialsGet in Setting Materials

Lists the names of all the materials in the specified part.Access: PR

pwlProEngineerConnect in Connecting to Pro/ENGINEER

Connects to a Pro/ENGINEER session that is already running.Access: Any

pwlProEngineerDisconnect in Disconnecting from Pro/ENGINEER

Disconnects from Pro/ENGINEER.Access: Any

pwlProEngineerDisconnectAndStop in Disconnecting from Pro/ENGINEER

Disconnects and terminates the Pro/ENGINEER session.Access: Any

pwlProEngineerStartAndConnect in Connecting to Pro/ENGINEER

Connects to Pro/ENGINEER and starts a session.Access: Any

Function Description

Page 259: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Quick Reference A - 11

Qu

ick Referen

ce

pwlSelect in Selection Functions

Enables the user to select an object.Access: PR

pwlSelectionCreatein Selection Functions

Creates a selection string.Access: Any

pwlSelectionParsein Selection Functions

Parses a selection string.Access: Any

pwlSessionMdlsGet in Model Management

List all the models with the specified type that are in session.Access: PR

pwlSessionWindowsGet in Windows

Gets the identifiers of the session windows.Access: PR

pwlSimprepActivate in Activating Simplified Representations

Activates the specified simplified representation.Access: PR, PW

pwlSimprepMasterActivate in Activating Simplified Representations

Activates the master simplified representation.Access: PR, PW

pwlSimprepOpen in Retrieving Simplified Representations

Retrieves the specified simplified representation.Access: PR, PW, DR

pwlSolidMassPropertiesGet in Mass Properties

Provides information about the distribution of mass in the specified part or assembly.Access: PR

pwlSolidXSectionDisplay in Cross Sections

Displays the specified cross section.Access: PR, PW

pwlSolidXSectionsGet in Cross Sections

Returns all the cross sections on the specified part or assembly.Access: PR

pwlViewDefaultSet in Views

Sets the view of the specified model to the default value.Access: PR, PW

pwlViewSetin Views

Sets the view for the specified model.Access: PR, PW

Function Description

Page 260: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 12 Pro/Web.Link User’s Guide

pwlWindowActivate in Windows

Equivalent to selecting Window, Activate from the menu bar.Access: PW

pwlWindowActiveGet in Windows

Gets the identifier of the currently active window.Access: PR

pwlWindowClosein Windows

Closes the specified window.Access: PW

pwlWindowMdlGet in Windows

Gets the name of the model, given the window identifier.Access: PR

pwlWindowRepaint in Windows

Repaints the specified window.Access: PW

pwluBooleanArrayAllocin Allocating Arrays

Allocates an array of Boolean values of the specified size.Access: Any

pwluDoubleArrayAlloc in Allocating Arrays

Allocates an array of doubles of the specified size.Access: Any

pwluIntArrayAlloc in Allocating Arrays

Allocates an array of integers of the specified size.Access: Any

pwluStringArrayAlloc in Allocating Arrays

Allocates an array of strings of the specified size.Access: Any

Function Description

Page 261: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Quick Reference A - 13

Qu

ick Referen

ce

Summary of Technical ChangesThe following sections summarize the changes to Release 20.0 of Pro/Web.Link.

New Functions

Release 20.0 introduces functionality for the following items:

• Family tables

• Layers

• Notes

The following table lists the corresponding new functions:

Function Description

Family Table Functions

pwlFamtabInstanceAdd Creates a new instance in the table.

pwlFamtabInstanceLockAdd Locks the instance for modification.

pwlFamtabInstanceLockGet Specifies whether the specified instance is locked for modification (true or false).

pwlFamtabInstanceLockRemove Removes the lock from the specified instance.

pwlFamtabInstanceRemove Removes an existing instance from a family table.

pwlFamtabInstancesGet Gets the instance names for the specified family table.

pwlFamtabInstanceValueGet Gets the values of the specified instance and item.

pwlFamtabInstanceValueSet Sets the values for the specified instance.

pwlFamtabItemAdd Sets the values for the specified instance.

pwlFamtabItemsGet Gets the items from the specified family table.

pwlFamtabItemRemove Removes the specified item from the family table.

pwlInstanceErase Erases an instance model from memory

Page 262: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 14 Pro/Web.Link User’s Guide

pwlInstanceOpen Opens an instance model in memory.

Layer Functions

pwlLayerCreate Creates a layer with the specified name.

pwlLayerDelete Deletes the specified layer.

pwlLayerDisplayGet Returns the display type of the specified layer.

pwlLayerDisplaySet Sets the display type of the specified layer.

pwlLayerItemAdd Adds an item to the specified layer.

pwlLayerItemsGet Lists the items assigned to the specified layer.

pwlLayerItemRemove Removes an item from the specified layer.

pwlMdlLayersGet Gets the layers for the specified model.

Note Functions

pwlFeatureNotesGet Provides the number and a list of all the note identifiers for the specified feature in the model.

pwlMdlNotesGet Gets the notes for the specified model.

pwlNoteNameGet Gets the name of the note, given its identifier.

pwlNoteNameSet Sets the name of a note.

pwlNoteOwnerGet Gets the owner of the specified note.

pwlNoteTextGet Gets the text of the specified note.

pwlNoteTextSet Sets the text of a note.

pwlNoteURLGet Gets the URL for the specified note.

pwlNoteURLSet Sets the URL for a note.

Function Description

Page 263: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Quick Reference A - 15

Qu

ick Referen

ce

Superseded FunctionsThe following function is superseded in Release 20.0:

• pwlPartMaterialGet—Replaced by pwlPartMaterialCurrentGet.

Page 264: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

A - 16 Pro/Web.Link User’s Guide

Page 265: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

B - 17

BError Codes

This appendix provides a listing of all Pro/Web.Link error codes and the values associated with them.

Topic Page

Error Codes

Page 266: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

B - 18 Pro/Web.Link User’s Guide

Error CodesPWL_ABORT = -25;PWL_BAD_CONTEXT = -8;PWL_BAD_DIM_ATTACH = -46;PWL_BAD_INPUTS = -2;PWL_BAD_SRF_CRV = -44;PWL_BSPL_MULTI_INNER_KNOTS = -43;PWL_BSPL_NON_STD_END_KNOTS = -42;PWL_BSPL_UNSUITABLE_DEGREE = -41;PWL_CANT_ACCESS = -33;PWL_CANT_MODIFY = -48;PWL_CANT_OPEN = -24;PWL_CANT_WRITE = -17;PWL_CHECKOUT_CONFLICT = -49;PWL_COMM_ERROR = -11;PWL_CONTINUE = -7;PWL_CRE_VIEW_BAD_EXPLODE = -54;PWL_CRE_VIEW_BAD_MODEL = -51;PWL_CRE_VIEW_BAD_PARENT = -52;PWL_CRE_VIEW_BAD_SHEET = -50;PWL_CRE_VIEW_BAD_TYPE = -53;PWL_DIMENSION_REFERENCE = 202;PWL_DIMENSION_STANDARD = 201;PWL_DISPLAY_TYPE_BLANK = 3;PWL_DISPLAY_TYPE_DISPLAY = 2;PWL_DISPLAY_TYPE_HIDDEN = 4;PWL_DISPLAY_TYPE_NONE = 0;PWL_DISPLAY_TYPE_NORMAL = 1;PWL_E_AMBIGUOUS = -36;PWL_E_BUSY = -38;PWL_E_DEADLOCK = -37;PWL_E_FOUND = -5;PWL_E_IN_USE = -39;PWL_E_NOT_FOUND = -4;PWL_EMPTY = -45;PWL_ERROR_INVALID_SELSTRING = -1001;PWL_ERROR_NOT_IN_SESSION = -1000;PWL_EXEC_NOT_FOUND = 1;PWL_GENERAL_ERROR = -1;PWL_INVALID_DIR = -15;PWL_INVALID_FILE = -16;PWL_INVALID_ITEM = -27;

Page 267: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Error Codes B - 19

Erro

r Co

des

PWL_INVALID_MATRIX = -21;PWL_INVALID_NAME = -22;PWL_INVALID_PTR = -19;PWL_INVALID_SELSTRING = -1001;PWL_INVALID_TYPE = -18;PWL_LAYER_TYPE_BLANK = 3;PWL_LAYER_TYPE_DISPLAY = 2;PWL_LAYER_TYPE_HIDDEN = 4;PWL_LAYER_TYPE_NONE = 0;PWL_LAYER_TYPE_NORMAL = 1;PWL_LINE_TOO_LONG = -6;PWL_MSG_FMT_ERROR = -30;PWL_MSG_NO_TRANS = -29;PWL_MSG_NOT_FOUND = -28;PWL_MSG_TOO_LONG = -32;PWL_MSG_USER_QUIT = -31;PWL_NO_ACCESS = 2;PWL_NO_CHANGE = -12;PWL_NO_COORD_SYSTEM = -35;PWL_NO_ERROR = 0;PWL_NO_LICENSE = -40;PWL_NOT_DISPLAYED = -47;PWL_NOT_EXIST = -23;PWL_NOT_IMPLEMENTED = -9;PWL_NOT_IN_SESSION = -1000;PWL_NOT_VALID = -26;PWL_OBSOLETE_FUNC = -34;PWL_OUT_OF_MEMORY = -10;PWL_PICK_ABOVE = -14;PWL_REGEN_AGAIN = -56;PWL_SUPP_PARENTS = -13;PWL_UNATTACHED_FEATS = -55;PWL_UNAV_SEC = -20;PWL_USER_ABORT = -3;PWL_VALUE_BOOLEAN = 104;PWL_VALUE_DOUBLE = 101;PWL_VALUE_INTEGER = 103;PWL_VALUE_NOTEID = 105;PWL_VALUE_STRING = 102;

Page 268: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

B - 20 Pro/Web.Link User’s Guide

Page 269: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

C - 1

CPro/Web.Link Constants

This appendix lists the constants defined for Pro/Web.Link. The constants are arranged by alphabetically by category (Dimension Styles, Dimension Types, Family Table Types, and so on).

Topic Page

Dimension Styles

Dimension Types

Family Table Types

Feature Group Pattern Statuses

Feature Group Statuses

Feature Pattern Statuses

Feature Types

Layer Display Types

Object Types

Parameter Types

ParamType Field Values

ParamValue Values

Tolerance Types

Page 270: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

C - 2 Pro/Web.Link User’s Guide

Dimension Styles

Dimension Types

Family Table Types

Constant Description

PWL_LINEAR_DIM Linear dimension

PWL_RADIAL_DIM Radial dimension

PWL_DIAMETRICAL_DIM Diametrical dimension

PWL_ANGULAR_DIM Angular dimension

PWL_UNKNOWN_STYLE_DIM Unknown dimension

Constant Description

PWL_DIMENSION_STANDARD Standard dimension

PWL_DIMENSION_REFERENCE Reference dimension

Constant Description

PWL_FAM_TYPE_UNUSED Unused

PWL_FAM_USER_PARAM User parameter

PWL_FAM_DIMENSION Dimension

PWL_FAM_IPAR_NOTE IPAR note

PWL_FAM_FEATURE Feature

PWL_FAM_ASMCOMP Assembly component

PWL_FAM_UDF User-defined feature

PWL_FAM_ASMCOMP_MODEL Assembly component model

PWL_FAM_GTOL Geometric tolerance

PWL_FAM_TOL_PLUS Displays the nominal tolerance with a plus

PWL_FAM_TOL_MINUS Displays the nominal tolerance with a minus

PWL_FAM_TOL_PLUSMINUS Displays the nominal tolerance with a plus/minus

Page 271: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Constants C - 3

Pro

/Web

.Lin

k C

on

stants

Feature Group Pattern Statuses

Feature Group Statuses

Feature Pattern Statuses

PWL_FAM_SYSTEM_PARAM System parameter

PWL_FAM_EXTERNAL_REFERENCE External reference

Constant Description

PWL_GRP_PATTERN_INVALID Invalid group pattern.

PWL_GRP_PATTERN_NONE The feature is not in a group pattern.

PWL_GRP_PATTERN_LEADER The feature is the leader of the group pattern.

PWL_GRP_PATTERN_MEMBER The feature is a member of the group pattern.

Constant Description

PWL_GROUP_INVALID Invalid group.

PWL_GROUP_NONE The feature is not in a group pattern.

PWL_GROUP_MEMBER The feature is in a group that is a group pattern member.

Constant Description

PWL_PATTERN_INVALID Invalid pattern.

PWL_PATTERN_NONE The feature is not in a pattern.

PWL_PATTERN_LEADER The feature is the leader of a pattern.

PWL_PATTERN_MEMBER The feature is a member of the pattern.

Constant Description

Page 272: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

C - 4 Pro/Web.Link User’s Guide

Feature Types

Constant Feature Type

PWL_FEAT_FIRST_FEAT First feature

PWL_FEAT_HOLE Hole

PWL_FEAT_SHAFT Shaft

PWL_FEAT_ROUND Round

PWL_FEAT_CHAMFER Chamfer

PWL_FEAT_SLOT Slot

PWL_FEAT_CUT Cut

PWL_FEAT_PROTRUSION Protrusion

PWL_FEAT_NECK Neck

PWL_FEAT_FLANGE Flange

PWL_FEAT_RIB Rib

PWL_FEAT_EAR Ear

PWL_FEAT_DOME Dome

PWL_FEAT_DATUM Datum

PWL_FEAT_LOC_PUSH Local push

PWL_FEAT_FEAT_UDF User-defined feature (UDF)

PWL_FEAT_DATUM_AXIS Datum axis

PWL_FEAT_DRAFT Draft

PWL_FEAT_SHELL Shell

PWL_FEAT_DOME2 Second dome

PWL_FEAT_CORN_CHAMF Corner chamfer

PWL_FEAT_DATUM_POINT Datum point

PWL_FEAT_IMPORT Import

PWL_FEAT_COSMETIC Cosmetic

PWL_FEAT_ETCH Etch

PWL_FEAT_MERGE Merge

PWL_FEAT_MOLD Mold

PWL_FEAT_SAW Saw

PWL_FEAT_TURN Turn

PWL_FEAT_MILL Mill

Page 273: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Constants C - 5

Pro

/Web

.Lin

k C

on

stants

PWL_FEAT_DRILL Drill

PWL_FEAT_OFFSET Offset

PWL_FEAT_DATUM_SURF Datum surface

PWL_FEAT_REPLACE_SURF Replacement surface

PWL_FEAT_GROOVE Groove

PWL_FEAT_PIPE Pipe

PWL_FEAT_DATUM_QUILT Datum quilt

PWL_FEAT_ASSEM_CUT Assembly cut

PWL_FEAT_UDF_THREAD Thread

PWL_FEAT_CURVE Curve

PWL_FEAT_SRF_MDL Surface model

PWL_FEAT_WALL Wall

PWL_FEAT_BEND Bend

PWL_FEAT_UNBEND Unbend

PWL_FEAT_CUT_SMT Sheetmetal cut

PWL_FEAT_FORM Form

PWL_FEAT_THICKEN Thicken

PWL_FEAT_BEND_BACK Bend back

PWL_FEAT_UDF_NOTCH UDF notch

PWL_FEAT_UDF_PUNCH UDF punch

PWL_FEAT_INT_UDF For internal use

PWL_FEAT_SPLIT_SURF Split surface

PWL_FEAT_GRAPH Graph

PWL_FEAT_SMT_MFG_PUNCH Sheetmetal manufacturing punch

PWL_FEAT_SMT_MFG_CUT Sheetmetal manufacturing cut

PWL_FEAT_FLATTEN Flatten

PWL_FEAT_SET Set

PWL_FEAT_VDA VDA

PWL_FEAT_SMT_MFG_FORM Sheetmetal manufacturing for milling

PWL_FEAT_SMT_PUNCH_PNT Sheetmetal punch point

Constant Feature Type

Page 274: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

C - 6 Pro/Web.Link User’s Guide

PWL_FEAT_LIP Lip

PWL_FEAT_MANUAL Manual

PWL_FEAT_MFG_GATHER Manufacturing gather

PWL_FEAT_MFG_TRIM Manufacturing trim

PWL_FEAT_MFG_USEVOL Manufacturing use volume

PWL_FEAT_LOCATION Location

PWL_FEAT_CABLE_SEGM Cable segment

PWL_FEAT_CABLE Cable

PWL_FEAT_CSYS Coordinate system

PWL_FEAT_CHANNEL Channel

PWL_FEAT_WIRE_EDM Wire EDM

PWL_FEAT_AREA_NIBBLE Area nibble

PWL_FEAT_PATCH Patch

PWL_FEAT_PLY Ply

PWL_FEAT_CORE Core

PWL_FEAT_EXTRACT Extract

PWL_FEAT_MFG_REFINE Manufacturing refine

PWL_FEAT_SILH_TRIM Silhouette trim

PWL_FEAT_SPLIT Split

PWL_FEAT_EXTEND Extend

PWL_FEAT_SOLIDIFY Solidify

PWL_FEAT_INTERSECT Intersect

PWL_FEAT_ATTACH Attach

PWL_FEAT_XSEC Cross section

PWL_FEAT_UDF_ZONE UDF zone

PWL_FEAT_UDF_CLAMP UDF clamp

PWL_FEAT_DRL_GRP Drill group

PWL_FEAT_ISEGM Ideal segment

PWL_FEAT_CABLE_COSM Cable cosmetic

PWL_FEAT_SPOOL Spool

PWL_FEAT_COMPONENT Component

PWL_FEAT_MFG_MERGE Manufacturing merge

Constant Feature Type

Page 275: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Constants C - 7

Pro

/Web

.Lin

k C

on

stants

PWL_FEAT_FIXSETUP Fixture setup

PWL_FEAT_SETUP Setup

PWL_FEAT_FLAT_PAT Flat pattern

PWL_FEAT_CONT_MAP Contour map

PWL_FEAT_EXP_RATIO Exponential ratio

PWL_FEAT_RIP Rip

PWL_FEAT_OPERATION Operation

PWL_FEAT_WORKCELL Workcell

PWL_FEAT_CUT_MOTION Cut motion

PWL_FEAT_BLD_PATH Build path

PWL_FEAT_DRV_TOOL_SKETCH Driven tool sketch

PWL_FEAT_DRV_TOOL_EDGE Driven tool edge

PWL_FEAT_DRV_TOOL_CURVE Driven tool curve

PWL_FEAT_DRV_TOOL_SURF Driven tool surface

PWL_FEAT_MAT_REMOVAL Material removal

PWL_FEAT_TORUS Torus

PWL_FEAT_PIPE_SET_START Piping set start point

PWL_FEAT_PIPE_PNT_PNT Piping point

PWL_FEAT_PIPE_EXT Pipe extension

PWL_FEAT_PIPE_TRIM Pipe trim

PWL_FEAT_PIPE_FOLL Follow (pipe routing)

PWL_FEAT_PIPE_JOIN Pipe join

PWL_FEAT_AUXILIARY Auxiliary

PWL_FEAT_PIPE_LINE Pipe line

PWL_FEAT_LINE_STOCK Line stock

PWL_FEAT_SLD_PIPE Solid pipe

PWL_FEAT_BULK_OBJECT Bulk object

PWL_FEAT_SHRINKAGE Shrinkage

PWL_FEAT_PIPE_JOINT Pipe joint

PWL_FEAT_PIPE_BRANCH Pipe branch

PWL_FEAT_DRV_TOOL_TWO_CNTR Driven tool (two centers)

PWL_FEAT_SUBHARNESS Subharness

Constant Feature Type

Page 276: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

C - 8 Pro/Web.Link User’s Guide

PWL_FEAT_SMT_OPTIMIZE Sheetmetal optimize

PWL_FEAT_DECLARE Declare

PWL_FEAT_SMT_POPULATE Sheetmetal populate

PWL_FEAT_OPER_COMP Operation component

PWL_FEAT_MEASURE Measure

PWL_FEAT_DRAFT_LINE Draft line

PWL_FEAT_REMOVE_SURFS Remove surfaces

PWL_FEAT_RIBBON_CABLE Ribbon cable

PWL_FEAT_ATTACH_VOLUME Attach volume

PWL_FEAT_BLD_OPERATION Build operation

PWL_FEAT_UDF_WRK_REG UDF working region

PWL_FEAT_SPINAL_BEND Spinal bend

PWL_FEAT_TWIST Twist

PWL_FEAT_FREE_FORM Free-form

PWL_FEAT_ZONE Zone

PWL_FEAT_WELDING_ROD Welding rod

PWL_FEAT_WELD_FILLET Welding fillet

PWL_FEAT_WELD_GROOVE Welding groove

PWL_FEAT_WELD_PLUG_SLOT Welding plug slot

PWL_FEAT_WELD_SPOT Welding spot

PWL_FEAT_SMT_SHEAR Sheetmetal shear

PWL_FEAT_PATH_SEGM Path segment

PWL_FEAT_RIBBON_SEGM Ribbon segment

PWL_FEAT_RIBBON_PATH Ribbon path

PWL_FEAT_RIBBON_EXTEND Ribbon extend

PWL_FEAT_ASMCUT_COPY Assembly cut copy

PWL_FEAT_DEFORM_AREA Deform area

PWL_FEAT_RIBBON_SOLID Ribbon solid

PWL_FEAT_FLAT_RIBBON_SEGM Flat ribbon segment

PWL_FEAT_POSITION_FOLD Position fold

PWL_FEAT_SPRING_BACK Spring back

PWL_FEAT_BEAM_SECTION Beam section

Constant Feature Type

Page 277: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Constants C - 9

Pro

/Web

.Lin

k C

on

stants

Layer Display Types

PWL_FEAT_SHRINK_DIM Shrink dimension

PWL_FEAT_THREAD Thread

PWL_FEAT_SMT_CONVERSION Sheetmetal conversion

PWL_FEAT_CMM_MEASSTEP CMM measured step

PWL_FEAT_CMM_CONSTR CMM construct

PWL_FEAT_CMM_VERIFY CMM verify

PWL_FEAT_CAV_SCAN_SET CAV scan set

PWL_FEAT_CAV_FIT CAV fit

PWL_FEAT_CAV_DEVIATION CAV deviation

PWL_FEAT_SMT_ZONE Sheetmetal zone

PWL_FEAT_SMT_CLAMP Sheetmetal clamp

PWL_FEAT_PROCESS_STEP Process step

PWL_FEAT_EDGE_BEND Edge bend

PWL_FEAT_DRV_TOOL_PROF Drive tool profile

PWL_FEAT_EXPLODE_LINE Explode line

PWL_FEAT_GEOM_COPY Geometric copy

PWL_FEAT_ANALYSIS Analysis

PWL_FEAT_WATER_LINE Water line

PWL_FEAT_UDF_RMDT Rapid mold design tool

PWL_FEAT_USER_FEAT User feature

Constant Description

PWL_DISPLAY_TYPE_NONE No layer

PWL_DISPLAY_TYPE_NORMAL A normal layer

PWL_DISPLAY_TYPE_DISPLAY A layer selected for display

PWL_DISPLAY_TYPE_BLANK A blanked layer

PWL_DISPLAY_TYPE_HIDDEN A hidden layer

Constant Feature Type

Page 278: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

C - 10 Pro/Web.Link User’s Guide

Object Types

Constant Description

PWL_MODEL Model (for parameter functions)

PWL_TYPE_UNUSED Unused

PWL_ASSEMBLY Assembly

PWL_PART Part

PWL_FEATURE Feature

PWL_DRAWING Drawing

PWL_SURFACE Surface

PWL_EDGE Edge

PWL_3DSECTION Three-dimensional section

PWL_DIMENSION Dimension

PWL_2DSECTION Two-dimensional section

PWL_LAYOUT Layout

PWL_AXIS Axis

PWL_CSYS Coordinate system

PWL_REF_DIMENSION Reference dimension

PWL_GTOL Geometric tolerance

PWL_DWGFORM Drawing form

PWL_SUB_ASSEMBLY Subassembly

PWL_MFG Manufacturing object

PWL_QUILT Quilt

PWL_CURVE Curve

PWL_POINT Point

PWL_NOTE Note

PWL_IPAR_NOTE IPAR note

PWL_EDGE_START Start of the edge

PWL_EDGE_END End of the edge

PWL_CRV_START Start of the curve

PWL_CRV_END End of the curve

PWL_SYMBOL_INSTANCE Symbol instance

Page 279: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Constants C - 11

Pro

/Web

.Lin

k C

on

stants

PWL_DRAFT_ENTITY Draft entity

PWL_DRAFT_GROUP Draft group

PWL_DRAW_TABLE Drawing table

PWL_VIEW View

PWL_REPORT Report

PWL_MARKUP Markup

PWL_LAYER Layer

PWL_DIAGRAM Diagram

PWL_SKETCH_ENTITY Sketched entity

PWL_DATUM_PLANE Datum plane

PWL_COMP_CRV Composite curve

PWL_BND_TABLE Bend table

PWL_PARAMETER Parameter

PWL_DIAGRAM_OBJECT Diagram object

PWL_DIAGRAM_WIRE Diagram wire

PWL_SIMP_REP Simplified representation

PWL_WELD_PARAMS Weld parameters

PWL_EXTOBJ External object

PWL_EXPLD_STATE Explode state

PWL_RELSET Set of relations

PWL_CONTOUR Contour

PWL_GROUP Group

PWL_UDF User-defined feature

PWL_FAMILY_TABLE Family table

PWL_PATREL_FIRST_DIR Pattern direction 1

PWL_PATREL_SECOND_DIR Pattern direction 2

Constant Description

Page 280: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

C - 12 Pro/Web.Link User’s Guide

Parameter Types

ParamType Field Values

ParamValue Values

Constant Description

PWL_USER_PARAM User parameter

PWL_DIM_PARAM Dimension parameter

PWL_PATTERN_PARAM Pattern parameter

PWL_DIMTOL_PARAM Dimension tolerance parameter

PWL_REFDIM_PARAM Reference dimension parameter

PWL_ALL_PARAMS All parameters

PWL_GTOL_PARAM Geometric tolerance parameter

PWL_SURFFIN_PARAM Surface finish parameter

Constant Description

PWL_VALUE_DOUBLE Double value

PWL_VALUE_STRING String value

PWL_VALUE_INTEGER Integer value

PWL_VALUE_BOOLEAN Boolean value

PWL_VALUE_NOTEID Note identifier

Constant Description

PWL_PARAMVALUE_DOUBLE Double value

PWL_PARAMVALUE_STRING String value

PWL_PARAMVALUE_INTEGER Integer value

PWL_PARAMVALUE_BOOLEAN Boolean value

PWL_PARAMVALUE_NOTEID Note identifier

Page 281: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Pro/Web.Link Constants C - 13

Pro

/Web

.Lin

k C

on

stants

Tolerance Types

Constant Description

PWL_TOL_DEFAULT Displays the nominal tolerance.

PWL_TOL_PLUS_MINUS Displays the nominal tolerance with a plus/minus.

PWL_TOL_LIMITS Displays the upper and lower tolerance limits.

PWL_TOL_PLUS_MINUS_SYM Displays the tolerance as, where x is the plus tolerance. The value of the minus tolerance is irrelevant and unused.

Page 282: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

C - 14 Pro/Web.Link User’s Guide

Page 283: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 1

DSample Web Pages

This appendix includes more detailed examples of how to use Pro/Web.Link.

Topic Page

Using Views and Simplified Representations

Determining Model Dependencies

Page 284: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 2 Pro/Web.Link User’s Guide

Using Views and Simplified Representations<HTML><HEAD><TITLE>Pro/Web.Link - Views and Simp Reps</TITLE></HEAD><BODY><CENTER><B><H1>Pro/Web.Link Example of Views and Assembly SimplifiedRepresentations</H1></B></CENTER>

This page shows the ability to manipulate views and assembly simplifiedrepresentations of the current model in Pro/ENGINEER.<p>Do the following:<UL>

<LI>Click <b>Connect to Pro/ENGINEER</b> to connect the page toPro/ENGINEER.

<LI>The Views drop-down list shows a list of named views. Select thename of the view to which to change.

<LI>The Simplified Reps drop-down list shows a list of assemblysimplified representations. Select the name of the simplifiedrepresentation to which to change.

<LI>Click <b>Refresh</b> to update the lists according to the currentmodel.

</UL>

<form NAME="ui"><input type=button value="Connect to Pro/ENGINEER"onclick='ConnectToPro()'><HR>

<input type=button value="Refresh" onclick='updateCurrentModelLists()'>

Views:<SELECT name="ViewNames" onChange='changeCurrentModelView()'>

<OPTION VALUE="NONE"> NONE </OPTION><OPTION VALUE="DEFAULT"> DEFAULT </OPTION>

</SELECT>Simplified Reps:

<SELECT name="SimpReps" onChange='changeCurrentSimpRep()'><OPTION VALUE="MASTER"> MASTER </OPTION><OPTION VALUE="GRAPHICS"> GRAPHICS </OPTION><OPTION VALUE="GEOMETRY"> GEOMETRY </OPTION>

</SELECT></form></BODY><SCRIPT language = "JavaScript">

Page 285: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Sample Web Pages D - 3

Sam

ple W

eb P

ages

// Global variables that can be used in any functionvar pwl = document.pwl;var form = document.ui;

// Function to connect the web page to Pro/ENGINEERfunction ConnectToPro(){

ret = pwl.pwlProEngineerConnect();

if (!ret.Status){alert ("pwlProEngineerConnect failed. Error code: " +

ret.ErrorCode);}

}

//Update all the lists for the current model.function updateCurrentModelLists(){

//Get the current model in Pro/ENGINEER.curModel = getCurModel();

//Update the "Views" drop-down list.updateNamedViewList (curModel);

//Update the "Simplified Reps" drop-down list.updateSimpRepList (curModel);

//Refresh the display.history.go(0);

}

//Update the simplified representation list for a given model.function updateSimpRepList (model){

if (model == null || model == ""){

return;}

//Get the list of user-created simplified representations.ret = pwl.pwlMdlSimprepsGet (model);if (!ret.Status && ret.ErrorCode != pwl.PWL_E_NOT_FOUND){

alert ("pwlMdlSimprepsGet failed. Error code: " + ret.ErrorCode);return;

}

Page 286: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 4 Pro/Web.Link User’s Guide

//Update the drop-down list in the html form.updateSelectList (form.SimpReps, 3, ret.Simpreps,

ret.NumSimpreps, "MASTER");}

function changeCurrentSimpRep(){

changeSimpRep (getCurModel());}

//Function called when user selects a new option in the simplified//representation drop-down list. This changes the simplified//representation in Pro/ENGINEER.function changeSimpRep(model){

if (model == null || model == ""){return;

}

//Get the name of the simplified representation from the drop-down//list.simprepName = getSelectValue (form.SimpReps);if (simprepName == "GRAPHICS"){

ret = pwl.pwlGraphicsSimprepOpen (model, null, true);if (!ret.Status){alert ("pwlGraphicsSimprepOpen failed. Error code: " +

ret.ErrorCode);}

}else if (simprepName == "GEOMETRY"){

ret = pwl.pwlGeomSimprepOpen (model, null, true);if (!ret.Status){alert ("pwlGeomSimprepOpen failed. Error code: " +

ret.ErrorCode);}

}else if (simprepName == "MASTER"){

ret = pwl.pwlSimprepMasterActivate (model);if (!ret.Status){alert ("pwlSimprepMasterActivate failed. Error code: " +

ret.ErrorCode);}

}

Page 287: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Sample Web Pages D - 5

Sam

ple W

eb P

ages

else{

ret = pwl.pwlSimprepActivate (model, simprepName);if (!ret.Status){

alert ("pwlSimprepActivate failed. Error code: " +ret.ErrorCode);

}}

}

function updateCurrentNamedViewList(){

updateNamedViewList (getCurModel());}//Function to update the list of named viewsfunction updateNamedViewList (model){

if (model == null || model == ""){

return;}

// Get a list of named views from the model.ret = pwl.pwlMdlViewsGet (model);if (!ret.Status && ret.ErrorCode != pwl.PWL_E_NOT_FOUND){

alert ("pwlMdlViewsGet failed. Error code: " + ret.ErrorCode);return;

}

// Update the "Views" drop-down list.updateSelectList (form.ViewNames, 2, ret.ViewNames,

ret.NumViews, "NONE");}

function changeCurrentModelView(){

changeView (getCurModel());}

//Function called when user selects a new option in the views//drop-down list. This changes to the named view in Pro/ENGINEER.function changeView (model){

if (model == null || model == ""){return;

}

Page 288: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 6 Pro/Web.Link User’s Guide

//Get the name of the view from the drop-down list.viewName = getSelectValue (form.ViewNames);

//Change the view in Pro/ENGINEER, accounting for the special cases//of "NONE" and "DEFAULT".if (viewName == "NONE"){

return;}else if (viewName == "DEFAULT"){

ret = pwl.pwlViewDefaultSet (model);if (!ret.Status){

alert ("pwlViewDefaultSet failed. Error code: " +ret.ErrorCode);

}}else{

ret = pwl.pwlViewSet (model, getSelectValue(form.ViewNames));if (!ret.Status){

alert ("pwlViewSet failed. Error code: " + ret.ErrorCode);}

}}

//Utility function to get the current model in Pro/ENGINEERfunction getCurModel(){

// Get the current model.ret = pwl.pwlMdlCurrentGet();if (!ret.Status){alert ("pwlMdlCurrentGet failed. Error code: " + ret.ErrorCode);return (null);

}

var curModel = ret.MdlNameExt;if (curModel == null || curModel == ""){

return (null);}return (curModel);

}

Page 289: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Sample Web Pages D - 7

Sam

ple W

eb P

ages

//Generic function to get current value of a selection list (drop-down//menu)function getSelectValue (selectObject){

return (selectObject.options[selectObject.selectedIndex].value);}

//Utility function that adds an array of strings to a drop-down list//in the formfunction updateSelectList (selectList, fixedNum, varList, numList,

selectedItem)

//Add elements of the varList array to the selection object selectList//(start to add them at fixedNum).{

var numOptions = selectList.options.length;var newListSize = fixedNum + numList;

//If the option list is too small, add some options.for (i = numOptions; i < newListSize; i++){

selectList[i] = new Option();}

//Set the names of the list.for (i = fixedNum; i < newListSize; i++){

selectList[i].text = selectList[i].value = varList[i - fixedNum];}

//Remove extra items from the list.numOptions = selectList.options.length;

for (i = numOptions - 1; i >= newListSize; i--){

selectList[i] = null;}

//Set the current option.for (i = 0; i < newListSize; i++){

if (selectList[i].value == selectedItem){

selectList[i].selected = "1";}

}}</SCRIPT>

Page 290: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 8 Pro/Web.Link User’s Guide

<EMBED type=application/x-proconnect name="mypwc" WIDTH=10 HEIGHT=10></EMBED><APPLET CODE=WebLink.class NAME="pwl" WIDTH=10 HEIGHT=10></APPLET></HTML>

The following figure shows the results of this example, as seen in the browser.

Figure D-1

Page 291: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Sample Web Pages D - 9

Sam

ple W

eb P

ages

Determining Model Dependencies<HTML><HEAD><TITLE>Pro/Web.Link - Model Dependencies</TITLE></HEAD><BODY><CENTER><B><H1>Pro/Web.Link Example of ModelDependencies</H1></B></CENTER>

This page shows the ability to access the in-session models andto determine the model dependencies. This works for all types of model,including drawings and manufacturing models.<p>Do the following:<UL>

<LI>Click <b>Connect to Pro/ENGINEER</b> to connect the page toPro/ENGINEER.

<LI>Enter the name of a model in the Model name text area.</ul><p>The available actions are as follows:

<ul><LI><b>List dependencies</b>---List all the models upon which the

specified model depends.<p><b>Note:</b> This shows <i>all</i> the dependencies, not just thefirst-level dependencies.<p>

<LI><b>List non-dependencies</b>---List all the in-session models uponwhich the specified model does <i>not</i> depend.<p>

<LI><b>Where used</b>---List all the in-session modelsthat depend on the specified model in some way.<p><b>Note:</b> This shows <i>all</i> the dependencies, not just the

first-level dependencies.</UL>

<p>In the text area, Pro/Web.Link displays a list of models accordingto the action selected.

<form NAME="ui"><input type=button value="Connect to Pro/ENGINEER"

onclick='ConnectToPro()'><HR>

Model name:<input type=text size=15 name=ModelName ><P>

Page 292: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 10 Pro/Web.Link User’s Guide

<textarea name=TextArea cols=30 rows=10> </textarea><P><input type=button value="List dependencies" onclick='showDependents()'><input type=button value="List non-dependencies"

onclick='showIndependents()'><input type=button value="Where used" onclick='showWhereUsed()'></form></BODY>

<SCRIPT language = "JavaScript">

//Global variables that can be used in any functionvar pwl = document.pwl;var form = document.ui;

//Connect the Web page to Pro/ENGINEER.function ConnectToPro(){

ret = pwl.pwlProEngineerConnect();

if (!ret.Status){alert ("pwlProEngineerConnect failed. Error code: " +ret.ErrorCode);

}}

//Display all the models that are in session that are NOT dependent on//the model.function showWhereUsed(){

var usedInArray = new Array();var inSessionMdls = new Array();var modelName = form.ModelName.value;

if (modelName == null || modelName == ""){

return (false);

//Get all the models that are in session.if (!findAllInSessionModels (inSessionMdls)){alert ("findInSessionModels failed");return (false);

}

var numMdls = inSessionMdls.length;

Page 293: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Sample Web Pages D - 11

Sam

ple W

eb P

ages

//Find which models are dependents of the specified model.for (i = 0; i < numMdls; i++ ){//Make a fresh array for each loop because findAllDependents()//appends to the input array.

var depArray = new Array();

// Find the model's dependents.if (!findAllDependents (inSessionMdls[i], depArray)){

alert ("findAllDependents failed");return(false);

}

// If the model is one of the dependents, add it to the array.if (inArray( modelName.toUpperCase(), depArray))

usedInArray[usedInArray.length] = inSessionMdls[i];}

//Show the list of non-dependents.if (usedInArray.length == 0){

form.TextArea.value = modelName +" is not used in \nany other model.";

}else{

form.TextArea.value = modelName + " is depended on by:\n";form.TextArea.value += usedInArray.join("\n");

}return (true);

}

//Display all the models that are in session that are not dependencies.function showIndependents(){

var depArray = new Array();var indepArray = new Array();var inSessionMdls = new Array();var modelName = form.ModelName.value;

if (modelName == null || modelName == ""){

return (false);}if (!findAllDependents (modelName, depArray)){

alert ("findAllDependents failed");return (false);

}

Page 294: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 12 Pro/Web.Link User’s Guide

//Get all the models in session.if (!findAllInSessionModels (inSessionMdls)){

alert ("findInSessionModels failed");return (false);

}

var numMdls = inSessionMdls.length;

//Exclude dependent models from the list of in-session models.for (i = 0; i < numMdls; i++){

//If the model is not the requested model or one of its//dependents, add it to the array.if (!inSessionMdls[i].equals(modelName.toUpperCase()) &&

!inArray( inSessionMdls[i], depArray)){

indepArray[indepArray.length] = inSessionMdls[i];}

}

//Show the list of non-dependents.if (indepArray.length == 0){

form.TextArea.value = "All models in session are \ndependencies of "+ modelName;

}else{

form.TextArea.value = "In session models NOT \nrequired by " +modelName + ":\n";

form.TextArea.value += indepArray.join("\n");}return (true);

}

// Array of all model typesvar modelTypes = new Array(

pwl.PWL_ASSEMBLY,pwl.PWL_PART,pwl.PWL_DRAWING,pwl.PWL_LAYOUT,pwl.PWL_MFG,pwl.PWL_REPORT,//pwl.PWL_DIAGRAM,pwl.PWL_MARKUP);

Page 295: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Sample Web Pages D - 13

Sam

ple W

eb P

ages

//Find ALL models in session and append them to the input array.function findAllInSessionModels (mdlArray){

// Loop through all the model types.for (var i = 0; i < modelTypes.length; i++){

if (!findInSessionModels( modelTypes[i], mdlArray)){

return (false);}

}return (true);

}//Find the models in session of the given type and append them to//the input array.function findInSessionModels (modelType, mdlArray){

//Get all the models of the given type.ret = pwl.pwlSessionMdlsGet (modelType);if (!ret.Status && ret.ErrorCode != pwl.PWL_E_NOT_FOUND){

alert ("pwlSessionMdlsGet failed for model type = " + modelType +ret.ErrorString + ret.ErrorCode);

return( false );}

//Add the models to the input array.for (var i = 0; i < ret.NumMdls; i++){

mdlArray[mdlArray.length] = ret.MdlNameExt[i];}return (true);

}//Display the list of models that the specified model depends on.function showDependents(){

var depArray = new Array();var modelName = form.ModelName.value;

if (modelName == null || modelName == "")return (false);

if (!findAllDependents(modelName, depArray)){

alert ("findAllDependents failed");return (false);

}//Show the list of dependents.

if (depArray.length == 0){

form.TextArea.value = modelName + " has no dependencies.";}

Page 296: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 14 Pro/Web.Link User’s Guide

else{

form.TextArea.value = modelName + " depends on:\n";form.TextArea.value += depArray.join("\n");

}return (true);

}

//Find ALL the dependents of the given model, and add them to the input//array. This function works for all model types including drawings and//manufacturing models.//The function returns false if there is an error.function findAllDependents (model, dependentArray){

if (model == null || model == ""){

return (false);}ret = pwl.pwlMdlDependenciesGet (model);if (!ret.Status){

if (ret.ErrorCode == pwl.PWL_E_NOT_FOUND){return (true); // Reached the end of the line

}else{alert ("pwlMdlDependenciesGet failed: " + ret.ErrorString);return (false);

}}var dependModels = ret.MdlNameExt;var numDepend = ret.NumMdls;

if (numDepend == 0){

return (true);}

//Add all the dependencies and recurse for assemblies.//CAUTION: YOU MUST USE VAR FOR VARIABLES IN RECURSIVE FUNCTIONS!!!

for (var i = 0; i < numDepend; i++){//If a dependency is already found, skip to the next.if (inArray (dependModels[i], dependentArray)){continue;

}

Page 297: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Sample Web Pages D - 15

Sam

ple W

eb P

ages

//Add the dependency.dependentArray[dependentArray.length] = dependModels[i];

// If the dependency can depend on another model itself,// recurse to find all the dependencies.ret = pwl.pwlMdlInfoGet (dependModels[i]);if (!ret.Status){

alert ("pwlMdlInfoGet failed for " + dependModels[i] +". Error code: " + ret.ErrorCode);

return (false);}

if (ret.MdlType == pwl.PWL_ASSEMBLY){//If an error occurred, return immediately.if (!findAllDependents (dependModels[i], dependentArray))

return (false);}

}return (true);

}

//Utility that determines whether an object exists in an arrayfunction inArray (object, array){

for (var i = 0; i < array.length; i++){

if (array[i].equals(object))return (true);

}return (false);

}</SCRIPT><EMBED type=application/x-proconnect name="mypwc" WIDTH=10 HEIGHT=10></EMBED><APPLET CODE=WebLink.class NAME="pwl" WIDTH=10 HEIGHT=10></APPLET></HTML>

The following figures show the results of this example, as seen in the browser.

Page 298: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 16 Pro/Web.Link User’s Guide

Figure D-2

Page 299: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Sample Web Pages D - 17

Sam

ple W

eb P

ages

Figure D-3

Page 300: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

D - 18 Pro/Web.Link User’s Guide

Page 301: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - i

Index

Symbols

<APPLET CODE> tag 1-6<EMBED_TYPE> tag 1-5<FORM> tag 1-5<SCRIPT> tag 1-5

A

Access control 2-5Activate

simplified representations 14-4window 7-3

Active windowgetting 7-3

code example 2-7Add

family table instances 16-5family table items 16-4layer items 17-4lock to family table instances 16-9parameter designation 12-8Pro/INTRALINK designation 12-8

APIWizardbrowsing

categories 3-7user’s guide 3-8

category description 3-6code examples 3-6defined 3-1display frame 3-6documentation

online 3-1PDF format 3-1

find (search feaure) 3-9

frames in web browser 3-5interface defined 3-5Internet Explorer

Java2 plug in 3-2, 3-4Java2 plugin 3-5requirements 3-2, 3-4

method descriptions 3-6navigating the tree 3-7Netscape Navigator

Java2 plugin not recommended 3-5requirements 3-3

searching for a string 3-9supported web browsers 3-2Swing

class path-NT 3-4class path-UNIX 3-4download JFC archive 3-3Java Foundation Class 3-2

topic/category selection frame 3-5tree updating

defined 3-5Java2 plugin requirements 3-5

APIWizard font propertiesUNIX 3-4

Applicationsstarting 4-3

Arraysallocating 5-4

Assembliescomponents 10-2exploded 10-4

Associated modelsretrieving 7-2

Autoprompting 2-6

Page 302: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - ii Pro/Web.Link User’s Guide

B

Bookson JavaScript programming 2-14

Booleanarray allocation 5-4

BrowsingPro/Web.Link categories with APIWizard

3-7Pro/Web.Link user’s guide with APIWizard

3-8

C

Changedirectory 5-3

Check out 6-6Children 11-3Close

window 7-3Components

assembly 10-2Configuration file

adding an application name 4-3description 1-7options

security 2-5setting the access level 2-5

Connectto Pro/ENGINEER 4-2

Constantslist of B-1

Createfamily table instances 16-5layers 17-2parameters 12-6selections 8-3X terminal windows 4-4

Criteriarelationship 6-6

Cross sections 15-3Current directory 5-3

D

Data typestips 2-11

Defaultcomponent locations for explode 10-4view 7-4

Deletefamily table instances 16-5features 11-8

item from layer 17-5layers 17-2models 6-5parameters 12-7

Dependenciesexample C-9getting 6-3relationship criteria 6-6

Designateparameters 12-8

Dimensionsgetting 13-2information 13-2list of styles B-2reading and modifying 13-2tolerances 13-5types 13-2

Directories 5-3listing the files and subdirectories 5-3plug-in

required files 1-3Disconnect

from Pro/ENGINEER 4-3Display

cross sections 15-3layers 17-3parameters 11-9

Display typesgetting and setting 17-3

Documentationsee APIWizard 3-1

Doublearray allocation 5-4

E

Environment variablesgetting the values 5-2to set up Pro/Web.Link 1-3to specify the location of the config.pwl file

1-7Erase

instances 16-10models 6-5

Error codes 2-3Errors

resolving 2-13Examples

connecting to Pro/ENGINEER 2-7determining model dependencies C-9getting the active window 2-7opening a model 2-7regenerating a model 2-7repainting a window 2-7

Page 303: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - iii

saving a model 2-7standard header 2-6starting Pro/ENGINEER 2-7using pwlApplicationStart 4-4using pwlAssemblyComponentReplace

10-3using pwlEnvVariableGet 5-2using pwlFamtabInstanceValueGet 16-7using pwlFamtabItemsGet 16-3using pwlParameterCreate 12-6using pwlParameterValueGet 12-4using the assembly functions 10-5using the cross section function 15-4using the dimension functions 13-5using the family table functions 16-11using the feature functions 11-10using the header file 2-6using the layer functions 17-5using the mass properties functions 15-4using the model functions 6-7using the note functions 18-5using the parameter functions 12-9using the selection functions 8-5using the view functions 7-4using views and simplified representations

C-2Exploded assemblies 10-4

F

Family tablesinstances 16-5

file management of 16-10locking 16-9values 16-6

items 16-2list of types B-2

Featureschildren 11-3deleting 11-8dimensions 13-2displaying parameters 11-9information 11-2list of group pattern statuses B-3list of group statuses B-3list of pattern statuses B-3list of types B-4names 11-5parents 11-3querying 11-2resuming 11-7status 11-4suppressing 11-6

Fileslisting 5-3

required 1-3Find

APIWizard search feature (Find) 3-9font.properties

APIWizard on UNIX 3-4Frames

display frame in APIWizard 3-6in the APIWizard online browser 3-5topic/category selection 3-5

Functionsconventions 2-2new for Release 20.0 A-13quick reference A-1, 17return bundle 2-2superseded A-15that return the window identifier 7-3

G

Getactive window 7-3assembly components 10-2assembly explode status 10-4associated models 7-2cross sections 15-3current directory 5-3current model 6-2dependencies 6-3dimension information 13-3environment variable 5-2explode states 10-5explode status 10-4family table instance locks 16-9family table instance values 16-6family table instances 16-5family table items 16-3feature children 11-3feature dimensions 13-2feature information 11-2feature names 11-5feature notes 18-2feature parameters 12-2feature parents 11-3feature status 11-4features 11-2files and subdirectories 5-3item identifiers 6-16item names 6-16layer display types 17-3layer items 17-3layers 17-2mass properties 15-2material 9-2model dimensions 13-2model features 11-2model information 6-3

Page 304: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - iv Pro/Web.Link User’s Guide

model views 7-4note names 18-3note owners 18-2note text 18-4note URLs 18-5notes 18-2parameter value 12-3parameters 12-2Pro/INTRALINK information 6-3session models 6-2session windows 7-2simplified representations 14-2

Group pattern statustypes 11-5

Group statustypes 11-5

H

Hardwaresupported 1-2

Header file 2-6Highlighting 8-4HTML page

setup 1-5

I

Informationdimension 13-2feature 11-2model 6-3

Inquiryfeature 11-2note 18-2

Instances 16-5file management 16-10locking 16-9

Integerarray allocation 5-4

Interchange assembly 10-3Internet Explorer

Java2 plug in 3-2, 3-4requirements 3-2, 3-4

Itemsfamily table 16-2highlighting 8-4layer 17-4model 6-16removing from a layer 17-5

J

Java applet

loading 1-6Java2 plugin

not recommended for APIWizard with Netscape Navigator 3-5

required for APIWizard with Internet Explorer 3-2, 3-4 to 3-5

JavaScriptbooks on 2-14reserved words 2-12

JavaScript headerfigure 2-11for examples 2-7

L

Layersadding items 17-4creating 17-2deleting 17-2display type 17-3getting 17-2getting items 17-3item types 17-3removing items 17-5resuming features 11-7suppressing features 11-6to delete features 11-8

Lockfamily table instances 16-9

M

Machinesetting up to run Pro/Web.Link 1-2

Mass properties 15-2Materials

getting and setting 9-2MIME type 2-7Model items 6-16Models

checking out 6-6defined types 6-2dependencies 6-3dimensions 13-2erasing 6-5information 6-3layers 17-2listing in-session 6-2opening 6-4Pro/INTRALINK information 6-3regenerating 6-4renaming 6-5retrieving the associated model 7-2session model 6-2view names 7-4

Page 305: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - v

Modifydimension values 13-2parameters 12-3

N

Namesfeature 11-5model items 6-16note 18-3view 7-4

Netscape Navigatorrequirements 3-3Swing required 3-3

Notenames 18-3text 18-4URLs 18-5

NPX_PLUGIN_PATH environment vari-able 1-3

O

Objectsbrowsing with APIWizard 3-7checking out 6-6list of types B-10

Openinstance 16-10model 6-4

code example 2-7simplified representation 14-2

Ownernote 18-2

P

Parameterscreating 12-6deleting 12-7designating for Pro/INTRALINK 12-8displaying 11-9getting 12-2identifying 12-2list of types B-12listing 12-2modifying 12-3reading 12-3renaming 12-7resetting 12-8values 12-3

Parents 11-3Parse

selection string 8-4parseFloat() function 2-11

parseInt() function 2-11Part

materials 9-2Pattern status

types 11-4Permissions 2-5Platforms

supported 1-2Plug-in 1-5

directory contents 1-3Pro/ENGINEER

access levels 2-5connecting to 4-2disconnecting from 4-3

Pro/INTRALINKchecking out objects 6-6designating parameters for 12-8model information 6-3

Pro/Web.Linkconfiguration file 1-7documentation

online (APIWizard) 3-1PDF format 3-2

error codes 2-3examples 2-6functions 2-2

quick reference A-1, 17list of defined constants B-1loading the Java applet 1-6overview 2-2plug-in 1-5prerequisite software 1-2required files 1-3setting up your HTML page 1-5setting up your machine 1-2standard header 2-6supported software and hardware 1-2tips and tricks 2-11trail files 1-8troubleshooting 2-13utilities 5-1

PRO_WEB_LINK_CONFIG environ-ment variable 1-7Properties

mass 15-2pwlAccessRequest function

description 4-4pwlApplicationStart function

description 4-3example 4-4

pwlAssemblyComponentReplace functiondescription 10-2used in a code example 10-8

Page 306: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - vi Pro/Web.Link User’s Guide

pwlAssemblyComponentsGet functiondescription 10-2used in a code example 10-5

pwlAssemblyExplodeDefaultSet functiondescription 10-4used in a code example 10-7

pwlAssemblyExplodeStateSet functiondescription 10-5used in a code example 10-7

pwlAssemblyExplodeStatesGet functiondescription 10-5used in a code example 10-7

pwlAssemblyExplodeStatusGet functiondescription 10-4used in a code example 10-6

pwlAssemblyExplodeStatusSet functiondescription 10-4used in a code example 10-6

pwlDimensionInfoGetByID functiondescription 13-3used in a code example 13-6

pwlDimensionInfoGetByName functiondescription 13-3used in a code example 13-7

pwlDimensionToleranceSetByID functiondescription 13-5used in a code example 13-8

pwlDimensionValueSetByID functiondescription 13-4used in a code example 13-7

pwlDirectoryCurrentGet functiondescription 5-3

pwlDirectoryCurrentSet functiondescription 5-3

pwlDirectoryFilesGet functiondescription 5-3

pwlEnvVariableGet functiondescription 5-2used in a code example 5-2

pwlFamtabInstanceAdd functiondescription 16-5used in a code example 16-14

pwlFamtabInstanceLockAdd functiondescription 16-9used in a code example 16-14

pwlFamtabInstanceLockGet functiondescription 16-9used in a code example 16-15

pwlFamtabInstanceLockRemove functiondescription 16-9used in a code example 16-14

pwlFamtabInstanceRemove function

description 16-5used in a code example 16-14

pwlFamtabInstancesGet functiondescription 16-5used in a code example 16-11

pwlFamtabInstanceValueGet functiondescription 16-6used in a code example 16-7

pwlFamtabInstanceValueSet functiondescription 16-8used in a code example 16-13

pwlFamtabItemAdd functiondescription 16-4used in a code example 16-15

pwlFamtabItemRemove functiondescription 16-4used in a code example 16-15

pwlFamtabItemsGet functiondescription 16-3used in a code example 16-3

pwlFeatureChildrenGet functiondescription 11-3used in a code example 11-19

pwlFeatureDeleteByID functiondescription 11-8used in a code example 11-15

pwlFeatureDeleteByIDList functiondescription 11-8used in a code example 11-16

pwlFeatureDeleteByLayer functiondescription 11-8

pwlFeatureDeleteByName functiondescription 11-8used in a code example 11-16

pwlFeatureDimensionsGet functiondescription 13-2used in a code example 13-6

pwlFeatureInfoGetByID functiondescription 11-2used in a code example 11-11

pwlFeatureInfoGetByName functiondescription 11-3used in a code example 11-11

pwlFeatureNameGetByID functiondescription 11-5used in a code example 11-12

pwlFeatureNameSetByID functiondescription 11-5used in a code example 11-12

pwlFeatureNotesGet functiondescription 18-2

pwlFeatureParametersDisplay functiondescription 11-9

Page 307: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - vii

used in a code example 8-7pwlFeatureParametersGet function

description 12-2used in a code example 12-10

pwlFeatureParentsGet functiondescription 11-3used in a code example 11-18

pwlFeatureResumeByID functiondescription 11-7used in a code example 11-14

pwlFeatureResumeByIDList functiondescription 11-7used in a code example 11-15

pwlFeatureResumeByLayer functiondescription 11-7

pwlFeatureResumeByName functiondescription 11-7used in a code example 11-14

pwlFeatureStatusGet functiondescription 11-4used in a code example 11-16

pwlFeatureSuppressByID functiondescription 11-6used in a code example 11-13

pwlFeatureSuppressByIDList functiondescription 11-6used in a code example 11-13

pwlFeatureSuppressByLayer functiondescription 11-6

pwlFeatureSuppressByName functiondescription 11-6used in a code example 11-13

pwlGeomSimprepActivate functiondescription 14-4used in a code example 14-8

pwlGeomSimprepOpen functiondescription 14-3used in a code example 14-6used in a sample program C-4

pwlGraphicsSimprepActivate functiondescription 14-5used in a code example 14-8

pwlGraphicsSimprepOpen functiondescription 14-3used in a code example 14-6used in a sample program C-4

pwlInstanceErase functiondescription 16-10used in a code example 16-12

pwlInstanceOpen functiondescription 16-10used in a code example 16-11

pwlItemHighlight function

description 8-4used in a code example 8-6

pwlItemIDToName functiondescription 6-16

pwlItemNameSetByID functiondescription 6-16

pwlItemNameToID functiondescription 6-16

pwlItemUnhighlight functiondescription 8-4used in a code example 8-6

pwlLayerCreate functiondescription 17-2used in a code example 17-7

pwlLayerDelete functiondescription 17-2used in a code example 17-7

pwlLayerDisplayGet functiondescription 17-3used in a code example 17-6

pwlLayerDisplaySet functiondescription 17-3used in a code example 17-6

pwlLayerItemAdd functiondescription 17-4used in a code example 17-8

pwlLayerItemRemove functiondescription 17-5used in a code example 17-8

pwlLayerItemsGet functiondescription 17-3used in a code example 17-7

pwlMdlCopy functionused in a code example 6-8

pwlMdlCurrentGet functiondescription 6-2used in a sample program C-6

pwlMdlDependenciesGet functiondescription 6-3used in a code example 6-8

pwlMdlDimensionsGet functiondescription 13-2used in a code example 13-6

pwlMdlErase functiondescription 6-5used in a code example 6-7

pwlMdlFeaturesGet functiondescription 11-2used in a code example 11-10

pwlMdlInfoGet functiondescription 6-3used in a code example 6-9

pwlMdlIntralinkInfoGet function

Page 308: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - viii Pro/Web.Link User’s Guide

description 6-3used in a code example 6-9

pwlMdlLayersGet functiondescription 17-2used in a code example 17-5

pwlMdlNotesGet functiondescription 18-2used in a code example 18-6

pwlMdlOpen functiondescription 6-4used in a code example 6-7used in a simple example 1-6used in the header 2-7

pwlMdlParametersGet functiondescription 12-2used in a code example 12-9

pwlMdlRegenerate functiondescription 6-4used in a code example 2-7

pwlMdlRename functiondescription 6-5used in a code example 6-7

pwlMdlSave functionused in a code example 2-7

pwlMdlSaveAs functiondescription 6-5used in a code example 2-7

pwlMdlSimprepsGet functiondescription 14-4used in a code example 14-6used in a sample program C-3

pwlMdlViewsGet functiondescription 7-4used in a code example 7-5used in a sample program C-5

pwlNoteNameGet functiondescription 18-3used in a code example 18-7

pwlNoteNameSet functiondescription 18-3used in a code example 18-7

pwlNoteOwnerGet functiondescription 18-2used in a code example 18-9

pwlNoteTextGet functiondescription 18-4used in a code example 18-7

pwlNoteTextSet functiondescription 18-4used in a code example 18-8

pwlNoteURLGet functiondescription 18-5used in a code example 18-8

pwlNoteURLSet functiondescription 18-5used in a code example 18-9

pwlObjMdlsCheckOut functiondescription 6-6

pwlParameterCreate functiondescription 12-6used in a code example 12-6

pwlParameterDelete functiondescription 12-7

pwlParameterDesignationAdd functiondescription 12-8

pwlParameterDesignationRemove func-tion

description 12-8pwlParameterDesignationVerify function

description 12-9used in a code example 12-13

pwlParameterRename functiondescription 12-7used in a code example 12-12

pwlParameterReset functiondescription 12-8

pwlParameterValueGet functiondescription 12-3used in a code example 12-10used in a code fragment 12-4

pwlParameterValueSet functiondescription 12-5

pwlPartMaterialCurrentGet functiondescription 9-2

pwlPartMaterialdataGet functiondescription 9-3

pwlPartMaterialdataSet functiondescription 9-4

pwlPartMaterialGet functiondescription 9-2superseded A-15

pwlPartMaterialSet functiondescription 9-2

pwlPartMaterialsGet functiondescription 9-3

pwlProEngineerConnect functiondescription 4-2used in a code example 2-7used in a sample program C-3used in a simple example 1-6

pwlProEngineerDisconnect functiondescription 4-3

pwlProEngineerDisconnectAndStop func-tion

description 4-3

Page 309: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - ix

pwlProEngineerStartAndConnect func-tion

description 4-2used in a code example 2-7

pwlSelect functiondescription 8-2used in a code example 8-5

pwlSelectionCreate functiondescription 8-3used in a code example 8-7

pwlSelectionParse functiondescription 8-4used in a code example 8-6

pwlSessionMdlsGet functiondescription 6-2used in a code example 6-8

pwlSessionWindowsGet functiondescription 7-2

pwlSimprepActivate functiondescription 14-4used in a code example 14-7used in a sample program C-5

pwlSimprepMasterActivate functiondescription 14-4used in a code example 14-7used in a sample program C-4

pwlSimprepOpen functiondescription 14-2

pwlSolidMassPropertiesGet functiondescription 15-2used in a code example 15-4

pwlSolidXSectionDisplay functiondescription 15-3used in a code example 15-5

pwlSolidXSectionsGet functiondescription 15-3used in a code example 15-5

pwluBooleanArrayAlloc functiondescription 5-4

pwluDoubleArrayAlloc functiondescription 5-4

pwluIntArrayAlloc functiondescription 5-4used in a code example 11-13

pwluStringArrayAlloc functiondescription 5-4used in a code example 8-6

pwlViewDefaultSet functiondescription 7-4used in a code example 7-5used in a sample program C-6

pwlViewSet function

description 7-4used in a code example 7-5used in a sample program C-6

pwlWindowActivate functiondescription 7-3

pwlWindowActiveGet functiondescription 7-3used in a code example 2-7

pwlWindowClose functiondescription 7-3

pwlWindowMdlGet functiondescription 7-2

pwlWindowRepaint functiondescription 7-2used in a code example 2-7

R

Readdimension values 13-2from disk 2-5from Pro/ENGINEER 2-5parameters 12-3

Regenerate 6-4code example 2-7

Relationship criteria 6-6Remove

family table instances 16-5family table items 16-4layer items 17-5locks on family table instances 16-9parameter designation 12-8

Renamemodel items 6-16models 6-5parameters 12-7

Repaint 7-2code example 2-7

Replaceassembly components 10-2

Requestaccess levels 4-4

Reserved words 2-12Reset

parameters 12-8Resume

features 11-7Retrieve

current model 6-2dimensions 13-2feature parameters 12-2model parameters 12-2models 6-4

Page 310: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - x Pro/Web.Link User’s Guide

parameter values 12-3simplified representations 14-2

Return bundle 2-2

S

Savemodels

code example 2-7Search

APIWizard search feature (Find) 3-9Security

configuration file options 2-5dialog box

figure 2-5setting programmatically 4-4

Selection 8-2Session

getting the windows 7-2terminating 4-3

Setcurrent directory 5-3default view 7-4dimension tolerances 13-5dimension values 13-4explode states 10-5explode status 10-4family table instance values 16-8feature names 11-5item names 6-16layer display types 17-3material 9-2names of model items 6-16note names 18-3note text 18-4note URLs 18-5parameter values 12-5view 7-4views 7-4

SGI platformrequirements 3-3Swing 3-3

Simplified representationsactivating 14-4opening 14-2

Softwaresupported 1-2

Solidscross sections 15-3mass properties 15-2

Standard headerfor examples 2-6

Startapplications 4-3

Pro/ENGINEER 4-2Status

explode 10-4feature 11-4group 11-5group pattern 11-5pattern 11-4

Stopa Pro/ENGINEER session 4-3

Stringarray allocation 5-4

Subdirectorieslisting 5-3

Superseded functions A-15Suppress

features 11-6Swing

class pathNT 3-4UNIX 3-4

download Java foundation class archive 3-3

in APIWizard 3-2required for APIWizard with Netscape 3-3required for APIWizards on SGI platforms

3-3required Java Foundation Class for

APIWizard 3-3

T

Technical changes A-13Text

note 18-4Tips

for using Pro/Web.Link 2-11Tolerances

dimension 13-5types of 13-4

Trail files 1-8Troubleshooting 2-13

U

UNIXAPIWizard font properties 3-4

URLnote 18-5

User’s Guidebrowsing with APIWizard 3-8documentation

online 3-1online format 3-1

Page 311: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - xi

PDF format 3-2Utilities 5-1

allocating arrays 5-4getting values of environment variables

5-2manipulating directories 5-3

V

Valuesdimension 13-2family table instance 16-6of environment variables 5-2parameter 12-3

Variable typing 2-11Verify

parameter designation 12-9Views

names 7-4setting 7-4setting the default 7-4

W

Windowsactivating 7-2active 7-3

code example 2-7closing 7-3repainting 7-2

code example 2-7retrieving the associated model 7-2session 7-2X terminal 4-3

Writeto disk 2-5

X

X terminal windowstarting 4-3

Page 312: Netscape-based Pro/Web.Link User’s Guide · Certain PTC software products contain licensed third-party technology: ... CGTech. Pro/PLASTIC ADVISOR ... Installing the Plug-In and

Index - xii Pro/Web.Link User’s Guide