Hot News:

Mit Unterstützung durch:

  Foren auf CAD.de (alle Foren)
  CATIA V5 Programmierung
  Auflisten *.CATDrawing u. Ausgabe in Datei

Antwort erstellen  Neues Thema erstellen
CAD.de Login | Logout | Profil | Profil bearbeiten | Registrieren | Voreinstellungen | Hilfe | Suchen

Anzeige:

Darstellung des Themas zum Ausdrucken. Bitte dann die Druckfunktion des Browsers verwenden. | Suche nach Beiträgen nächster neuer Beitrag | nächster älterer Beitrag
Autor Thema:  Auflisten *.CATDrawing u. Ausgabe in Datei (1223 mal gelesen)
Wahl
Mitglied
Dipl. Ing.


Sehen Sie sich das Profil von Wahl an!   Senden Sie eine Private Message an Wahl  Schreiben Sie einen Gästebucheintrag für Wahl

Beiträge: 81
Registriert: 24.09.2001

erstellt am: 23. Apr. 2007 11:46    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities

Hallo,

für mein Batch-Plot Programm möchte ich alle CATDrawings eines
Verzeichnisses in eine Datei ausgeben. Der Anwender soll diese Datei
anschliessend noch mit Notpad barbeiten können für die Feinauswahl.

Dieser Teil funktioniert schon. Ich bekomme aber die Ausgabeumlenkung wie folgt nicht gebacken:

CmdLine = "dir  "+folderinput+"*.CATDrawing 1 > "+folderinput+"liste"
msgbox CmdLine
Ergebnis = CATIA.SystemService.ExecuteProcessus(CmdLine)
msgbox Ergebnis

Hat jemand eine besser Idee ?
mfG
Wahl

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

Maximilianus
Mitglied
PLM-Consultant


Sehen Sie sich das Profil von Maximilianus an!   Senden Sie eine Private Message an Maximilianus  Schreiben Sie einen Gästebucheintrag für Maximilianus

Beiträge: 136
Registriert: 28.05.2004

Catia V5 21
CADENAS PARTsolutions / Exalead OnePart
V8.1.09 / V9.0.8
Windows 2000/XP/2003 Server/2010, HP-UX, Linux

erstellt am: 23. Apr. 2007 14:58    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities Nur für Wahl 10 Unities + Antwort hilfreich

Probier es mal hiermit:

For Each fil In fc
t = fil.Type
If (t = "CATIA Drawing" or t = "CDD-Datei") then
  filename = fil.Name
  Pos1 = instr(1, s, filename)
  If Pos1 = 0 Then
  Set documents1 = CATIA.Documents
  PFADEINGABE =  fld & "\" & fil.name
  scount = scount + 1
  sfiles = scount & ". " & filename & "<p>" & sfiles
  Set document1 = documents1.Open(PFADEINGABE)
  CATIA.ActiveWindow.WindowState = 0
  Set drawingDocument1 = CATIA.ActiveDocument
  If t = "CATIA Drawing" then
  fileoutname = replace(fil.name,".CATDrawing","")
  End If
  If t = "CDD-Datei" then
  fileoutname = replace(fil.name,".cdd","")
  End If
      If folderoutput = "NEIN" then
      PFADAUSGABE = fld & "\" & fileoutname & ".pdf"
      Else
        PFADAUSGABE = fldo & "\" & fileoutname & ".pdf"
      End If

      On Error Resume Next
  drawingDocument1.ExportData PFADAUSGABE, "pdf"
      drawingDocument1.Close

      If Err <> 0 Then
    s = s & PFADEINGABE & "; " & "Fehler!"
  Else
s = s & PFADEINGABE & "; " & PFADAUSGABE
  End If

  s = s & vbCrLf
  End if
End if
Next

For Each sfld In fld.SubFolders
  Set fc = sfld.Files
  For Each fil In fc
t = fil.Type
If (t = "CATIA Drawing" or t = "CDD-Datei") then
  filename = fil.Name
  Pos1 = instr(1, s, filename)
    If Pos1 = 0 Then
  Set documents1 = CATIA.Documents
  PFADEINGABE =  sfld & "\" & fil.name
  scount = scount + 1
  sfiles = scount & ". " & filename & "<p>" & sfiles
  Set document1 = documents1.Open(PFADEINGABE)
CATIA.ActiveWindow.WindowState = 0
Set drawingDocument1 = CATIA.ActiveDocument
  If t = "CATIA Drawing" then
  fileoutname = replace(fil.name,".CATDrawing","")
  End If
  If t = "CDD-Datei" then
  fileoutname = replace(fil.name,".cdd","")
  End If
    If folderoutput = "NEIN" then
      PFADAUSGABE = sfld & "\" & fileoutname & ".pdf"
    Else
      PFADAUSGABE = fldo & "\" & fileoutname & ".pdf"
    End If

      On Error Resume Next
  drawingDocument1.ExportData PFADAUSGABE, "pdf"
      drawingDocument1.Close

      If Err <> 0 Then
    s = s & PFADEINGABE & "; " & "Fehler!"
  Else
s = s & PFADEINGABE & "; " & PFADAUSGABE
  End If
s = s & vbCrLf
  End if
End if
  Next



For Each ssfld In sfld.SubFolders
  Set fc = ssfld.Files
  For Each fil In fc
t = fil.Type
If (t = "CATIA Drawing" or t = "CDD-Datei") then
  filename = fil.Name
  Pos1 = instr(1, s, filename)
  If Pos1 = 0 Then
  Set documents1 = CATIA.Documents
  PFADEINGABE =  ssfld & "\" & fil.name
  scount = scount + 1
  sfiles = scount & ". " & filename & "<p>" & sfiles
  Set document1 = documents1.Open(PFADEINGABE)
