Home Image-Pro Automation (Macros, Apps, Reports)

PROGRAM DEVELOPMENT ENVIRONMENT for use with PREMIER 9.3 . . .

2017-08-11-095400

All --

A few years ago I created an VB APP using VISUAL STUDIO (6 I think) which worked with IMAGE-PRO PLUS.

The end user is wanting to upgrade their system to modern hardware and software.

Is there an EXTERNAL PROGRAM DEVELOPMENT ENVIRONMENT that has received the MEDIA CY SEAL OF APPROVAL to work with PREMIER 9.3?

If so, what is it and is there a tutorial about creating the links required to control to PREMIER?

Also . . .

Is there any difference in doing this with WIN 7, WIN 8, or WIN 10?

Thanks in advance.

-- Matt

Best Answer

  • Answer ✓
    Matt,

    You can use any of the .NET languages (there's a free version of Visual Studio including VB.NET or C# which will do the job), look for Automation Server Help.chm in the Help folder. It explains how to control Premier from another application. The version of Windows doesn't matter as long as it is supported by Premier.

    Pierre

Answers

  • 2017-08-11-125933

    Pierre --

    Thank you for the information.

    I have located the CHM FILE that you referenced in

        C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.3\Help

    and the SAMPLE FILES that it references in

        C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.3\Automation\Samples

    I'll be digging into this project shortly.

    Thanks again.

    -- Matt


  • 2017-09-14-170529

    All --

    I have downloaded and installed

        MICROSOFT VISUAL STUDIO 2017 COMMUNITY

    After opening the

        MediaCy.Automation.Samples.VBClient.vbproj

    found in

        C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2

    and attempting a START / BUILD OPERATION, STUDIO displays 16 ERRORS and 15 WARNINGS.

    This is shown in the SCREEN CAPTURE below.

    Will you point me toward a solution for the issues that are keeping the EXAMPLE VB.NET PROJECT from running please.

    Thanks.

    -- Matt

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-


  • Matt,

    It looks like it can't find the assemblies it needs which are expected to be in the X:\ folder. Have you created such a drive (using the subst command) as described above?

    Pierre
  • 2017-09-15-085928

    Pierre --

    I saw one reference to the X DRIVE for the results of the BUILD.

    I redirected that to an OUTPUT FOLDER I created in the vicinity of the SOURCE CODE using a UI within VISUAL STUDIO but this seems to be on the OUTPUT SIDE of the BUILD.

    It seems there is another that I have not seen that is on the INPUT SIDE of the BUILD.

    Can you please direct me to that UI or suggest what I should change within

        subst x: c:\abc

    to allow VISUAL STUDIO to find the assemblies.

    Thanks.

    -- Matt
  • 2017-09-18-094251

    Pierre --

    Please direct me (us) on the next step to connecting VS2017 and PREMIER.

    Thanks.

    -- Matt

  • Hi Matt,

    Sorry I was referring to another post (about creating an add-in). In this case you are using Premier from another application so it's a little different. The sample project is expecting to find its input in the X:\ folder and will write its output there as well, so what you need is the following. You also have to make the folder "C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2" writable, which is not the default.

    subst /D X:
    subst X: "C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2"

    Pierre
  • 2017-09-18-162055

    Pierre --

    Thank you for the advice.

    I will try this ASAP and provide feedback.

    Thanks again.

    -- Matt
  • 2017-09-18-170848

    Pierre --

    I attempted to follow your directions.

    I created

        x.bat

    which contains

        Rem *** Disconnect / Delete any X DRIVE which may already be connected or substituted
        net use X: /delete
        subst /D X:
        Rem *** Connect drives which need to show in my computer
        subst X: "C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2"

    and I set the permissions on

        C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2

    to

        FULL CONTROL

    After I run x.bat and open

        MediaCy.Automation.Samples.VBClient.sln

    I can START the PROJECT and no errors are generated as shown in the first SCREEN CAPTURE below.



    YAY!!!

    When I press the ATTACH BUTTON, the following is displayed (by the PROJECT I think)

       

    and the following is shown within VS2017

       

    Will you please suggest the next step to getting VS2017 and PREMIER 3D V9.2 connected.

    FYI . . .

    My BUILD OUTPUT PATH is as shown below rather than the X:\ that I believe was set up in the original example. 



    This seems to be working since the OUTPUT FOLDER (created by me) now has 187 FILES stored within itself and two folders (named "en" and "ja").

       

    And nothing has been MODIFIED in the

        C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2

    FOLDER.

    Thanks.

     -- Matt
  • Matt,

    The project is setup to build in X:\ so you may have to leave it that way. But more importantly here, you are trying to connect to Premier 3D, so you have to change the Session parameter:

        Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
            Try
                _session = New Session("Image-Pro Premier 3D 9.2 64-bit", 60)
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End Sub

    Pierre
  • 2017-09-20-093700

    Pierre --

    Thank you for your suggestion. 

    I did as you suggested with:

        Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
            Try
                '_session = New Session("Image-Pro Premier 9.2 64-bit", 60)
                _session = New Session("Image-Pro Premier 3D 9.2 64-bit", 60)

            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End Sub

    When I did a START within VS 2017 and an ATTACH within the APP, the following was displayed



    Within VS2017, the following was displayed



    Your suggestion on resolving this would be much appreciated.

    Thanks again.

    -- Matt
  • Matt,

    Have you set X: to point to "C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2" with the sufficient permissions and built the application there?

    Pierre
  • 2017-09-20-183255

    Pierre --

    I know the permissions on the FOLDER that you quote are still FULL CONTROL but I'm not 100% I ran my X.BAT FILE before pressing START and ATTACH.

    I will confirm these things and I will point the BUILD OUTPUT at that FOLDER if the ERROR happens after the above is confirmed.

    I will let you know how it goes ASAP.

    Thanks.

    -- Matt
  • Matt,

    You should run X.bat only once in windows session. 
    Another point what Pierre wants to confirm is that the output of your project is set to X:\ (and not to "F:\Alces\..." as shown on your screenshots.)

    Yuri
  • 2017-09-21-103835

    Pierre and Yuri --

    Thank you for your messages.

    This (THU) AM I configured the computer with VS2017 on it in the manner suggested by PIERRE with

    1)

        X

    substituted for 

        "C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2"

    via X.BAT

    2)

    ALLOW FULL CONTROL for

        "C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2"

    on my account

    3)

    BackgroundWorker1_DoWork modified from

                _session = New Session("Image-Pro Premier 9.2 64-bit", 60)

    to

                _session = New Session("Image-Pro Premier 3D 9.2 64-bit", 60)

    4)

    BUILD OUTPUT PATH set to

        X:\

    When these things were done, the EXAMPLE PROJECT worked with no errors as shown below.

    !!! YAY !!!

    BUT . . .

    This puts the OUTPUT of the VS 2017 BUILD into a MEDIA CY FOLDER which seems to be bad to me.

    I poked around for a while and made the BUILD OUTPUT PATH a FOLDER that I had created on the C DRIVE named

        C:\VS2017 Build Output Folder

    and changed the SUB to

    *-*-*-*-*-*-*-*-*-*-*-*-*-

        Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
            Try
                '_session = New Session("Image-Pro Premier 9.2 64-bit", 60)
                _session = New Session("Image-Pro Premier 3D 9.2 64-bit", 60)
            Catch ex As Exception
                MsgBox("2" & " -- " & ex.Message)
                MsgBox("2" & " -- " & ex.ToString)
                Debug.Print("2" & " -- " & ex.ToString)
            End Try
        End Sub

    *-*-*-*-*-*-*-*-*-*-*-*-*-

    and the results of the DEBUG.PRINT were

    *-*-*-*-*-*-*-*-*-*-*-*-*-

    2 -- System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
    ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\VS2017 Build Output Folder\Automation'.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileSystemEnumerableIterator`1.CommonInit()
       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
       at System.IO.Directory.GetFiles(String path, String searchPattern)
       at Microsoft.VisualBasic.FileIO.FileSystem.FindPaths(FileOrDirectory FileOrDirectory, String directory, String wildCard)
       at Microsoft.VisualBasic.FileIO.FileSystem.FindFilesOrDirectories(FileOrDirectory FileOrDirectory, String directory, SearchOption searchType, String[] wildcards, Collection`1 Results)
       at Microsoft.VisualBasic.FileIO.FileSystem.FindFilesOrDirectories(FileOrDirectory FileOrDirectory, String directory, SearchOption searchType, String[] wildcards)
       at MediaCy.Automation.Server.GetKnownTypes(ICustomAttributeProvider provider)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.ServiceModel.Description.TypeLoader.GetKnownTypes(Object[] knownTypeAttributes, ICustomAttributeProvider provider)
       at System.ServiceModel.Description.TypeLoader.UpdateOperationsWithInterfaceAttributes(ContractDescription contractDesc, ContractReflectionInfo reflectionInfo)
       at System.ServiceModel.Description.TypeLoader.LoadContractDescriptionHelper(Type contractType, Type serviceType, Object serviceImplementation)
       at System.ServiceModel.ChannelFactory`1.CreateDescription()
       at System.ServiceModel.ChannelFactory.InitializeEndpoint(Binding binding, EndpointAddress address)
       at System.ServiceModel.ChannelFactory`1..ctor(Binding binding, EndpointAddress remoteAddress)
       at System.ServiceModel.ChannelFactory`1.CreateChannel(Binding binding, EndpointAddress endpointAddress)
       at MediaCy.Automation.Server.Connect(String uri, String exepath, Int32 timeout)
       at MediaCy.Automation.Proxy.Session..ctor(String product, Int32 timeout)
       at MediaCy.Automation.Samples.VBClient.Form1.BackgroundWorker1_DoWork(Object sender, DoWorkEventArgs e) in F:\Alces\2017-09-14-165747 -- Premier Automation with Visual Studio\2017-09-14-171505 -- PREMIER 9.2 3D AUTOMATION FOLDER\Samples\VB.NET\MediaCy.Automation.Samples.VBClient_2\Form1.vb:line 96

    *-*-*-*-*-*-*-*-*-*-*-*-*-

    Looking at all of that seemed to indicate that the PROJECT was trying to find something within an AUTOMATION FOLDER that did not exist within my BUILD OUTPUT PATH.

    I copied the contents of the

        C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2\Automation

    folder into

        C:\VS2017 Build Output Folder\Automation

    and the PROJECT does not throw any errors when I do

        START
        ATTACH
        RUN
        DETACH

    This remains true after I:

    1)

    REMOVE the FULL CONTROL of

        C:\Program Files\Media Cybernetics\Image-Pro Premier 3D 9.2

    from the SECURITY / PERMISSIONS

    2)

    REMOVE the SAMPLES FOLDER from the AUTOMATION FOLDER in my BUILD OUTPUT FOLDER.

    I now need to learn how to make this PROJECT portable and installable.

    Thank you very much for your assistance with this and if you can suggest any way to fine tune this approach, it would be much appreciated.

    I hope the information above is helpful to others working to control PREMIER from VISUAL BASIC.

    -- Matt

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-




  • Hi Matt,

    I am glad you made it work. Yes your project can live in a separate folder as long as it finds all the assemblies it was compiled with at run time.That includes the automation dlls and potentially a few others depending on what the application is using.

    Pierre
Sign In or Register to comment.