Creo Weblink CREOJS updated notes question
If my model changes and the note becomes unattached, my textline "&REF_DES:AT_CONN" calling a parameter changes to "***".
Once I go through and reattach all the leaders, I can run this function to update all the notes back to "&REF_DES:AT_CONN", It only works if I've double clicked to edit the text before hand.
Has any one else had this issue? Does Toolkit also have this issue, or is this solely a weblink problem?
function Notevisit() {
if (pfcIsMozilla())
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var session = pfcGetProESession ();
var model = session.CurrentModel;
alert("STARTING NOTE REFRESH: PRESS 'OK', AND DO NOT TOUCH UNTIL 'DONE' IS DISPLAYED");
model.Regenerate(void null);
if (model == null)
return;
if (model.Type != pfcCreate("pfcModelType").MDL_DRAWING)
return;
var LABEL = "LABEL: &REF_DES:ATT_CONN";
var name = String(LABEL)
var LABEL = "LABEL: &REF_DES:ATT_CONN";
var name = String(LABEL)
var LABEL2 = "LABEL: \*\*\*";
var name2 = String(LABEL2)
var notes = model.ListItems(pfcCreate("pfcModelItemType").ITEM_DTL_NOTE);
for (var i = 0; i < notes.Count; i++) {
if (notes.Item(i).GetDetailType() === pfcCreate("pfcDetailType").DETAIL_NOTE) {
var item = notes.Item(i);
if (item.Type == pfcCreate("pfcModelItemType").ITEM_DTL_NOTE) {
if (item.GetDetailType() == pfcCreate("pfcDetailType").DETAIL_NOTE) {
var detailNoteInstructions = item.GetInstructions(true);
var content = "Got Error to modify note: "
var detailNoteInstructions = item.GetInstructions(true);
var textLines = detailNoteInstructions.TextLines;
for (j = 0; j < textLines.Count; j++) {
var texts = textLines.Item(j).Texts;
for (var k = 0; k < texts.Count; k++) {
content += texts.Item(k).Text;
texts.Item(k).Text = texts.Item(k).Text;
item.Modify(detailNoteInstructions);
if (texts.Item(k).Text == name2){
texts.Item(k).Text = name;
item.Modify(detailNoteInstructions);
}
}
}
}
}
}
}
model.Regenerate(void null);
}
Creo 9

