Script to make a change in all programs?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script to make a change in all programs?

    All of our programs are set up to automatically save reports to a specific directory based on part number. IT has decided they need to re-map our entire network which means I need to edit all of our programs to save reports according to the new network mapping scheme. Is it possible to use a script for this task? If so, does anyone have an example of how to do this?

  • #2
    To avoid getting myself into this sort of situation I have a text file that contains all of the components of my file paths that I don't have direct control over. I read in this text file at the beginning of every program and use the information to create the paths for saving off data. This way if something like what just happened to you happens to me I can just change a few lines in that text file and all of my programs will adapt to the new directory structure without any modification. This won't be much help to you with your current situation but may be something to consider in the future.
    2013MR1 SP6
    Global Frames, Tesastar-M Heads, LSP-X1M/H Probes

    Comment


    • #3
      Question: are the paths hard-coded in the File- Printing - Report Window Setup, or are they hard-coded in a Print Command?


      Originally posted by DaSalo View Post
      To avoid getting myself into this sort of situation I have a text file that contains all of the components of my file paths that I don't have direct control over. I read in this text file at the beginning of every program and use the information to create the paths for saving off data. This way if something like what just happened to you happens to me I can just change a few lines in that text file and all of my programs will adapt to the new directory structure without any modification. This won't be much help to you with your current situation but may be something to consider in the future.
      +1, excellent elegant "preventative measures" solution.
      Help with PC-DMIS:
      1. Search Forum. If nothing then:
      2. Post new thread - title clearly referring to problem.
      3. Listen & learn.
      No PMs please

      Comment


      • #4
        I do something kind of like DaSalo, except that I utilize drive mappings on the computer.

        My CMMs have their default directories pointing to a simple folder structure on a "P:" drive:

        Programs - P:\PROGRAMS\
        Probes - P:\PROBES\
        Recall - P:\RECALL\
        Subroutines - P:\SUBROUTINES\

        These are also the paths I will use to recall any scripts or subroutines from (e.g. "P:\SUBROUTINES\DOSTUFF.BAS")

        If we want to change the location of where all these folders are I can just remap my P: drive to a new location, I just have to make sure I maintain the same structure of subfolders (PROGRAMS / PROBES / etc.)
        (╯□)╯︵ ┻━┻

        Comment


        • #5
          By the way N3WPV, do you have any experience scripting in something outside of PC-DMIS (i.e. VB.NET/VBA/VBScript/Powershell/etc.)? If you give us an example of what commands/values you're trying to modify, we could probably help you write something.
          (╯□)╯︵ ┻━┻

          Comment


          • #6
            Originally posted by Josh Carpenter View Post
            Question: are the paths hard-coded in the File- Printing - Report Window Setup, or are they hard-coded in a Print Command?
            Originally posted by ewe0006 View Post
            By the way N3WPV, do you have any experience scripting in something outside of PC-DMIS (i.e. VB.NET/VBA/VBScript/Powershell/etc.)? If you give us an example of what commands/values you're trying to modify, we could probably help you write something.


            I have a Print Command at the end of each program that saves the report to a specific folder based on part number with a filename based on user input data.

            Code:
            PRINT/REPORT,EXEC MODE=END,$              
            TO_FILE=ON,OVERWRITE="J:\Quality\Enginetics Part Numbers\5000 - 5999\5307188-01\CMM Reports\5307188-01 - Lot "+ LOT +" - #"+ SERNUM +".rtf",$
            TO_PRINTER=OFF,$
            TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
            REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
            PREVIOUS_RUNS=KEEP_INSTANCES

            Everything on our "J" drive has been moved to the "S" drive. I wasn't sure if a script to change this was possible since PCD programs are not true text files, unless I'm mistaken. If a script is possible I do not know how to do it. I've taken scripts here and studied how they work and have been able to modify them to meet my needs but to create one from scratch is above me.

            I also have some other commands I may need to modify ie., scripts, stats, custom data exports, etc. Being able to use a script to do a global "find...replace" would be a big time saver! I like the idea of reading in a text file for path structure and will look into this.

            Comment


            • #7
              Isn't it possible to create a new drive letter (J in this case) pointing to the S-drive folder?

              Then there would be no need to edit all your programs...
              PC-DMIS CAD++ 2o16.0

              Comment


              • #8
                If you can just remap your J: to the location of your new S: drive, that would be the easiest way to go. If your J: drive is a network share that you still need access to, you may need to map it to something else, but then your PC will probably be different from all the others in your company.

                If you want to script a batch conversion, you can paste this into a new VB.NET console application. You'll need to change the constant 'ProgramDir' value (right at the top) to whatever root directory you want to start the conversion in (maybe "J:\Quality\" based on your example.) It would probably be wise to copy a few programs to another location to test this, and then copy all of your programs to another location for doing a full run.

                Code:
                Imports System.Threading
                Imports System.IO
                
                Module Module1
                
                    Const ProgramDir = "J:\TEMP\"
                    Const ProgramFileExt = "*.PRG"
                    Const ChangeFromPath = "J:\"
                    Const ChangeToPath = "S:\"
                
                    Private pcdApp As PCDLRN.Application
                    Private pcdParts As PCDLRN.PartPrograms
                    Private pcdActivePart As PCDLRN.PartProgram
                    Private pcdCommands As PCDLRN.Commands
                    Private pcdCommand As PCDLRN.Command
                
                    Sub Main()
                
                        If ConnectPCD() = True Then
                            Dim tmpFiles() As String = GetFiles(ProgramDir)
                            Try
                                For Each tmpFile As String In tmpFiles
                                    If ConvertPrintPath(tmpFile, ChangeFromPath, ChangeToPath) = False Then Exit For
                                Next
                            Catch ex as Exception
                                Console.Writeline(ex.Message)
                            End Try
                            Console.WriteLine("Complete!")
                        End If
                
                        DisconnectPCD()
                
                        Console.ReadLine()
                
                    End Sub
                
                    Function GetFiles(ByVal RootDir As String) As String()
                
                        Return Directory.GetFiles(RootDir, ProgramFileExt, SearchOption.AllDirectories)
                
                    End Function
                
                    Function ConnectPCD() As Boolean
                
                        Try
                            pcdApp = GetObject("", "PCDLRN.Application")
                            pcdApp.WaitUntilReady(60)
                            Thread.Sleep(2000)
                            pcdApp.Visible = True
                            pcdApp.Maximize()
                            pcdParts = pcdApp.PartPrograms
                            If pcdParts.Count <> 0 Then
                                Throw New Exception("Please close all open PC-DMIS part programs.")
                            End If
                            Return True
                        Catch ex As Exception
                            Console.WriteLine("ConnectPCD : " & ex.Message)
                            Return False
                            pcdParts = Nothing
                            pcdApp = Nothing
                            GC.Collect()
                        End Try
                
                    End Function
                
                    Sub DisconnectPCD()
                
                        pcdCommand = Nothing
                        pcdCommands = Nothing
                        pcdActivePart = Nothing
                        pcdParts = Nothing
                        pcdApp = Nothing
                        GC.Collect()
                
                    End Sub
                
                    Function ConvertPrintPath(ByVal FilePath As String, ByVal ChangeFrom As String, ByVal ChangeTo As String) As Boolean
                
                        Console.WriteLine("Converting file: " & FilePath)
                
                        Try
                            pcdParts.Open(FilePath, "CMM1")
                            pcdActivePart = pcdApp.ActivePartProgram
                            pcdCommands = pcdActivePart.Commands
                            For i As Integer = 0 To pcdCommands.Count
                                pcdCommand = pcdCommands.Item(i)
                                If pcdCommand Is Nothing Then Continue For
                                If Not pcdCommand.Type = PCDLRN.OBTYPE.PRINT_REPORT Then Continue For
                                Dim tmpText = pcdCommand.GetText(PCDLRN.ENUM_FIELD_TYPES.FILE_NAME, 1)
                                If tmpText.Contains(ChangeFrom) Then
                                    pcdCommand.PutText(tmpText.Replace(ChangeFrom, ChangeTo), PCDLRN.ENUM_FIELD_TYPES.FILE_NAME, 1)
                                End If
                            Next
                            pcdActivePart.Close()
                            Return True
                        Catch ex As Exception
                            Console.WriteLine("ConvertPrintPath : " & ex.Message)
                            Return False
                        End Try
                
                    End Function
                
                End Module
                Last edited by ewe0006; 12-04-2013, 07:14 PM.
                (╯□)╯︵ ┻━┻

                Comment


                • #9
                  So I'm finally getting around to trying this. I created a new console app in VB 2010 Express and copied the above code into the code window. I'm getting the following in the error list:

                  Script error.JPG

                  I'm assuming it's because I need to add the PCD reference library to VB 2010 Express. My question is which file(s) do I need to add?

                  Comment


                  • #10
                    Before you do anything else, keep in mind that this code is doing a batch processing of files, and has the potential to do some damage. With that said...

                    ---

                    You should by default have a "Solution Explorer" window on the right side of your screen that lists the items in your solution, otherwise you can open it from the View menu.

                    On the very first item in your solution (should be named whatever you assigned as the overall project name), right click and choose "Add Reference..." from the context menu.

                    When the "Add Reference" dialog appears, click the "COM" tab and wait a few seconds/minutes for the list of registered COM assemblies to populate.

                    Once the list if populated, scroll down until you find an item to the effect of "PC-DMIS XXXXX Object Library". There should be an entry for any versions of PC-DMIS you have installed (i.e. "PC-DMIS 4.2 Object Library".) If there is more than one, choose the one that best matches whatever you are currently running.

                    Highlight the item as described above, and click OK. The errors in your list should go away.

                    ---

                    Once you're getting ready to start running the code, I would recommend that you change the constant paths to a location with a few files you can test on.

                    I would also recommend putting a breakpoint in the program and stepping through so you understand what the code is doing. You can add a breakpoint by clicking on the grey vertical bar on the left side of the editor window:

                    Breakpoint.jpg

                    When you run the application (pressing the F5 key), it will pause on this point so you can step through one command at a time with the F8 key.
                    (╯□)╯︵ ┻━┻

                    Comment


                    • #11
                      Thanks, it's working just fine now. However I do have another question. Currently this changes only the path in my print command. I have paths called out in other commands as well, script, stats, assignments, file/open, file/close, etc. I've been able to get those to change using this script by copy/paste and changing some code.

                      Is there a way to just straight up look for a string of text ("J:\") throughout the whole program, like find/replace, without looking for a specific command? I only ask because not all programs have the same commands. I would need to modify this script to include all commands where a path is called out. I don't have a problem doing this; I understand if a program does not have that command it will skip over it. I'm just curious...

                      Comment


                      • #12
                        Originally posted by N3WPV View Post
                        Thanks, it's working just fine now. However I do have another question. Currently this changes only the path in my print command. I have paths called out in other commands as well, script, stats, assignments, file/open, file/close, etc. I've been able to get those to change using this script by copy/paste and changing some code.

                        Is there a way to just straight up look for a string of text ("J:\") throughout the whole program, like find/replace, without looking for a specific command? I only ask because not all programs have the same commands. I would need to modify this script to include all commands where a path is called out. I don't have a problem doing this; I understand if a program does not have that command it will skip over it. I'm just curious...
                        Without doing any testing, I would assume the path is usually stored in a PCDLRN.ENUM_FIELD_TYPES.FILE_NAME property underneath any command. In our loop that evaluates the command and modifies the path property, we could try taking out the conditional statement that filters out anything but print commands (notice I put an apostrophe at the beginning of the line that checked the command type; this comments out that line so it does not execute when the application is run):

                        Code:
                                Try
                                    pcdParts.Open(FilePath, "CMM1")
                                    pcdActivePart = pcdApp.ActivePartProgram
                                    pcdCommands = pcdActivePart.Commands
                                    For i As Integer = 0 To pcdCommands.Count
                                        pcdCommand = pcdCommands.Item(i)
                                        If pcdCommand Is Nothing Then Continue For
                                        'If Not pcdCommand.Type = PCDLRN.OBTYPE.PRINT_REPORT Then Continue For
                                        Dim tmpText = pcdCommand.GetText(PCDLRN.ENUM_FIELD_TYPES.FILE_NAME, 1)
                                        If tmpText.Contains(ChangeFrom) Then
                                            pcdCommand.PutText(tmpText.Replace(ChangeFrom, ChangeTo), PCDLRN.ENUM_FIELD_TYPES.FILE_NAME, 1)
                                        End If
                                    Next
                                    pcdActivePart.Close()
                                    Return True
                                Catch ex As Exception
                                    Console.WriteLine("ConvertPrintPath : " & ex.Message)
                                    Return False
                                End Try
                        The whole application would now look like this:

                        Code:
                        Imports System.Threading
                        Imports System.IO
                        
                        Module Module1
                        
                            Const ProgramDir = "J:\TEMP\"
                            Const ProgramFileExt = "*.PRG"
                            Const ChangeFromPath = "J:\"
                            Const ChangeToPath = "S:\"
                        
                            Private pcdApp As PCDLRN.Application
                            Private pcdParts As PCDLRN.PartPrograms
                            Private pcdActivePart As PCDLRN.PartProgram
                            Private pcdCommands As PCDLRN.Commands
                            Private pcdCommand As PCDLRN.Command
                        
                            Sub Main()
                        
                                If ConnectPCD() = True Then
                                    Dim tmpFiles() As String = GetFiles(ProgramDir)
                                    Try
                                        For Each tmpFile As String In tmpFiles
                                            If ConvertPrintPath(tmpFile, ChangeFromPath, ChangeToPath) = False Then Exit For
                                        Next
                                    Catch ex as Exception
                                        Console.Writeline(ex.Message)
                                    End Try
                                    Console.WriteLine("Complete!")
                                End If
                        
                                DisconnectPCD()
                        
                                Console.ReadLine()
                        
                            End Sub
                        
                            Function GetFiles(ByVal RootDir As String) As String()
                        
                                Return Directory.GetFiles(RootDir, ProgramFileExt, SearchOption.AllDirectories)
                        
                            End Function
                        
                            Function ConnectPCD() As Boolean
                        
                                Try
                                    pcdApp = GetObject("", "PCDLRN.Application")
                                    pcdApp.WaitUntilReady(60)
                                    Thread.Sleep(2000)
                                    pcdApp.Visible = True
                                    pcdApp.Maximize()
                                    pcdParts = pcdApp.PartPrograms
                                    If pcdParts.Count <> 0 Then
                                        Throw New Exception("Please close all open PC-DMIS part programs.")
                                    End If
                                    Return True
                                Catch ex As Exception
                                    Console.WriteLine("ConnectPCD : " & ex.Message)
                                    Return False
                                    pcdParts = Nothing
                                    pcdApp = Nothing
                                    GC.Collect()
                                End Try
                        
                            End Function
                        
                            Sub DisconnectPCD()
                        
                                pcdCommand = Nothing
                                pcdCommands = Nothing
                                pcdActivePart = Nothing
                                pcdParts = Nothing
                                pcdApp = Nothing
                                GC.Collect()
                        
                            End Sub
                        
                            Function ConvertPrintPath(ByVal FilePath As String, ByVal ChangeFrom As String, ByVal ChangeTo As String) As Boolean
                        
                                Console.WriteLine("Converting file: " & FilePath)
                        
                                Try
                                    pcdParts.Open(FilePath, "CMM1")
                                    pcdActivePart = pcdApp.ActivePartProgram
                                    pcdCommands = pcdActivePart.Commands
                                    For i As Integer = 0 To pcdCommands.Count
                                        pcdCommand = pcdCommands.Item(i)
                                        If pcdCommand Is Nothing Then Continue For
                                        'If Not pcdCommand.Type = PCDLRN.OBTYPE.PRINT_REPORT Then Continue For
                                        Dim tmpText = pcdCommand.GetText(PCDLRN.ENUM_FIELD_TYPES.FILE_NAME, 1)
                                        If tmpText.Contains(ChangeFrom) Then
                                            pcdCommand.PutText(tmpText.Replace(ChangeFrom, ChangeTo), PCDLRN.ENUM_FIELD_TYPES.FILE_NAME, 1)
                                        End If
                                    Next
                                    pcdActivePart.Close()
                                    Return True
                                Catch ex As Exception
                                    Console.WriteLine("ConvertPrintPath : " & ex.Message)
                                    Return False
                                End Try
                        
                            End Function
                        
                        End Module
                        (╯□)╯︵ ┻━┻

                        Comment


                        • #13
                          Originally posted by ewe0006 View Post
                          Without doing any testing, I would assume the path is usually stored in a PCDLRN.ENUM_FIELD_TYPES.FILE_NAME property underneath any command. In our loop that evaluates the command and modifies the path property, we could try taking out the conditional statement that filters out anything but print commands (notice I put an apostrophe at the beginning of the line that checked the command type; this comments out that line so it does not execute when the application is run):

                          For whatever reason the Stats/Transfer command uses the PCDLRN.ENUM_FIELD_TYPES.TRANSFER_DIR property. I will have to look through my programs and see what commands are used with a network path. Luckily, as currently written I think this should take care of about 95% or my programs. There are only a few that have extra commands due to specific customer requirements for data capture.

                          Your help is much appreciated! I am better off with the knowledge you have shared; thank you!

                          Comment


                          • #14
                            Originally posted by N3WPV View Post
                            For whatever reason the Stats/Transfer command uses the PCDLRN.ENUM_FIELD_TYPES.TRANSFER_DIR property. I will have to look through my programs and see what commands are used with a network path. Luckily, as currently written I think this should take care of about 95% or my programs. There are only a few that have extra commands due to specific customer requirements for data capture.

                            Your help is much appreciated! I am better off with the knowledge you have shared; thank you!
                            It sounds like you're picking up the code! Another cool thing you can do is export BASIC scripts of entire programs out of PC-DMIS (File > Export > BASIC), and it will be almost identical to how you need to call things from VB.Net.

                            If I'm trying to figure out what one specific PC-DMIS command looks like in BASIC code, I will write a simple PC-DMIS program that only calls that one command and export the BASIC file. For example, I write a PC-DMIS program that looks like this:

                            Code:
                            PART NAME  : EricTemp
                            REV NUMBER : 
                            SER NUMBER : 
                            STATS COUNT : 1
                             
                            STARTUP    =ALIGNMENT/START,RECALL:,LIST=YES
                                        ALIGNMENT/END
                                        MODE/MANUAL
                                        FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, , 
                                        LOADPROBE/MD01_SM_STAR
                                        TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                                        STATS/TRANSFER,DIRECTORY=J:\
                            When I export the BASIC code, it looks like this:

                            Code:
                            Dim DmisApp As Object
                            Dim DmisPart As Object
                            Dim DmisCommands As Object
                            Dim DmisCommand As Object
                            
                            Sub Part1
                              Set DmisApp = CreateObject("PCDLRN.Application")
                              Set DmisPart = DmisApp.ActivePartProgram
                              Set DmisCommands = DmisPart.Commands
                              CommandCount = DmisCommands.Count
                              Set DmisCommand = DmisCommands.Item(CommandCount)
                              DmisCommands.InsertionPointAfter DmisCommand
                              Set DmisCommand = DmisCommands.Add(START_ALIGN, TRUE)
                                DmisCommand.Marked = TRUE
                              ' Set Id  = STARTUP
                                retval = DmisCommand.PutText ("STARTUP", ID, 0)
                              ' Set Reference Id Item 1 = 
                                retval = DmisCommand.PutText ("", REF_ID, 1)
                              ' Set Alignment List  = YES
                                retval = DmisCommand.SetToggleString (2, ALIGN_LIST, 0)
                              
                              Set DmisCommand = DmisCommands.Add(END_ALIGN, TRUE)
                                DmisCommand.Marked = TRUE
                              
                              Set DmisCommand = DmisCommands.Add(MAN_DCC_MODE, TRUE)
                                DmisCommand.Marked = TRUE
                              ' Set Mode  = MANUAL
                                retval = DmisCommand.SetToggleString (2, MODE_TYPE, 0)
                              
                              Set DmisCommand = DmisCommands.Add(DIMENSION_FORMAT, TRUE)
                                DmisCommand.Marked = TRUE
                              ' Set Dimension Text  = TEXT
                                retval = DmisCommand.SetToggleString (1, DIM_TEXT, 0)
                              ' Set Dimension Text Options  = OPTIONS
                                retval = DmisCommand.SetToggleString (2, DIM_TEXT_OPTIONS, 0)
                              ' Set Show Headings  = HEADINGS
                                retval = DmisCommand.SetToggleString (3, SHOW_HEADINGS, 0)
                              ' Set Show Symbols  = SYMBOLS
                                retval = DmisCommand.SetToggleString (4, DEVIATION_SYMBOLS, 0)
                              ' Set Standard Deviation  =  
                                retval = DmisCommand.SetToggleString (7, STANDARD_DEVIATION, 0)
                              ' Set Dimension Heading Item 1 = NOM
                                retval = DmisCommand.SetToggleString (1, DIM_HEADING, 1)
                              ' Set Dimension Heading Item 2 = TOL
                                retval = DmisCommand.SetToggleString (2, DIM_HEADING, 2)
                              ' Set Dimension Heading Item 3 = MEAS
                                retval = DmisCommand.SetToggleString (3, DIM_HEADING, 3)
                              ' Set Dimension Heading Item 4 = DEV
                                retval = DmisCommand.SetToggleString (5, DIM_HEADING, 4)
                              ' Set Dimension Heading Item 5 = OUTTOL
                                retval = DmisCommand.SetToggleString (6, DIM_HEADING, 5)
                              
                              Set DmisCommand = DmisCommands.Add(GET_PROBE_DATA, TRUE)
                                DmisCommand.Marked = TRUE
                              ' Set Filename  = MD01_SM_STAR
                                retval = DmisCommand.PutText ("MD01_SM_STAR", FILE_NAME, 0)
                              
                              Set DmisCommand = DmisCommands.Add(SET_ACTIVE_TIP, TRUE)
                                DmisCommand.Marked = TRUE
                              ' Set Id  = T1A0B0
                                retval = DmisCommand.PutText ("T1A0B0", ID, 0)
                              ' Set Tip I  = 0
                                retval = DmisCommand.PutText ("0", TIP_I, 0)
                              ' Set Tip J  = 0
                                retval = DmisCommand.PutText ("0", TIP_J, 0)
                              ' Set Tip K  = 1
                                retval = DmisCommand.PutText ("1", TIP_K, 0)
                              ' Set Theoretical Angle  = 0
                                retval = DmisCommand.PutText ("0", THEO_ANGLE, 0)
                              
                              Set DmisCommand = DmisCommands.Add(STATISTICS, TRUE)
                                DmisCommand.Marked = TRUE
                              ' Set Statistics Type  = TRANSFER
                                retval = DmisCommand.SetToggleString (3, STATS_TYPE, 0)
                              ' Set Transfer Directory  = J:\
                                retval = DmisCommand.PutText ("J:\", TRANSFER_DIR, 0)
                              
                            End Sub
                            
                            Sub Main
                            
                              Part1
                            
                              DmisPart.RefreshPart
                            End Sub
                            I can then look at the Stats command, and see that PC-DMIS is calling a "STATISTICS" command and the TRANSFER_DIR property is holding the path:

                            Code:
                              Set DmisCommand = DmisCommands.Add(STATISTICS, TRUE)
                                DmisCommand.Marked = TRUE
                              ' Set Statistics Type  = TRANSFER
                                retval = DmisCommand.SetToggleString (3, STATS_TYPE, 0)
                              ' Set Transfer Directory  = J:\
                                retval = DmisCommand.PutText ("J:\", TRANSFER_DIR, 0)
                            Going back to our console application, I can now add another line into our loop that reads the text in the "TRANSFER_DIR" property, as well as a test for the folder string we're looking for and a command to replace it:

                            Code:
                                    Try
                                        pcdParts.Open(FilePath, "CMM1")
                                        pcdActivePart = pcdApp.ActivePartProgram
                                        pcdCommands = pcdActivePart.Commands
                                        For i As Integer = 0 To pcdCommands.Count
                                            pcdCommand = pcdCommands.Item(i)
                                            If pcdCommand Is Nothing Then Continue For
                                            'If Not pcdCommand.Type = PCDLRN.OBTYPE.PRINT_REPORT Then Continue For
                                            Dim tmpText = pcdCommand.GetText(PCDLRN.ENUM_FIELD_TYPES.FILE_NAME, 1)
                                            If tmpText.Contains(ChangeFrom) Then
                                                pcdCommand.PutText(tmpText.Replace(ChangeFrom, ChangeTo), PCDLRN.ENUM_FIELD_TYPES.FILE_NAME, 1)
                                            End If
                                            tmpText = pcdCommand.GetText(PCDLRN.ENUM_FIELD_TYPES.TRANSFER_DIR, 0)
                                            If tmpText.Contains(ChangeFrom) Then
                                                pcdCommand.PutText(tmpText.Replace(ChangeFrom, ChangeTo), PCDLRN.ENUM_FIELD_TYPES.TRANSFER_DIR, 0)
                                            End If
                                        Next
                                        pcdActivePart.Close()
                                        Return True
                                    Catch ex As Exception
                                        Console.WriteLine("ConvertPrintPath : " & ex.Message)
                                        Return False
                                    End Try
                            Last edited by ewe0006; 01-10-2014, 05:27 PM.
                            (╯□)╯︵ ┻━┻

                            Comment


                            • #15
                              I did not know you could export dmis to basic like this. This is actually awesome. yay geek moment.

                              Comment

                              Working...
                              X