CATIA.ActiveWindow.WindowState = 0
Set drawingDocument1 = CATIA.ActiveDocument
  If t = "CATIA Drawing" then
  fileoutname = replace(fil.name,".CATDrawing","")
  End If
  If t = "CDD-Datei" then
  fileoutname = replace(fil.name,".cdd","")
  End If
    If folderoutput = "NEIN" then
      PFADAUSGABE = ssfld & "\" & fileoutname & ".pdf"
    Else
      PFADAUSGABE = fldo & "\" & fileoutname & ".pdf"
    End If

      On Error Resume Next
  drawingDocument1.ExportData PFADAUSGABE, "pdf"
      drawingDocument1.Close

      If Err <> 0 Then
    s = s & PFADEINGABE & "; " & "Fehler!"
  Else
s = s & PFADEINGABE & "; " & PFADAUSGABE
  End If
s = s & vbCrLf
  End if
End if
  Next

For Each sssfld In ssfld.SubFolders
  Set fc = sssfld.Files
  For Each fil In fc
t = fil.Type
If (t = "CATIA Drawing" or t = "CDD-Datei") then
  filename = fil.Name
  Pos1 = instr(1, s, filename)
  If Pos1 = 0 Then
  Set documents1 = CATIA.Documents
  PFADEINGABE =  sssfld & "\" & fil.name
  scount = scount + 1
  sfiles = scount & ". " & filename & "<p>" & sfiles
  Set document1 = documents1.Open(PFADEINGABE)
CATIA.ActiveWindow.WindowState = 0
Set drawingDocument1 = CATIA.ActiveDocument
  If t = "CATIA Drawing" then
  fileoutname = replace(fil.name,".CATDrawing","")
  End If
  If t = "CDD-Datei" then
  fileoutname = replace(fil.name,".cdd","")
  End If
    If folderoutput = "NEIN" then
      PFADAUSGABE = sssfld & "\" & fileoutname & ".pdf"
    Else
      PFADAUSGABE = fldo & "\" & fileoutname & ".pdf"
    End If

      On Error Resume Next
  drawingDocument1.ExportData PFADAUSGABE, "pdf"
      drawingDocument1.Close

      If Err <> 0 Then
    s = s & PFADEINGABE & "; " & "Fehler!"
  Else
s = s & PFADEINGABE & "; " & PFADAUSGABE
  End If
s = s & vbCrLf
  End if
End if
  Next

For Each ssssfld In sssfld.SubFolders
  Set fc = ssssfld.Files
  For Each fil In fc
t = fil.Type
If (t = "CATIA Drawing" or t = "CDD-Datei") then
  filename = fil.Name
  Pos1 = instr(1, s, filename)
    If Pos1 = 0 Then
  Set documents1 = CATIA.Documents
  PFADEINGABE =  ssssfld & "\" & fil.name
  scount = scount + 1
  sfiles = scount & ". " & filename & "<p>" & sfiles
Set document1 = documents1.Open(PFADEINGABE)
CATIA.ActiveWindow.WindowState = 0
Set drawingDocument1 = CATIA.ActiveDocument
  If t = "CATIA Drawing" then
  fileoutname = replace(fil.name,".CATDrawing","")
  End If
  If t = "CDD-Datei" then
  fileoutname = replace(fil.name,".cdd","")
  End If
    If folderoutput = "NEIN" then
      PFADAUSGABE = ssssfld & "\" & fileoutname & ".pdf"
    Else
      PFADAUSGABE = fldo & "\" & fileoutname & ".pdf"
    End If

      On Error Resume Next
  drawingDocument1.ExportData PFADAUSGABE, "pdf"
      drawingDocument1.Close

      If Err <> 0 Then
    s = s & PFADEINGABE & "; " & "Fehler!"
  Else
s = s & PFADEINGABE & "; " & PFADAUSGABE
  End If
s = s & vbCrLf
  End if
End if
  Next
  Next
Next
Next
Next

' FileSystemObject objFs oeffnen
Set objFs= CreateObject("Scripting.FileSystemObject")

If folderoutput = "NEIN" then
    strDateiname = folderinput + "\" + "Drawing2PDF-DeepStructure-Report.csv"
Else
    strDateiname = folderoutput + "\" + "Drawing2PDF-DeepStructure-Report.csv"
End If

Set objTextStream = objFs.CreateTextFile(strDateiname, True)
strWriteString = s
objTextStream.Write strWriteString
objTextStream.Close
Set objTextStream = Nothing
Set objFs = Nothing

MsgBox "Fertig !" & vbCrLf & "Eine Logdatei finden Sie hier: " & strDateiname

Mit diesem (unvollständigen) Script werden bis zu vier Unterverzeichnisebenen mitdurchsucht und die CATDrawings als PDF gespeichert.

Die Logvariable s enthält alle Dateinamen. Diese Logdaten werden in die Datei Drawing2PDF-DeepStructure-Report.csv geschrieben.

Maximilianus

------------------
Maximilianus
Dipl.-Ing. (Wi-Ing ET)
PLM-Consultant

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

Anzeige.:

Anzeige: (Infos zum Werbeplatz >>)

Darstellung des Themas zum Ausdrucken. Bitte dann die Druckfunktion des Browsers verwenden. | Suche nach Beiträgen

nächster neuerer Beitrag | nächster älterer Beitrag
Antwort erstellen


Diesen Beitrag mit Lesezeichen versehen ... | Nach anderen Beiträgen suchen | CAD.de-Newsletter

Administrative Optionen: Beitrag schliessen | Archivieren/Bewegen | Beitrag melden!

Fragen und Anregungen: Kritik-Forum | Neues aus der Community: Community-Forum

(c)2023 CAD.de | Impressum | Datenschutz