| • | <creo_loadpoint>\<version>\Common Files\otk\otk_java—Contains all the libraries and example applications specific to Creo Object TOOLKIT Java. |
| • | <creo_loadpoint>\<version>\Common Files\otk_java_doc—Contains documentation files specific to Creo Object TOOLKIT Java. |
| • | <creo_loadpoint>\<version>\Common Files\otk_java_free—Contains all the example applications specific to J-Link. |
PTC_LICENSE_222: 1
| • | Creo Object TOOLKIT Java development license, or |
| • | Creo Object TOOLKIT Java extension license along with Creo TOOLKIT license to be present and unused on your license server |
<creo_loadpoint>/<app_name>/bin/protk_unlock.bat [-java] [<classname>
<jarpath> <one or more pairs of class name and path to jar files>
| • | Creo Object TOOLKIT Java runtime license, or |
| • | Creo Object TOOLKIT Java development license, or |
| • | Both Creo Object TOOLKIT Java extension license and Creo TOOLKIT license |
|
Message
|
Cause
|
|---|---|
|
<application name>:Successfully unlocked application.
|
The application is unlocked successfully.
|
|
Usage: protk_unlock.bat <one or more Creo TOOLKIT executables or DLLs>
|
No arguments supplied.
|
|
<application name>:ERROR: No READ access
<application name>:ERROR: No WRITE access
|
You do not have READ/WRITE access for the executable.
|
|
<application name>:Executable is not a Creo Object TOOLKIT Java application.
|
The executable is not linked with the Creo Object TOOLKIT Java libraries, or does not use any methods from those libraries.
|
|
<application name>:Executable is already unlocked.
|
The executable is already unlocked.
|
|
Error: Licenses do not contain Creo TOOLKIT License Code.
|
A requirement for unlocking a Creo Object TOOLKIT Java application.
|
|
ERROR: No Creo Parametric licenses are available for the startup command specified
|
Could not contact the license server.
|
|
<application name>:Unlocking this application requires option TOOLKIT-for-3D_Drawings.
|
The application uses methods that require an advanced option; and this option is not available.
The license option 222, that is, the TOOLKIT-for-3D_Drawings license is not available.
|
|
<application name>:Unlocking this application requires option TOOLKIT-for-Mechanica.
|
The application uses methods that require an advanced option; and this option is not available.
|
| • | Creo-Related Interfaces—Contain unique methods and attributes that are directly related to the functions in the Creo application. See the section Creo-Related Interfaces for additional information. |
| • | Compact Data Classes—Classes containing data needed as arguments to some Creo Object TOOLKIT Java methods. See the section Compact Data Classes for additional information. |
| • | Union Classes—A class with a potential for multiple types of values. See the section Unions for additional information. |
| • | Sequence Classes—Expandable arrays of objects or primitive data types. See the section Sequences for more information. |
| • | Array Classes—Arrays that are limited to a certain size. See the section Arrays for more information. |
| • | Enumeration Classes—Defines enumerated types. See the section Enumeration Classes for more information. |
| • | ActionListener Classes—Enables you to specify programs that will run only if certain events in the Creo application take place. See the section Action Listeners for more information. |
| • | Utility Classes—Contains static methods used to initialize certain Creo Object TOOLKIT Java objects. See the section Utilities for more information. |
| • | Java Package, Java Class, and Java Method—Lists the Creo Object TOOLKIT Java packages, classes and methods. |
| • | Exposure—Specifies PMA if the method is supported in Creo Parametric. The field specifies PMA when the method is supported in Creo Parametric. |
| • | Description—Describes the class or method. |
Attribute name: int XYZ
Methods: int GetXYZ();
void SetXYZ (int i);Window window;
window.Activate(); // The window has not yet been
initialized.
Repaint(); // There is no invoking object.WSession session = (WSession) pfcSession.Session.GetCurrentSession();
Window window = session.GetCurrentWindow();
// You have initialized the window object.
window.Activate()
window.Repaint()public interface Feature
extends jxobject,
pfcModelItem.ParameterOwner,
pfcObject.Parent,
pfcObject.Object,
pfcModelItem.ModelItem
Feature myfeature; // Previously initialized
String name = myfeature.GetName();// GetName is in the
// class ModelItem.ModelItem item; // You know this is a Feature -- perhaps
// you previously checked its type.
int number = ((Feature)item).GetNumber();
// GetNumber() is a Feature method. Example: pfcModel.BOMExportIntructions_Create()Attribute name: int XYZ
Methods: int GetXYZ();
void SetXYZ (int i);SelectionOptions options;
options.SetMaxNumSels(); // The object has not been
initialized.
SetOptionsKeywords(); // There is no invoking objectclass ParamValue
{
public:
ParamValueType Getdiscr ();
String GetStringValue ();
void SetStringValue (String value);
int GetIntValue ();
void SetIntValue (int value);
boolean GetBoolValue ();
void SetBoolValue (boolean value);
double GetDoubleValue ();
void SetDoubleValue (double value);
int GetNoteId ();
void SetNoteId (int value);
};Features features = (Features) modelitems;package com.ptc.pfc.pfcModel;
public class Models extends jxobject_i
{
public int getarraysize() throws jxthrowable
public Model get (int idx) throws jxthrowable
public void set (
int idx,
Model value
) throws jxthrowable
public void removerange
(
int frominc,
int toexcl
) throws jxthrowable
public void insert
(
int atidx,
Model value
) throws jxthrowable
public void insertseq
(
int atidx,
pfcModel.Models value
) throws jxthrowable
public static pfcModel.Models create() throws jxthrowable
} package com.ptc.pfc.pfcBase;
public class Point2D extends jxobject_i
{
public double get (int idx0) throws jxthrowable
public void set (
int idx0,
double value
) throws jxthrowable
public static Point2D create() throws jxthrowable
};| • | PARAM_INTEGER—An instance of the ParamValueType enumeration class that is used to indicate that a parameter stores an integer value. The corresponding integer is _PARAM_INTEGER. |
| • | ITEM_FEATURE—An instance of the ModelItemType enumeration class that is used to indicate that a model item is a feature. The corresponding integer is_ ITEM_FEATURE. |
| • | getValue—Returns the integer value of an enumeration instance. |
package com.ptc.pfc.pfcBase;
public final class Placement
{
public static final int _PLACE_INSIDE = 0;
public static final Placement PLACE_INSIDE =
new Placement (_PLACE_INSIDE);
public static final int _PLACE_ON_BOUNDARY = 1;
public static final Placement PLACE_ON_BOUNDARY =
new Placement (_PLACE_ON_BOUNDARY);
public static final int _PLACE_OUTSIDE = 2;
public static final Placement PLACE_OUTSIDE =
new Placement (_PLACE_OUTSIDE);
public static final int __Last = 3;
public static Placement FromInt (int value)
public int getValue()
};package com.ptc.pfc.pfcSolid;
public interface SolidActionListener extends
jxobject,
com.ptc.pfc.pfcBase.ActionListener
{
void OnBeforeRegen
(
com.ptc.pfc.pfcSolid.Solid Sld,
com.ptc.pfc.pfcFeature.Feature /* optional */ StartFeature
) throws jxthrowable;
void OnAfterRegen (
com.ptc.pfc.pfcSolid.Solid Sld,
com.ptc.pfc.pfcFeature.Feature /* optional */ StartFeature,
boolean WasSuccessful
) throws jxthrowable;
void OnBeforeUnitConvert (
com.ptc.pfc.pfcSolid.Solid Sld,
boolean ConvertNumbers
) throws jxthrowable;
void OnAfterUnitConvert (
com.ptc.pfc.pfcSolid.Solid Sld,
boolean ConvertNumbers
) throws jxthrowable;
};ParamValue pv = pfcModelItem.CreateStringParamValue ("my_param");package com.ptc.pfc.pfcGlobal;
public class pfcGlobal
{
public static pfcSession.Session GetCurrentSession()
throws jxthrowable
public static stringseq GetProEArguments()
throws jxthrowable
public static string GetProEVersion()
throws jxthrowable
public static string GetProEBuildCode()
throws jxthrowable
}import com.ptc.pfc.pfcModelItem.Parameter;import com.ptc.pfc.pfcBase.*;import com.ptc.cipjava.*;| 1. | Get a handle to the session: |
| 2. | Get the models that are active in the session: |
| 3. | Get the feature model items in each model: |
| 4. | Filter out the features of type hole: |
| 5. | Get the subitems in each feature that are axes: |
com.ptc.pfc.pfcLayer.Layer CreateLayer (
String Name
) throws jxthrowable;
|
Exception
|
Purpose
|
|---|---|
|
XInvalidArrayDimIndex, XInvalidArrayIndex, XInvalidDictIndex, XNegativeIndex
|
Illegal index value used when accessing a cipjava array, sequence, or dictionary. (The Creo Object TOOLKIT Java interface does not currently include any dictionary classes.)
|
|
XLicense
|
Licensing error (license does not exist, lost, server down, etc.)
|
|
XMsgStringTooLong
|
Communication synchronization problem between Creo and Creo Object TOOLKIT Java application. Restart the Creo Object TOOLKIT Java application.
|
|
XNativeException
|
Unknown exception occurred in another language. This usually signals a serious error (such as division by zero or class not
found) that is related to the Creo Object TOOLKIT Java application.
|
|
XCannotConnect, XConnectionClosed, XFlushFailed
|
Communication problems between Creo and Creo Object TOOLKIT Java application.
|
|
Other, internal errors
|
Internal assertions that should not append and which need not be caught individually.
|
|
Exception
|
Purpose
|
|---|---|
|
XBadExternalData
|
An attempt to read contents of an external data object which has been terminated.
|
|
XBadGetArgValue
|
Indicates attempt to read the wrong type of data from the ArgValue union.
|
|
XBadGetExternalData
|
Indicates attempt to read the wrong type of data from the ExternalData union.
|
|
XBadGetParamValue
|
Indicates attempt to read the wrong type of data from the ParamValue union.
|
|
XBadOutlineExcludeType
|
Indicates an invalid type of item was passed to the outline calculation method.
|
|
XCancelProEAction
|
This exception type will not be thrown by Creo Object TOOLKIT Java methods, but you may instantiate and throw this from certain ActionListener methods to cancel the corresponding action in
the Creo application.
|
|
XCannotAccess
|
The contents of a Creo Object TOOLKIT Java object cannot be accessed in this situation.
|
|
XEmptyString
|
An empty string was passed to a method that does not accept this type of input.
|
|
XInvalidEnumValue
|
Indicates an invalid value for a specified enumeration class.
|
|
XInvalidFileName
|
Indicates a file name passed to a method was incorrectly structured.
|
|
XInvalidFileType
|
Indicates a model descriptor contained an invalid file type for a requested operation.
|
|
XInvalidModelItem
|
Indicates that the item requested to be used is no longer usable (for example, it may have been deleted).
|
|
XInvalidSelection
|
Indicates that the Selection passed is invalid or is missing a needed piece of information. For example, its component path,
drawing view, or parameters.
|
|
XJLinkApplicationException
|
Contains the details when an attempt to call code in an external Creo Object TOOLKIT Java application failed due to an exception.
|
|
XJLinkApplicationInactive
|
Unable to operate on the requested JLinkApplication object because it has been shut down.
|
|
XJLinkTaskExists
|
Indicates that a Creo Object TOOLKIT Java task with the given name already exists in session.
|
|
XJLinkTaskNotFound
|
Indicates that the Creo Object TOOLKIT Java task with the given name could not be found and run.
|
|
XMethodForbidden
|
Indicates that the specified method is not supported in the Creo environment..
|
|
XModelNotInSession
|
Indicates that the model is no longer in session; it may have been erased or deleted.
|
|
XNegativeNumber
|
Numeric argument was negative.
|
|
XNumberTooLarge
|
Numeric argument was too large.
|
|
XProEWasNotConnected
|
The Creo session is not available so the operation failed.
|
|
XSequenceTooLong
|
Sequence argument was too long.
|
|
XStringTooLong
|
String argument was too long.
|
|
XUnimplemented
|
Indicates unimplemented method.
|
|
XUnknownModelExtension
|
Indicates that a file extension does not match a known Creo model type.
|
|
XToolkitError Child Class
|
Creo TOOLKIT Error
|
#
|
|---|---|---|
|
XToolkitGeneralError
|
PRO_TK_GENERAL_ERROR
|
-1
|
|
XToolkitBadInputs
|
PRO_TK_BAD_INPUTS
|
-2
|
|
XToolkitUserAbort
|
PRO_TK_USER_ABORT
|
-3
|
|
XToolkitNotFound
|
PRO_TK_E_NOT_FOUND
|
-4
|
|
XToolkitFound
|
PRO_TK_E_FOUND
|
-5
|
|
XToolkitLineTooLong
|
PRO_TK_LINE_TOO_LONG
|
-6
|
|
XToolkitContinue
|
PRO_TK_CONTINUE
|
-7
|
|
XToolkitBadContext
|
PRO_TK_BAD_CONTEXT
|
-8
|
|
XToolkitNotImplemented
|
PRO_TK_NOT_IMPLEMENTED
|
-9
|
|
XToolkitOutOfMemory
|
PRO_TK_OUT_OF_MEMORY
|
-10
|
|
XToolkitCommError
|
PRO_TK_COMM_ERROR
|
-11
|
|
XToolkitNoChange
|
PRO_TK_NO_CHANGE
|
-12
|
|
XToolkitSuppressedParents
|
PRO_TK_SUPP_PARENTS
|
-13
|
|
XToolkitPickAbove
|
PRO_TK_PICK_ABOVE
|
-14
|
|
XToolkitInvalidDir
|
PRO_TK_INVALID_DIR
|
-15
|
|
XToolkitInvalidFile
|
PRO_TK_INVALID_FILE
|
-16
|
|
XToolkitCantWrite
|
PRO_TK_CANT_WRITE
|
-17
|
|
XToolkitInvalidType
|
PRO_TK_INVALID_TYPE
|
-18
|
|
XToolkitInvalidPtr
|
PRO_TK_INVALID_PTR
|
-19
|
|
XToolkitUnavailableSection
|
PRO_TK_UNAV_SEC
|
-20
|
|
XToolkitInvalidMatrix
|
PRO_TK_INVALID_MATRIX
|
-21
|
|
XToolkitInvalidName
|
PRO_TK_INVALID_NAME
|
-22
|
|
XToolkitNotExist
|
PRO_TK_NOT_EXIST
|
-23
|
|
XToolkitCantOpen
|
PRO_TK_CANT_OPEN
|
-24
|
|
XToolkitAbort
|
PRO_TK_ABORT
|
-25
|
|
XToolkitNotValid
|
PRO_TK_NOT_VALID
|
-26
|
|
XToolkitInvalidItem
|
PRO_TK_INVALID_ITEM
|
-27
|
|
XToolkitMsgNotFound
|
PRO_TK_MSG_NOT_FOUND
|
-28
|
|
XToolkitMsgNoTrans
|
PRO_TK_MSG_NO_TRANS
|
-29
|
|
XToolkitMsgFmtError
|
PRO_TK_MSG_FMT_ERROR
|
-30
|
|
XToolkitMsgUserQuit
|
PRO_TK_MSG_USER_QUIT
|
-31
|
|
XToolkitMsgTooLong
|
PRO_TK_MSG_TOO_LONG
|
-32
|
|
XToolkitCantAccess
|
PRO_TK_CANT_ACCESS
|
-33
|
|
XToolkitObsoleteFunc
|
PRO_TK_OBSOLETE_FUNC
|
-34
|
|
XToolkitNoCoordSystem
|
PRO_TK_NO_COORD_SYSTEM
|
-35
|
|
XToolkitAmbiguous
|
PRO_TK_E_AMBIGUOUS
|
-36
|
|
XToolkitDeadLock
|
PRO_TK_E_DEADLOCK
|
-37
|
|
XToolkitBusy
|
PRO_TK_E_BUSY
|
-38
|
|
XToolkitInUse
|
PRO_TK_E_IN_USE
|
-39
|
|
XToolkitNoLicense
|
PRO_TK_NO_LICENSE
|
-40
|
|
XToolkitBsplUnsuitableDegree
|
PRO_TK_BSPL_UNSUITABLE_DEGREE
|
-41
|
|
XToolkitBsplNonStdEndKnots
|
PRO_TK_BSPL_NON_STD_END_
KNOTS |
-42
|
|
XToolkitBsplMultiInnerKnots
|
PRO_TK_BSPL_MULTI_INNER_KNOTS
|
-43
|
|
XToolkitBadSrfCrv
|
PRO_TK_BAD_SRF_CRV
|
-44
|
|
XToolkitEmpty
|
PRO_TK_EMPTY
|
-45
|
|
XToolkitBadDimAttach
|
PRO_TK_BAD_DIM_ATTACH
|
-46
|
|
XToolkitNotDisplayed
|
PRO_TK_NOT_DISPLAYED
|
-47
|
|
XToolkitCantModify
|
PRO_TK_CANT_MODIFY
|
-48
|
|
XToolkitCheckoutConflict
|
PRO_TK_CHECKOUT_CONFLICT
|
-49
|
|
XToolkitCreateViewBadSheet
|
PRO_TK_CRE_VIEW_BAD_
SHEET |
-50
|
|
XToolkitCreateViewBadModel
|
PRO_TK_CRE_VIEW_BAD_
MODEL |
-51
|
|
XToolkitCreateViewBadParent
|
PRO_TK_CRE_VIEW_BAD_PARENT
|
-52
|
|
XToolkitCreateViewBadType
|
PRO_TK_CRE_VIEW_BAD_TYPE
|
-53
|
|
XToolkitCreateViewBadExplode
|
PRO_TK_CRE_VIEW_BAD_EXPLODE
|
-54
|
|
XToolkitUnattachedFeats
|
PRO_TK_UNATTACHED_FEATS
|
-55
|
|
XToolkitRegenerateAgain
|
PRO_TK_REGEN_AGAIN
|
-56
|
|
XToolkitDrawingCreateErrors
|
PRO_TK_DWGCREATE_ERRORS
|
-57
|
|
XToolkitUnsupported
|
PRO_TK_UNSUPPORTED
|
-58
|
|
XToolkitNoPermission
|
PRO_TK_NO_PERMISSION
|
-59
|
|
XToolkitAuthenticationFailure
|
PRO_TK_AUTHENTICATION_FAILURE
|
-60
|
|
XToolkitMultibodyUnsupported
|
PRO_TK_MULTIBODY_UNSUPPORTED
|
-69
|
|
XToolkitAppNoLicense
|
PRO_TK_APP_NO_LICENSE
|
-92
|
|
XToolkitAppExcessCallbacks
|
PRO_TK_APP_XS_CALLBACKS
|
-93
|
|
XToolkitAppStartupFailed
|
PRO_TK_APP_STARTUP_FAIL
|
-94
|
|
XToolkitAppInitializationFailed
|
PRO_TK_APP_INIT_FAIL
|
-95
|
|
XToolkitAppVersionMismatch
|
PRO_TK_APP_VERSION_MISMATCH
|
-96
|
|
XToolkitAppCommunicationFailure
|
PRO_TK_APP_COMM_FAILURE
|
-97
|
|
XToolkitAppNewVersion
|
PRO_TK_APP_NEW_VERSION
|
-98
|
try {
JLinkObject.DoSomething()
}
catch (jxthrowable x) {
// Respond to the exception.
}
try
{
Object.DoSomething()
}
catch (XToolkitError x)
{
// Respond based on the error code.
x.GetErrorCode();
}
catch (XStringTooLong x)
{
// Respond to the exception.
}
catch (jxthrowable x) // Do not forget to check for
// an unexpected error!
{
// Respond to the exception.
}
public class MyClass {
public void MyMethod() throws jxthrowable
{
// Includes Pro/Object TOOLKIT Java function calls
}
}| • | pfc—This domain provides classes that support basic functionality. |
| • | wfc—This domain provides classes that support advanced functionality. |
| • | uifc—This domain provides classes that allow you to create user interface components. Refer to the PTC Creo UI Editor User’s Guide, for more information on how to create and customize the user interface components. |
| • | The application should be packaged as a .jar, which must be included in the classpath. Refer to the section CLASSPATH Variables, for more information. |
| • | This jar must be unlocked. Refer to the section Unlockin, for more information. |
| • | The classpath should contain otk.jar. |
| • | The registry should indicate startup as otk_java. Refer to the section Registry File, for more information. |
| • | CREO_PARAMETRIC |
| • | protoolkit for applications based on Creo TOOLKIT |
| • | object for applications based on Creo Object TOOLKIT Java |
| • | CATIA V5 (.CATPart, .CATProduct) |
| • | CATIA V5 CGR |
| • | CATIA V4 (.Model) |
| • | SolidWorks (.sldasm, .sldprt) |
| • | NX (.prt) |
| • | Creo Parametric release newer than a Creo Object TOOLKIT Java release: This works in many, but not all, cases. The communication method used to link Creo Object TOOLKIT Java to Creo Parametric provides full compatibility between releases. However, there are occasional cases where changes internal to Creo Parametric may require changes to the source code of a Creo Object TOOLKIT Java application in order that it continues to work correctly. Whether you need to convert Creo Object TOOLKIT Java applications depends on what functionality it uses and what functionality changed in Creo Parametric and Creo Object TOOLKIT Java. PTC makes every effort to keep these effects to a minimum. The Release Notes for Creo Object TOOLKIT Java detail any conversion work that could be necessary for that release.
|
| • | Creo Parametric build newer than aCreo Object TOOLKIT Java build. This is always supported.
|
| |
| |
| |
| |
| |
| • | CompatibilityUndefined—Specifies that compatibility value is not set. The default compatibility value is used. |
| • | C3Compatible—Specifies that the methods deprecated in Creo Object TOOLKIT Java 4.0 are compatible and continue working in Creo Object TOOLKIT Java 4.0. By default the compatibility is set to pfcC3Compatible. |
| • | C4Compatible—Specifies that the methods deprecated in Creo Object TOOLKIT Java 4.0 will not work in Creo Object TOOLKIT Java 4.0. If your application uses the deprecated methods, you must replace these methods with new methods and rebuild you applications. |
| |
| |
| |
| |
| |
| |
| |
| • | TK_CONTINUE—Specifies that the visit action method must not visit this object, but continue to visit the subsequent objects. |
| • | Any other value—Specifies that the visit action method must be called for this object. The return value must be passed as the input argument to the visit action method. |
| • | TK_NO_ERROR—Specifies that the visit action method must continue visiting the other objects in the list. |
| • | TK_E_NOT_FOUND—Specifies that no items of the specified type were found and therefore no objects could be visited. |
| • | Any other value (including TK_CONTINUE)—Terminates the visit. Typically this status is returned from the visit action method on termination, so that the calling method knows the reason for the abnormal termination of the visit. |