3 Replies Latest reply: May 5, 2011 11:51 AM by Jeff Singer-Oracle RSS

    Migrating from AutoVue DV to AutoVue DD with VBA/MS Access

    858160
      Apologize in advance for long post – trying to get all details in to get help for myself and maybe help others get a jump if they’re in the same boat…

      Currently using Autovue DV. We use VBA code in MS Access to first create a file then shell to Autovue and run the file created which opens/prints drawings. (i.e. Shell("C:\Progra~1\AV\AVWIN\AVWIN -s C:\data\Access\AV.SCR", 0). Example of AV.SCR and alternative AVI.SCR at very end of post - former for individual wkstns like an engineer bringing up a drawing to view in Autovue and manually print if desired; latter for automatically printing 1+ drawings on the shop floor. It has worked great for years and we are VERY happy with it and wish we weren’t being forced to change. But, Oracle is dropping DV in preference to DD (by February of next year?) and we’re running into some snags.

      One big issue from start was getting properly initialized. So:

      Public Function AutoVuePrint()
      Dim AVctrl As JVueAXControl, strResults As String
      Set AVctrl = New JVueAXControl
      AVctrl.initActiveX
      AVctrl.setFile "upload://\\CORP\FILES\SLDWORKS\Q524350.SLDDRW"
      AVctrl.setPrintOptions "PRINTDRIVER", "HP 4000 Info Services"
      AVctrl.printIt
      AVctrl.closeDocument
      End Function

      Would compile and run, but nothing would print and no error produced. Found that adding a PAUSE after .initActiveX would work, but it isn't practical if we want to keep things moving on the shop floor (if PAUSE is too long, it will take an unnecessarily long time to get all the prints out) AND not miss any prints due to it not yet being initialized (if PAUSE is too short, and initActiveX isn't fully initialized, no error is returned, nothing printed, etc - we'd just have 'lost' prints). Seems VBA in MS Access (which is what we have to use) is more event driven rather than object oriented and to my knowledge, can't handle events like doneInit. Anyone know how to use doneInit with VBA?

      I did find what I think can be a workaround by checking GetFile… it seems to be empty until everything is initialized and loaded, so the best I can do through VBA is :

      Public Function AutoVuePrint()
      Dim AVctrl As JVueAXControl, strResults As String
      Set AVctrl = New JVueAXControl
      AVctrl.initActiveX
      Do While strResults = ""
      AVctrl.setFile "upload://\\CORP\FILES\SLDWORKS\Q524350.SLDDRW"
      strResults = AVctrl.GetFile
      Loop
      AVctrl.setPrintOptions "PRINTDRIVER", "HP 4000 Info Services"
      AVctrl.printIt
      AVctrl.closeDocument
      End Function

      Although this code seems to work with VBA in MS Access, really only works for auto printing drawings on the shop floor (replacement for AVI.scr) since nothing visible opens - not for the engineer just bringing up drawing(s) to view in AutoVue (like AV.scr). The same function creates both .SCR files – basically only difference is ‘if autoprint from unmanned station, then write PRINT to .SCR’. Looking for suggestions on how to get this to work as easily as it has in the past (create file -> shell to AutoVue)… am thinking I’ll unfortunately have to do something separate for manned vs unmanned stations, but also think it’s still not going to provide the same functionality and interface for the users as before.

      For those of you looking to use WATERMARK and PENMAPFILE settings when printing as previously used, stop looking – they aren’t available…. Although I have put in enhancement requests for both.

      Oh, why can’t we just shell like we did before?! 

      So, my open question/issues:
      1.     Anyone know how to get doneInit to work in VBA?
      2.     Suggestions for easy replacement of current method (create file w/ print setup options to view/print then shell to AutoVue referencing file created)?



      AV.SCR example file contents (can paste in notepad, save, use Shell cmd):
      CHILD CLOSE
      CHILD NEW
      CHILD MAXIMIZE
      FILE OPEN \\CORP\FILES\SLDWORKS\Q528853.SLDDRW
      PRINT-OPTION CH="Q30705 %M %D %Y %H %U"
      PRINT-OPTION CF=" 10-3090 STAGE-D2-BT0347..."
      PRINT-OPTION RF="!10030-11X1!"
      PRINT-OPTION LF="Q528853"
      PRINT-OPTION RH="!T1!"
      PRINT-OPTION LH="!MOVEPARTS!"
      PRINT-OPTION PRINTDRIVER "\\CORP\MIS_HP"
      PRINT-OPTION PAPERSIZE 1
      PRINT-OPTION ORIENTATION L
      PRINT-OPTION WATERMARK ""



      AVI.SCR example file contents (can paste in notepad, save, use Shell cmd):
      CHILD CLOSE
      CHILD NEW
      WINDOW MINIMIZE
      FILE OPEN \\CORP\FILES\SLDWORKS\Q524350.SLDDRW
      PRINT-OPTION CH=" %M %D %Y %H %U"
      PRINT-OPTION CF=" 10-6190 25-S8-7710 S12-FA0150X60"
      PRINT-OPTION RF="!12629X60!"
      PRINT-OPTION LF="Q524350"
      PRINT-OPTION RH="!T1!"
      PRINT-OPTION LH="!MOVEPARTS!"
      PRINT-OPTION PRINTDRIVER "\\WK\P011"
      PRINT-OPTION PAPERSIZE 1
      PRINT-OPTION ORIENTATION L
      PRINT-OPTION PENMAPFILE E2
      PRINT-OPTION WATERMARK ""
      PAUSE 1500
      PRINT
      PAUSE 1500
      CHILD CLOSE
      CHILD NEW
      WINDOW MINIMIZE
      FILE OPEN \\CORP\FILES\CD02B\3301063.1
      PRINT-OPTION CH=" %M %D %Y %H %U"
      PRINT-OPTION CF=" 5-6190 8-STAGE 10-6026 B64100X4"
      PRINT-OPTION RF="!12977X4!"
      PRINT-OPTION LF="3301063"
      PRINT-OPTION RH="!T1!"
      PRINT-OPTION LH="!MOVEPARTS!"
      PRINT-OPTION PRINTDRIVER "\\WK\P011"
      PRINT-OPTION PAPERSIZE 17
      PRINT-OPTION ORIENTATION L
      PRINT-OPTION PENMAPFILE E2
      PRINT-OPTION WATERMARK ""
      PAUSE 1500
      PRINT
      PAUSE 1500
      CHILD CLOSE
      CHILD NEW
      WINDOW MINIMIZE
      FILE OPEN \\CORP\FILES\SLDWORKS\3390082.SLDDRW
      PRINT-OPTION CH=" %M %D %Y %H %U"
      PRINT-OPTION CF=" 10-6190 30-S1-2061 40-2084 S3-J24015X382"
      PRINT-OPTION RF="!13513.1X175!"
      PRINT-OPTION LF="3390082"
      PRINT-OPTION RH="!T1!"
      PRINT-OPTION LH="!MOVEPARTS!"
      PRINT-OPTION PRINTDRIVER "\\WK\P011"
      PRINT-OPTION PAPERSIZE 1
      PRINT-OPTION ORIENTATION L
      PRINT-OPTION PENMAPFILE E2
      PRINT-OPTION WATERMARK "SPLIT ORDER (0)\nPARTIAL"
      PAUSE 1500
      PRINT
      PAUSE 1500
      CHILD CLOSE
      CHILD NEW
      WINDOW MINIMIZE
      FILE OPEN \\CORP\FILES\TIFFS\3301160.TIF
      PRINT-OPTION CH=" %M %D %Y %H %U"
      PRINT-OPTION CF=" 10-6190 STAGE-S1-M3-AT0627..."
      PRINT-OPTION RF="!13965-2X30!"
      PRINT-OPTION LF="3301160"
      PRINT-OPTION RH="!T1!"
      PRINT-OPTION LH="!MOVEPARTS!"
      PRINT-OPTION PRINTDRIVER "\\WK\P011"
      PRINT-OPTION PAPERSIZE 1
      PRINT-OPTION ORIENTATION L
      PRINT-OPTION PENMAPFILE E2
      PRINT-OPTION WATERMARK ""
      PAUSE 1500
      PRINT
      PAUSE 1500
      CHILD CLOSE
      CHILD NEW
      WINDOW MINIMIZE
      FILE OPEN \\CORP\FILES\SLDWORKS\3342776.SLDDRW
      PRINT-OPTION CH=" %M %D %Y %H %U"
      PRINT-OPTION CF=" 10-6190 STAGE-S11-BS-FULL..."
      PRINT-OPTION RF="!14959-7X4!"
      PRINT-OPTION LF="3342776"
      PRINT-OPTION RH="!T1!"
      PRINT-OPTION LH="!MOVEPARTS!"
      PRINT-OPTION PRINTDRIVER "\\WK\P011"
      PRINT-OPTION PAPERSIZE 1
      PRINT-OPTION ORIENTATION L
      PRINT-OPTION PENMAPFILE E2
      PRINT-OPTION WATERMARK "BURNED EARLY"
      PAUSE 1500
      PRINT
      PAUSE 1500
      CHILD CLOSE
      CHILD NEW
      WINDOW MINIMIZE
      FILE OPEN \\CORP\FILES\CD08A\Q500026.1
      PRINT-OPTION CH="S.O. 19312 %M %D %Y %H %U"
      PRINT-OPTION CF=" 10-6190 S2-CSHP01"
      PRINT-OPTION RF="!15121X4!"
      PRINT-OPTION LF="Q500026"
      PRINT-OPTION RH="!T1!"
      PRINT-OPTION LH="!MOVEPARTS!"
      PRINT-OPTION PRINTDRIVER "\\WK\P011"
      PRINT-OPTION PAPERSIZE 1
      PRINT-OPTION ORIENTATION L
      PRINT-OPTION PENMAPFILE E2
      PRINT-OPTION WATERMARK ""
      PAUSE 1500
      PRINT
      PAUSE 1500
      CHILD CLOSE
        • 1. Re: Migrating from AutoVue DV to AutoVue DD with VBA/MS Access
          Jeff Singer-Oracle
          Custah,

          While I'm unable to answer your specific question, I'm wondering if your approach of using DD is the best one.

          Our recommended way of batch printing files, especially when those files are sitting on a file server (like at \\CORP in your case), is to use our printing web services combined with AutoVue Client/Server version. This would also allow you to support Watermarks.

          I can't say for sure if this is the best solution for your specific requirements, but it's probably worth checking out since you're building a new solution anyway.

          http://download.oracle.com/docs/cd/E17470_02/otn/pdf/E17421_01.pdf

          Email me if you want to discuss offline (email address is first name dot last name at oracle.com)
          • 2. Re: Migrating from AutoVue DV to AutoVue DD with VBA/MS Access
            858160
            Thanks, I will take a look at the printing web services... this raises a question of licensing, though - is the print service another product we have to purchase? And do we have to change/upgrade (aka pay more) to use the AutoVue Client/Server version, too? (I actually thought DD was the Client portion of the Client/Server)

            On a side note, I think you were at Cimmetry way back when we originally purchased, weren't you? Good to know you're still around helping us out! :-)
            • 3. Re: Migrating from AutoVue DV to AutoVue DD with VBA/MS Access
              Jeff Singer-Oracle
              There shouldn't be any extra cost. As long as all the users are licensed to use AutoVue, they can use DV, DD or C/S (or all of them). An AutoVue user is an AutoVue user - regardless of which product flavor they're using. Feel free to send me an email if you want to discuss further.

              Not sure who this is, but yes - we've probably chatted before!