hexagon logo

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?
Parents
  • 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:



    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.
Reply
  • 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:



    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.
Children
No Data