Cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a string to a 3D object

Creator
Creator

Hi all,

 

Is there an equivalent function to str_to_obj that converts a string into a 3D animation object?

 

I need to access the path of a 3D animation object after calling its name from a table file.

 

Best,

 

Lucy

4 REPLIES

Re: Convert a string to a 3D object

Phenom
Phenom

_3d.getObject(..) is not the exact equivalent but close to.

Re: Convert a string to a 3D object

Creator
Creator

Right, okay that makes sense to me. I'll go try it!

 

Thank you!

Re: Convert a string to a 3D object

Siemens Phenom Siemens Phenom
Siemens Phenom

There is another, slightly more difficult, but more general approach:

If you have the paths in your table is the form

 

Object._3D.getObject("Subobject").getObject("Subsubobject") (. etc...),

 

then you can use the following term:

 

execute("-> any" + chr(10) + "return " + str)

 

wherein str is the path you get from your table.

 

That way, you can access everything for which you can write the path down, say, for instance, failures, animation paths in 3D objects, animatable objects (as above).

The trick behind this is that you don't see your path as a path but as a piece of SimTalk code.

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

Re: Convert a string to a 3D object

Creator
Creator

Thank you!

 

The first code suggestion I couldn't quite get working in this context but the second reply helped a lot!

 

My simualtion is now running.

 

Best,

 

Lucy