The variable text in symbol instants does not change from the preset value.
The variable text in symbol instants does not change from the preset value.
The value in the instruction is set to the new value.
What is needed to get the text in the symbol changed?
public static void placeKPCInst(Point3D point, Integer kpc) {
try{
DetailSymbolDefItem symDef = drawing.RetrieveSymbolDefinition ("PWI-04-02-06_kpc_diamond", null, null, false);
DetailSymbolInstInstructions instrs = pfcDetail.DetailSymbolInstInstructions_Create (symDef);
String variableText = "" + kpc;
DetailVariantTexts varTexts = DetailVariantTexts.create();
DetailVariantText varText = pfcDetail.DetailVariantText_Create("VAR_TEXT" , variableText );
varTexts.insert(0,varText);
instrs.SetTextValues(varTexts);
// instrs.GetTextValues().get(0).GetValue(); returns the KPC value
// Set the location of the note text
FreeAttachment position = pfcDetail.FreeAttachment_Create (point);
DetailLeaders allAttachments = pfcDetail.DetailLeaders_Create ();
allAttachments.SetItemAttachment (position);
instrs.SetInstAttachment (allAttachments);
// * Create and display the symbol
DetailSymbolInstItem symInst = (DetailSymbolInstItem) drawing.CreateDetailItem (instrs);
symInst.Show();
}
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

