Language="VBSCRIPT" '------------------------------------------------------------------------ ' Prozedur CATMain '------------------------------------------------------------------------ ' CATPart öffnen ' Selektion definieren ' Aktuelle Farbe auslesen ' Aktuelle Farbe ändern (in rot) ' ------------------------------------------------------------------------ Sub CATMain() '------------------------------------------------------------------------ ' CATPart öffnen '------------------------------------------------------------------------ Dim documents1 As Documents Set documents1 = CATIA.Documents Dim partDocument1 As Document Set partDocument1 = documents1.Open("D:\Student\T-Stueck.CATPart") 'Hier zu öffnedes File angeben '------------------------------------------------------------------------ ' Selektion definieren '------------------------------------------------------------------------ Dim selection1 As Selection Set selection1 = partDocument1.Selection selection1.Search "((Name:* & Typ:*) & Farbe:*);Alle" '------------------------------------------------------------------------ ' Aktuelle Farbe auslesen und ausgeben '------------------------------------------------------------------------ Dim visPropertySet1 As VisPropertySet Set visPropertySet1 = selection1.VisProperties visPropertySet1.GetRealColor a,b,c msgbox a & " " & b & " " & c '------------------------------------------------------------------------ ' Aktuelle Farbe ändern (in rot) '------------------------------------------------------------------------ visPropertySet1.SetRealColor 255,0,0,0 End Sub