Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
I'm new to Pro/ENGINEER customizations and I am having some trouble. I am trying to figure out how to delete the last 'x' notes that have been added to the drawing. I've been successful in deleting the last note on the last sheet however none of the others are deleted. Any assistance would be appreciated.
//to find all detail notes on drawing
int intNumSheets = drw.GetNumberOfSheets();
int intNoteCount;
intNoteCount = 0;
int intArraySize = noteList.getarraysize();
while (intNoteCount < intNumSheets){
System.out.println("Note to be deleted: " + (intArraySize - intNoteCount));
noteList.get(intArraySize - 1 - intNoteCount).Delete();
intNoteCount = intNoteCount + 1;
}
drw.Regenerate(); // so that drawing is back in state prior to printing
Thanks,
Mark Bohannon
From my point of view the statement in your while() loop is incorrect.
If you drawing has one sheet your loop will be executed only for intNoteCount==0...
So you should use a while or for loop that counts from 0 to arraysize of noteList.
Andreas
__________________________________
Andreas Hellmann
MCAD Services Pro/E & Pro/E customization
Rudolf-Diesel-Str. 6
D-65439 Floersheim / Germany
phone: +49 6145 598296
mail: -
Update...
I was able to figure out how to delete the notes on each page by looking for the last ListDetailItem on each page. However,I am having trouble with updating the display on each page to remove the note. I am having to manually go to each page to update the display on allbut the last one that had anote removed after running the application. Any help would be appreciated.
//note number
int intArraySize;
intNoteCount = 0;
while (intNoteCount < intNumSheets){
drw.SetCurrentSheetNumber(intNumSheets - intNoteCount);
noteList = drw.ListDetailItems(DetailType.DETAIL_NOTE, intCurrentSheetNumber); // the last note found on sheet
intNoteCount = intNoteCount + 1;
}
drw.Regenerate(); <----- this command is not updating all sheets
Thanks,
Mark Bohannon
Try to loop through the sheets again and execute a
drw.RegenerateSheet (i)
Andreas
__________________________________
Andreas Hellmann
MCAD Services Pro/E & Pro/E customization
Rudolf-Diesel-Str. 6
D-65439 Floersheim / Germany
phone: +49 6145 598296
mail: -