Extrude up to surface/body

Hi,

I need to be able to extrude a sketch up to a target surface/body. I haven't been able to find any examples of how to do this - all uses of FeatureExtrusion2 that I've seen use the blind end condition, and specify an extrude depth.

I tried the call below, but it simply results in my source sketch being deleted. I'm also not sure how to specify the end-condition surface (should I select it immediately after the call?).

swModel.FeatureManager.FeatureExtrusion2(true, false, false,

(int)swEndConditions_e.swEndCondUpToSurface, (int)swEndConditions_e.swEndCondUpToSurface,

0, 0, false, false, false, false, 0, 0, false, false, false, false, true, true, true,

(int)swStartConditions_e.swStartSketchPlane, 0, false);

SolidworksApi macros