I'm using "AddNewHybridSplit" function between Pad and Line (picture below) and I want to find the split line (with green color on screen) start and end points to create a new line "AddNewLinePtPt". how can I do it? I tried intersection but this points is also undefined.
Can anyone help me?
Sub ArchiliIntCoords()
' Define the document and part
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As PartDocument
Set partDocument1 = documents1.Item("X0 Line.CATPart")
Dim part1 As Part
Set part1 = partDocument1.Part
' Define the bodies and sketches
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("X0-Line")
Dim sketches1 As Sketches
Set sketches1 = body1.Sketches
Dim sketch1 As Sketch
Set sketch1 = sketches1.Item("Sketch.1")
' Create a new geometrical set for the intersection
Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies
Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Add()
' Create a new intersection object
Dim hshf As HybridShapeFactory
Set hshf = part1.HybridShapeFactory
Dim pad1 As Sketch
Set pad1 = body1.Sketches.Item(1)
Dim ref11 As Reference
Set ref11 = part1.CreateReferenceFromObject(pad1)
Dim myObj2 As AnyObject
Set myObj2 = part1.FindObjectByName("Epox")
Set ref2 = part1.CreateReferenceFromObject(myObj2)
Dim myIntersect As HybridShapeIntersection
Set myIntersect = hshf.AddNewIntersection(ref11, ref2)
' Add the intersection object to the geometrical set
hybridBody1.AppendHybridShape myIntersect
part1.Update
Dim myHybridBody As HybridBody
Set myHybridBody = part1.HybridBodies.Item(1) 'geometrical setshi iwereba wertili
Dim hybridShapeFactory1 As HybridShapeFactory
Set hybridShapeFactory1 = part1.HybridShapeFactory
Dim bodies11
Set bodies11 = part1.Bodies
Dim body11 As Body
Set body11 = bodies1.Item(1) 'ak migebulia partpody
Dim line11
Set line11 = body1.Sketches.Item(1) 'curved igebs sketch 1-is lines romelzec unda daematos wertili
Dim mysplit As HybridShapeSplit
Set mysplit = hybridShapeFactory1.AddNewHybridSplit(ref11, ref2, -1)
myHybridBody.AppendHybridShape mysplit
part1.Update
Dim oSelection As Selection
Set oSelection = partDocument1.Selection
oSelection.Clear
oSelection.Add mysplit
oSelection.VisProperties.SetRealColor 0, 255, 0, 0 'mwvane pers nishnavs
part1.Update
End Sub