Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hello;
I am writing a Jlink app for our ME team to place informational custom (aka User) symbols on Drawing2Ds.
The app jarfile and the symbol file are both installed into the users ptc/creo3/ directory:
the code in the jar file uses RetrieveSymbolDefinition() to load the DetailSymbolDefItm
DetailSymbolDefItem DefItm =
prts_dwg.RetrieveSymbolDefinition("autoplace_test", null, null, null);
The good news is that it finds the symfile.
The bad news is that it fails to load it and tosses an XToolkitFound exception.
The stack looks like this:
Solved! Go to Solution.
Ok! I'll try that. Your reasoning makes perfect sense. I will report back on how it goes.
FilePath
The path to the symbol definition file, relative to the configuration option pro_symbol_dir. null indicates that the function should search the system symbol definition directory instead.
Option pro_symbol_dir in config.pro file point Creo to the folder with symbols. I think, you must copy symbol file to this folder.
Hi Moonstone!
Thankyou so much for your thoughtful response and reasonable hypothesis.
However, the exception thrown is not the one that says it cant find the file, it's the one that says it was found and a loading was attempted and something went wrong.
Here is the pertinent part of the stack trace again:
com.ptc.pfc.Implementation.pfcExceptions$XToolkitFound
at com.ptc.pfc.Implementation.PFCRemoteCommImpl.makeObject(PFCRemoteCommImpl.java:2144)
at com.ptc.cipjava.NativeTransport.recvObject(NativeTransport.java:115)
at com.ptc.cipjava.CIPRemoteComm.processMessages(CIPRemoteComm.java:153)
at com.ptc.pfc.Implementation.pfcDrawing$Drawing.RetrieveSymbolDefinition(pfcDrawing.java:712)
Here is what the api docs say about it:
package com.ptc.pfc.pfcExceptions;
public class XToolkitFound
extends com.ptc.pfc.pfcExceptions.XToolkitError
Description
This exception is thrown when there is an error of type PRO_TK_E_FOUND in a Creo Parametric TOOLKIT function called by PFC.
Now that you have seen this, do you have any other thoughts? Or do you think that Creo found it, loaded it and then tossed the error because it didnt like where it found the *.sym file?
Tnx!
johnu
Try to set last argument in method
UpdateUnconditionally
true if Creo Parametric should update existing instances of this symbol definition, false if the operation should fail if the definition already exists in the model.
DetailSymbolDefItem DefItm =
prts_dwg.RetrieveSymbolDefinition("autoplace_test", null, null, true);
In this case symbol instance will be replaced, if it was loaded in drawing early.
Ok! I'll try that. Your reasoning makes perfect sense. I will report back on how it goes.
FIXED IT! THANKYOU SO VERY MUCH!!!