Execute action - Forum

Forum Navigation
You need to log in to create posts and topics.

Execute action

Hello.

Im buggin on this problem for a week. Meybe someone of you can halp me? Is there a way to execute action in VBWeb from a variable, like in VBWin?

Im creating app that will be drawing many lines and want to use variables to it. But if i want to add another action to draw a line, there is a problem, because i want to add this action from application window, depends how many lines i want to create.

For example:

There is six text inputs for two sets of X,Y ,Z  values.  And there are two push buttons which one of them says 'Add line' and another one 'Draw lines'

Push button 1 will write action 'add line' which is modified version of neo3dDrawLine:

     neo3dDrawLine("Container1","1","[X1],[Y1],[Z1]","[X2],[Y2],[Z2]","0,0,0","0,0,0","3","0,0,0");

But instead of execution, put's it into a variable.

     SetVar [lineCode] "neo3dDrawLine\u0022Container1\u0022 \u00221\u0022 \u0022[X1],[Y1],[Z1]\u0022 \u0022[rX2],[Y2],[Z1]\u0022 \u00220,0,0\u0022 \u00220,0,0\u0022 \u00223\u0022 \u00220,0,0\u0022"

Then it takes a value of this variable and add it to another one, named [Code]

Now you can modify values X,Y,Z, and when you push it once again, it will create another line of code but with difrent values.

Then it's add it to variable [Code] once again. And so one, and so forth.

In the end when we got  set of drawlines commands ready

neo3dDrawLine"Container1" "1" "-42,0,0" "2,-47,0" "91,55,0" "0,0,0" "3" "0,0,0"
neo3dDrawLine"Container1" "1" "-60,89,0" "70,78,0" "57,-76,0" "0,0,0" "3" "0,0,0"
neo3dDrawLine"Container1" "1" "-78,-1,0" "75,-83,0" "-36,75,0" "0,0,0" "3" "0,0,0"

We push second button, and it will execute all this actions from variable [Code] at once.

Please help...

 

For now im using loop function instead, but with action execution it will be much better for me.

Code need to be runned by neoEdge

neo3dInitialize "Container1" 0.5

neo3dEnableDrag "Container1"


jsPrompt "How many lines?" "10" [quantSet]

         Loop 0 [quantSet] [quant]

              RandomEx -100 100 [randomX1]
              RandomEx -100 100 [randomY1]

              RandomEx -100 100 [randomX2]
              RandomEx -100 100 [randomY2]

              RandomEx -100 100 [randomX3]
              RandomEx -100 100 [randomY3]

neo3dDrawLine "Container1" "1" "[randomX1],[randomY1],0" "[randomX2],[randomX2],0" "[randomX3],[randomX3],0" "0,0,0" "3" "0,0,0"

EndLoop

 

Uploaded files:
  • You need to login to have access to uploads.

@ziebzie

Each time you want to add a new line you must create an object to store the coordinates.
Then you add the object to an Array.

When you want to draw the lines, just loop the Array and get the stored coordinates to draw each line.
Please take a look at the attached app.

Let me know if you have any doubts.

Uploaded files:
  • You need to login to have access to uploads.
ziebzie has reacted to this post.
ziebzie

@luishp

Thats what im talkin about :) Thank you very  much. This is that simple...

I was so desperate, that i tried to modify 'main.js' file with "_FileRead" , "_FileWrite" commands.

But variable can't store the whole file, so i cut 'main.js' into two files, then i put my set of drawlines commands between.

Then i join it, into one 'main.js' once again. What a mess... anyway, thank you once again :)

luishp has reacted to this post.
luishp