Cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Animation paths on 2D

Valued Contributor
Valued Contributor

Hello All,

 

I was wondering if it is possible to copy the animation path of, for example, a line, and use it to create more animation paths.

 

I have tried the following.

*Getting the animation points of teh network by GetAnipoints.

*Copy the co-ordinates of the animation paths and try to use these values in the command Setzeanilinie.

* But, the SetzeAnilinie can only take Integer values. Is it possible in any way to get the values from the table, or an array, so it is not required to enter each co-ordinate manually?

 

Thank you for your time.

6 REPLIES

Betreff: Copy Animation paths on 2D

Valued Contributor
Valued Contributor

I can define each co-ordinate with a variable of datatype integer and then use these values in the setzeanilinie command. But as the number of animation points increases, it makes no sense to define so many variables.

 

Like this,

x1:=  Anipointstable[3,1];

y1:= Anipointstable[4,1];

.........

 

But for an animation path which has like 10 or more co-ordinates, it is not so useful to define a variable. Hope this helps in understanding the problem.

Betreff: Copy Animation paths on 2D

Phenom
Phenom

have a look at the execute ( "sourcecode") function

 

Here you can individually create your source code in a text string e.g. individually extend

the "setzeanilinie" parameters.

 

 

Betreff: Copy Animation paths on 2D

Valued Contributor
Valued Contributor

Thank you for your quick response. Do you mean something like this?

 

execute("is do netzwerk.setzeanilinie(array); end;") ;

 

WHen I tried this, it still asks for three more values, i.e, setzeanilie can take only integer values.

 

Is there a way to create an AniLine from a table column or an array?

Betreff: Copy Animation paths on 2D

Valued Contributor
Valued Contributor


execute("is do local array: integer[ ] ; netzwerk.setzeanilinie(array); end;") ;

Re: Copy Animation paths on 2D

Phenom
Phenom

I thought of something like this kind of code ( execute has to be  uncommented)

is
	code:string;
	str:string;	
	p : string;
do

	local A:= makeArray(1,2,3,4);

	for local i:=1 to a.dim loop
		if i< a.dim then
			p:=sprint(p,A[i],",");
		else
			p:=sprint(P,A[i]);
		end;
	next;
	
	code:="current.setzeanilinie("+p+");";
	str:="is do "+code+" end;";

	print str;
	
 -- execute(str);	
end;

Re: Copy Animation paths on 2D

Valued Contributor
Valued Contributor
That is brilliant! The biggest Kudos I can give! Thank you Simulator. Smiley Happy