Sub CATMain()
Dim xlTmp As Object
Dim xlSheet As Object
Set xlTmp = CreateObject("Excel.Application")
Dim strFileName As String
Dim xi, xj As Integer
strFileName = "F:\Schnecke.xls"
xlTmp.Workbooks.Add strFileName
'xlTmp.ActiveWorkbook.Open Filename:=strFileName
xlTmp.Visible = True
Set xlSheet = xlTmp.ActiveSheet
Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridShapeFactory1 As HybridShapeFactory
Set hybridShapeFactory1 = part1.HybridShapeFactory
Dim hybridShapePointCoord1 As HybridShapePointCoord
Dim axisSystems1 As AxisSystems
Dim axisSystem1 As AxisSystem
Dim reference1 As Reference
Dim hybridBodies1 As HybridBodies
Dim hybridBody1 As HybridBody
Dim i As Integer
Dim x As Double
Dim y As Double
For i = 5 To 77
x = xlSheet.cells(i, 3)
y = xlSheet.cells(i, 4)
Set hybridShapePointCoord1 = hybridShapeFactory1.AddNewPointCoord(x, y, 0#)
Set axisSystems1 = part1.AxisSystems
Set axisSystem1 = axisSystems1.Item("Absolute Axis System")
Set reference1 = part1.CreateReferenceFromObject(axisSystem1)
hybridShapePointCoord1.RefAxisSystem = reference1
Set hybridBodies1 = part1.HybridBodies
Set hybridBody1 = hybridBodies1.Item("GS1")
hybridBody1.AppendHybridShape hybridShapePointCoord1
part1.InWorkObject = hybridShapePointCoord1
part1.Update
Next i
End Sub
u can make the spline by hand at the end.
GS1 is the name of the geometrical set of the points.
PS: Change the columns number from the code above according to your needs.
</pre>
Edited by: gvi70000