×
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

Catia VBA: View.Size

Catia VBA: View.Size

Catia VBA: View.Size

(OP)
I tried to use View.Size to find the bounding rectangle of a view, but could not do so.

RE: Catia VBA: View.Size

CODE --> VBA

Sub View_Box()

   Dim DrwDocument As DrawingDocument
   Set DrwDocument = CATIA.ActiveDocument
 
   Dim oDrawing As DrawingDocument
   Set oDrawing = CATIA.ActiveDocument
    
   Dim oSheets As DrawingSheets
   Set oSheets = oDrawing.Sheets
    
   Dim oSheet As DrawingSheet
   Set oSheet = oSheets.Item(1)
    
   Dim oView As DrawingView
   Set oView = oSheet.Views.Item(3)
   oView.Activate

   Dim oView2
   Set oView2 = oView
   Dim oXY(4) '

   oView2.Size oXY
   Xmin = oXY(0)
   Xmax = oXY(1)
   Ymin = oXY(2)
   Ymax = oXY(3)

End Sub 

______

Alex ,

RE: Catia VBA: View.Size

(OP)
Thank you very much Alex. It worked like charm.
I hadn't used

Dim oView2
Set oView2 = oView
Dim oXY(4)

which gave me error.

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