SolidWorks API and SolidWorks Makro'da SheetMetal EdgeFlange problem

Hello, I'm writing a program in Visual Studio using the SolidWorks API. I open a new file in SolidWorks, select a plane, open a sketch, draw, and create a SheetMetalBaseFlange using the InsertSheetMetalBaseFlange2 command. Then, I select an edge using the SelectByRay command and try to create an edgeFlange using the InsertSheetMetalEdgeFlange command. Each time, the InsertSheetMetalEdgeFlange command returns null. Also, when I try to get a macro for this command, I get no result. Can you help me?
Even when I write the macro manually, SolidWorks doesn't perform the edgeFlans operation.