Left Sidebar
Right Sidebar
06/07/03: Change collor of dimensions in drawing...
A small CATScript which will change collor of dimensions in drawing.
Language="VBSCRIPT"
Sub CATMain()
Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument
'~ ******* select all dimensions in drawing
Dim selection1 As Selection
Set selection1 = drawingDocument1.Selection
selection1.Search "CATDrwSearch.DrwDimension,all"
'~ ******* change color of selection (it will be magenta - RGB code 255,0,255)
Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetRealColor 255,0,255,0
selection1.Clear
'~ *******End Sub
To see what you have to put instead of 255,0,255 (which is the RGB code for magenta), you can check http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html or try Wikipedia or any other resources which can give you the RGB code.
In the same way, you can select what ever you want: planes, surfaces, points, CATParts in assemblies a.s.o.
Regards
Fernando
Language="VBSCRIPT"
Sub CATMain()
Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument
'~ ******* select all dimensions in drawing
Dim selection1 As Selection
Set selection1 = drawingDocument1.Selection
selection1.Search "CATDrwSearch.DrwDimension,all"
'~ ******* change color of selection (it will be magenta - RGB code 255,0,255)
Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetRealColor 255,0,255,0
selection1.Clear
'~ *******End Sub
To see what you have to put instead of 255,0,255 (which is the RGB code for magenta), you can check http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html or try Wikipedia or any other resources which can give you the RGB code.
In the same way, you can select what ever you want: planes, surfaces, points, CATParts in assemblies a.s.o.
Regards
Fernando
Category: Developer's corner
Posted by: ferdo