matteostasim
Guest
Buongiorno,
sono in pushnza, tempi strettissimi (vorrei mandare i files oggi), quindi vado diretto.
devo mandare a lasertubo una marea di Tubi tutti simili ma diversi relativi a 10 assiemi.
al laserista van bene i file step per fortuna.
quindi devo esportare dagli assieme i singoli step delle singole parti.
ho trovato in giro una bella regola ilogic che me lo fa.
ha solo 1 problema: mi salva gli step con il nome del file della parte originaria (orrenda essendo telai).
qualcuno sa cosa devo cambiare per salvarli col numero parte al posto del nome file (in cui ho già cambiato i nomi in caso di lunghezze uguali)?
di seguito la regola e un paio di immagini per far capire cosa vorrei.
grazie unendlich
syntaxeditor code snippet'definieren Sie das aktive Dokument als Montagedatei
dim oasmdoc als Montagedokument
oasmdoc = thisapplication.activedocument
oasmname = thisdoc.filename(false) 'ohne Erweiterung
wenn diese Anwendung.activedocumenttype <>
messagebox.show("bitte diese Regel aus der Montagedatei ausführen.", "ilogic")
Ausgang Sub
Ende
"Benutzereingabe vergessen
rusure = messagebox.show
"Dies wird eine Schrittdatei für alle Komponenten erstellen." - Ja.
& vblf & "
& vblf & "Sind Sie sicher, dass Sie Schrittzeichnungen für alle Montagekomponenten erstellen möchten?" - Ja.
& vblf & "das könnte eine Weile dauern.", "ilogic - batch output steps ",messageboxbuttons.yesno)
wenn rusure = vbno dann
zurück
andere
Ende
- - -- -- -- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
opath = thisdoc.path
'get Schritt Zielordnerpfad
vonolder = opath & "\" & oasmname & " Schrittdateien"
'Check für den Schrittordner und erstellen Sie ihn, wenn es nicht existiert
wenn nicht system.io.directory.exists(ofolder) dann
system.io.directory.createdirectory(ofolder)
Ende
- - - - - - - - - - zusammenfassend -
thisdoc.document.saveas(ofolder & "\" & oasmname &(.stp"), true)
- - - - - - - - - - - - Komponenten - - - - - - - - - - - - - - - - - -
'Sieh dir die Akten an, die von der Versammlung referiert wurden
dim orefdocs als Dokumentenenumerator
orefdocs = oasmdoc.allreferenceddocuments
dim orefdoc als Dokument
„Die Referenzmodelle bearbeiten
für jedes orefdoc in orefdoc
dim ocurfile als Dokument
ocurfile = thisapplication.documents.open(orefdoc.fullfilename, true)
ocurfilename = ocurfile.fullfilename
'Definitionen Backslash als Unterverzeichnis Separator
dim strcharsep as string = system.io.path.directoryseparatorchar
'findet die Postion des letzten Rückschlags im Pfad
fnamepos = instrrev(ocurfilename, "\", -1)
'get der Dateiname mit der Dateierweiterung
Name = rechts(ocurfilename, len(ocurfilename) - fnamepos)
'get the file name (ohne Extension)
Kurzname = links(Name, len(Name) - 4)
Versuch
ocurfile.saveas(ofolder & "\" & kurzname & (".stp"), true)
Fangmenge
messagebox.show('error processing " & ocurfilename, "ilogic")
Ende Versuch
ocurfile. schließen
Nächste
- Ja.
messagebox.show("neue Dateien erstellt in: " & vblf & ofolder, "ilogic")
'Öffnen Sie den Ordner, in dem die neuen Dateien gespeichert werden
Shell("explorer.exe " & ofolder,vbnormalfocus)
sono in pushnza, tempi strettissimi (vorrei mandare i files oggi), quindi vado diretto.
devo mandare a lasertubo una marea di Tubi tutti simili ma diversi relativi a 10 assiemi.
al laserista van bene i file step per fortuna.
quindi devo esportare dagli assieme i singoli step delle singole parti.
ho trovato in giro una bella regola ilogic che me lo fa.
ha solo 1 problema: mi salva gli step con il nome del file della parte originaria (orrenda essendo telai).
qualcuno sa cosa devo cambiare per salvarli col numero parte al posto del nome file (in cui ho già cambiato i nomi in caso di lunghezze uguali)?
di seguito la regola e un paio di immagini per far capire cosa vorrei.
grazie unendlich
syntaxeditor code snippet'definieren Sie das aktive Dokument als Montagedatei
dim oasmdoc als Montagedokument
oasmdoc = thisapplication.activedocument
oasmname = thisdoc.filename(false) 'ohne Erweiterung
wenn diese Anwendung.activedocumenttype <>
messagebox.show("bitte diese Regel aus der Montagedatei ausführen.", "ilogic")
Ausgang Sub
Ende
"Benutzereingabe vergessen
rusure = messagebox.show
"Dies wird eine Schrittdatei für alle Komponenten erstellen." - Ja.
& vblf & "
& vblf & "Sind Sie sicher, dass Sie Schrittzeichnungen für alle Montagekomponenten erstellen möchten?" - Ja.
& vblf & "das könnte eine Weile dauern.", "ilogic - batch output steps ",messageboxbuttons.yesno)
wenn rusure = vbno dann
zurück
andere
Ende
- - -- -- -- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
opath = thisdoc.path
'get Schritt Zielordnerpfad
vonolder = opath & "\" & oasmname & " Schrittdateien"
'Check für den Schrittordner und erstellen Sie ihn, wenn es nicht existiert
wenn nicht system.io.directory.exists(ofolder) dann
system.io.directory.createdirectory(ofolder)
Ende
- - - - - - - - - - zusammenfassend -
thisdoc.document.saveas(ofolder & "\" & oasmname &(.stp"), true)
- - - - - - - - - - - - Komponenten - - - - - - - - - - - - - - - - - -
'Sieh dir die Akten an, die von der Versammlung referiert wurden
dim orefdocs als Dokumentenenumerator
orefdocs = oasmdoc.allreferenceddocuments
dim orefdoc als Dokument
„Die Referenzmodelle bearbeiten
für jedes orefdoc in orefdoc
dim ocurfile als Dokument
ocurfile = thisapplication.documents.open(orefdoc.fullfilename, true)
ocurfilename = ocurfile.fullfilename
'Definitionen Backslash als Unterverzeichnis Separator
dim strcharsep as string = system.io.path.directoryseparatorchar
'findet die Postion des letzten Rückschlags im Pfad
fnamepos = instrrev(ocurfilename, "\", -1)
'get der Dateiname mit der Dateierweiterung
Name = rechts(ocurfilename, len(ocurfilename) - fnamepos)
'get the file name (ohne Extension)
Kurzname = links(Name, len(Name) - 4)
Versuch
ocurfile.saveas(ofolder & "\" & kurzname & (".stp"), true)
Fangmenge
messagebox.show('error processing " & ocurfilename, "ilogic")
Ende Versuch
ocurfile. schließen
Nächste
- Ja.
messagebox.show("neue Dateien erstellt in: " & vblf & ofolder, "ilogic")
'Öffnen Sie den Ordner, in dem die neuen Dateien gespeichert werden
Shell("explorer.exe " & ofolder,vbnormalfocus)
Anhänge
Zuletzt bearbeitet: