Maxscript help needed

Hi all

I want to remove any all XREF objects in the scene, then remove the files it is referenced from the current scene. (Because the dialog is not working and I have couple thousand xrefed obects that doesnt exist from 10 files that also doesnt exist)

I found this:


local currentXRefScenesIndexArr = #[COLOR=#66cc66]([/COLOR][COLOR=#66cc66])
[/COLOR][COLOR=#b1b100]for[/COLOR] i = xrefs.getXRefFileCount[COLOR=#66cc66]([/COLOR][COLOR=#66cc66])[/COLOR] to 1 by -1 [COLOR=#b1b100]do
[/COLOR][COLOR=#66cc66](
[/COLOR] append currentXRefScenesIndexArr [COLOR=#66cc66]([/COLOR]xrefs.getXRefFile i[COLOR=#66cc66])[/COLOR].filename
delete [COLOR=#66cc66]([/COLOR]xrefs.getXRefFile i[COLOR=#66cc66])
[/COLOR][COLOR=#66cc66])[/COLOR]

But that’s for XREF scenes.
I’m having a hard time using this


[I]objXRefs.getAllXRefObjects()[/I]

to modify the code and get rid of all xref objects.

Anybody care to lend a hand please?

For those interested, this did the trick:
delete (for obj in objects where isKindOf obj XRefObject collect obj)

Thanks to SwordSlayer on CGTalk for that one!