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!

Export Catia V5 Drawing Text

Status
Not open for further replies.
Hi Friends,

Please help me to copy all the Texts on Active Drawing sheet & Paste it to Excel.
Is it possible?

Thanks in advance

Regards
Datta Raja
 
something to start...

Code:
Sub Export_Drawing_Texts()
    
Path = "C:\Alex\Book1.xlsx"


Set objExcel = CreateObject("Excel.Application")
Set workbook = objExcel.Workbooks.Open(Path)
workbook.Application.Visible = True
workbook.Parent.Windows(1).Visible = True


objExcel.Cells(1, 1).Value = "Text Name"
objExcel.Cells(1, 2).Value = "Text Value"

    Dim oDrawing As DrawingDocument
    Set oDrawing = CATIA.ActiveDocument
    
  
    Dim oSheets As DrawingSheets
    Set oSheets = oDrawing.Sheets
    
For a = 1 To oSheets.Count

    Dim oSheet As DrawingSheet
    Set oSheet = oSheets.Item(a)
    
    Dim oView As DrawingView
    Set oView = oSheet.Views.Item(1)
    oView.Activate
    
     Dim oText As DrawingTexts
Set oText = oView.Texts

 For i = 2 To oText.Count
   Set ThisDrawingText = oText.Item(i)
     objExcel.Cells(i, 1).Value = ThisDrawingText.Name
   objExcel.Cells(i, 2).Value = ThisDrawingText.Text
  
    Next i
    
Next a
End Sub
 
Hi AlexLozoya,

Thanks a Lot..for your quick reply.
It is working..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top