Hallo Max
Ich habe mich gerade mit VB2008 damit beschäftigt und habe folgende Lösung gefunden:
Private Sub Export_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Export.Click
Dim CATIA As INFITF.Application
Dim EXC As Microsoft.Office.Interop.Excel.Application
Dim Wks As Worksheet
CATIA = GetObject(, "CATIA.Application")
EXC = GetObject(, "EXCEL.Application")
Wks = EXC.ActiveWorkbook.ActiveSheet
Dim i As Integer
Dim Spline As Spline2D
Dim points() As Object
Dim pp As Point2D
Dim coord(1) As Object
Dim UserSel As Selection
UserSel = CATIA.ActiveDocument.Selection
If UserSel.Count > 0 Then
Spline = UserSel.Item(1).Value
ReDim points(Spline.GetNumberOfControlPoints - 1)
Spline.GetControlPoints(points)
For i = 0 To Spline.GetNumberOfControlPoints - 1
pp = points(i)
pp.GetCoordinates(coord)
Wks.Cells(i + 1, 1).value = coord(0)
Wks.Cells(i + 1, 2).value = coord(1)
Next
End If
End Sub
Vorraussetzungen für diese SUB sind:
1) Leeres Excel mit leerem Sheet offen
2) In CATIA ist ein Spline in einem Sketch selektiert
Gruss René
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP