Macro for creating a divider line

Hello.
On Solidworks Premium 2019.
I'm trying to create a macro that creates a dividing line from a sketch and a face.
Selecting items seems to work but the command to create the separator line has no effect...
Here's the code:
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim Model As ModelDoc2
Dim feature As feature
Dim boolstatus As Variant
Sub main()
Set swApp = Application.SldWorks
Set Model = swApp.ActiveDoc
'boolstatus = Model.Extension.SelectByID2(" Boss-Extrude1 ", " BODYFEATURE ", 0, 0, 0, False, 0, Nothing, swSelectOptionDefault)
boolstatus = Model.Extension.SelectByID2("  ", "  ", 0.0061, 0.0079, 0, False, 0, Nothing, swSelectOptionDefault)
boolstatus = Model.Extension.SelectByID2(" Pointes_bottom ", " SKETCH ", 0, 0, 0, True, 4, Nothing, 0)

Model.InsertSplitLineProject True, True

End Sub

Eventually, the coordinates of the face will be defined by variables.
Thank you for your help

Hello

For the selection of the face, we must have the mark value parameter of the selection function set to 1.
InsertSplitLineProject Method (IModelDoc2) - 2019 - SOLIDWORKS API Help
Create Projection Split Line Feature Example (VBA) - 2019 - SOLIDWORKS API Help

4 Likes