Hallo,
Habe Aufgezeichnet, und dann wie oben beschrieben die Visproperty eingebaut. Im VBA Editor ist es möglich mit F1 Hilfe zu Methoden, Functionen zu bekommen.
Guter Einstieg ist natürlich auch die Inofficielle Hilfeseite catia.cad.de, dort liegen ein paar Makros, ansonsten COE auf Englich .
############# VBA Beispiel ################
' ###################################################################
' # Programmiert von: Carl Tenschert <carl.tenschert(at)fh-koeln.de>#
' # Programmiert für: Forum CAD.DE #
' # Datum: 2005.03.10 #
' # Catia Ver.: V5 R12 SP4 #
' # Beschreibung: #
' # Beispiel für Laden eines Iges Files, Ändern der Schrift auf Rot #
' # Linien (schwarz und Stärke =0,35 in Grün, Unsichtbar, 0,13mm #
' ###################################################################
' ###################################################################
' # Beginn Programm #
' ###################################################################
Sub CATMain()
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim document1 As Document
Set document1 = documents1.Open("C:\Temp\Drawing1.ig2") 'Datei Laden
Dim drawingDocument1 As DrawingDocument
Set drawingDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = drawingDocument1.Selection
Dim VisProperties1 As VisPropertySet
selection1.Search "CATSketchSearch.2DPolyline,all" ' Nach Text suchen
Set VisProperties1 = selection1.VisProperties
VisProperties1.SetRealColor 255, 0, 0, 0 ' Rot einfärben
selection1.Clear
selection1.Search "(Color='(0,0,0)' & Weight=0,35mm),all" ' Nach bestimmten Linien suchen
Set VisProperties1 = selection1.VisProperties
VisProperties1.SetRealColor 0, 255, 0, 0 ' Grün einfärben
VisProperties1.SetRealLineType 3, 0 ' Linientyp 3 Unsichtbare
VisProperties1.SetRealWidth 1, 0 ' Linienstärke 1 0.13mm
selection1.Clear
End Sub
######################################
------------------
Mit freundlichem Gruß von Carl Tenschert
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP