Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
' Purpose: Macro will change all text greater then 2 into 10 in an active CATIA drawing
' Usage: 1 - A CATDrawing must be active with some dimensions on it
' 2 - Run macro
' Author: ferdo (Disclaimer: You use this code at your own risk)
' ======================================================
Sub CATMain()
Set drawingDocument1 = CATIA.ActiveDocument
Set Sheets = drawingDocument1.Sheets
Set activeSheet = Sheets.ActiveSheet
Set views = activeSheet.Views
For i=1 to views.Count
if i <> 2 then
Set view = views.Item(i)
Set texts = view.Texts
For j=1 to texts.Count
Set text = texts.Item(j)
text.SetFontSize 0,0,10.0 'change all text greater then 2 into 10
Next
End if
Next
End Sub
' Purpose: Macro will change text in an active CATIA drawing according to your inputs
' Usage: 1 - A CATDrawing must be active with some dimensions on it
' 2 - Run macro
' Author: ferdo (Disclaimer: You use this code at your own risk)
' ======================================================
Sub CATMain()
Set drawingDocument1 = CATIA.ActiveDocument
Set Sheets = drawingDocument1.Sheets
Set activeSheet = Sheets.ActiveSheet
Set views = activeSheet.Views
Dim myFontSize As Double
myFontSize = "10"
myFontSize = InputBox ("Please enter a font size.", "Enter Font Size", myFontSize)
Dim myFontName As Double
myFontName = "Courier"
myFontName = InputBox ("Please enter a font name.", "Enter Font Name", myFontName)
For i=1 to views.Count
if i <> 2 then
Set view = views.Item(i)
Set texts = view.Texts
For j=1 to texts.Count
Set text = texts.Item(j)
text.SetFontSize 0,0,myFontSize
text.SetFontName 0,0, "myFontName"
Next
End if
Next
End Sub
Sub CATMain()
Set drawingDocument1 = CATIA.ActiveDocument
Set Sheets = drawingDocument1.Sheets
Set activeSheet = Sheets.ActiveSheet
Set views = activeSheet.Views
Dim selection1 As Selection
Set selection1 = drawingDocument1.Selection
selection1.Search "CATDrwSearch.DrwDimension,all"
For i=1 to selection1.count
Set Dimension = selection1.Item(i).Value
MsgBox Dimension.GetValue.Value
Next
End Sub