Not to update Assembly

Hi,

I have a macro that opens all the parts of an assembly one by oneand closes each one before it opens another one and flattens theopened part but it updates in the assembly right away and causes anerror with my assembly because of other parts are referenced tothis part. If I manually open a part and flatten it and spit mywindow to see the assembly and the opened part it flattens in theassembly aswell but does not update the references and if i fold itback up and close it the assembly is fine. Could somebody give anidea why this is happening ? Thanks.

This is the code it use to flatten:
If swFeature.GetTypeName2 = "FlatPattern" Then
swFeature.Select2 False, -1
modelDoc.EditUnsuppressSolidworksApi macros