Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to loop through already opened .CATDrawing files in catia v5 using vba

Sidtha

Aerospace
Nov 25, 2012
34
Hello,

Is there any possiblity to loop through already opened .CATDrawing files in catia v5 using vba.

If yes please help me with code


I found below code but its counting sheets inside the same CATDrawing file.

Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument
Set oDrwView = drawingDocument1.Sheets.ActiveSheet.Views

Debug.Print drawingDocument1.Sheets.Count

For i = 1 To drawingDocument1.Sheets.Count
Set oSheet = drawingDocument1.Sheets.Item(i)
oSheet.Activate
Debug.Print oSheet.Name
Next

BR Siddu
 
Replies continue below

Recommended for you

Code:
Sub CATMain()
Dim V As Integer
Dim StrWindows As String
Dim DrawingExists As Boolean
DrawingExists = False
Set windows2 = CATIA.Windows
For V = 1 To windows2.Count
    StrWindows = windows2.item(V).name
    MsgBox windows2.item(V).Parent.name
    If InStr(StrWindows, "Drawing") Then
        DrawingExists = True
        MsgBox StrWindows
    End If
Next
End Sub
 

Part and Inventory Search

Sponsor