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.
Sub CatMain()
Dim MyDoc As Document
Set MyDoc = CATIA.ActiveDocument
Dim MyDrawingDoc 'As DrawingDocument
Set MyDrawingDoc = MyDoc
Dim MySelection 'As Selection
Set MySelection = MyDrawingDoc.Selection
Dim Status As String
Dim vFilter(0)
vFilter(0) = "DrawingView"
MySelection.Clear
Status = MySelection.SelectElement2(vFilter, "Select Drawing View", True)
Dim MyDrawingView As DrawingView
Set MyDrawingView = MySelection.Item(1).Value
MyDrawingView.Activate
Dim MyDrawingSheet As DrawingSheet
Set MyDrawingSheet = MyDrawingView.Parent
Dim TextLocation(1)
Status = MyDrawingDoc.Indicate2D("Indicate Text Location", TextLocation)
Dim MyText As DrawingText
Set MyText = MyDrawingView.Texts.Add(vbCrLf + "Scale", TextLocation(0), TextLocation(1))
Dim ParameterName As String
ParameterName = "Drawing\" + MyDrawingSheet.Name + "\" + MyDrawingView.Name + "\Name"
MsgBox ParameterName
Call MyDrawingView.InsertViewScale(1 + Len(MyText.Text), MyText)
Call MyText.InsertVariable(1, 0, MyDrawingDoc.Parameters.GetItem(ParameterName))
End Sub