Showing results 1 to 3 of 3

Thread: How to create a new Template (Frame) Using C#

  1. #1
    Join Date
    16.06.2015
    Posts
    5

    Default How to create a new Template (Frame) Using C#

    Hello,

    Can you please help me creating a new Template (Frame) for a Screen?
    Actually I am using this code:

    private Template vTemplate;
    vTemplate = ZenonGLOBAL.Templates().Create("Test");

    Where "ZenonGLOBAL" is the Global project in zenon. This is unfortunately not working.
    But when I try to read the name of an existing template:

    vTemplate = ZenonGLOBAL.Templates().Item(1);
    MessageBox.Show(vTemplate.Name);

    This Works without problems. Can someone tell me what I am messing?

    Thanks in advance.

  2. #2
    Join Date
    13.08.2013
    Posts
    57

    Default Re: How to create a new Template (Frame) Using C#

    Hmm could you tell me which version you are working with

     public void Macro_CreateTemplate() 
            {
                for(int i=0;i
    Works fine on my machine, but "Create()" takes an additonal parameter which may be null.

    Best regards
    Sigi

  3. #3
    Join Date
    16.06.2015
    Posts
    5

    Default Re: How to create a new Template (Frame) Using C#

    Hi Sigi,

    Thank you verry much. It is working now.
    I set the second parameter to null, and this solves the problem.

    Best regards
    Hamza

Similar Threads

  1. transparent frame
    By newtec in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 4
    Last Post: 8th January 2021, 15:48
  2. Template copy across projects
    By mvj in forum VBA
    Replies: 3
    Last Post: 10th February 2010, 17:18
  3. screen template
    By stephanepilon in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 6
    Last Post: 24th April 2008, 08:00

Posting Rules

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