Hallo zusammen,
ich habe es mit folgendem Makro versucht: 
Sub CATMain()
Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow
Dim specsViewer1 As Viewer
Set specsViewer1 = specsAndGeomWindow1.ActiveViewer
Set drawingDocument1 = CATIA.ActiveDocument
Set MySheet = CATIA.ActiveDocument.Sheets.ActiveSheet
Set MyView = MySheet.Views.ActiveView
Dim MyText As DrawingText
PI=4*atn(1)
radiant=PI/180
start=90                                          'Startwinkel
alpha = 360                                      'Vollkreis
Text ="AGB-Halter SN 2 222 222"
iFontSize = 2                                    'Textgrösse
anzahl =len(Text)                                'Anzahl Buchstaben
phi = alpha/anzahl                                'Neigungswinkel
beta = start-90                                  'Startwinkel für Neigung
r = 10                                            'Radius
i=0
for winkel = start*radiant to (start-alpha)*radiant step -phi*radiant
  txt = Mid(Text,i+1,1) 
  phi1 = beta - i*phi
  x = r*cos(winkel)
  y = r*sin(winkel)
 
  Set MyText = MyView.Texts.Add(txt, 100+x,100+y)      '100,100 ist Mittelpunkt des Kreises 
  MyText.Angle = phi1
  MyText.SetFontSize 0,  0, iFontSize
  MyText.AnchorPosition = catMiddleCenter
  i = i+1                                     
next
specsViewer1.ZoomIn 
End Sub
Leider kommt immer die Fehlermeldung wie in dem Bild zu sehen. Was muss ich ändern?
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP