View Names at Top of Views
View Names at Top of Views
(OP)
Hi Friends,
I would like to place the view names of all views at the top of corresponding views using catvba. Kindly give me a hint for it and not the entire macro.
Regards,
Harry
I would like to place the view names of all views at the top of corresponding views using catvba. Kindly give me a hint for it and not the entire macro.
Regards,
Harry





RE: View Names at Top of Views
You can play with the code bellow
CODE --> CATScript
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 SubRegards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: View Names at Top of Views
I would put the view name text in noshow and check the frame size, then bring the view name text in show and position it according to frame size.
indocti discant et ament meminisse periti