- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
If when you call debug.print, that shows a MessageBox, and you have that code within the loop for every component, then there is not much way to avoid it showing before the task is complete. You could try a line of code to update the assembly just before calling that debug.print line, but I do not see a variable with a reference to the main assembly shown in your example code. Something like AssemblyDocument.Update, AssemblyDocument.Update2, or ThisApplication.ActiveView.Update. It looks like your code renames all components starting with their Part Number iProperty value, followed by their Description iProperty value, if available. Have you thought about creating a collection before the loop starts, then within the loop, if a problem component is found, you could add that component to the collection, that way you still have a reference to the problem components when the process is done, and can do something with them at that point? We could also help you re-write the code in some way, if needed. Do you just maintain the portion after the colon (:) then?
Wesley Crihfield
(Not an Autodesk Employee)