Announcement

Collapse
No announcement yet.

SET TEXT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SET TEXT

    Hi, I am applying the below code. but i am facing the issue is on this button its restating the complete scene. and even if i commit the sendbuffer its not sendingvalue.
    any suggestion i am beginner in scripting.



    private void vizActionButton4_Click(object sender, EventArgs e)
    {
    {
    vizConnection1.AddToBuffer("RENDERER*TREE*$textobject*GEOM*TEXT SET " + txtbox.Text);

    //
    vizConnection1.SendBuffer();
    }

  • #2
    Originally Posted by wajahat ali View Post
    Hi, I am applying the below code. but i am facing the issue is on this button its restating the complete scene. and even if i commit the sendbuffer its not sendingvalue.
    any suggestion i am beginner in scripting.



    private void vizActionButton4_Click(object sender, EventArgs e)
    {
    {
    vizConnection1.AddToBuffer("RENDERER*TREE*$textobject*GEOM*TEXT SET " + txtbox.Text);

    //
    vizConnection1.SendBuffer();
    }
    110.PNG

    111.PNG
    112.PNG

    Comment


    • #3
      Methods:

      AddToBuffer Overloaded.
      ClearBuffer Clears output buffer
      RequestEngineIndentification Tries to retrieve viz|engine version running on remote machine
      SendBuffer Sends commands from output buffer
      SendBufferSequentially Sends commands from output buffer sequentially (one after another)
      SendSingleCmd Sends command immediately overcomming commands buffer

      Comment


      • #4
        thanks jozef its done.. please can u tell me that i have same code like tis forthe image change. does it work in same way. like i want toloadimage fromfile open or from viz images.
        Attached Files

        Comment


        • #5
          Hi Guys,
          and any idea to TEXT GET from container and use it as a value to next steps?
          I've got sth like this to use TextBox value to press button and trigger mathematical addition:



          private void vizActionButton4_Click(object sender, EventArgs e)
          {
          if (vizConnection1.IsConnected == true);
          vizConnection1.ClearBuffer();
          vizConnection1.AddToBuffer("RENDERER*STAGE*DIRECTOR*CIRCLE START");
          vizConnection1.SendSingleCmd("RENDERER*TREE*$DROP1*GEOM*TEXT SET " + (Convert.ToInt32(textBox1.Text) + 2), true);
          vizConnection1.SendBuffer();

          }

          But I would like to make a button to GET the contener actual value and add digit and SET new value, like:

          private void vizActionButton4_Click(object sender, EventArgs e)
          {
          if (vizConnection1.IsConnected == true);
          vizConnection1.ClearBuffer();
          vizConnection1.SendSingleCmd("RENDERER*TREE*$DROP1*GEOM*TEXT GET " = (????????);
          vizConnection1.AddToBuffer("RENDERER*STAGE*DIRECTOR*CIRCLE START");
          vizConnection1.SendSingleCmd("RENDERER*TREE*$DROP1*GEOM*TEXT SET " + (Convert.ToInt32(????????.Text) + 2), true);
          vizConnection1.SendBuffer();

          }


          This is my way of thinking, but doesn't work.
          Pls help

          Comment


          • #6
            response.PNG

            Code:
            using FPS.VizToolkit;
            using System;
            using System.Windows.Forms;
            
            namespace Example
            {
                public partial class Form1 : Form
                {
                    public int cmd1;
                    public delegate void ResponseCallback(int responseID, string responseValue);
                    public delegate void StateCallback(SocketConnectionState state);
            
                    public Form1()
                    {
                        InitializeComponent();
                    }
            
                    //---------------------------------------------
            
                    public void UpdateText(int responseID, string responseValue)
                    {
                        if (responseID == cmd1)
                        {
                            textBox1.Text = responseValue;
                        }
                    }
            
                    public void UpdateState(SocketConnectionState state)
                    {
                        switch (state)
                        {
                            case SocketConnectionState.Connecting:
                                break;
                            case SocketConnectionState.Connected:
                                cmd1 = vizConnection1.SendSingleCmd("RENDERER*TREE*$Test1*GEOM*TEXT GET", true);
                                break;
                            case SocketConnectionState.Disconnected:
                                break;
                        }
                    }
            
                    //---------------------------------------------
                    private void btnUp_Click(object sender, EventArgs e)
                    {
                        if (vizConnection1.IsConnected == true)
                        {
                            vizConnection1.SendSingleCmd("RENDERER*TREE*$Test1*GEOM*TEXT SET " + (Convert.ToInt32(textBox1.Text) + 1).ToString(), false);
                            cmd1 = vizConnection1.SendSingleCmd("RENDERER*TREE*$Test1*GEOM*TEXT GET", true);
                        }
                    }
            
                    private void btnDown_Click(object sender, EventArgs e)
                    {
                        if (vizConnection1.IsConnected == true)
                        {
                            vizConnection1.SendSingleCmd("RENDERER*TREE*$Test1*GEOM*TEXT SET " + (Convert.ToInt32(textBox1.Text) - 1).ToString(), false);
                            cmd1 = vizConnection1.SendSingleCmd("RENDERER*TREE*$Test1*GEOM*TEXT GET", true);
                        }
                    }
            
                    //---------------------------------------------
            
                    private void vizConnection1_OnVizResponse(object sender, VizConnectionEventArgs e)
                    {
                        Invoke(new ResponseCallback(UpdateText), Convert.ToInt32(e.ResponseID), e.ResponseValue);
                    }
            
                    private void vizConnection1_OnConnect(object sender, VizConnectionEventArgs e)
                    {
                        Invoke(new StateCallback(UpdateState), e.ConnectionState);
                    }
            
                    private void vizConnection1_OnConnecting(object sender, VizConnectionEventArgs e)
                    {
                        Invoke(new StateCallback(UpdateState), e.ConnectionState);
                    }
            
                    private void vizConnection1_OnDisconnect(object sender, VizConnectionEventArgs e)
                    {
                        Invoke(new StateCallback(UpdateState), e.ConnectionState);
                    }
                }
            }

            Comment

            Working...
            X