Showing results 1 to 3 of 3

Thread: Dynproperties of function "Screen: Move center"

  1. #1
    Join Date
    28.03.2013
    Location
    Lyon
    Posts
    7

    Default Dynproperties of function "Screen: Move center"

    Hi,

    I wonder if it is possible to call function "Screen: Move center" in VBA (or VSTA) code after setting dynamically its properties ; I have two functionnalities which depend on it :

    - I have in VBA code the name of the picture and the name of the element I want to center on, and I want to have only one function of this type created (too many pictures and elements in my project to create a function for each).
    - I have in VBA code the name of the picture to open with minimum zoom (1%)

    I tried this sample code for minimum zoom :
        Dim zFCT As RtFunction
    
        Stop
        Set zFCT = thisProject.RtFunctions.Item("TestFunction")
        With zFCT
            Debug.Print "First result : " & .DynProperties("PictSwitch[0].Picture")
            .DynProperties("PictSwitch[0].Picture") = strVueNiveau
            Debug.Print "Second result : " & .DynProperties("PictSwitch[0].Picture")
    
            .DynProperties("MidParameter.Type") = 0
            .DynProperties("MidParameter.ZoomType") = 1
            .DynProperties("MidParameter.ZoomPercent") = 1
    
            .Start
        End With

    Results in debug are :
    First result : PictureNameSetInEditor
    Second result :
    And the function does not open the picture.
    "(PictureNameSetInEditor" is the name of the picture selected in editor, when creating the function "TestFunction"

    Note : The function gives expected result when first executed directly (via a button) : it opens picture with minimum zoom.

    Am I missing something ?

    Regards,
    Clément.

  2. #2

    Default Re: Dynproperties of function "Screen: Move center"

    Hi Clément,

    I had a look and could reproduce this issue.

    In the editor it is possible to set the dynproperty, however in the runtime it seems to clear the picture at the function, and the function can no longer be executed properly.

    I have forwarded this for further investigation. If you require a feedback, please contact your local COPA-DATA support.

    At the moment the only alternative I can think of is to create a function for each screen.

    As it is possible to modify the dynproperty in the editor, you can easily do this with a small VBA macro in the editor that creates the required function(s) for each screen.

    Best regards,
    Mark

  3. #3
    Join Date
    28.03.2013
    Location
    Lyon
    Posts
    7

    Default Re: Dynproperties of function "Screen: Move center"

    Thanks Mark for your reply.

    I'll develop a VBA macro to create functions in the editor and I'll contact local support for feedback on this subject.

    For information, the same issue seems to occur for function "Screen switch".

    Regards,
    Clément.

Similar Threads

  1. Replies: 2
    Last Post: 21st September 2012, 04:23
  2. EdLimit DynProperties("Function")
    By carlo.chiari in forum VBA
    Replies: 2
    Last Post: 14th September 2012, 09:13
  3. picture:move center function
    By shahramkh59 in forum zenon Supervisor
    Replies: 9
    Last Post: 27th June 2010, 12:28
  4. Replies: 2
    Last Post: 9th June 2009, 12:53
  5. Replies: 5
    Last Post: 28th November 2008, 10:49

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •