diff --git a/Dokumentáció Készítő 3.sln b/Dokumentáció Készítő 3.sln
new file mode 100644
index 0000000..738c92f
--- /dev/null
+++ b/Dokumentáció Készítő 3.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29102.190
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Dokumentáció Készítő 3", "Dokumentáció Készítő 3\Dokumentáció Készítő 3.vbproj", "{0D82F19D-DF81-45F3-9BF3-6CE2E79267E6}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0D82F19D-DF81-45F3-9BF3-6CE2E79267E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0D82F19D-DF81-45F3-9BF3-6CE2E79267E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0D82F19D-DF81-45F3-9BF3-6CE2E79267E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0D82F19D-DF81-45F3-9BF3-6CE2E79267E6}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3A13563B-6A8A-4203-8467-975D7AE62D66}
+ EndGlobalSection
+EndGlobal
diff --git a/Dokumentáció Készítő 3/App.config b/Dokumentáció Készítő 3/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/Dokumentáció Készítő 3/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/Application.xaml b/Dokumentáció Készítő 3/Application.xaml
new file mode 100644
index 0000000..0515c55
--- /dev/null
+++ b/Dokumentáció Készítő 3/Application.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/Application.xaml.vb b/Dokumentáció Készítő 3/Application.xaml.vb
new file mode 100644
index 0000000..084cbe9
--- /dev/null
+++ b/Dokumentáció Készítő 3/Application.xaml.vb
@@ -0,0 +1,6 @@
+Class Application
+
+ ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
+ ' can be handled in this file.
+
+End Class
diff --git a/Dokumentáció Készítő 3/Dokumentáció Készítő 3.vbproj b/Dokumentáció Készítő 3/Dokumentáció Készítő 3.vbproj
new file mode 100644
index 0000000..2c32528
--- /dev/null
+++ b/Dokumentáció Készítő 3/Dokumentáció Készítő 3.vbproj
@@ -0,0 +1,247 @@
+
+
+
+ Debug
+ AnyCPU
+ {0D82F19D-DF81-45F3-9BF3-6CE2E79267E6}
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
+ WinExe
+ Dokumentáció_Készítő_3
+ Dokumentáció Készítő 3
+ v4.7.2
+ Custom
+ true
+ true
+
+
+
+
+ AnyCPU
+ true
+ full
+ true
+ true
+ true
+ bin\Debug\
+ Dokumentáció Készítő 3.xml
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314
+
+
+ AnyCPU
+ pdbonly
+ false
+ false
+ true
+ false
+ true
+ bin\Release\
+ Dokumentáció Készítő 3.xml
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314
+
+
+ On
+
+
+ Binary
+
+
+ Off
+
+
+ On
+
+
+
+ ..\packages\Portable.BouncyCastle.1.8.5\lib\net40\BouncyCastle.Crypto.dll
+
+
+ ..\packages\Common.Logging.3.4.1\lib\net40\Common.Logging.dll
+
+
+ ..\packages\Common.Logging.Core.3.4.1\lib\net40\Common.Logging.Core.dll
+
+
+ ..\packages\iTextSharp.5.5.13.1\lib\itextsharp.dll
+
+
+ ..\packages\MaterialDesignColors.1.2.4\lib\net45\MaterialDesignColors.dll
+
+
+ ..\packages\MaterialDesignExtensions.3.1.0\lib\net45\MaterialDesignExtensions.dll
+
+
+ ..\packages\MaterialDesignThemes.3.1.1\lib\net45\MaterialDesignThemes.Wpf.dll
+
+
+
+ ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll
+
+
+ ..\packages\Ookii.Dialogs.1.0\lib\net35\Ookii.Dialogs.Wpf.dll
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Form2.xaml
+
+
+ form3.xaml
+
+
+ Window1.xaml
+
+
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+ Always
+
+
+ Application.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+ Always
+
+
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Microsoft.VisualBasic.WPF.MyExtension
+ 1.0.0.0
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ VbMyResourcesResXFileCodeGenerator
+ Resources.Designer.vb
+ My.Resources
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.vb
+
+
+
+
+
+
+
+ {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}
+ 2
+ 8
+ 0
+ primary
+ False
+ True
+
+
+ {00020813-0000-0000-C000-000000000046}
+ 1
+ 9
+ 0
+ primary
+ False
+ True
+
+
+ {176453F2-6934-4304-8C9D-126D98C1700E}
+ 1
+ 0
+ 0
+ tlbimp
+ False
+ True
+
+
+ {0002E157-0000-0000-C000-000000000046}
+ 5
+ 3
+ 0
+ primary
+ False
+ True
+
+
+
+
+
+
+
+ Always
+
+
+
+
+ Always
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/Form2.xaml b/Dokumentáció Készítő 3/Form2.xaml
new file mode 100644
index 0000000..a9631d1
--- /dev/null
+++ b/Dokumentáció Készítő 3/Form2.xaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
diff --git a/Dokumentáció Készítő 3/Form2.xaml.vb b/Dokumentáció Készítő 3/Form2.xaml.vb
new file mode 100644
index 0000000..5154771
--- /dev/null
+++ b/Dokumentáció Készítő 3/Form2.xaml.vb
@@ -0,0 +1,25 @@
+Public Class Form2
+ Public Shared ans As String
+ Public Shared NewParamValue As String
+
+
+ Private Sub Form2_Loaded(ByVal sender As Object, ByVal e As EventArgs) Handles MyClass.Loaded
+ Label1.Content = "A " & MainWindow.ParamNameD & " paraméternek alapérték van beállítáva, szeretnéd módosítanin?"
+
+ End Sub
+
+
+
+ Private Sub MaterialRaisedButton1_Click(sender As Object, e As RoutedEventArgs) Handles MaterialRaisedButton1.Click
+ ans = "ok"
+ End Sub
+
+ Private Sub MaterialRaisedButton2_Click(sender As Object, e As RoutedEventArgs) Handles MaterialRaisedButton2.Click
+ ans = "notok"
+ End Sub
+
+ Private Sub TextBox_TextChanged(sender As Object, e As TextChangedEventArgs)
+ NewParamValue = TextBox1.Text
+ End Sub
+
+End Class
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/HandleWindow.vb b/Dokumentáció Készítő 3/HandleWindow.vb
new file mode 100644
index 0000000..369ea25
--- /dev/null
+++ b/Dokumentáció Készítő 3/HandleWindow.vb
@@ -0,0 +1,73 @@
+Imports System.Runtime.InteropServices
+Module HandleWindow
+
+ Dim name3 As String
+ Dim name4 As String
+ Dim n As Integer = 0
+ Dim CreoWindowNameM As String
+ Public Declare Function EnumWindows Lib "User32.dll" (ByVal WNDENUMPROC As EnumWindowDelegate, ByVal lparam As IntPtr) As Boolean
+ Public Declare Auto Function GetWindowText Lib "User32.dll" (ByVal Hwnd As IntPtr, ByVal Txt As Byte(), ByVal Lng As Integer) As Integer
+ Public Declare Function IsWindowVisible Lib "User32.dll" (ByVal hwnd As IntPtr) As Boolean
+ Public Declare Function GetWindowTextLengthA Lib "User32.dll" (ByVal hwnd As IntPtr) As Integer
+ Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
+ Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
+ Public Const SWP_SHOWWINDOW = &H40
+ Public Const SWP_NOMOVE = &H2
+ Public Const SWP_NOSIZE = &H1
+ Delegate Function EnumWindowDelegate(ByVal hWnd As IntPtr, ByVal Lparam As IntPtr) As Boolean
+ Public Callback As EnumWindowDelegate = New EnumWindowDelegate(AddressOf EnumWindowProc)
+
+ Public Function FocusWindowM(name1 As String, name2 As String)
+ name3 = name1
+ name4 = name2
+
+ Dim Result As String = HandleWindow.EnumWindows(Callback, IntPtr.Zero)
+ n = n + 1
+ FocusWindow()
+ Return True
+
+ End Function
+ Public Function EnumWindowProc(ByVal hWnd As IntPtr, ByVal Lparam As IntPtr) As Boolean
+
+ If IsWindowVisible(hWnd) Then
+ Dim TheLength As Integer = GetWindowTextLengthA(hWnd)
+ Dim TheReturn(TheLength * 2) As Byte '2x the size of the Max length
+ GetWindowText(hWnd, TheReturn, TheLength + 1)
+ Dim TheText As String = ""
+ For x = 0 To (TheLength - 1) * 2
+ If TheReturn(x) <> 0 Then
+ TheText &= Chr(TheReturn(x))
+ End If
+ Next
+
+ If TheText.Contains(name3) And TheText.Contains(name4) Then
+
+ CreoWindowNameM = TheText
+ Else
+
+ End If
+
+ End If
+
+ Return True
+
+ End Function
+ Public Sub FocusWindow()
+ Dim dbHwnd As IntPtr = FindWindow(Nothing, CreoWindowNameM)
+
+ Debug.Print(dbHwnd)
+ If dbHwnd = 0 Then
+ ' MsgBox("Can't find creo window")
+ Else
+ ' MsgBox("Creo window found")
+ SetWindowPos(dbHwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE)
+
+ End If
+ End Sub
+
+
+
+
+End Module
+
+
diff --git a/Dokumentáció Készítő 3/Images/baseline_clear_black_18dp.png b/Dokumentáció Készítő 3/Images/baseline_clear_black_18dp.png
new file mode 100644
index 0000000..4ad510b
Binary files /dev/null and b/Dokumentáció Készítő 3/Images/baseline_clear_black_18dp.png differ
diff --git a/Dokumentáció Készítő 3/Images/logo.png b/Dokumentáció Készítő 3/Images/logo.png
new file mode 100644
index 0000000..7ecece0
Binary files /dev/null and b/Dokumentáció Készítő 3/Images/logo.png differ
diff --git a/Dokumentáció Készítő 3/MainWindow.xaml b/Dokumentáció Készítő 3/MainWindow.xaml
new file mode 100644
index 0000000..6863827
--- /dev/null
+++ b/Dokumentáció Készítő 3/MainWindow.xaml
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/MainWindow.xaml.vb b/Dokumentáció Készítő 3/MainWindow.xaml.vb
new file mode 100644
index 0000000..890a762
--- /dev/null
+++ b/Dokumentáció Készítő 3/MainWindow.xaml.vb
@@ -0,0 +1,2847 @@
+
+Option Explicit On
+
+Imports pfcls
+Imports System.IO
+Imports Ookii
+Imports iTextSharp.text.pdf
+Imports Excel = Microsoft.Office.Interop.Excel
+Imports System.Runtime.InteropServices
+Imports Newtonsoft.Json
+Imports Newtonsoft.Json.Linq
+Imports System.Net
+Imports System.Text
+Imports System.Runtime.Serialization.Formatters.Binary
+Imports System.Runtime.Serialization
+Imports Microsoft.Win32
+Imports System.ComponentModel
+Imports System.Text.RegularExpressions
+Imports Microsoft.Office.Interop.Excel
+Imports Microsoft.Office.Core
+Imports Shape = Microsoft.Office.Interop.Excel.Shape
+
+Public Class MainWindow
+
+ Dim NewWindow As New Form2
+
+ Public Shared ParamValueD As String = ""
+ Public Shared ParamNameD As String = ""
+ Public Shared HibakSzama As Integer = 0
+ Public str1 As String
+ Public str2 As String
+ Public Shared sresult As String
+ Public Shared ddas As Boolean = True
+ Dim FilesList As New List(Of String)
+ Dim drw_names As New List(Of String)
+ Dim drw_paths As New List(Of String)
+ Dim FileNames As New List(Of String)
+ Dim row_count As Single
+ Dim strFilePath As String
+ Dim table As IpfcTable = Nothing
+ Dim i As Single
+ Dim pdfFiles As New List(Of String)
+ Dim PathToPurge As String
+ Dim NameList As New List(Of String)
+ Dim models As New List(Of IpfcModel)
+ 'table
+ Dim SHMNum As String
+ Dim NameT As String
+ Dim MachineName As String
+ Dim SHMDate As String
+ Dim SubMachineName As String
+ Dim AudiNum As String
+ Dim excelPrintNeeded As Boolean
+
+
+
+
+ Dim NeedPdf As Boolean
+ Dim NeedPdfOssze As Boolean
+ Dim NeedDxf As Boolean
+ Dim NeedTiff As Boolean
+ Dim NeedParams As Boolean
+ Dim NeedXls As Boolean
+ Dim NeedStroke As Boolean
+ Dim NeedSheetNumbers As Boolean
+ Dim NeedStep As Boolean
+
+ Dim xlApp As Excel.Application
+ Dim xlWorkBook As Excel.Workbook
+ Dim xlWorkSheet As Excel.Worksheet
+ Dim ProgressTextstr As String
+
+ Dim LoadingPoints As String
+ Dim LoadingPointsCount As Integer = 0
+ Dim FileNameModTimer As String
+ Dim q As Integer = 0
+
+ 'FilesCreated
+ Dim xlsCreated As New List(Of String)
+ Dim dxfCreated As New List(Of String)
+ Dim tiffCreated As New List(Of String)
+ Dim pdfCreated As New List(Of String)
+ Dim params As New List(Of String)
+ Public Shared workDir As String
+
+ Dim SheetNumber As Integer
+ Dim SheetPartList As New List(Of String)
+ Dim folderpicked As String
+ Dim WithEvents BackgroundWorker1 As New BackgroundWorker()
+ Dim WithEvents BackgroundWorker2 As New BackgroundWorker()
+ Dim WithEvents BackgroundWorker3 As New BackgroundWorker()
+
+ Public Shared dict As New Dictionary(Of String, String)(System.StringComparer.Ordinal)
+
+ Dim isSeperateDrawing As Boolean
+ Dim isEllNeeded As Boolean
+ Dim sheetParamNeeded As Boolean
+ Dim printNeeded As Boolean
+ Dim autofolder As Boolean
+ Dim namingsyntax As String
+ Dim xlstype As String = ""
+
+ Dim session As IpfcBaseSession = Nothing
+ Dim conn As IpfcAsyncConnection = Nothing
+
+ 'Buttons
+ Private Sub MyWindow_Loaded(ByVal sender As Object, ByVal e As EventArgs) Handles MainWindow.Loaded
+ BackgroundWorker2.WorkerReportsProgress = True
+ BackgroundWorker2.WorkerSupportsCancellation = True
+ BackgroundWorker1.WorkerReportsProgress = True
+
+ For Each param As String In Environment.GetCommandLineArgs
+ params.Add(param)
+ ' MsgBox(param)
+ Next param
+
+
+ PDFCheckBox.IsChecked = True
+ DXFCheckBox.IsChecked = True
+ XLSCheckbox.IsChecked = True
+ NamingSyntaxStefani.IsChecked = True
+ namingsyntax = "stefani"
+ AktualisRajzRadioButton.IsChecked = True
+ ' MainWindow.MinHeight = 270
+ 'MainWindow.MaxHeight = 270
+
+
+
+ If params.Contains("-arg") Then
+ Try
+ For Each P As Process In System.Diagnostics.Process.GetProcessesByName("cmd")
+ P.Kill()
+ Next
+ Catch ex As Exception
+
+ End Try
+ Me.Opacity = 0
+ PDFCheckBox.IsChecked = False
+ DXFCheckBox.IsChecked = False
+ XLSCheckbox.IsChecked = False
+
+
+ If params.Contains("-egylap") Then
+ KulonAloRajzok.IsChecked = False
+ MaterialRadioButton3.IsChecked = True
+
+ End If
+ If params.Contains("-tobblap") Then
+ KulonAloRajzok.IsChecked = True
+ MaterialRadioButton3.IsChecked = False
+ End If
+
+
+ CreateDocument.RaiseEvent(New RoutedEventArgs(System.Windows.Controls.Button.ClickEvent))
+
+ End If
+
+ Try
+ Process.GetProcessesByName("pfclscom")(0).Kill()
+ Catch ex As Exception
+ ' MsgBox("1")
+ End Try
+
+
+ Dim conn As IpfcAsyncConnection = Nothing
+
+ Try
+ Connect(session, conn)
+ Catch ex As Exception
+ If ex.Message = "pfcExceptions::XToolkitAmbiguous" Then
+ MsgBox("Egynél több Creo fut, kérlezk zárd be az egyiket.")
+ End If
+ Exit Sub
+ End Try
+
+ End Sub
+
+ Private Sub Destenation_Browse_Click(sender As Object, e As EventArgs)
+ 'Jelenleg nem használt!!!
+ Dim mydig As New Ookii.Dialogs.Wpf.VistaFolderBrowserDialog
+ mydig.SelectedPath = folderpicked
+ mydig.ShowDialog()
+
+ If Not Strings.Right(mydig.SelectedPath, 1) = "\" Then
+ folderpicked = mydig.SelectedPath() + "\"
+ End If
+ End Sub
+ Private Sub Files_Browse_Click(sender As Object, e As EventArgs) Handles Files_Browse.Click
+
+ 'Dialogbox megmutatása
+ ListBox1.Items.Clear()
+ FilesList.Clear()
+
+
+
+
+
+ Dim b As New OpenFileDialog
+ b.Multiselect = True 'Több file kijelölhetősége
+ b.Filter = "DRW|*drw.1|All version drw|*.drw*" 'Alap formátum kiválasztáas
+ b.InitialDirectory = session.GetCurrentDirectory
+
+
+ FixExtention(session.GetCurrentDirectory)
+
+
+ ' b.AutoUpgradedimEnabled = True
+ 'ez biztos rossz lesz!!!!!!!!!!!!
+ ' Dim bul As Boolean
+ ' bul = b.ShowDialog
+
+ If b.ShowDialog() = True Then
+
+ Dim names As String() = b.FileNames
+
+ For Each name As String In names
+ ListBox1.Items.Add(Path.GetFileNameWithoutExtension(name))
+ FilesList.Add(name)
+ Next
+
+ End If
+
+ End Sub
+
+ Private Sub CreateDocument_Click(sender As Object, e As RoutedEventArgs) Handles CreateDocument.Click
+
+
+
+
+
+ workDir = session.GetCurrentDirectory
+ ' MsgBox(workDir)
+ If PDFCheckBox.IsChecked = True Or
+ DXFCheckBox.IsChecked = True Or
+ TIFFCheckbox.IsChecked = True Or
+ XLSCheckbox.IsChecked = True Then
+
+
+ ' MsgBox(session.ConnectionId)
+
+ If autofolder = True Then
+ Dim FileExtPos As Integer
+ workDir = Path.GetDirectoryName(workDir)
+ Try
+ FileExtPos = Path.GetFullPath(workDir).LastIndexOf("02 - Modellek")
+ workDir = workDir.Substring(0, FileExtPos)
+ Catch ex As Exception
+
+ End Try
+
+
+ workDir = workDir + "\03 - Gyártási dokumentáció\"
+
+
+
+ System.IO.Directory.CreateDirectory(workDir)
+ End If
+ ' MsgBox(workDir)
+ If autofolder = False Then
+ Dim mydig As New Ookii.Dialogs.Wpf.VistaFolderBrowserDialog
+ mydig.SelectedPath = workDir
+ mydig.ShowDialog()
+ If Not Strings.Right(mydig.SelectedPath, 1) = "\" Then
+ folderpicked = mydig.SelectedPath() + "\"
+ End If
+ Else
+ folderpicked = "aaas"
+
+ End If
+
+ Else
+
+ folderpicked = "casddasdasdawindows"
+ End If
+
+ 'Figyelmeztetés hogy túl hosszú az elérési út
+ '---
+ '' Dim asn As DialogResult
+
+ ' asn = MessageBox.Show(,
+ ' "Hajjaj..",
+ '' MessageBoxButtons.YesNo,
+ ' MessageBoxIcon.Warning,
+ ' MessageBoxDefaultButton.Button1)
+ ' End If
+ ' If asn = DialogResult.No Then
+
+
+ If NamingSyntaxStefani.IsChecked Then
+ namingsyntax = "stefani"
+ xlstype = ""
+ ElseIf NamingSyntaxAudi.IsChecked Then
+ namingsyntax = "audi"
+ xlstype = ""
+ ElseIf NamingSyntaxHanon.IsChecked Then
+ namingsyntax = "stefani"
+ xlstype = "hanon"
+ End If
+
+
+
+ '\--
+ If folderpicked.Length > 196 Then
+ Dim result As MessageBoxResult = MessageBox.Show("A kiválasztotte elérésiút túl hosszű, szeretnéd folytatni?", "Hajjaj..", MessageBoxButton.YesNo, MessageBoxImage.Warning)
+ If result = MessageBoxResult.Yes Then
+ Exit Sub
+ End If
+
+ End If
+ If folderpicked.Length > 1 Then
+
+ MainGrid.IsEnabled = False
+ BackgroundWorker2.RunWorkerAsync()
+ BackgroundWorker1.RunWorkerAsync()
+
+ End If
+ ' Close()
+ End Sub
+ Private Sub AutomateFolderPick_Cick(sender As Object, e As EventArgs)
+
+
+
+ AutomatedFolderPick(session)
+
+
+ End Sub
+ Private Sub PurgeBongeszesButton_Click(sender As Object, e As EventArgs) Handles PurgeBongeszesButton.Click
+
+ Dim mydig As New Ookii.Dialogs.Wpf.VistaFolderBrowserDialog
+ mydig.ShowDialog()
+
+ Dim PurgeSelectedPath = mydig.SelectedPath() + "\"
+
+ Try
+ My.Computer.FileSystem.DeleteFile(Path.GetTempPath() + "FilesDeletedRenamed.txt")
+ Catch ex As Exception
+
+ End Try
+
+
+ Dim TempTxtFile As String = Path.GetTempPath() + "FilesDeletedRenamed.txt"
+ Dim fs As FileStream = File.Create(TempTxtFile)
+ fs.Close()
+ Dim allDirectories = System.IO.Directory.EnumerateDirectories(PurgeSelectedPath, "*", System.IO.SearchOption.AllDirectories)
+ 'Dim allDirectoriesList As String()
+
+
+ For Each DirD In allDirectories
+ ' MsgBox(DirD)
+
+ If PRTCheckBox.IsChecked = True Then
+ Purge.Purge(DirD, 1, ".prt", True, False, TempTxtFile)
+ End If
+ If ASMCheckBox.IsChecked = True Then
+ Purge.Purge(DirD, 1, ".asm", True, False, TempTxtFile)
+ End If
+ If DRWCheckBox.IsChecked = True Then
+ Purge.Purge(DirD, 1, ".drw", True, False, TempTxtFile)
+ End If
+
+ Next
+
+ Process.Start(Path.GetTempPath() + "FilesDeletedRenamed.txt")
+ End Sub
+
+
+ Private Sub drwSplitButton_Click_1(sender As Object, e As EventArgs) Handles drwSplitButton.Click
+
+ TakeAway()
+
+ End Sub
+ 'Radio Buttons
+ Private Sub MaterialRadioButton4_CheckedChanged(sender As Object, e As EventArgs)
+
+ ListBox1.IsEnabled = True
+ Files_Browse.IsEnabled = True
+ PDFOsszeCheckBox.IsEnabled = True
+ SheetCheckBox.IsEnabled = False
+ SheetCheckBox.IsChecked = False
+
+ End Sub
+ Private Sub MaterialRadioButton3_CheckedChanged(sender As Object, e As EventArgs)
+
+ ListBox1.IsEnabled = False
+ Files_Browse.IsEnabled = False
+ PDFOsszeCheckBox.IsEnabled = False
+ PDFOsszeCheckBox.IsChecked = False
+ 'XLSCheckBox.Enabled = True
+ ' XLSCheckBox.Checked = True
+ SheetCheckBox.IsEnabled = True
+ ListBox1.Items.Clear()
+ FilesList.Clear()
+
+ End Sub
+
+ 'Check boxes
+ Private Sub DxfCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles DXFCheckBox.Checked, DXFCheckBox.Unchecked
+
+ If DXFCheckBox.IsChecked = True Then
+ NeedDxf = True
+ Else
+ NeedDxf = False
+ End If
+
+ End Sub
+
+
+
+ Private Sub XLSCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles XLSCheckbox.Checked, XLSCheckbox.Unchecked
+
+ If XLSCheckbox.IsChecked = True Then
+ NeedXls = True
+
+ Else
+ NeedXls = False
+ End If
+
+ End Sub
+
+ Private Sub TiffCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles TIFFCheckbox.Checked, TIFFCheckbox.Unchecked
+
+ If TIFFCheckbox.IsChecked = True Then
+ NeedTiff = True
+ Else
+ NeedTiff = False
+ End If
+
+ End Sub
+ Private Sub PdfTypeStroke_CheckedChanged(sender As Object, e As EventArgs)
+
+ If NeedPdfStroke.IsChecked = True Then
+ NeedStroke = True
+ Else
+ NeedStroke = False
+ End If
+
+ End Sub
+ Private Sub PDFOsszeCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles PDFCheckBox.Checked, PDFCheckBox.Unchecked
+
+ If PDFOsszeCheckBox.IsChecked = True Then
+ NeedPdfOssze = True
+ Else
+ NeedPdfOssze = False
+ End If
+
+
+ End Sub
+ Private Sub PdfCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles PDFCheckBox.Checked, PDFCheckBox.Unchecked
+
+ If PDFCheckBox.IsChecked = True Then
+ NeedPdf = True
+ NeedPdfStroke.IsEnabled = True
+ Else
+ NeedPdf = False
+ NeedPdfStroke.IsEnabled = False
+ NeedPdfStroke.IsChecked = False
+ End If
+
+ If KulonAloRajzok.IsChecked = True Then
+ If PDFCheckBox.IsChecked = True Then
+ PDFOsszeCheckBox.IsEnabled = True
+ PDFOsszeCheckBox.IsChecked = True
+ Else
+ PDFOsszeCheckBox.IsEnabled = False
+ PDFOsszeCheckBox.IsChecked = False
+ End If
+ End If
+
+ End Sub
+
+ Private Sub SheetCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles SheetCheckBox.Checked, SheetCheckBox.Unchecked
+
+ If SheetCheckBox.IsChecked = True Then
+ NeedSheetNumbers = True
+ Else
+ NeedSheetNumbers = False
+ End If
+
+ End Sub
+ 'Document creation subs
+ Private Sub CreateDocuments()
+ xlsCreated.Clear()
+ dxfCreated.Clear()
+ tiffCreated.Clear()
+ pdfCreated.Clear()
+ HibakSzama = 0
+
+
+
+ If isSeperateDrawing = True Then
+
+
+ ' Dim filenames As New List(Of String)
+ Dim FileExtPos As Single
+ Dim FileExtPos_names As Single
+
+ For Each item As String In FilesList
+ FileExtPos = Path.GetFullPath(item).LastIndexOf("\")
+ FileExtPos_names = Path.GetFileNameWithoutExtension(item).LastIndexOf(".")
+ drw_names.Add(Path.GetFileNameWithoutExtension(item).Substring(0, FileExtPos_names))
+ drw_paths.Add(Path.GetFullPath(item).Substring(0, FileExtPos + 1))
+ FileNames.Add(Path.GetFileNameWithoutExtension(item))
+ Next
+
+ row_count = drw_paths.Count
+ Else
+
+
+ End If
+
+
+ Dim y As Single
+
+ SheetNumber = 1
+ ProgressTextstr = "Csatlakozás..."
+ BackgroundWorker1.ReportProgress(0)
+
+ ' Threading.Thread.Sleep(2500)
+
+ Dim model1 As IpfcModel = session.CurrentModel
+
+ '
+ HandlePage(session, y)
+ ' If namingsyntax = "stefani" Then
+ ' HideShowTables(session, model1, 0)
+ ' End If
+
+
+
+ q = 0
+ i = 0
+ ' table.Display()
+ NameList.Clear()
+ drw_names.Clear()
+ drw_paths.Clear()
+ FileNames.Clear()
+ pdfFiles.Clear()
+ folderpicked = ""
+ End Sub
+ Private Sub HandlePage(session As IpfcBaseSession, y As Single)
+
+ Dim model1 As IpfcModel = Nothing
+ Dim options As IpfcRetrieveModelOptions = Nothing
+ Dim oModelDescriptor As IpfcModelDescriptor = Nothing
+ Dim oModelDescriptorCreate As New CCpfcModelDescriptor
+ Dim sheetowner As IpfcSheetOwner = Nothing
+ Dim Drawing As IpfcDrawing = Nothing
+ Dim oWindow As IpfcWindow
+
+
+
+
+
+ If isSeperateDrawing = False Then
+
+ row_count = 1
+ drw_names.Add(session.CurrentModel.FileName)
+ FileNames.Add(session.CurrentModel.FileName)
+
+ End If
+
+ For y = 0 To row_count - 1
+
+ oModelDescriptor = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_DRAWING, drw_names(y), "")
+
+ If isSeperateDrawing = True Then
+
+ options = (New CCpfcRetrieveModelOptions).Create
+ options.AskUserAboutReps = False
+ oModelDescriptor.Path = drw_paths(y)
+
+
+ Console.WriteLine("Cél könyvtár:" + drw_paths(y))
+ Console.WriteLine("File Name:" + drw_names(y))
+ Try
+ model1 = session.RetrieveModelWithOpts(oModelDescriptor, options)
+ Catch ex As Exception
+ MsgBox("Nem lehet megnyitni a rajzot! (Nincs a modell a mappában?)")
+ End Try
+
+
+ Else
+ Try
+ model1 = session.CurrentModel
+ Catch ex As Exception
+
+ MsgBox("Active window not drw? " & ex.Message)
+ Exit Sub
+ End Try
+ End If
+
+ If isSeperateDrawing = True Then
+ oWindow = session.OpenFile(oModelDescriptor)
+ oWindow.Activate()
+ Else
+ oWindow = session.CurrentWindow
+ oWindow.Activate()
+ End If
+ '
+
+ Dim iTableOwner As IpfcTableOwner
+ iTableOwner = model1
+ iTableOwner.UpdateTables()
+
+
+ 'Count Number of sheets
+ Dim LapokSzama As Integer
+ sheetowner = model1
+ LapokSzama = sheetowner.NumberOfSheets
+ Drawing = CType(model1, IpfcDrawing)
+
+ 'Write parameters if needed
+ ' If NeedParams = True Then
+ 'WriteParam(model1, FocsoportTextLine.Text, "oa_megnevezes_1")
+ 'WriteParam(model1, AlcsoportTextLine.Text, "oa_megnevezes_2")
+ ' WriteParam(model1, AudiRajzszamParam.Text, "AUDI_RAJZSZAM")
+ ' End If
+
+ 'Handles sheets on drw
+
+
+ ' ParamaterChecker(model1)
+
+ ' ChangeSheets(model1, session, Drawing)
+
+
+
+ HandleSheet(session, sheetowner, model1, Drawing, LapokSzama, y)
+ 'Create PDF if needed
+ If NeedPdf = True Then
+
+ Dim FileNameMod As String
+ ' MsgBox(FileNames(y))
+ FileNameMod = FileNames(y)
+ HandleNames(FileNameMod, y, 0, ".PDF", model1)
+ CreatePdf(session, model1, FileNameMod)
+
+ End If
+ Dim iWindows As IpfcWindows
+ iWindows = session.ListWindows
+
+ ' MsgBox(WindowCount)
+ 'Close active window
+ If isSeperateDrawing = True Then
+ oWindow.Close()
+ End If
+
+
+ Next
+
+ 'Merge PDF if needed
+ If NeedPdfOssze = True Then
+
+ MergePdfFiles(pdfFiles, folderpicked + "/Oszefuzott.pdf")
+
+ End If
+
+ End Sub
+ Private Sub HandleSheet(Session As IpfcBaseSession, SheetOwner As IpfcSheetOwner, Model1 As IpfcModel, Drawing As IpfcDrawing, LapokSzama As Single, y As Single)
+
+ Dim FileNameMod As String
+ Drawing.CurrentSheetnumber = 1
+ FileNameMod = FileNames(y)
+
+ ' If NeedDxf = True Then
+ HideShowTables(Session, Model1, 1)
+ ' End If
+
+ If NeedDxf = False And NeedTiff = False And sheetParamNeeded = False And printNeeded = False Then
+ LapokSzama = 1
+ End If
+
+ If NeedXls = True Then
+
+ If isSeperateDrawing = True Then
+
+ ' If y = 0 Then
+
+ HandleNames(FileNameMod, 1, 1, ".xls", Model1)
+ CreateExcel(Session, FileNameMod)
+ ' End If
+
+ Else
+ HandleNames(FileNameMod, y, 1, ".xls", Model1)
+ CreateExcel(Session, FileNameMod)
+ End If
+
+ End If
+
+
+
+
+
+
+ For i = 1 To LapokSzama
+
+ SheetOwner = Model1
+ Drawing.currentsheetnumber = i
+ 'Lapszámok beírása
+
+
+ WriteSheetNum(Model1)
+ '-----
+ 'DXF Készítése ha szükséges
+ If NeedDxf = True Then
+
+ HandleNames(FileNameMod, y, i, ".DXF", Model1)
+ CreateDXF(Model1, FileNameMod)
+
+ End If
+
+ If NeedStep = True Then
+ HandleNames(FileNameMod, y, 1, ".stp", Model1)
+ CreateStep(Model1, Session, FileNameMod)
+
+ End If
+
+ 'Create Tiff if needed
+ If NeedTiff = True Then
+
+ HandleNames(FileNameMod, y, i, ".Tif", Model1)
+
+ CreateTiff(Session, Drawing, i, i, FileNameMod, Model1)
+
+ End If
+
+ '--------------------- Calculate sheetsize for print
+ Try
+ Dim iFormatDrawing As IpfcModelDescriptor
+ iFormatDrawing = SheetOwner.GetSheetFormatDescr(i)
+ Dim NameOfSheet As String = iFormatDrawing.InstanceName(iFormatDrawing.InstanceName.Length - 4)
+ Dim A01234 As String = iFormatDrawing.InstanceName.IndexOf("A?")
+ Dim regex As New RegularExpressions.Regex("A\d")
+ Dim FormatString As String = regex.Match(iFormatDrawing.InstanceName).Value
+
+ NameOfSheet = FormatString.Substring(1, 1)
+
+ Dim e_int As Integer
+ e_int = 2 ^ CInt(NameOfSheet)
+
+ Dim model2d As IpfcModel2D
+ Dim view2d As IpfcView2D
+ Dim dview As CpfcView2Ds
+ Dim model2 As IpfcModel
+ Dim ListOfViewSheets As New List(Of Integer)
+ Dim SheetNumberIndex As New List(Of Integer)
+ Dim ViewCount As Single
+ Dim IndexOfCurrentSheetFirstView As Integer
+
+ model2d = Model1
+ dview = model2d.List2DViews()
+ ViewCount = dview.Count
+
+ For z = 0 To ViewCount - 1
+ view2d = (dview(z))
+ ListOfViewSheets.Add(view2d.GetSheetNumber)
+ Next
+
+ If i = 0 Then
+ i = 1
+ IndexOfCurrentSheetFirstView = ListOfViewSheets.IndexOf(i)
+ i = 0
+ Else
+ IndexOfCurrentSheetFirstView = ListOfViewSheets.IndexOf(i)
+ End If
+
+ view2d = dview(IndexOfCurrentSheetFirstView)
+ model2 = view2d.GetModel
+
+ Dim SheetScale As Double = SheetOwner.GetSheetScale(i, model2)
+
+ Dim Print_value As Double = e_int * 10 * SheetScale
+ '--------------------- Calculate sheetsize for print END
+
+
+
+ If printNeeded = True Then
+ HandleNames(FileNameMod, y, i, ".Tif", Model1)
+ Printtoprinter(Session, Drawing, i, i, FileNameMod, Model1, Print_value)
+ End If
+
+
+
+ Catch ex As Exception
+ ' MsgBox(ex.Message)
+ End Try
+
+
+ Next i
+ ' MsgBox(workDir)
+ 'Log fileok törlése
+ If NeedDxf = True Then
+ If My.Computer.FileSystem.GetFiles(workDir, FileIO.SearchOption.SearchTopLevelOnly, "*.log.*").Count > 0 Then 'ha nem sikerült dxf-t csinálni, akkor ne csináljon semmit
+ Dim logpath As String
+ If autofolder = True Then
+ logpath = workDir
+ Else
+ logpath = folderpicked
+ End If
+ Kill(logpath & "\*log*")
+ End If
+ End If
+
+
+ If excelPrintNeeded = True Then
+
+
+ folderpicked = Path.GetTempPath
+ HandleNames(FileNameMod, 0, 0, ".xls", Model1)
+ CreateExcel(Session, FileNameMod)
+ PrintExcel(FileNameMod)
+
+ End If
+
+
+ End Sub
+ 'Handles all the nameing sintax for every file XLS,DXF,PDF and TIFF
+ Private Sub HandleNames(ByRef FileNameMod As String, y As Single, i As Single, Ext As String, model1 As IpfcModel)
+
+ Dim model2d As IpfcModel2D
+ Dim view2d As IpfcView2D
+ Dim dview As CpfcView2Ds
+ Dim model2 As IpfcModel
+ Dim ListOfViewSheets As New List(Of Integer)
+ Dim SheetNumberIndex As New List(Of Integer)
+ Dim ViewCount As Single
+ Dim FilePathMod As String
+ Dim FileNamesWOExtention As String
+ Dim iDisplay As IpfcDisplay
+ ' Dim FileNameOnlyBatchNumber As String
+ ' Dim sResult As String
+ Dim IndexOfCurrentSheetFirstView As Integer
+
+ model2d = model1
+ dview = model2d.List2DViews()
+ ViewCount = dview.Count
+
+ For z = 0 To ViewCount - 1
+ view2d = dview(z)
+ Try
+ ListOfViewSheets.Add(view2d.GetSheetNumber)
+ Catch ex As Exception
+
+ End Try
+ Next
+
+
+
+ If i = 0 Then
+ i = 1
+ IndexOfCurrentSheetFirstView = ListOfViewSheets.IndexOf(i)
+ i = 0
+ Else
+ IndexOfCurrentSheetFirstView = ListOfViewSheets.IndexOf(i)
+ End If
+
+ Console.WriteLine(ListOfViewSheets.IndexOf(i))
+ If IndexOfCurrentSheetFirstView >= 0 Then
+
+ view2d = dview(IndexOfCurrentSheetFirstView)
+ model2 = view2d.GetModel
+ sresult = model2.FullName
+
+ FileNamesWOExtention = (FileNames(y).Substring(0, FileNames(y).Length - 4))
+ FileNamesWOExtention = sresult
+
+ Else
+ FileNamesWOExtention = "NO_VIEW_ON_SHEET"
+ End If
+
+
+
+ FilePathMod = folderpicked
+
+
+ If autofolder = True Then
+
+ FilePathMod = workDir
+ Else
+ workDir = FilePathMod
+
+ End If
+
+
+ NameList.Add(FilePathMod + FileNamesWOExtention + Ext)
+
+ Dim SameModellNumber As Integer = NameList.Where(Function(value) value = (FilePathMod + FileNamesWOExtention + Ext)).Count
+ Dim SamemodelnumberStr As String
+
+ If SameModellNumber <> 1 Then
+ SamemodelnumberStr = "_" + CStr(SameModellNumber)
+ Else
+ SamemodelnumberStr = ""
+ End If
+
+ Dim FirstCharacter As Integer = FileNamesWOExtention.IndexOf("<")
+ Console.WriteLine(FirstCharacter)
+ If FirstCharacter > 0 Then
+ FileNamesWOExtention = Strings.Left(FileNamesWOExtention, FirstCharacter)
+ End If
+ Console.WriteLine(FileNameMod)
+
+ If namingsyntax = "stefani" = True Then
+
+ FileNameMod = FilePathMod + FileNamesWOExtention + SamemodelnumberStr + Ext ' " _" + CStr(i) +
+
+ Else
+
+ Dim AudiRajzSzamStr As String = ""
+ ReadParam(model1, "AUDI_RAJZSZAM", AudiRajzSzamStr)
+ Try
+ AudiRajzSzamStr = AudiRajzSzamStr.Substring(0, 3) + "000-" + AudiRajzSzamStr.Substring(3, 3) + "-" + AudiRajzSzamStr.Substring(7, 6) + "-001"
+
+ Catch ex As Exception
+ MsgBox("Az audi szám nem megfelelő formátum.")
+ Environment.Exit(0)
+ End
+ End Try
+
+ If Ext = ".xls" Then
+ FileNameMod = FilePathMod + AudiRajzSzamStr + "_" + "stl" + Ext
+ Else
+ FileNameMod = FilePathMod + AudiRajzSzamStr + "_" + i.ToString("000") + Ext
+ End If
+
+
+ FileNameMod = FileNameMod.ToUpper
+
+ End If
+ ProgressTextstr = Path.GetFileName(FileNameMod)
+ BackgroundWorker1.ReportProgress(0, Nothing)
+ FileNameModTimer = FileNameMod
+
+ End Sub
+ Public Sub HandleTable(session As IpfcBaseSession, ByRef TableContent(,) As String, MoreThanOneTable As Integer)
+
+ Dim selection As IpfcSelection = Nothing
+ Dim selections As New CpfcSelections
+ Dim selectionOptions As IpfcSelectionOptions
+ Dim TableCell As IpfcTableCell
+ Dim NonBaseSession As IpfcSession
+ Dim iTableOwner As IpfcTableOwner
+ NonBaseSession = session
+ iTableOwner = session.CurrentModel
+ Dim row As Integer
+ Dim col As Integer
+ Dim TableRowCount As Integer
+ Dim TableCoulomnCount As Integer
+ Dim Cstringseq As New Cstringseq
+ Dim CellValues As String
+ ' str1 = " Creo segéd program"
+ 'str2 = ""
+
+
+ ' ChooseTable(session, session.CurrentModel, MoreThanOneTable, table)
+
+
+ If MoreThanOneTable > 1 Then
+
+ HandleWindow.FocusWindowM("In", "fo")
+ ProgressTextstr = "Válassz táblázatot!"
+ BackgroundWorker1.ReportProgress(0)
+ ' Dim UISO As IpfcMessageDialogOptions
+ ' UISO = (New CCpfcMessageDialogOptions)
+ ' UISO.DialogLabel = "Válassz táblázatot!"
+ NonBaseSession.UIShowMessageDialog("Válassz táblázatot!", Nothing)
+
+ selectionOptions = (New CCpfcSelectionOptions).Create("dwg_table")
+ selectionOptions.MaxNumSels = 1
+
+ ' Try
+ selections = session.Select(selectionOptions, Nothing)
+ selection = selections.Item(0)
+ ' Catch ex As Exception
+ ' MsgBox(ex.Message)
+ ' Exit Sub
+ ' End Try
+ ' Dim name1 As String = "Creo Parametric"
+ ' Dim name2 As String = "(Active)"
+ ' HandleWindow.FocusWindowM(name2, name1)
+ table = selection.SelItem
+ End If
+
+
+ HandleWindow.FocusWindowM("Dokumentáció", "készítő")
+
+
+
+ ' table = iTableOwner.GetTable(2)
+
+
+ TableCoulomnCount = table.GetColumnCount()
+ TableRowCount = table.GetRowCount()
+ ReDim TableContent(TableRowCount - 1, TableCoulomnCount)
+
+ For col = 1 To TableCoulomnCount
+
+ For row = 7 To TableRowCount
+ TableCell = (New CCpfcTableCell).Create(row, col)
+ Try
+ Cstringseq = table.GetText(TableCell, 0)
+ CellValues = Cstringseq.Item(0)
+ ' MsgBox(Cstringseq.Item(0))
+
+ TableCell = (New CCpfcTableCell).Create(row, col)
+
+
+ TableContent(row - 4, col) = CellValues
+
+
+ Catch ex As Exception
+ TableContent(row - 4, col) = " "
+ End Try
+
+
+ ' MsgBox(row)
+ Next
+ Next
+
+
+
+
+
+ SHMNum = CellToString(table, 1, 5)
+ MachineName = CellToString(table, 2, 7)
+ SHMDate = CellToString(table, 3, 7)
+ SubMachineName = CellToString(table, 1, 7)
+ 'AudiNum = CellToString(table, 1, 7)
+ NameT = CellToString(table, 3, 5)
+
+
+
+
+ 'table.Erase()
+ End Sub
+ Private Sub HandleExcel(model1 As IpfcModel, FilnameMod As String, TableContent(,) As String)
+
+ xlApp = New Excel.Application
+ xlWorkBook = xlApp.Workbooks.Open(FilnameMod)
+ xlWorkSheet = xlWorkBook.Worksheets("Darabjegyzék")
+ Dim sheet As Worksheet = xlWorkBook.ActiveSheet
+ xlApp.DisplayAlerts = False
+
+ Dim RowCount As Integer = TableContent.GetLength(0) - 1
+ Dim ColCount As Integer = TableContent.GetLength(1) - 1
+ 'Fill V-numbers...I think
+
+ For row = 3 To RowCount - 3
+
+ Console.WriteLine(TableContent(row, 7))
+ ' If TableContent(row, 7).Length < 2 Then
+ ' TableContent(row, 7) = " "
+ ' End If
+ 'Ha "V-"-vel kezdődik a string akkor kitölti a
+ ' If TableContent(row, 7).Substring(0, 2) <> "V-" Then
+ ' For col = 1 To ColCount
+ ' xlWorkSheet.Cells(row + 5, col) = TableContent(row, col)
+ 'xt
+ ' Else
+ Dim u As Integer = 1
+ xlWorkSheet.Cells(row + u, 1) = TableContent(row, 1)
+ xlWorkSheet.Cells(row + u, 2) = TableContent(row, 2)
+ xlWorkSheet.Cells(row + u, 3) = TableContent(row, 3)
+ xlWorkSheet.Cells(row + u, 4) = TableContent(row, 4)
+ xlWorkSheet.Cells(row + u, 5) = TableContent(row, 5)
+ xlWorkSheet.Cells(row + u, 6) = TableContent(row, 6)
+ xlWorkSheet.Cells(row + u, 7) = TableContent(row, 7)
+ xlWorkSheet.Cells(row + u, 8) = TableContent(row, 8)
+ xlWorkSheet.Cells(row + u, 9) = TableContent(row, 9).Replace("n", "ø")
+ ' xlWorkSheet.Cells(row + u, 9) = TableContent(row, 9)
+ xlWorkSheet.Cells(row + u, 10) = TableContent(row, 10)
+ ' End If
+ '
+ Next
+
+ 'Do I really need this ?!
+ SHMNum = CellToString(table, 1, 5)
+ NameT = CellToString(table, 3, 5)
+ MachineName = CellToString(table, 2, 7)
+ SHMDate = CellToString(table, 3, 7)
+ SubMachineName = CellToString(table, 1, 7)
+ ' AudiNum = CellToString(table, 1, 7)
+
+ 'A fejléc kitöltése
+ xlWorkSheet.Cells(1, 1) = CellToString(table, 1, 1)
+ xlWorkSheet.Cells(2, 1) = CellToString(table, 2, 1)
+ xlWorkSheet.Cells(1, 6) = CellToString(table, 3, 1)
+ xlWorkSheet.Cells(1, 5) = CellToString(table, 1, 5)
+ xlWorkSheet.Cells(2, 5) = CellToString(table, 2, 5)
+ xlWorkSheet.Cells(1, 10) = CellToString(table, 3, 5)
+ xlWorkSheet.Cells(1, 6) = CellToString(table, 1, 6)
+ xlWorkSheet.Cells(2, 6) = CellToString(table, 2, 6)
+ xlWorkSheet.Cells(2, 9) = CellToString(table, 3, 6)
+ xlWorkSheet.Cells(1, 7) = CellToString(table, 1, 7)
+ xlWorkSheet.Cells(2, 7) = CellToString(table, 2, 7)
+ xlWorkSheet.Cells(2, 10) = CellToString(table, 3, 7)
+ xlWorkSheet.Cells(3, 1) = CellToString(table, 4, 1)
+ xlWorkSheet.Cells(3, 2) = CellToString(table, 4, 2)
+ xlWorkSheet.Cells(3, 3) = CellToString(table, 4, 3)
+ xlWorkSheet.Cells(3, 4) = CellToString(table, 4, 4)
+ xlWorkSheet.Cells(3, 5) = CellToString(table, 4, 5)
+ xlWorkSheet.Cells(3, 6) = CellToString(table, 4, 6)
+ xlWorkSheet.Cells(3, 7) = CellToString(table, 4, 7)
+ xlWorkSheet.Cells(3, 8) = CellToString(table, 4, 8)
+ xlWorkSheet.Cells(3, 9) = CellToString(table, 4, 9)
+ xlWorkSheet.Cells(3, 10) = CellToString(table, 4, 10)
+
+
+
+ ' Dim headerImage As Picture = sheet.PageSetup.LeftHeaderPicture
+
+ If CellToString(table, 1, 1) = "Rajzszám:" Then
+ Dim startupPath As String = AppDomain.CurrentDomain.BaseDirectory
+ Dim imagePath As String = System.IO.Path.Combine(startupPath, "fejlec_hu.png")
+ Dim scaleFactor As Double = 0.5 ' Set your desired scale factor
+ With xlWorkSheet.PageSetup.CenterHeaderPicture
+ .Filename = imagePath
+ .Height = 0.83 * 72
+ .Width = 10.08 * 72
+ End With
+
+ End If
+
+ '
+ ' If xlWorkSheet.Shapes Is Nothing Then Return
+ ' For Each shape As Shape In xlWorkSheet.Shapes
+ ' ReleaseObject(shape)
+ ' Next
+
+ ' If namingsyntax = "stefani" Then
+ ' xlWorkSheet.Cells(1, 7) = ""
+ ' ElseIf namingsyntax = "audi" Then
+ ' Else
+
+ ' Try
+ ' Dim tempparam As String = ""
+ ' ' ReadParam(model1, "BESTELLER", tempparam)
+ ' xlWorkSheet.Cells(1, 7) = tempparam
+ '
+ ' End Try
+
+
+ ' End If
+
+ ' xlWorkSheet.Range(xlWorkSheet.Cells(RowCount + 6, 1), xlWorkSheet.Cells(3000, 10)).Clear()
+
+ ' ReleaseObject(xlWorkSheet.Shapes)
+
+
+ 'Save and close, set display alerts back to true
+ xlWorkBook.Save()
+ xlWorkBook.Close() : xlApp.Quit()
+ xlApp.DisplayAlerts = True
+ 'Clear shit
+ ' ReleaseObject(headerImage)
+
+ ReleaseObject(xlApp)
+ ReleaseObject(xlWorkBook)
+ ReleaseObject(xlWorkSheet)
+ ' ReleaseObject(xlWorkSheet.Shapes)
+
+
+ End Sub
+
+ Private Sub ReleaseObject(ByVal obj As Object)
+ ' Try
+ System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
+ obj = Nothing
+ ' Catch ex As Exception
+ ' obj = Nothing
+ ' Finally
+ ' GC.Collect()
+ ' GC.WaitForPendingFinalizers()
+ ' End Try
+ End Sub
+
+ Private Sub HandleExcel2(model1 As IpfcModel, TableContent(,) As String)
+
+ Dim b As New OpenFileDialog
+ b.Multiselect = True 'Több file kijelölhetősége
+ b.Filter = "XLS|*.XLSX" 'Alap formátum kiválasztáas
+ b.InitialDirectory = "C:\"
+
+
+ ' b.AutoUpgradedimEnabled = True
+ 'ez biztos rossz lesz!!!!!!!!!!!!
+ ' Dim bul As Boolean
+ ' bul = b.ShowDialog
+ Dim FilnameMod As String = ""
+ If b.ShowDialog() = True Then
+
+ FilnameMod = b.FileName
+
+ End If
+
+
+
+
+ xlApp = New Excel.Application
+ xlWorkBook = xlApp.Workbooks.Open(FilnameMod)
+ xlApp.DisplayAlerts = False
+ ' ' xlWorkSheet = xlWorkBook.Worksheets("Test")
+
+
+ Dim ShiftRows As Integer = 0
+
+ Dim RowCount As Integer = TableContent.GetLength(0) - 1
+ Dim ColCount As Integer = TableContent.GetLength(1) - 1
+
+ FillCalcXLS("Mechanikus", "M", "S", TableContent, RowCount)
+ FillCalcXLS("Pneumatika", "P", "q", TableContent, RowCount)
+ FillCalcXLS("Gyártott", "F", "N", TableContent, RowCount)
+ FillCalcXLS("Elektromos", "E", "q", TableContent, RowCount)
+ FillCalcXLS("Egyéb", "H", "q", TableContent, RowCount)
+
+
+ '-------------------------------------
+ Dim NumberOrTyp As Integer
+ NumberOrTyp = 1
+
+ 'Save and close, set display alerts back to true
+ xlWorkBook.Save()
+ xlWorkBook.Close() : xlApp.Quit()
+ xlApp.DisplayAlerts = True
+ 'Clear shit
+ System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp) : xlApp = Nothing
+ System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkBook) : xlWorkBook = Nothing
+ System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkSheet) : xlWorkSheet = Nothing
+
+ End Sub
+
+ 'Create tiff,dxf and pdf
+ Private Sub CreateDXF(model1 As IpfcModel, FileNameMod As String)
+
+ Try
+ 'Create a DXF export instruction
+ Dim myDXFInstr = (New CCpfcDXFExportInstructions).Create
+ 'Export the drawing to dxf
+ model1.Export(FileNameMod, myDXFInstr)
+ FileSystem.Rename(FileNameMod.ToLower, FileNameMod.ToUpper) 'Átnevezés mert imre szólt hogy a "c" nagy betüvel legyen...
+
+ dxfCreated.Add(Path.GetFileName(FileNameMod) & " elkészült.")
+
+ 'Hiba esetén a felugró ablakba beírni a mgefelelő adatokat
+ Catch ex As Exception
+ Dim TryError As String
+ If ex.Message = "pfcExceptions:: XStringTooLong; argument: FileName string: " & FileNameMod & " maximum length: 216" Then
+ TryError = "Az elérési út túl hosszú!"
+ Else
+ TryError = ex.Message
+ End If
+ ' Console.WriteLine(ex.Message)
+ ' Console.WriteLine("pfcExceptions::XStringTooLong; argument: FileName string: " & FileNameMod & " maximum lenght: 216")
+
+ dxfCreated.Add(Path.GetFileName(FileNameMod) & " nem készült el, a következő hiba üzenettel: " & TryError)
+ HibakSzama = HibakSzama + 1
+ End Try
+
+ End Sub
+ Private Sub CreatePdf(session As IpfcBaseSession, model1 As IpfcModel, Filename As String)
+
+ Try
+
+ Dim PDFExportInstrCreate As New CCpfcPDFExportInstructions
+ Dim PDFExportInstr As IpfcPDFExportInstructions
+ PDFExportInstr = PDFExportInstrCreate.Create
+ Dim PDF_Options As New pfcls.CpfcPDFOptions
+
+ 'Set Stroke All Fonts PDF Option
+ If NeedStroke = True Then
+
+ Dim PDFOptionCreate_SAF As New CCpfcPDFOption
+ Dim PDFOption_SAF As IpfcPDFOption
+ PDFOption_SAF = PDFOptionCreate_SAF.Create
+ PDFOption_SAF.OptionType = EpfcPDFOptionType.EpfcPDFOPT_FONT_STROKE
+ Dim newArg_SAF As New CMpfcArgument
+ PDFOption_SAF.OptionValue = newArg_SAF.CreateIntArgValue(EpfcPDFFontStrokeMode.EpfcPDF_STROKE_ALL_FONTS)
+ Call PDF_Options.Append(PDFOption_SAF)
+
+ End If
+
+ ' Set COLOR_DEPTH value (Set EpfcPDF_CD_MONO to have Black & White output)
+ Dim PDFOptionCreate_CD As New CCpfcPDFOption
+ Dim PDFOption_CD As IpfcPDFOption
+ PDFOption_CD = PDFOptionCreate_CD.Create
+ PDFOption_CD.OptionType = EpfcPDFOptionType.EpfcPDFOPT_COLOR_DEPTH
+ Dim newArg_CD As New CMpfcArgument
+ PDFOption_CD.OptionValue = newArg_CD.CreateIntArgValue(EpfcPDFColorDepth.EpfcPDF_CD_MONO)
+ Call PDF_Options.Append(PDFOption_CD)
+
+ ' Set PDF EpfcPDFOPT_LAUNCH_VIEWER(Set FALSE Not to Launch Adobe reader)
+ Dim PDFOptionCreate_LV As New CCpfcPDFOption
+ Dim PDFOption_LV As IpfcPDFOption
+ PDFOption_LV = PDFOptionCreate_LV.Create
+ PDFOption_LV.OptionType = EpfcPDFOptionType.EpfcPDFOPT_LAUNCH_VIEWER
+ Dim newArg_LV As New CMpfcArgument
+ PDFOption_LV.OptionValue = newArg_LV.CreateBoolArgValue(False)
+ Call PDF_Options.Append(PDFOption_LV)
+
+ 'Set Output PDF File Name
+ Dim TempPath As String = Path.GetTempPath() & Path.GetFileName(Filename)
+ PDFExportInstr.FilePath = Filename
+ PDFExportInstr.Options = PDF_Options
+ Try
+ Dim fOpen As IO.FileStream = IO.File.Open("your file name", IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.None)
+ fOpen.Close()
+ fOpen.Dispose()
+ fOpen = Nothing
+ Catch e1 As IO.IOException
+ 'File Open by some one else..
+ Catch e2 As Exception
+ End Try
+
+
+ If System.IO.File.Exists(Filename) Then
+ File.Delete(Filename)
+ End If
+ model1.Export(PDFExportInstr.FilePath, PDFExportInstr)
+ ' File.Move(TempPath, Filename)
+
+ pdfFiles.Add(Filename)
+ pdfCreated.Add(Path.GetFileName(Filename) & " elkészült.")
+ ' pdfCreated = pdfCreated + 1
+
+ Catch ex As Exception
+ Dim TryError As String
+ If ex.Message = "pfcExceptions::XStringTooLong; argument: FileName string: " & Filename & " maximum length: 216" Then
+ TryError = "Az elérési út túl hosszú!"
+ Else
+ TryError = ex.Message
+ End If
+ pdfCreated.Add(Path.GetFileName(Filename) & " nem készült el, a következő hiba üzenettel: " & TryError)
+ HibakSzama = HibakSzama + 1
+
+ End Try
+
+ End Sub
+ Private Sub CreateTiff(ByRef session As IpfcBaseSession, ByRef Drawing As IpfcDrawing, ByVal StartSheet As Integer, ByVal EndSheet As Integer, Filename As String, model1 As IpfcModel)
+
+ Try
+
+ session.SetConfigOption("display_planes", "no")
+ session.SetConfigOption("display_axes", "no")
+ session.SetConfigOption("datum_point_display", "no")
+ session.SetConfigOption("display_coord_sys", "no")
+ ' Place your company standard plot configuration files (*.pcf) in a directory and
+ ' set it's full path as value to Creo configuration option pro_plot_config_dir.
+ ' Example: pro_plot_config_dir C:\Engineering_Standards\Creo_Standards\Plot_configs\
+ ' Creo will find any *.pcf file just by its file name if it exists in one of the below mentioned locations
+ ' 1. In Current Working Directory
+ ' 2. In Directory set by configuration option pro_plot_config_dir
+ ' 2. In \text\plot_config Directory
+
+ Dim pcfOptions As IpfcPrinterPCFOptions
+
+ Dim printerOptions As IpfcPrinterInstructions
+ 'pfcFileName length should be max 32 chars excluding file extension.
+ 'If exceeds 32 chars, results in exception xToolkitNotFound / xToolkitStringTooLong
+ Dim model2d As IpfcModel2D
+ model2d = model1
+ pcfOptions = session.GetPrintPCFOptions("ms_print_mgr_2.pcf", model2d)
+
+ printerOptions = (New CCpfcPrinterInstructions).Create()
+ printerOptions.ModelOption = pcfOptions.ModelOption
+ printerOptions.PlacementOption = pcfOptions.PlacementOption
+ printerOptions.PrinterOption = pcfOptions.PrinterOption
+ printerOptions.WindowId = session.GetModelWindow(Drawing).GetId()
+
+ printerOptions.ModelOption.Sheets = EpfcPrintSheets.EpfcPRINT_SELECTED_SHEETS
+ printerOptions.ModelOption.FirstPage = StartSheet
+ printerOptions.ModelOption.LastPage = EndSheet
+
+ ' Set required output print paper size.
+ ' Do this only if you want any sheet size to be plot to single paper size.
+
+ Dim iPlotPaperSize As New CCpfcPlotPaperSize
+
+ Dim printSize As IpfcPrintSize
+ printSize = (New CCpfcPrintSize).Create()
+ printSize.Height = 841
+ printSize.Width = 1189
+ printSize.PaperSize = iPlotPaperSize.A0SIZEPLOT
+
+ printerOptions.PrinterOption.PaperSize = printSize
+
+ 'printerOptions.PrinterOption.PaperSize
+ printerOptions.ModelOption.Mdl = model2d
+ 'printerOptions.PrinterOption.FileName = model2d.InstanceName
+
+ Dim ExportInstr As IpfcExportInstructions
+ ExportInstr = CType(printerOptions, IpfcExportInstructions)
+
+ model1.Export(Filename, ExportInstr)
+
+ FileSystem.Rename(Filename.ToLower, Filename.ToUpper)
+ tiffCreated.Add(Path.GetFileName(Filename) + " elkészült.")
+ Catch ex As Exception
+
+ Dim TryError As String
+ If ex.Message = "pfcExceptions::XStringTooLong; argument: FileName string: " & Filename & " maximum length: 216" Then
+ TryError = "Az elérési út túl hosszú!"
+ Else
+ TryError = ex.Message
+ End If
+ tiffCreated.Add(Path.GetFileName(Filename) & " nem készült el, a következő hiba üzenettel: " & TryError)
+ HibakSzama = HibakSzama + 1
+ End Try
+ End Sub
+ Private Sub CreateExcel(session As IpfcBaseSession, FilnameMod As String)
+
+ ' Try
+
+ Dim TableContent(,) As String = Nothing
+ Dim MoreThanOneTable As Integer = 0
+ ChooseTable(session, session.CurrentModel, MoreThanOneTable, table)
+ If MoreThanOneTable = 0 Then
+ Exit Sub
+ End If
+
+ HandleTable(session, TableContent, MoreThanOneTable)
+
+ ' Generálja a temp fájl elérési útját
+ Dim tempPath As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), Path.GetFileName(FilnameMod))
+ Dim currentDirectory As String = Directory.GetCurrentDirectory() ' Gets the running directory
+ ' currentDirectory = "C:\Creo_config\06 - Creo\18 - Utilities"
+ Dim sourcePath As String = Path.Combine(currentDirectory, "Darabjegyzek.xlsm")
+ ' Másolja az XLS-t az ideiglenes mappába
+ File.Copy(sourcePath, tempPath, True)
+
+ ' Kiírja a Creo táblázat tartalmát az XLS-be
+ HandleExcel(session.CurrentModel, tempPath, TableContent)
+
+ ' Ellenőrzés és visszajelzés
+ If ddas = True Then
+ xlsCreated.Add(Path.GetFileName(FilnameMod) & " elkészült.")
+ Else
+ xlsCreated.Add(Path.GetFileName(FilnameMod) & " elkészült." & " - Cég információk hiányoznak!")
+ HibakSzama = HibakSzama + 1
+ End If
+
+ ' Végleges fájl elérési útjának generálása
+ Dim finalDestination As String = FilnameMod.ToUpper()
+
+ ' Másolja az ideiglenes fájlt a végleges célhelyre
+ File.Copy(tempPath, finalDestination & "M", True)
+
+ ' Catch ex As Exception
+ ' xlsCreated.Add(Path.GetFileName(FilnameMod) & " nem készült el, a következő hiba üzenettel: " & ex.Message)
+ ' HibakSzama = HibakSzama + 1
+ ' End Try
+
+ End Sub
+
+ 'Printing each file to printer
+ Private Const BM_CLICK As Integer = &HF5
+ Private Const WM_SETFOCUS As Integer = &H7
+
+
+ Private Shared Function FindWindowExW(ByVal hWndParent As IntPtr, ByVal hWndChildAfter As IntPtr, ByVal lpszClass As String, ByVal lpszWindow As String) As IntPtr
+ End Function
+
+ Private Shared Function SendMessageW(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
+ End Function
+ Private Sub Printtoprinter(ByRef session As IpfcBaseSession, ByRef Drawing As IpfcDrawing, ByVal StartSheet As Integer, ByVal EndSheet As Integer, Filename As String, model1 As IpfcModel, Print_Value As Double)
+
+ 'Dim the used variables
+ Dim pcfOptions As IpfcPrinterPCFOptions
+ Dim printerOptions As IpfcPrinterInstructions
+ Dim ExportInstr As IpfcExportInstructions
+
+
+ 'Turning off displayed planes,axes,points and coordiante systems
+ session.SetConfigOption("display_planes", "no")
+ session.SetConfigOption("display_axes", "no")
+ session.SetConfigOption("datum_point_display", "no")
+ session.SetConfigOption("display_coord_sys", "no")
+
+ 'Choosing and using the PCF file"
+ If Print_Value > 15 Then 'a4
+ pcfOptions = session.GetPrintPCFOptions("CDC5520_A4.pcf", model1)
+ ElseIf Print_Value > 3 Then 'A3
+ pcfOptions = session.GetPrintPCFOptions("CDC5520_A3.pcf", model1)
+ ElseIf Print_Value > 1 Then 'A2
+ pcfOptions = session.GetPrintPCFOptions("CDC5520_A2.pcf", model1)
+ ElseIf Print_Value > 0 Then 'A1
+ pcfOptions = session.GetPrintPCFOptions("CDC5520_A1.pcf", model1)
+ Else 'A0
+ pcfOptions = session.GetPrintPCFOptions("CDC5520_A0.pcf", model1)
+ End If
+
+ printerOptions = (New CCpfcPrinterInstructions).Create()
+ printerOptions.ModelOption = pcfOptions.ModelOption
+ printerOptions.PlacementOption = pcfOptions.PlacementOption
+ printerOptions.PrinterOption = pcfOptions.PrinterOption
+ printerOptions.WindowId = session.GetModelWindow(Drawing).GetId()
+
+ 'Choosing the sheets to print, the reason why it is printed one by one is to use the right naming syntax
+ printerOptions.ModelOption.Sheets = EpfcPrintSheets.EpfcPRINT_SELECTED_SHEETS
+ printerOptions.ModelOption.FirstPage = StartSheet
+ printerOptions.ModelOption.LastPage = EndSheet
+
+ 'Choosing the model to print
+ printerOptions.ModelOption.Mdl = model1
+ printerOptions.PrinterOption.FileName = model1.InstanceName
+
+ 'Printing the document (Don't mind that it is called export, for some fucking reason)
+ ExportInstr = CType(printerOptions, IpfcExportInstructions)
+
+ If Print_Value > 3 Then 'A3
+
+
+ ' EZ VALAMI OKNÁL FOGVA BACKGROUND WOERKERBEN VOLT ????
+ BackgroundWorker3.RunWorkerAsync()
+ Else
+ MsgBox("Kérlek válaszd ki a nyomtató beállításokat, javasolt a Canon plotter használata.")
+ End If
+
+ model1.Export(Filename, ExportInstr)
+
+ End Sub
+ 'Write parameters and sheetnumber
+
+ Private Sub WriteParam(iFeature As IpfcModel, iParamValueStr As String, iParamName As String)
+
+ Dim iParamOwner As IpfcParameterOwner
+ Dim iParam As IpfcParameter
+ Dim iBaseParam As IpfcBaseParameter = Nothing
+ Dim iParamValue As IpfcParamValue
+ Dim MItem As New CMpfcModelItem
+ 'Paraméter string érték paraméter value értékké alakítása
+ iParamValue = MItem.CreateStringParamValue(iParamValueStr)
+ 'Paraméter tulajdonos beállítása (mi tartalmazza a praméteret(Feature,Modell stb.)
+ iParamOwner = iFeature
+
+ If iParamOwner.GetParam(iParamName) Is Nothing Then
+ iParamOwner.CreateParam(iParamName, iParamValue)
+ Else
+ Try
+ iParam = iParamOwner.GetParam(iParamName)
+ iBaseParam = iParam
+ iBaseParam.Value = iParamValue
+ Catch ex As Exception
+ Console.WriteLine("Paraméterek beírása nem történt meg. (Zárt..)")
+ End Try
+ End If
+
+ End Sub
+ Private Sub ReadParam(iFeature As IpfcModel, IparamName As String, ByRef iParamValueStr As String)
+ Dim iParamOwner As IpfcParameterOwner
+ Dim iParam As IpfcParameter
+ Dim iBaseParam As IpfcBaseParameter = Nothing
+ Dim iParamValue As IpfcParamValue
+ Dim MItem As New CMpfcModelItem
+ ' MsgBox(iFeature.FileName)
+ iParamOwner = iFeature
+ ' MsgBox(IparamName)
+ iParam = iParamOwner.GetParam(IparamName)
+ iBaseParam = iParam
+ Console.WriteLine("param name: " + IparamName)
+
+ iParamValue = iBaseParam.Value
+ Console.WriteLine("value: " + iParamValue.StringValue)
+ iParamValueStr = iParamValue.StringValue
+ End Sub
+ 'drw Split sub
+ Private Sub TakeAway()
+ Dim session As IpfcBaseSession = Nothing
+ Dim conn As IpfcAsyncConnection = Nothing
+ Connect(session, conn)
+ Dim model1 As IpfcModel
+ Dim sheetowner As IpfcSheetOwner = Nothing
+ Dim Drawing As IpfcDrawing = Nothing
+ Dim model2d As IpfcModel2D
+ Dim cmodels As CpfcModels
+ Dim oModelDescriptor As IpfcModelDescriptor = Nothing
+ Dim oModelDescriptorCreate As New CCpfcModelDescriptor
+ Dim options As IpfcRetrieveModelOptions = Nothing
+ Dim NewWorkingDir As String
+ Dim OldWorkDir As String
+ Dim model2 As IpfcModel = Nothing
+
+ ' Dim copyins As New CopyInstructions
+ model1 = session.CurrentModel
+ Dim model1name As String = model1.FileName
+ sheetowner = model1
+ Dim numberorsheets As Integer = sheetowner.NumberOfSheets
+ Dim oPath As String = Path.GetDirectoryName(model1.Origin)
+
+ Dim mydig As New Ookii.Dialogs.Wpf.VistaFolderBrowserDialog
+ mydig.ShowDialog()
+ NewWorkingDir = mydig.SelectedPath() + "\"
+
+ OldWorkDir = session.GetCurrentDirectory
+ session.ChangeDirectory(NewWorkingDir)
+
+ For k = 1 To numberorsheets
+ sheetowner = model1
+ If Not AktualisRajzRadioButton.IsChecked = True Then
+ sheetowner.CurrentSheetNumber = k
+ Else
+
+ End If
+
+
+ Dim h As Integer = 1
+ Dim numberofsheetsforloop As Integer
+ If k = 1 And AktualisRajzRadioButton.IsChecked = False Then
+ numberofsheetsforloop = numberorsheets
+ Else
+ numberofsheetsforloop = numberorsheets - 1
+ End If
+
+ For j = 1 To numberofsheetsforloop
+ If Not sheetowner.CurrentSheetNumber = h Then
+ sheetowner.DeleteSheet(h)
+ End If
+ If Not h = sheetowner.CurrentSheetNumber Then
+ h = h - 1
+ End If
+ h = h + 1
+ Next
+
+ model2d = model1
+
+ cmodels = model2d.ListModels()
+ For i = 0 To cmodels.Count - 1
+ Try
+ model2d.DeleteModel(cmodels.Item(i))
+ Catch ex As Exception
+
+ End Try
+ Next
+
+ Dim FileNameMod As String
+ namingsyntax = "stefani"
+
+ FileNameMod = model1.FileName
+
+ FileNames.Add(FileNameMod)
+ HandleNames(FileNameMod, 0, 0, ".DRW", model1)
+ Console.WriteLine(FileNameMod)
+
+ Dim savedName As String = Strings.Left(Path.GetFileName(FileNameMod), Path.GetFileName(FileNameMod).Length - 4)
+ Dim fname As String = "r_" + Strings.Left(Path.GetFileName(FileNameMod), Path.GetFileName(FileNameMod).Length - 4)
+
+ Try
+ model1.Copy(savedName, Nothing)
+ Catch ex As Exception
+ model1.Copy(fname, Nothing)
+ End Try
+
+
+ options = (New CCpfcRetrieveModelOptions).Create
+ options.AskUserAboutReps = False
+
+ MsgBox(FileNameMod)
+
+ Dim oModelDescriptor2 As IpfcModelDescriptor
+
+ oModelDescriptor2 = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_PART, FileNameMod, "")
+ oModelDescriptor2.Path = oPath
+ model2 = session.RetrieveModelWithOpts(oModelDescriptor2, options)
+
+ oModelDescriptor = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_PART, NewWorkingDir, "")
+ model2.Backup(oModelDescriptor)
+
+
+ Dim iWindow As IpfcWindow
+ iWindow = session.CurrentWindow
+ iWindow.Close()
+ model1name = model1.FileName
+
+ model1.Erase()
+ options = (New CCpfcRetrieveModelOptions).Create
+ options.AskUserAboutReps = False
+ oModelDescriptor = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_DRAWING, Strings.Left(model1name, model1name.Length - 4), "")
+ oModelDescriptor.Path = oPath
+ Try
+ model1 = session.RetrieveModelWithOpts(oModelDescriptor, options)
+ Catch ex As Exception
+ MsgBox("Nem megefelelő munkakönyvtár?")
+ Exit Sub
+ End Try
+
+
+ model1 = session.RetrieveModelWithOpts(oModelDescriptor, options)
+ iWindow = session.OpenFile(oModelDescriptor)
+ iWindow.Activate()
+
+
+
+
+ If AktualisRajzRadioButton.IsChecked = True Then
+ Exit For
+ End If
+ Next
+
+
+ Dim iWindows As IpfcWindows
+ iWindows = session.ListWindows
+
+ For Each iWindow As IpfcWindow In iWindows
+ iWindow.Close()
+ Next
+
+ Dim model3 As IpfcModel
+ Dim model4 As IpfcModel
+
+
+ Dim modelToRetrive As String = model2.InstanceName
+ oModelDescriptor = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_DRAWING, modelToRetrive, "")
+
+ session.EraseUndisplayedModels()
+ model3 = session.RetrieveModel(oModelDescriptor)
+
+ Dim newModelName As String
+ newModelName = InputBox("Eneter new model name", "New model name", "")
+ model3.Rename(newModelName, False)
+ oModelDescriptor = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_PART, modelToRetrive, "")
+
+ model4 = session.RetrieveModel(oModelDescriptor)
+ model4.Rename(newModelName, False)
+ model3.Save()
+ session.EraseUndisplayedModels()
+
+
+
+ session.ChangeDirectory(OldWorkDir)
+ conn.Disconnect(1)
+ FileNames.Clear()
+
+
+ End Sub
+ 'Don't know wtf this is atm
+ Private Sub AutomatedFolderPick(ByVal session As IpfcBaseSession)
+ 'WTF is this?
+ Dim WorkingDir As String
+ WorkingDir = session.GetCurrentDirectory()
+ ' Dim whateverthefuck As String =
+ Dim WorkingDirPerIndex As Single
+ WorkingDirPerIndex = GetNthIndex(WorkingDir, "\", 4)
+ folderpicked = WorkingDir
+
+ End Sub
+ 'Functions
+ Private Function MergePdfFiles(ByVal pdfFiles As List(Of String), ByVal outputPath As String) As Boolean
+
+ Dim result As Boolean = False
+ Dim pdfCount As Integer = 0 'total input pdf file count
+ Dim f As Integer = 0 'pointer to current input pdf file
+ Dim fileNamePdf As String
+ Dim reader As iTextSharp.text.pdf.PdfReader = Nothing
+ Dim pageCount As Integer = 0
+ Dim pdfDoc As iTextSharp.text.Document = Nothing 'the output pdf document
+ Dim writer As PdfWriter = Nothing
+ Dim cb As PdfContentByte = Nothing
+
+ Dim page As PdfImportedPage = Nothing
+ Dim rotation As Integer = 0
+ MsgBox("hi")
+ ' Try
+ pdfCount = pdfFiles.Count
+ If pdfCount > 0 Then
+ 'Open the 1st item in the array PDFFiles
+ fileNamePdf = pdfFiles(f)
+
+ reader = New iTextSharp.text.pdf.PdfReader(fileNamePdf)
+ 'Get page count
+ pageCount = reader.NumberOfPages
+
+ pdfDoc = New iTextSharp.text.Document(reader.GetPageSizeWithRotation(1), 18, 18, 18, 18)
+
+ writer = PdfWriter.GetInstance(pdfDoc, New FileStream(outputPath, FileMode.OpenOrCreate))
+
+
+ With pdfDoc
+ .Open()
+ End With
+ 'Instantiate a PdfContentByte object
+ cb = writer.DirectContent
+ 'Now loop thru the input pdfs
+ While f < pdfCount
+ 'Declare a page counter variable
+ Dim i As Integer = 0
+ 'Loop thru the current input pdf's pages starting at page 1
+ While i < pageCount
+ i += 1
+ 'Get the input page size
+ pdfDoc.SetPageSize(reader.GetPageSizeWithRotation(i))
+ 'Create a new page on the output document
+ pdfDoc.NewPage()
+ 'If it is the 1st page, we add bookmarks to the page
+ 'Now we get the imported page
+ page = writer.GetImportedPage(reader, i)
+ 'Read the imported page's rotation
+ rotation = reader.GetPageRotation(i)
+ 'Then add the imported page to the PdfContentByte object as a template based on the page's rotation
+ If rotation = 90 Then
+ cb.AddTemplate(page, 0, -1.0F, 1.0F, 0, 0, reader.GetPageSizeWithRotation(i).Height)
+ ElseIf rotation = 270 Then
+ cb.AddTemplate(page, 0, 1.0F, -1.0F, 0, reader.GetPageSizeWithRotation(i).Width + 60, -30)
+ Else
+ cb.AddTemplate(page, 1.0F, 0, 0, 1.0F, 0, 0)
+ End If
+ End While
+ 'Increment f and read the next input pdf file
+ f += 1
+ If f < pdfCount Then
+ fileNamePdf = pdfFiles(f)
+ reader = New iTextSharp.text.pdf.PdfReader(fileNamePdf)
+ pageCount = reader.NumberOfPages
+ End If
+ End While
+ 'When all done, we close the document so that the pdfwriter object can write it to the output file
+ pdfDoc.Close()
+ result = True
+ End If
+ ' Print()
+ reader.Close()
+ ' Catch ex As Exception
+ Return False
+ ' End Try
+ Return result
+
+ End Function
+ Private Function GetNthIndex(searchString As String, charToFind As Char, n As Integer) As Integer
+ Dim charIndexPair = searchString.Select(Function(c, i) New With {.Character = c, .Index = i}) _
+ .Where(Function(x) x.Character = charToFind) _
+ .ElementAtOrDefault(n - 1)
+ Return If(charIndexPair IsNot Nothing, charIndexPair.Index, -1)
+ End Function
+ Private Sub Connect(ByRef session As IpfcBaseSession, ByRef conn As IpfcAsyncConnection)
+
+ Dim cac As New CCpfcAsyncConnection
+ 'Kapcsolódás creo-hoz
+ ' Dim iAsyncConnection As IpfcAsyncConnection = Nothing
+ ' Dim iConnection As IpfcConnectionId = iAsyncConnection.GetConnectionId
+
+ conn = cac.Connect("", "", ".", 5)
+ session = conn.Session
+
+
+ End Sub
+ Private Function CellToString(table As IpfcTable, row As Integer, col As Integer)
+
+ Dim TableCell As IpfcTableCell
+ TableCell = (New CCpfcTableCell).Create(row, col)
+ Dim Cstringseq As New Cstringseq
+ Dim strg As String
+
+ Try
+ Cstringseq = table.GetText(TableCell, 0)
+ strg = Cstringseq.Item(0)
+ Catch ex As Exception
+ strg = ""
+ End Try
+
+ Return strg
+
+ End Function
+ 'Background worker so I can show names while creating the files
+ Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
+ ' Private Sub Backgroundworker1_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
+ 'Run the whole whole create document sub
+
+ CreateDocuments()
+ sresult = String.Join(Environment.NewLine, pdfCreated.ToArray()) & Environment.NewLine _
+ & String.Join(Environment.NewLine, dxfCreated.ToArray()) & Environment.NewLine _
+ & String.Join(Environment.NewLine, tiffCreated.ToArray()) & Environment.NewLine _
+ & String.Join(Environment.NewLine, xlsCreated.ToArray())
+
+ End Sub
+ Private Sub Backgroundworker2_ProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs) Handles BackgroundWorker2.ProgressChanged
+ Progressbar.Value = e.ProgressPercentage
+
+ End Sub
+ Private Sub Backgroundworker1_ProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
+ ProgressText.Content = ProgressTextstr
+ End Sub
+ Private Sub Backgroundworker2_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) Handles BackgroundWorker2.DoWork
+
+ For pbs = 0 To 100
+
+ BackgroundWorker2.ReportProgress(pbs, Nothing)
+ If pbs = 99 Then
+ pbs = 0
+ End If
+
+
+ If BackgroundWorker1.IsBusy = False Then
+
+
+ pbs = 100
+ BackgroundWorker2.ReportProgress(0, Nothing)
+ End If
+
+
+ Threading.Thread.Sleep(50)
+ Next
+
+ End Sub
+
+
+ Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
+ ProgressText.Content = ""
+
+ MainGrid.IsEnabled = True
+
+ ' Dim window2 As New Form3
+ ' MsgBox(sresult)
+ ' window2.ShowDialog()
+
+ If params.Contains("-arg") Then
+ Environment.Exit(0)
+ End
+ End If
+
+ End Sub
+ Private Sub WriteSheetNum(model1 As IpfcModel)
+ 'Cauction! I only undestand half of it...if you manage to undestand, it you are the first one to! It was a trial and error process for 2 hours
+ If NeedSheetNumbers = True Then
+
+ If i <> 1 Then
+
+ Dim model2 As IpfcModel
+ model2 = Nothing
+ Dim SheetNumberIndex As New List(Of Integer)
+ Dim tol As Integer = 0
+ Dim ig As String = 0
+ GetDrawingModel(model1, model2)
+
+ tol = SheetNumber
+ Dim u As Integer = i - 2
+ If u > 0 Then
+ If models(u - 1).FileName.Length > 13 Then
+ 'MsgBox(Strings.Left(models(u).FileName, 16) + Strings.Left(models(u - 1).FileName, 16))
+ If Strings.Left(models(u).FileName, 16) = Strings.Left(models(u - 1).FileName, 16) Then
+ ig = SheetNumber + 1
+ q = q + 1
+ Console.WriteLine(q)
+ tol = tol - q
+ Console.WriteLine(tol)
+ Else
+ ig = 0
+ q = 0
+ End If
+ Console.WriteLine("Tol:" & tol & "Ig:" & ig)
+ End If
+ End If
+ Dim SheetNumberStr As String
+ SheetPartList.Add(model2.FileName)
+ If ig = 0 Then
+ SheetNumberStr = CStr(tol + 1)
+ Else
+ SheetNumberStr = CStr(tol + 1) & "-" & CStr(ig)
+ End If
+ ' MsgBox(models(u - j).FileName)
+ WriteParam(models(u - q), SheetNumberStr, "lap")
+ SheetNumber = SheetNumber + 1
+
+ End If
+ End If
+ End Sub
+
+ Private Sub GetDrawingModel(model1 As IpfcModel, ByRef model2 As IpfcModel)
+ Dim view2d As IpfcView2D
+ Dim dview As CpfcView2Ds
+ Dim model2d As IpfcModel2D
+ Dim IndexOfCurrentSheetFirstView As Integer
+ Dim ViewCount As Single
+ Dim ListOfViewSheets As New List(Of Integer)
+ model2d = model1
+ dview = model2d.List2DViews()
+ ViewCount = dview.Count
+
+ For z = 0 To ViewCount - 1
+ view2d = (dview(z))
+ ListOfViewSheets.Add(view2d.GetSheetNumber)
+ Next
+ If i = 0 Then
+ i = 1
+ IndexOfCurrentSheetFirstView = ListOfViewSheets.IndexOf(i)
+ i = 0
+ Else
+ IndexOfCurrentSheetFirstView = ListOfViewSheets.IndexOf(i)
+ End If
+
+ view2d = dview(IndexOfCurrentSheetFirstView)
+ model2 = view2d.GetModel
+ models.Add(model2)
+ End Sub
+ Private Sub ChooseTable(session As IpfcBaseSession, model1 As IpfcModel, ByRef MoreThanOne As Integer, ByRef iTableRef As IpfcTable)
+
+ Dim iTables As IpfcTables
+ Dim iTableOnwer As IpfcTableOwner
+ iTableOnwer = model1
+ iTables = iTableOnwer.ListTables
+ Dim iTCells As IpfcTableCell
+ iTCells = (New CCpfcTableCell).Create(2, 2)
+ Dim Cstringseq As New Cstringseq
+ Dim a As Integer = 0
+ 'MsgBox(iTables.Count)
+
+
+ For Each iTablea As IpfcTable In iTables
+ Try
+ Dim CellStr As String = CellToString(iTablea, 2, 5)
+ 'MsgBox(CellStr)
+ If CellStr = "Famex Tools Kft." Or CellStr = "Famex Tools" Then
+ MoreThanOne = MoreThanOne + 1
+ iTableRef = iTablea
+ End If
+
+ Catch ex As Exception
+ ' MsgBox(ex.Message)
+ End Try
+
+ Next
+
+ ' MsgBox(iTableRef.GetRowCount)
+ ' iLayer.
+ End Sub
+ Private Sub HideShowTables(session As IpfcBaseSession, model1 As IpfcModel, HideShow As Boolean)
+
+ Dim iTables As IpfcTables
+ Dim iTableOnwer As IpfcTableOwner
+ iTableOnwer = model1
+ iTables = iTableOnwer.ListTables
+ Dim iTCells As IpfcTableCell
+ iTCells = (New CCpfcTableCell).Create(5, 7)
+ Dim Cstringseq As New Cstringseq
+ Dim iModelItems As IpfcModelItems
+ Dim iLayer As IpfcLayer = Nothing
+ iModelItems = CType(model1, IpfcModelItemOwner).ListItems(EpfcModelItemType.EpfcITEM_LAYER)
+ Dim CheckLayers As Integer = 0
+
+ For Each iModelItem In iModelItems
+ If iModelItem.GetName.ToString = "HIDETABLE" Then
+ iLayer = iModelItem
+ CheckLayers = 1
+
+ End If
+ Next
+
+ If CheckLayers = 0 Then
+ iLayer = model1.CreateLayer("HideTable")
+ End If
+
+ iLayer.Status = 2
+
+ For Each iTablea As IpfcTable In iTables
+ ' iTablea.
+ Try
+
+ Cstringseq = iTablea.GetText(iTCells, 0)
+
+ If Cstringseq.Item(0) = "Stefani" Then
+ If HideShow = True Then
+ iLayer.AddItem(iTablea)
+ Else
+ iLayer.RemoveItem(iTablea)
+ End If
+
+
+ End If
+ ' MsgBox(Cstringseq.Item(0))
+ Catch ex As Exception
+
+ End Try
+
+ Next
+ ' iLayer.
+ End Sub
+
+ Public Shared Function gtranslate(ByVal inputtext As String, ByVal fromlangid As String, ByVal tolangid As String) As String
+
+ inputtext = System.Web.HttpUtility.HtmlAttributeEncode(inputtext)
+ Dim step1 As New WebClient
+ step1.Encoding = Encoding.UTF8
+ Dim step2 As String = step1.DownloadString("https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=" & tolangid & "&hl=" & fromlangid & "&dt=t&dt=bd&dj=1&source=icon&q=" & inputtext)
+ Dim step3 As Newtonsoft.Json.Linq.JObject = JObject.Parse(step2)
+ Dim step4 As String = step3.SelectToken("sentences[0]").SelectToken("trans").ToString()
+
+ Return step4
+ End Function
+
+
+ Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
+
+
+
+ Dim fs As New FileStream("Serialized.ser", FileMode.Open)
+ Dim MyFormatter As New BinaryFormatter()
+
+ dict = MyFormatter.Deserialize(fs)
+ fs.Close()
+
+
+
+
+ Dim WorkingDir As String
+ WorkingDir = session.GetCurrentDirectory()
+ Dim strFileSize As String = ""
+ Dim di As New IO.DirectoryInfo(WorkingDir)
+ Dim aryFi As IO.FileInfo() = di.GetFiles("SHM-*.prt*")
+ Dim options As IpfcRetrieveModelOptions = Nothing
+ Dim model1 As IpfcModel = Nothing
+ Dim oWindow As IpfcWindow
+
+ For Each fi In aryFi
+ strFileSize = (Math.Round(fi.Length / 1024)).ToString()
+ Console.WriteLine("File Name: {0}", fi.FullName)
+ Next
+
+ 'Clean up list
+ Dim PrtList As New List(Of String) 'prt list with duplicates
+
+ 'remove version number from
+ For Each fi In aryFi
+ PrtList.Add(Path.GetFileNameWithoutExtension(Path.GetFileNameWithoutExtension(fi.Name)))
+ Next
+
+ Dim result As List(Of String) = PrtList.Distinct().ToList 'prtlist without duplicates
+
+ Dim MyFile As New FileStream("Serialized.ser", FileMode.Create, FileAccess.Write, FileShare.None)
+ Try
+
+
+ For Each Strss In result
+ Dim oModelDescriptor As IpfcModelDescriptor = Nothing
+ Dim oModelDescriptorCreate As New CCpfcModelDescriptor
+ Dim PrtNaneWE As String = Strss
+
+
+ oModelDescriptor = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_PART, PrtNaneWE, "")
+
+ options = (New CCpfcRetrieveModelOptions).Create
+ options.AskUserAboutReps = False
+ oModelDescriptor.Path = WorkingDir
+
+ model1 = session.RetrieveModelWithOpts(oModelDescriptor, options)
+
+ oWindow = session.OpenFile(oModelDescriptor)
+ oWindow.Activate()
+ Dim ParamValueR As String = ""
+
+ Try
+ ReadParam(model1, "MEGNEVEZES_1", ParamValueR)
+ Catch ex As Exception
+ ParamValueR = "Nem létezik a paraméter"
+ End Try
+
+ Dim form5window As New Form5
+
+ form5window.NemetMegnevezes.Text = ParamValueR
+ Dim ParamValueW As String = ""
+
+ If dict.TryGetValue(ParamValueR, ParamValueW) = True Then
+ form5window.MaterialLabel4.Background = Brushes.Green
+ form5window.MaterialLabel4.Content = "Megtaláható a szótárban!"
+ Else
+ 'form5window.MaterialLabel4.Background = SystemColors.ButtonFace
+ form5window.MaterialLabel4.Content = ""
+ ParamValueW = gtranslate(ParamValueR, "de", "hu")
+ End If
+
+ form5window.MagyarMegnevezes.Text = ParamValueW
+
+
+
+ If Not PromtTranslateCBOX.IsChecked = True And dict.TryGetValue(ParamValueR, ParamValueW) = True Then
+ form5window.WWClicked = "OK"
+ Else
+ form5window.ShowDialog()
+
+ End If
+
+
+
+ ParamValueW = form5window.MagyarMegnevezes.Text
+
+ If form5window.WWClicked = "OK" Then
+ WriteParam(model1, ParamValueW, "Megnevezes_1")
+
+ If ParamValueR = form5window.NemetMegnevezes.Text Then
+ Else
+ ' WriteParam(model1, Form5.NemetMegnevezes.Text, "Megnevezes_1")
+ End If
+
+
+ Dim TestForChange As String = ""
+ If dict.TryGetValue(ParamValueR, TestForChange) = True Then
+ If Not TestForChange = ParamValueW Then
+ dict(ParamValueR) = ParamValueW
+ End If
+ Else
+
+ dict.Add(ParamValueR, ParamValueW)
+ End If
+
+
+ ElseIf form5window.WWClicked = "FB" Then
+
+ MyFormatter.Serialize(MyFile, dict)
+ MyFile.Close()
+ conn.Disconnect(1)
+ Exit Sub
+ End If
+
+
+
+
+
+ oWindow.Close()
+ Next
+ Catch ex As Exception
+
+ End Try
+ MyFormatter.Serialize(MyFile, dict)
+ MyFile.Close()
+
+ conn.Disconnect(1)
+
+ End Sub
+
+
+
+
+ Private Sub Button3_Click(sender As Object, e As EventArgs)
+
+ Dim dict As New Dictionary(Of String, String)()
+ Dim fs As New FileStream("Serialized.ser", FileMode.Open)
+ Dim MyFormatter As New BinaryFormatter()
+
+ dict = MyFormatter.Deserialize(fs)
+ fs.Close()
+
+ dict.Remove(InputBox("dsad"))
+ Dim MyFile As New FileStream("Serialized.ser", FileMode.Create, FileAccess.Write, FileShare.None)
+ MyFormatter.Serialize(MyFile, dict)
+ MyFile.Close()
+
+ End Sub
+
+ Private Sub TranslateNotes(model1 As IpfcModel, session As IpfcSession)
+
+ Dim iModelIOwner As IpfcModelItemOwner = model1
+ Dim iModelItems As IpfcModelItems
+ Dim IDNI As IpfcDetailNoteItem
+ Dim DTLs As IpfcDetailTextLines
+ Dim DTL As IpfcDetailTextLine
+ Dim DTs As IpfcDetailTexts
+ Dim DT As IpfcDetailText
+ iModelItems = iModelIOwner.ListItems(EpfcModelItemType.EpfcITEM_DTL_NOTE)
+ Dim countnote As Integer = 1
+ ' Dim reversedDictionary = dictionary.ToDictionary(Function(x) x.Value, Function(x) x.Key)
+
+ ProgressTextstr = "Megjegyzések listázása"
+ BackgroundWorker1.ReportProgress(0)
+
+ For Each IMI As IpfcModelItem In iModelItems
+
+
+ IDNI = IMI
+
+ DTLs = IDNI.GetTextLines(0)
+ DTL = DTLs.Item(0)
+ DTs = DTL.Texts
+ DT = DTs.Item(0)
+
+ Dim dict As Dictionary(Of String, String)
+ Dim MyFormatter As New BinaryFormatter()
+ Dim fs As New FileStream("Serialized2.ser", FileMode.Open)
+ dict = MyFormatter.Deserialize(fs)
+ fs.Close()
+
+ Dim sb As New System.Text.StringBuilder()
+
+
+ Dim TranslatedText As String = ""
+ Dim NewLine As String = ""
+
+ Dim ReadFirst As Boolean = False
+
+
+ If namingsyntax = "stefani" Then
+
+
+ ElseIf namingsyntax = "audi" Then
+ dict = dict.ToDictionary(Function(x) x.Value, Function(x) x.Key)
+
+ End If
+
+ If Not IDNI.GetAttachment.GetNoteAttachment.GetType = 2 Then
+ For Each DLI As IpfcDetailTextLine In DTLs
+ Console.WriteLine(DLI.Texts.Item(0).Text.Substring(0, DLI.Texts.Item(0).Text.Length - 1))
+ If dict.TryGetValue(DLI.Texts.Item(0).Text, NewLine) = True Then
+
+ If ReadFirst = False Then
+
+ TranslatedText = TranslatedText & NewLine
+ Else
+ TranslatedText = TranslatedText & Environment.NewLine & NewLine
+ End If
+ ' MsgBox(TranslatedText)
+
+ Try
+ IDNI.SetTextLines(StrstoTextlines(TranslatedText))
+ Catch ex As Exception
+
+ End Try
+ ElseIf dict.TryGetValue(DLI.Texts.Item(0).Text.Substring(0, DLI.Texts.Item(0).Text.Length - 1), NewLine) = True Then
+ If ReadFirst = False Then
+
+ TranslatedText = TranslatedText & NewLine
+ Else
+ TranslatedText = TranslatedText & Environment.NewLine & NewLine
+ End If
+ MsgBox(TranslatedText)
+
+ Try
+ IDNI.SetTextLines(StrstoTextlines(TranslatedText))
+ Catch ex As Exception
+
+ End Try
+
+ Else
+
+ Exit For
+ End If
+ ReadFirst = True
+ Next
+ End If
+ Next
+
+ ' MsgBox("Fordítás kész!")
+
+
+ End Sub
+
+ Private Function StrstoTextlines(ByVal Texts As String) As CpfcDetailTextLines
+ Dim detailText As IpfcDetailText
+ Dim detailTexts As CpfcDetailTexts
+ Dim textLine As IpfcDetailTextLine
+ Dim i As Integer
+ Dim Strs() As String
+
+ StrstoTextlines = New CpfcDetailTextLines
+ Strs = Split(Texts, Chr(10))
+
+ For i = 0 To Strs.Length - 1
+ detailText = (New CCpfcDetailText).Create(Strs(Strs.Length - i - 1))
+ detailTexts = New CpfcDetailTexts
+ detailTexts.Insert(0, detailText)
+ textLine = (New CCpfcDetailTextLine).Create(detailTexts)
+ StrstoTextlines.Insert(0, textLine)
+ Next
+ End Function
+
+
+
+ Private Sub ChangeSheets(model1 As IpfcModel, session As IpfcSession, drawing As IpfcDrawing)
+
+ ' ' Dim session As IpfcBaseSession = Nothing
+ ' Dim conn As IpfcAsyncConnection = Nothing
+ ' Dim model1 As IpfcModel
+ ' Connect(session, conn)
+ ' model1 = session.CurrentModel
+
+
+ Dim sheetowner As IpfcSheetOwner = model1
+ Dim iFormatDrawing As IpfcModelDescriptor
+ Dim DrawingFormat As IpfcDrawingFormat
+ Dim numberofsheets As Integer = sheetowner.NumberOfSheets
+ Dim options As IpfcRetrieveModelOptions = Nothing
+ Dim oModelDescriptor As IpfcModelDescriptor = Nothing
+ Dim oModelDescriptorCreate As New CCpfcModelDescriptor
+
+ Dim itableowner As IpfcTableOwner = model1
+ Dim itables As IpfcTables
+
+
+
+ Dim model2d As IpfcModel2D = model1
+ Dim model2 As IpfcModel = Nothing
+
+
+
+
+ For v = 1 To numberofsheets
+ ' If TiffCheckBox.Checked = True Then
+ iFormatDrawing = sheetowner.GetSheetFormatDescr(v)
+ Dim oFormat As String = iFormatDrawing.GetFileName
+
+ Dim sheetname As String = ""
+
+ Dim regexvalue As String = ""
+ Dim regexvalue2 As String = ""
+
+ Dim sheetfolder As String = "U:\proe_beallitasok\Creo4\rajzlap\stefani_magyar"
+
+ regexvalue = "^_ALK_A"
+ regexvalue2 = "^_OA_A"
+ sheetname = sheetowner.GetSheetFormatDescr(v).GetFullName
+ sheetfolder = "U:\proe_beallitasok\Creo4\rajzlap\stefani_magyar"
+
+ Dim regex As New RegularExpressions.Regex(regexvalue)
+ Dim regex2 As New RegularExpressions.Regex(regexvalue2)
+ ' MsgBox(regexvalue)
+ ' MsgBox(regex.IsMatch(sheetowner.GetSheetFormatDescr(i).GetFullName) & sheetowner.GetSheetFormatDescr(i).GetFullName)
+
+
+ drawing.currentsheetnumber = v
+
+
+ Dim result As MessageBoxResult = MessageBox.Show("A(z) " & v & " lapszámú rajzlap nem megfelelő formátomú, szeretnéd lecserélni?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning)
+ If result = MessageBoxResult.Yes Then
+
+ For Each model2view As IpfcView2D In model2d.List2DViews
+ If model2view.GetSheetNumber = v Then
+ model2 = model2view.GetModel
+ Exit For
+ End If
+
+ Next
+
+
+ 'i = 2
+
+ iFormatDrawing = sheetowner.GetSheetFormatDescr(v)
+
+ itables = itableowner.ListTables()
+ For Each itable As IpfcTable In itables
+
+ If (itable.GetSegmentSheet(0) = v) Then
+ If itable.CheckIfIsFromFormat(v) = True Then
+ itableowner.DeleteTable(itable, Nothing)
+ End If
+ Else
+ ' MsgBox("sdad")
+ End If
+ Next
+
+
+
+ ' MsgBox(sheetname & sheetfolder)
+ oModelDescriptor = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_DWG_FORMAT, sheetname, "")
+ options = (New CCpfcRetrieveModelOptions).Create
+ options.AskUserAboutReps = False
+ oModelDescriptor.Path = sheetfolder
+ DrawingFormat = session.RetrieveModelWithOpts(oModelDescriptor, options)
+ sheetowner.SetSheetFormat(i, DrawingFormat, Nothing, model2)
+ MsgBox("Kérlek igazítsd meg a rajzot, majd kattints az OK-ra")
+ End If
+
+ ' End If
+ Next
+
+ End Sub
+
+ Private Sub Button1_Click_1(sender As Object, e As RoutedEventArgs) Handles Button1.Click
+
+ End Sub
+
+ Private Sub KulonAloRajzok_Checked(sender As Object, e As RoutedEventArgs) Handles KulonAloRajzok.Checked
+ If KulonAloRajzok.IsChecked = True Then
+ isSeperateDrawing = True
+ Else
+ isSeperateDrawing = False
+ End If
+ End Sub
+
+ Private Sub EllenorzesCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles EllenorzesCheckBox.Checked
+ If EllenorzesCheckBox.IsChecked = True Then
+ isEllNeeded = True
+ Else
+ isEllNeeded = False
+ End If
+
+ End Sub
+
+ Private Sub Label_MouseDown(sender As Object, e As MouseButtonEventArgs)
+ If e.ChangedButton = MouseButton.Left Then
+ Me.DragMove()
+ End If
+ End Sub
+
+ Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
+ Environment.Exit(0)
+ End Sub
+
+ Private Sub SheetCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles SheetCheckBox.Checked
+ If SheetCheckBox.IsChecked = True Then
+ sheetParamNeeded = True
+ Else
+ sheetParamNeeded = False
+
+ End If
+ End Sub
+
+ Private Sub PrintCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles PrintCheckBox.Checked
+ If PrintCheckBox.IsChecked = True Then
+ printNeeded = True
+ Else
+ printNeeded = False
+ End If
+ End Sub
+
+ Private Sub AutomaticFolderSelect_Checked(sender As Object, e As RoutedEventArgs) Handles AutomaticFolderSelect.Checked
+ If AutomaticFolderSelect.IsChecked = True Then
+
+ autofolder = True
+ Else
+ autofolder = False
+ End If
+ End Sub
+
+ Private Sub NeedPdfStroke_Checked(sender As Object, e As RoutedEventArgs) Handles NeedPdfStroke.Checked
+
+ End Sub
+
+
+ Private Sub Subdirctories_Checked(sender As Object, e As RoutedEventArgs) Handles subdirctories.Checked
+
+ End Sub
+
+
+
+ Private Sub ParamaterChecker(model1 As IpfcModel)
+ Dim ParamValueDef As String
+ ParamNameD = "OA_MEGNEVEZES_1"
+ ParamValueDef = "Focsoport"
+ ReadParam(model1, ParamNameD, ParamValueD)
+
+
+ If ParamValueD = ParamValueDef Then
+ ' MsgBox(sresult)
+ NewWindow.ShowDialog()
+ End If
+ If Form2.ans = "ok" Then
+ WriteParam(model1, Form2.NewParamValue, ParamNameD)
+ End If
+
+
+ End Sub
+
+
+ Private Sub BackgroundWorker3_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker3.DoWork
+
+ Threading.Thread.Sleep(1000)
+ Dim hWndAbout As IntPtr = FindWindowExW(IntPtr.Zero, IntPtr.Zero, Nothing, "Nyomtatás") 'use the dialog window's text in second parameter
+ Dim hWndOkButton As IntPtr = FindWindowExW(hWndAbout, IntPtr.Zero, "Button", "Ok")
+ SendMessageW(hWndOkButton, BM_CLICK, IntPtr.Zero, IntPtr.Zero)
+ SendMessageW(hWndOkButton, BM_CLICK, IntPtr.Zero, IntPtr.Zero) 'some buttons seem to need to receive the message a second time, not sure why???
+
+
+ End Sub
+
+ Private Sub Progressbar_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles Progressbar.MouseDoubleClick
+ MainWindow.MinHeight = 370
+ MainWindow.MaxHeight = 370
+
+ End Sub
+
+ Private Sub CreateDocument_XLS_Click(sender As Object, e As RoutedEventArgs) Handles CreateDocument_XLS.Click
+ Dim session As IpfcBaseSession = Nothing
+ Dim conn As IpfcAsyncConnection = Nothing
+ Dim model1 As IpfcModel
+ Dim FileNameMod As String
+ Connect(session, conn)
+
+ model1 = session.CurrentModel
+ folderpicked = Path.GetTempPath
+ FileNameMod = model1.FileName
+ FileNames.Add(FileNameMod)
+ conn.Disconnect(1)
+
+ End Sub
+
+ Private Sub PrintExcel(FileNameMod As String)
+ xlApp = New Excel.Application
+
+
+ xlWorkBook = xlApp.Workbooks.Open(FileNameMod)
+ xlWorkSheet = xlWorkBook.Worksheets("AUDI-Bemi-Stückliste")
+ xlApp.DisplayAlerts = False
+
+ xlWorkSheet.PrintOutEx(
+ ,
+ ,
+ Copies:=1,
+ Preview:=False,
+ Collate:=True,
+ IgnorePrintAreas:=True)
+
+
+ End Sub
+
+ Private Sub PrintExcelCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles PrintExcelCheckBox.Checked
+
+ If PrintExcelCheckBox.IsChecked = True Then
+ excelPrintNeeded = True
+ Else
+ excelPrintNeeded = False
+ End If
+ End Sub
+
+ Private Sub Test_Click(sender As Object, e As RoutedEventArgs) Handles test.Click
+ Dim session As IpfcBaseSession = Nothing
+ Dim conn As IpfcAsyncConnection = Nothing
+ Connect(session, conn)
+
+ Dim iWindows As IpfcWindows
+ iWindows = session.ListWindows
+
+ For Each iWindow As IpfcWindow In iWindows
+ iWindow.Close()
+ Next
+
+ session.EraseUndisplayedModels()
+ conn.Disconnect(1)
+ End Sub
+
+
+ Private Sub FillCalcXLS(SheetName As String, typBetu As String, typBetu2 As String, TableContent(,) As String, RowCount As Integer)
+
+ Dim NumberOrTyp As Integer
+ xlWorkSheet = xlWorkBook.Worksheets(SheetName)
+ NumberOrTyp = 2
+ SHMNum = CellToString(table, 1, 5)
+
+ Dim Offset As Integer = 0
+
+ If xlWorkSheet.Cells(1, 1).Value = "Z000-00-000" Then
+ xlWorkSheet.Cells(1, 1) = SHMNum
+ Else
+
+ For i = 1 To 100
+
+ If Not xlWorkSheet.Cells(i * 41 - 40, 1).value = SHMNum Then
+ 'MsgBox(xlWorkSheet.Cells(i * 41 - 40, 1).value)
+
+ If Not xlWorkSheet.Cells(i * 41 + 1, 1).value = SHMNum Then
+
+ If xlWorkSheet.Cells(i * 41 + 1, 1).value = "" Then
+
+
+ xlWorkSheet.Range(xlWorkSheet.Cells(1, 1), xlWorkSheet.Cells(41, 18)).Copy()
+
+ xlWorkSheet.Range(xlWorkSheet.Cells(i * 41 + 1, 1), xlWorkSheet.Cells(i * 42, 18)).PasteSpecial(Excel.XlPasteType.xlPasteAll)
+ xlWorkSheet.Cells(i * 41 + 1, 1) = SHMNum
+
+ ' xlWorkSheet.Range(xlWorkSheet.Cells(i * 41 + 2, 2), xlWorkSheet.Cells(i * 42 + 42, 18)).ClearContents()
+
+ Offset += 41
+ Exit For
+ Else
+ End If
+
+ End If
+ Offset += 41
+
+ Else
+ xlWorkSheet.Range(xlWorkSheet.Cells(i * 42 + 1, 2), xlWorkSheet.Cells(i * 42 + 42, 18)).ClearContents()
+
+ Exit For
+ End If
+
+ Next
+
+ End If
+
+
+
+
+ For row = 3 To RowCount - 3
+ If TableContent(row, 11) = typBetu Or TableContent(row, 11) = typBetu2 Then
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 1) = TableContent(row, 1)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 2) = TableContent(row, 2)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 3) = TableContent(row, 3)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 4) = TableContent(row, 4)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 5) = TableContent(row, 5)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 6) = TableContent(row, 6)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 7) = TableContent(row, 7)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 8) = TableContent(row, 8)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 9) = TableContent(row, 9)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 10) = TableContent(row, 10)
+ xlWorkSheet.Cells(NumberOrTyp + Offset, 11) = TableContent(row, 11)
+ NumberOrTyp += 1
+
+ End If
+ Next
+
+ End Sub
+
+ Sub FixExtention(dirPath As String)
+
+ ' Assuming dirPath is already declared and initialized
+
+ If Not Directory.Exists(dirPath) Then
+ Console.WriteLine("Invalid directory path.")
+ Exit Sub
+ End If
+
+ Dim files As String() = Directory.GetFiles(dirPath, "*.*")
+
+ If files.Length = 0 Then
+ Console.WriteLine("No matching files found.")
+ Exit Sub
+ End If
+
+ Dim regex As New Regex("^(.*?\.drw)(?:\.(\d+))?$")
+ Dim fileGroups As New Dictionary(Of String, List(Of String))()
+
+ ' Group files by base file name
+ For Each file As String In files
+ Dim fileName As String = Path.GetFileName(file)
+
+ Dim match As Match = regex.Match(fileName)
+ If match.Success Then
+ Dim baseFileName As String = match.Groups(1).Value
+
+ If Not fileGroups.ContainsKey(baseFileName) Then
+ fileGroups(baseFileName) = New List(Of String)()
+ End If
+
+ fileGroups(baseFileName).Add(file)
+ End If
+ Next
+
+ ' Rename files in each group in numerical order
+ Dim filesRenamed As Integer = 0
+ For Each group As KeyValuePair(Of String, List(Of String)) In fileGroups
+ Dim counter As Integer = 1
+
+ ' Sort the files by their current numbering
+ Dim sortedFiles As List(Of String) = group.Value.OrderBy(Function(f)
+ Dim match As Match = regex.Match(Path.GetFileName(f))
+ If match.Success AndAlso Integer.TryParse(match.Groups(2).Value, Nothing) Then
+ Return Integer.Parse(match.Groups(2).Value)
+ Else
+ Return Integer.MaxValue
+ End If
+ End Function).ToList()
+
+ For Each file As String In sortedFiles
+ Dim newFileName As String = Path.Combine(dirPath, $"{group.Key}.{counter}")
+
+ If file <> newFileName Then
+ My.Computer.FileSystem.MoveFile(file, newFileName)
+ filesRenamed += 1
+ End If
+
+ counter += 1
+ Next
+ Next
+
+ ' Display the result
+ Dim msg As String = $"{filesRenamed} files have been renamed successfully." & Environment.NewLine & "Renamed files:" & Environment.NewLine
+ For Each file As String In Directory.GetFiles(dirPath, "*.*")
+ msg += Path.GetFileName(file) & Environment.NewLine
+ Next
+ ' MessageBox.Show(msg)
+ End Sub
+
+ Sub CreateStep(model1 As IpfcModel, session As IpfcBaseSession, FileNameMod As String)
+ Dim iWindow As IpfcWindow
+ Dim oModelDescriptor As IpfcModelDescriptor = Nothing
+ Dim oModelDescriptorCreate As New CCpfcModelDescriptor
+ Dim modelname As String = model1.InstanceName
+ Dim aIpfcSTEP3DExportInstructions As IpfcSTEP3DExportInstructions = Nothing
+ Dim aIpfcSTEP3DExportInstructionsCreate As New CCpfcSTEP3DExportInstructions
+
+
+ Dim model2d As IpfcModel2D
+ Dim view2d As IpfcView2D
+ Dim dview As CpfcView2Ds
+ Dim model2 As IpfcModel = Nothing
+ Dim ListOfViewSheets As New List(Of Integer)
+ Dim SheetNumberIndex As New List(Of Integer)
+ Dim ViewCount As Single
+ Dim FileNamesWOExtention As String
+ Dim IndexOfCurrentSheetFirstView As Integer
+
+ model2d = model1
+ dview = model2d.List2DViews()
+ ViewCount = dview.Count
+
+ For z = 0 To ViewCount - 1
+ view2d = dview(z)
+ Try
+ ListOfViewSheets.Add(view2d.GetSheetNumber)
+ Catch ex As Exception
+
+ End Try
+ Next
+
+ If i = 0 Then
+ i = 1
+ IndexOfCurrentSheetFirstView = ListOfViewSheets.IndexOf(i)
+ i = 0
+ Else
+ IndexOfCurrentSheetFirstView = ListOfViewSheets.IndexOf(i)
+ End If
+
+ Console.WriteLine(ListOfViewSheets.IndexOf(i))
+ If IndexOfCurrentSheetFirstView >= 0 Then
+
+ view2d = dview(IndexOfCurrentSheetFirstView)
+ model2 = view2d.GetModel
+
+ Dim startupPath As String = AppDomain.CurrentDomain.BaseDirectory
+ Dim profilePath As String = System.IO.Path.Combine(startupPath, "def_profile.dep_step")
+
+ session.ExportProfileLoad(profilePath)
+ Dim Iobj As Object = profilePath
+
+ model2.ExportIntf3D(FileNameMod, EpfcExportType.EpfcEXPORT_STEP, Nothing)
+
+
+ Else
+ FileNamesWOExtention = "NO_VIEW_ON_SHEET"
+
+ End If
+
+
+ ' oModelDescriptor = oModelDescriptorCreate.Create(EpfcModelType.EpfcMDL_PART, modelname, "")
+
+ ' iWindow = session.OpenFile(oModelDescriptor)
+
+
+ ' iWindow.Close()
+ ' iWindow = session.GetModelWindow(model1)
+ ' iWindow.Activate()
+
+ End Sub
+
+ Private Sub STEPCheckbox_Checked(sender As Object, e As RoutedEventArgs) Handles STEPCheckbox.Checked, STEPCheckbox.Unchecked
+
+ If STEPCheckbox.IsChecked = True Then
+ NeedStep = True
+ Else
+ NeedStep = False
+ End If
+
+ End Sub
+End Class
diff --git a/Dokumentáció Készítő 3/Module1.vb b/Dokumentáció Készítő 3/Module1.vb
new file mode 100644
index 0000000..adab5fd
--- /dev/null
+++ b/Dokumentáció Készítő 3/Module1.vb
@@ -0,0 +1,144 @@
+Imports System.IO
+
+Module Purge
+
+ Public Sub Purge(PathToPurge As String, FilesToKeepNum As Integer, FileType As String, subdir As Boolean, copyonly As Boolean, TempTxtFile As String)
+ MsgBox(".........")
+ Console.WriteLine("Folder: " + PathToPurge)
+ My.Computer.FileSystem.WriteAllText(TempTxtFile, Environment.NewLine + ".........", True)
+
+ My.Computer.FileSystem.WriteAllText(TempTxtFile, Environment.NewLine + "Folder: " + PathToPurge, True)
+
+
+ Dim files() As String
+ Dim pathss As String = PathToPurge
+ ' Dim FileType As String = ".prt"
+
+
+ files = Directory.GetFiles(pathss, "*" & FileType & "*", SearchOption.TopDirectoryOnly)
+ Dim NumberOfFilesDeleted As String = 0
+ Dim FirstCharacter As Integer
+ Dim FirstCharacter_2 As Integer
+ Dim SameFiles As New List(Of String)
+ Dim SameFileExtentensions As New List(Of Integer)
+ Dim FileExtention As New List(Of String)
+ Dim FilesToKeep As New List(Of String)
+ Dim FilesToRename As New List(Of String)
+ Dim FilesToDelete As New List(Of String)
+
+ 'Fileok megszámolása
+ Dim FileCount As Integer = files.Count
+
+
+
+ For i = 0 To FileCount - 1
+
+
+ ' Console.WriteLine(FileType)
+ FirstCharacter = files(i).ToLower.IndexOf(FileType)
+ ' FirstCharacter_2 = files(i - 1).ToLower.IndexOf(FileType)
+ If i <> 0 Then
+ FirstCharacter_2 = files(i - 1).ToLower.IndexOf(FileType)
+ ' Console.WriteLine(files(i))
+ ' Console.WriteLine(FirstCharacter)
+ ' Console.WriteLine(Strings.Left(files(i), FirstCharacter))
+
+ ' Console.WriteLine(Strings.Left(files(i - 1), FirstCharacter))
+ ' Console.WriteLine(i)
+
+
+ If Strings.Left(files(i), FirstCharacter) <> Strings.Left(files(i - 1), FirstCharacter_2) Then
+ ' Console.WriteLine(files(i))
+ SameFiles.Add(files(i))
+
+ Else
+ 'IDE AZT HA
+
+
+ End If
+
+ Else
+ SameFiles.Add(files(i))
+ End If
+
+ Next
+
+ ' Console.WriteLine(SameFiles.Count)
+ Dim EachSamefiles() As String
+ For Each SameFile As String In SameFiles
+
+ Dim samefilesname As String = Path.GetFileNameWithoutExtension(SameFile)
+ Console.WriteLine(samefilesname)
+ EachSamefiles = Directory.GetFiles(pathss, samefilesname & "*.*", SearchOption.TopDirectoryOnly)
+ FirstCharacter = SameFile.LastIndexOf(FileType)
+ ' If Left(SameFile, 108) = Left("Z:\Projekt-Rajzok\SHM-8001...SHM-8100\SHM-8020 - Umbau für G25 Interim\02 - Modellek\shm-9999-010-222-222-01", 108) Then
+ Try
+ For Each EachSameFile As String In EachSamefiles
+
+ SameFileExtentensions.Add(CInt(Mid(EachSameFile, FirstCharacter + 6)))
+
+ Next
+ Catch ex As Exception
+
+ End Try
+
+
+ SameFileExtentensions.Sort()
+ SameFileExtentensions.Reverse()
+
+
+ For i = 0 To SameFileExtentensions.Count - 1
+
+ If i < FilesToKeepNum Then
+
+ FilesToRename.Add(Strings.Left(SameFile, FirstCharacter) & FileType & "." & CStr(SameFileExtentensions(i)))
+
+ Else
+ FilesToDelete.Add(Strings.Left(SameFile, FirstCharacter) & FileType & "." & CStr(SameFileExtentensions(i)))
+
+ End If
+
+ Next
+
+
+ FilesToRename.Reverse()
+
+
+ For Each asd In FilesToDelete
+ My.Computer.FileSystem.DeleteFile(asd)
+ NumberOfFilesDeleted = NumberOfFilesDeleted + 1
+
+ My.Computer.FileSystem.WriteAllText(TempTxtFile, Environment.NewLine + "File deleted:" + asd, True)
+ MsgBox("File deleted: " + asd)
+ ' Console.WriteLine(asd)
+ Next
+
+
+ For Each asd In FilesToRename
+
+ FirstCharacter = asd.ToLower.IndexOf(FileType)
+ 'Console.WriteLine(asd)
+ My.Computer.FileSystem.WriteAllText(TempTxtFile, Environment.NewLine + "File renamed: " + asd + "to: " + Strings.Left(asd, FirstCharacter + 5) & FilesToRename.IndexOf(asd) + 1, True)
+ Console.WriteLine("File renamed: " + asd + "to: " + Strings.Left(asd, FirstCharacter + 5) & FilesToRename.IndexOf(asd) + 1)
+ 'Console.WriteLine(Strings.Left(asd, FirstCharacter + 5) & FilesToRename.IndexOf(asd) + 1)
+ If asd <> Strings.Left(asd, FirstCharacter + 5) & FilesToRename.IndexOf(asd) + 1 Then
+
+ My.Computer.FileSystem.RenameFile(asd, Path.GetFileName(Strings.Left(asd, FirstCharacter + 5) & FilesToRename.IndexOf(asd) + 1))
+
+ End If
+
+
+ Next
+
+ FilesToRename.Clear()
+ FilesToDelete.Clear()
+ SameFileExtentensions.Clear()
+
+ Next
+
+ SameFiles.Clear()
+ Console.WriteLine("...")
+ End Sub
+
+
+End Module
diff --git a/Dokumentáció Készítő 3/My Project/AssemblyInfo.vb b/Dokumentáció Készítő 3/My Project/AssemblyInfo.vb
new file mode 100644
index 0000000..fbd043b
--- /dev/null
+++ b/Dokumentáció Készítő 3/My Project/AssemblyInfo.vb
@@ -0,0 +1,59 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+Imports System.Globalization
+Imports System.Resources
+Imports System.Windows
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+
+
+
+
+
+
+
+
+'In order to begin building localizable applications, set
+'CultureYouAreCodingWith in your .vbproj file
+'inside a . For example, if you are using US english
+'in your source files, set the to "en-US". Then uncomment the
+'NeutralResourceLanguage attribute below. Update the "en-US" in the line
+'below to match the UICulture setting in the project file.
+
+'
+
+
+'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
+'1st parameter: where theme specific resource dictionaries are located
+'(used if a resource is not found in the page,
+' or application resource dictionaries)
+
+'2nd parameter: where the generic resource dictionary is located
+'(used if a resource is not found in the page,
+'app, and any theme specific resource dictionaries)
+
+
+
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+'
+
+
+
diff --git a/Dokumentáció Készítő 3/My Project/MyExtensions/MyWpfExtension.vb b/Dokumentáció Készítő 3/My Project/MyExtensions/MyWpfExtension.vb
new file mode 100644
index 0000000..22f84b7
--- /dev/null
+++ b/Dokumentáció Készítő 3/My Project/MyExtensions/MyWpfExtension.vb
@@ -0,0 +1,121 @@
+#If _MyType <> "Empty" Then
+
+Namespace My
+ '''
+ ''' Module used to define the properties that are available in the My Namespace for WPF
+ '''
+ '''
+ _
+ Module MyWpfExtension
+ Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
+ Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
+ Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
+ Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
+ '''
+ ''' Returns the application object for the running application
+ '''
+ _
+ Friend ReadOnly Property Application() As Application
+ Get
+ Return CType(Global.System.Windows.Application.Current, Application)
+ End Get
+ End Property
+ '''
+ ''' Returns information about the host computer.
+ '''
+ _
+ Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
+ Get
+ Return s_Computer.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Returns information for the current user. If you wish to run the application with the current
+ ''' Windows user credentials, call My.User.InitializeWithWindowsUser().
+ '''
+ _
+ Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
+ Get
+ Return s_User.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Returns the application log. The listeners can be configured by the application's configuration file.
+ '''
+ _
+ Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
+ Get
+ Return s_Log.GetInstance()
+ End Get
+ End Property
+
+ '''
+ ''' Returns the collection of Windows defined in the project.
+ '''
+ _
+ Friend ReadOnly Property Windows() As MyWindows
+ _
+ Get
+ Return s_Windows.GetInstance()
+ End Get
+ End Property
+ _
+ _
+ Friend NotInheritable Class MyWindows
+ _
+ Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
+ If Instance Is Nothing Then
+ If s_WindowBeingCreated IsNot Nothing Then
+ If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
+ Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
+ End If
+ Else
+ s_WindowBeingCreated = New Global.System.Collections.Hashtable()
+ End If
+ s_WindowBeingCreated.Add(GetType(T), Nothing)
+ Return New T()
+ s_WindowBeingCreated.Remove(GetType(T))
+ Else
+ Return Instance
+ End If
+ End Function
+ _
+ _
+ Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
+ instance = Nothing
+ End Sub
+ _
+ _
+ Public Sub New()
+ MyBase.New()
+ End Sub
+ Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
+ Public Overrides Function Equals(ByVal o As Object) As Boolean
+ Return MyBase.Equals(o)
+ End Function
+ Public Overrides Function GetHashCode() As Integer
+ Return MyBase.GetHashCode
+ End Function
+ _
+ _
+ Friend Overloads Function [GetType]() As Global.System.Type
+ Return GetType(MyWindows)
+ End Function
+ Public Overrides Function ToString() As String
+ Return MyBase.ToString
+ End Function
+ End Class
+ End Module
+End Namespace
+Partial Class Application
+ Inherits Global.System.Windows.Application
+ _
+ _
+ Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
+ _
+ Get
+ Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
+ End Get
+ End Property
+End Class
+#End If
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/My Project/Resources.Designer.vb b/Dokumentáció Készítő 3/My Project/Resources.Designer.vb
new file mode 100644
index 0000000..e7ecddc
--- /dev/null
+++ b/Dokumentáció Készítő 3/My Project/Resources.Designer.vb
@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:$clrversion$
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '''
+ ''' A strongly-typed resource class, for looking up localized strings, etc.
+ '''
+ _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''
+ ''' Returns the cached ResourceManager instance used by this class.
+ '''
+ _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("$safeprojectname$.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''
+ ''' Overrides the current thread's CurrentUICulture property for all
+ ''' resource lookups using this strongly typed resource class.
+ '''
+ _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set(ByVal value As Global.System.Globalization.CultureInfo)
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/Dokumentáció Készítő 3/My Project/Resources.resx b/Dokumentáció Készítő 3/My Project/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Dokumentáció Készítő 3/My Project/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/My Project/Settings.Designer.vb b/Dokumentáció Készítő 3/My Project/Settings.Designer.vb
new file mode 100644
index 0000000..9588aa9
--- /dev/null
+++ b/Dokumentáció Készítő 3/My Project/Settings.Designer.vb
@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ _
+ Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+ End Class
+End Namespace
+
+Namespace My
+
+ _
+ Friend Module MySettingsProperty
+
+ _
+ Friend ReadOnly Property Settings() As Global.Dokumentáció_Készítő_3.My.MySettings
+ Get
+ Return Global.Dokumentáció_Készítő_3.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/Dokumentáció Készítő 3/My Project/Settings.settings b/Dokumentáció Készítő 3/My Project/Settings.settings
new file mode 100644
index 0000000..40ed9fd
--- /dev/null
+++ b/Dokumentáció Készítő 3/My Project/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/Serialized2.ser b/Dokumentáció Készítő 3/Serialized2.ser
new file mode 100644
index 0000000..1670e5b
Binary files /dev/null and b/Dokumentáció Készítő 3/Serialized2.ser differ
diff --git a/Dokumentáció Készítő 3/Window1.xaml b/Dokumentáció Készítő 3/Window1.xaml
new file mode 100644
index 0000000..9634382
--- /dev/null
+++ b/Dokumentáció Készítő 3/Window1.xaml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Dokumentáció Készítő 3/Window1.xaml.vb b/Dokumentáció Készítő 3/Window1.xaml.vb
new file mode 100644
index 0000000..2ac443c
--- /dev/null
+++ b/Dokumentáció Készítő 3/Window1.xaml.vb
@@ -0,0 +1,69 @@
+
+Imports System.IO
+ Imports System.Runtime.Serialization.Formatters.Binary
+
+Public Class Form5
+
+ Public Shared NemetMegnevezesStr As String
+ Public Shared MagyarMegnevezesStr As String
+
+ Public WWClicked As String
+ Private Sub MyWindow_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
+
+ 'Material skin select
+
+ End Sub
+
+ Private Sub MaterialRaisedButton2_Click(sender As Object, e As EventArgs) Handles MaterialRaisedButton2.Click
+ WWClicked = "Cancel"
+ Me.Close()
+ End Sub
+
+
+ Private Sub MaterialRaisedButton1_Click(sender As Object, e As EventArgs) Handles MaterialRaisedButton1.Click
+ WWClicked = "OK"
+ Me.Close()
+ End Sub
+
+ Private Sub MaterialRaisedButton3_Click(sender As Object, e As EventArgs) Handles MaterialRaisedButton3.Click
+ Dim webAddress As String = "https://translate.google.com/?client=firefox-b-d&um=1&ie=UTF-8&hl=hu&client=tw-ob#view=home&op=translate&sl=de&tl=hu&text=" & NemetMegnevezes.Text
+ Process.Start(webAddress)
+ End Sub
+
+ Private Sub MaterialRaisedButton4_Click(sender As Object, e As EventArgs) Handles MaterialRaisedButton4.Click
+ Dim webAddress As String = "https://magyar-nemet-szotar.hu/" & NemetMegnevezes.Text & "-magyarul.html"
+ Process.Start(webAddress)
+ End Sub
+
+ Private Sub MaterialRaisedButton5_Click(sender As Object, e As EventArgs) Handles MaterialRaisedButton5.Click
+ WWClicked = "FB"
+ Me.Close()
+ End Sub
+
+ Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
+
+ End Sub
+
+ Private Sub NemetMegnevezes_LostFocus(sender As Object, e As RoutedEventArgs) Handles NemetMegnevezes.LostFocus
+
+ Dim magyarmegnevezesstr As String = ""
+ If MainWindow.dict.TryGetValue(NemetMegnevezes.Text, magyarmegnevezesstr) = True Then
+ MaterialLabel4.Background = Brushes.Green
+ MaterialLabel4.Content = "Megtaláható a szótárban!"
+ MagyarMegnevezes.Text = magyarmegnevezesstr
+ ' MsgBox("!!")
+ Else
+ MaterialLabel4.Content = ""
+ MainWindow.gtranslate(NemetMegnevezes.Text, "de", "hu")
+ ' MsgBox("!")
+ End If
+ End Sub
+
+ Private Sub MaterialRaisedButton5_Click_1(sender As Object, e As RoutedEventArgs) Handles MaterialRaisedButton5.Click
+
+ End Sub
+
+ Private Sub NemetMegnevezes_TextChanged(sender As Object, e As TextChangedEventArgs) Handles NemetMegnevezes.TextChanged
+
+ End Sub
+End Class
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/baseline_clear_black_18dp.png b/Dokumentáció Készítő 3/baseline_clear_black_18dp.png
new file mode 100644
index 0000000..4ad510b
Binary files /dev/null and b/Dokumentáció Készítő 3/baseline_clear_black_18dp.png differ
diff --git a/Dokumentáció Készítő 3/form3.xaml b/Dokumentáció Készítő 3/form3.xaml
new file mode 100644
index 0000000..a1860ec
--- /dev/null
+++ b/Dokumentáció Készítő 3/form3.xaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
diff --git a/Dokumentáció Készítő 3/form3.xaml.vb b/Dokumentáció Készítő 3/form3.xaml.vb
new file mode 100644
index 0000000..4369a64
--- /dev/null
+++ b/Dokumentáció Készítő 3/form3.xaml.vb
@@ -0,0 +1,35 @@
+Public Class Form3
+
+ Private Sub Form3_Loaded(ByVal sender As Object, ByVal e As EventArgs) Handles MyClass.Loaded
+
+ TextBox1.Text = MainWindow.sresult
+ ' MaterialLabel2.Text = "Hibák száma: " & MainWindow.HibakSzama
+
+ If MainWindow.HibakSzama = 0 Then
+ Label1.Foreground = Brushes.Green
+ Else
+ Label1.Foreground = Brushes.Red
+ If MainWindow.HibakSzama = 1 And MainWindow.ddas = False Then
+ Label1.Foreground = Brushes.Orange
+ End If
+ End If
+ HandleWindow.FocusWindowM("Elkészül", "t")
+ Me.Topmost = False
+ End Sub
+
+ Private Sub MaterialRaisedButton1_Click(sender As Object, e As EventArgs) Handles MaterialRaisedButton1.Click
+ Me.Close()
+ End Sub
+
+ Private Sub MaterialRaisedButton2_Click(sender As Object, e As EventArgs) Handles MaterialRaisedButton2.Click
+ Process.Start(MainWindow.workDir)
+ End Sub
+
+ Private Sub TextBox1_TextChanged(sender As Object, e As TextChangedEventArgs) Handles TextBox1.TextChanged
+
+ End Sub
+
+ Private Sub MaterialRaisedButton1_Click_1(sender As Object, e As RoutedEventArgs) Handles MaterialRaisedButton1.Click
+
+ End Sub
+End Class
\ No newline at end of file
diff --git a/Dokumentáció Készítő 3/logo.png b/Dokumentáció Készítő 3/logo.png
new file mode 100644
index 0000000..7ecece0
Binary files /dev/null and b/Dokumentáció Készítő 3/logo.png differ
diff --git a/Dokumentáció Készítő 3/packages.config b/Dokumentáció Készítő 3/packages.config
new file mode 100644
index 0000000..9b7ec88
--- /dev/null
+++ b/Dokumentáció Készítő 3/packages.config
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file