×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

View Names at Top of Views

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

RE: View Names at Top of Views

Hi,

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 Sub 

Regards
Fernando

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: View Names at Top of Views

for each view I would check all text to see if one match the view name, if not I would create text with view name.

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.

Eric N.
indocti discant et ament meminisse periti

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources