surface facets as macro feature

The attached macro computes a surface from two input curvesand shows how I'm trying to make that surface into a macro feature.The surface is an array of planar facets, each represented by a3dsketch and a fill surface. However, the MakeSubFeature calls tomake these features into subfeatures of the macro feature all fail.Why do the MakeSubFeature calls fail?

Details

Before running the macro, first open the attached part file, whichhas the input curves. In the macro, the input curves are put intothe 'inputs' global array and the 3dsketches and fill surfaces gointo the 'intermediates' global array. The 'inputs' array ispopulated in PropMgr.PropertyManagerPage2Handler_AfterClose. The'intermediates' array is populated in Main.makeSurface. TheMakeSubFeature calls are in Main.makeMacroFeature. The computationis currently done outside of solidworks, so for this example Ihardcoded the surface in Main.copyData.

SolidworksApi macros