An error in my macro but can't find them

Last week i spend a lot of time on this macro.

I have almost searched the whole web and read problems from other people, but can't explain why it's not doing what i want.

The problem is that almost everything is good, but i can't solve the last problem.

The macro saves, export to dxf, close the document.

the only thing that goes wrong is that the macro export not the flat pattern, he export the top view.

I'm Using SW 2015 1.0

The macro is included.

Can anyone find help me?

SolidworksApi macros