That's true. I understand your issue now. The macro could solve this, but it might take a lot of time if have really huge assemblies.
You can probably try to lower the Display and Hardware Settings in Application options (just for Running the code).
Please submit us your feedback here, it is an interesting improvement request :
It shows following error
with following line of code shown in red
For Each lodrep In oCompDef.RepresentationsManager.LevelOfDetailRepre
Please suggest what to do.
You pasted this text :
For Each lodrep In oCompDef.RepresentationsManager.LevelOfDetailRepre?sentations
There is a question mark in Repre?sentations. If this is also in your code, then you need to remove it.