Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catia VBA: View.Size 1

Status
Not open for further replies.

man2007

Aerospace
Nov 6, 2007
283
IN
I tried to use View.Size to find the bounding rectangle of a view, but could not do so.
 
Replies continue below

Recommended for you

Code:
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 ,
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top