Sub CATMain()
Dim Doc, Prt, SF, Slct, BodyO, BodyN
Set Doc = CATIA.ActiveDocument
Set Prt = Doc.Part
Set SF = Prt.ShapeFactory
Set Slct = Doc.Selection
Dim Status, lType(1)
lType(0) = "Body"
lType(1) = "Body"
Status = Slct.SelectElement2(lType, "Select the body to be split", True)'这里是让用户选择目标实体
If Status = "Redo" Or Status = "Undo" Or Status = "Cancel" Then
Exit Sub
End If
Set BodyO = Slct.Item(1).Value'获取用户选择的实体
Slct.Clear
lType(0) = "Plane"
lType(1) = "BiDim"
Status = Slct.SelectElement2(lType, "Select the split surface", False)'让用户选择切割元素(或者叫刀更形象)
If Status = "Redo" Or Status = "Undo" Or Status = "Cancel" Then
Exit Sub
End If