Hallo Bernd,
danke nochmal für die Hilfe. Ich habe das mit dem Textfelder probiert und es geht sogar dass ich ein Textfeld erzeuge und danach wieder lösche.
ABER
Ich kann ein schon erzeugtes Textfeld nicht löschen. z.ß (Textfeld.141).
Kannst dir bitte schauen was ich in dem Programm ändern soll damit ich die vorhanden Textfelder löschen kann.
Danke Dir :-)
Sub CATMain()
Dim drawingDocument1 As DrawingDocument
Set drawingDocument1 = CATIA.ActiveDocument
Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = drawingDocument1.Sheets
Dim drawingSheet1 As DrawingSheet
Set drawingSheet1 = drawingSheets1.Item("Sheet.4 (Detail)")
Dim drawingViews1 As DrawingViews
Set drawingViews1 = drawingSheet1.Views
Dim MyView As DrawingView
'Set MyView = drawingViews1.ActiveView
Set MyView = drawingSheet1.Views.Item(1)
Dim Mytexts As DrawingTexts
Set Mytexts = MyView.Texts
Dim Mytext As DrawingText
Set Mytext = Mytexts.Add("TEST", 500, 400)
Mytext.SetFontSize 0, 0, 100
'Mytext.SetFontName 0, 0, "SSS1"
Mytext.SetParameterOnSubString catItalic, 0, 0, 1
Set oSel = CATIA.ActiveDocument.Selection
'oSel.VisProperties.SetRealColor r,b,g, 10
oSel.VisProperties.SetRealColor 0, 0, 255, 0
msgbox "Hallo"
Dim osel As Selection
Set osel = CATIA.ActiveDocument.Selection
osel.Clear
osel.Add Mytext
osel.Delete
End Sub
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP