Page 1 of 2 1 2 LastLast
Showing results 1 to 10 of 11

Thread: Access to pitch angle in C#

  1. #1
    Join Date
    20.01.2015
    Posts
    18

    Default Access to pitch angle in C#

    Hey!

    I want to change the pitch angle of a quarter circle.

                zenOn.IDynPicture Faceplate = this.DynPictures().Item("Faceplate_01");
                zenOn.IElement element = Faceplate.Elements().Item("Gauge_1");

    What are the properties of pitch angle ?

  2. #2
    Join Date
    20.08.2009
    Posts
    293

    Default AW: Access to pitch angle in C#

    Hi,

    you need to set the DynProperties for SegStartAngle and SegEndAngle.
    Note that this will only work in the Editor!

    element.set_DynProperties("SegStartAngle", 50);
    element.set_DynProperties("SegEndAngle", 150);

    If you want to have something like this in the runtime you would either have to create several symbols with different angles and display the right one via a combined element, or you could create a custom WPF control.

    Regards,
    Bernhard

  3. #3
    Join Date
    20.01.2015
    Posts
    18

    Default Re: Access to pitch angle in C#

    Thanks! Your support is awesome!

    How can I find these properties ? I can't find SegStartAngle and SegStartAngle properties!

    I exported my synoptic to .XML. I saw that DxfSegStartX/Y and DxfSegEndX/Y change with pitch angle. Is it possible to change these properties dynamicaly ? (I mean in runtime).

    I have an another question :

    How to access to combined element in C# ? I use the "move" method to try it, but this is not changing my combined element.

    zenOn.IDynPicture Faceplate = this.DynPictures().Item("Faceplate_01");
    zenOn.IElement element = Faceplate.Elements().Item("Combined_element_name");
    element.move((int)0,(int)0,(int)10,(int)10);

  4. #4
    Join Date
    20.08.2009
    Posts
    293

    Default AW: Access to pitch angle in C#

    Hi,

    I found these properties by clicking checking the embedded help:
    Click image for larger version

Name:	angle.PNG
Views:	13
Size:	9.5 KB
ID:	1658

    Usually these properties are the same as in the XML Export, but not in this case. Nevertheless, you also won't be able to change it in the Runtime by using these properties.

    For moving elements you can link variables at Position -> X/Y Position dynamic and by changing the values of these variables.

    Click image for larger version

Name:	pos.PNG
Views:	8
Size:	8.3 KB
ID:	1659

    Regards,
    Bernhard

  5. #5
    Join Date
    20.01.2015
    Posts
    18

    Default Re: Access to pitch angle in C#

    Ok !

    Well i'm not trying to move my element, but i'm trying to access at an combined element in C#. I usually use this following lines code :

    zenOn.IDynPicture Faceplate = this.DynPictures().Item("Faceplate_name");
    zenOn.IElement element = Faceplate.Elements().Item("Element_name");

    With single element, it's works, but now i'm trying with a combined element and it doesn't work!

    Sorry for my bad english , my question was, how to access to an combined element in C# ?

  6. #6
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    881

    Default Re: Access to pitch angle in C#

    Have a look at following zenon standard elements:
    - Universal slider
    - Pointer Instrument

    you simply link a variable (i.e. INT) with value range i.e. 0 - 360 to it
    -> adapt the the used element to your needs

    So, no programming required at all for this...

    regards,
    herbert


  7. #7
    Join Date
    20.01.2015
    Posts
    18

    Default Re: Access to pitch angle in C#

    Yes, I know, but I still want to access to combined elements (not only for gauges) !

    How can I access to combined element in C# ?

    I'm just learning zenOn VSTA ! I saw that's not possible to change "text" element in runtime ?

    How can I create a digital clock ?

    Is there any tricks in VSTA to change text dynamicaly in the runtime ? Example, stack all texts and show the good one ?

  8. #8
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    881

    Default Re: Access to pitch angle in C#

    How can I create a digital clock ?
    -> zenon standard element: clock
    -> see help documntation at Manual -> Screens -> Screen elements -> Clock

    Example, stack all texts and show the good one ?
    -> zenon standard element: Combo-/Listbox
    -> see help documntation at Manual -> Screens -> Screen elements -> Combo-/Listbox

    regards,
    herbert


  9. #9
    Join Date
    20.01.2015
    Posts
    18

    Default Re: Access to pitch angle in C#

    Thanks herberto!

    But you still forget an question !

    How can I access to combined elements in C# ?

    Best regards!

  10. #10
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    881

    Default Re: Access to pitch angle in C#

    combi-elements can be configured in that way that the value of a linked variable (or a combination of several variable values - formula) show i.e. a certain text, certain symbol, ....
    see Manual -> Screens -> Screen elements -> Combined element


    btw:
    Is there any tricks in VSTA to change text dynamicaly in the runtime ?
    -> use the standard element "Dynamic Text" which displays the value of a string variable
    see Manual -> Screens -> Screen elements -> Dynamic Text

    regards,
    herbert


Similar Threads

  1. Access violation
    By croc in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 1
    Last Post: 27th June 2014, 07:37
  2. Database Access
    By whitetaru in forum Drivers
    Replies: 11
    Last Post: 20th September 2011, 22:48
  3. How to calculate mean value for an angle by zenOn?
    By lephis in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 2
    Last Post: 13th September 2011, 16:52
  4. VBA and Microsoft Access
    By bjoerndavid in forum VBA
    Replies: 2
    Last Post: 30th November 2007, 22:22

Posting Rules

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