Cancel
Showing results for 
Search instead for 
Did you mean: 

Using a string in a path

Pioneer
Pioneer

Hallo,

 

this is pretty simple: I wanted to move objects using "move".

 

The path should be (self.~. + "somestring").

 

I tried using move(str_to_obj("self.~."+somestring)) but it doesn't recognize it as a true path?!

 

Thanks!

2 REPLIES

Re: Using a string in a path

Legend
Legend

Hello, 

 

Try this : 

 

local MyDest : object := str_to_obj( to_str(self.~) + "." + somestring)) ;

....move(MyDes) ; 

 

BR 
O.C

Re: Using a string in a path

Siemens Phenom Siemens Phenom
Siemens Phenom

str_to_obj("self.~."+something) resolves the path relative to the surrounding Frame, so the keyword "self" does not reference the user-defined method attribute.

 

Instead you could use:

move(self.~.extendPath(something))

 

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.