API: delete folder of smart components without deleting the components

Hello,


I tried to delete the folder that contains smart component without deleting the components in an assembly.

Sub DelSCFolder(SCName as string)

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

boolstatus = Part.Extension.SelectByID2(SCName, "FTRFOLDER", 0, 0, 0, False, 0, Nothing, 0)

'Part.EditDelete

boolstatus = Part.Extension.DeleteSelection2(0)

End Sub

Both delete lines will delete the folder and the components. I need the components in the assembly afterwards.

With UI it is able to delete the folder only.

Any ideas how to handle that?

regards

Bernd