Forum

How do I remove lines?

29 September 2018 02:38
Hi. I've created lines in my scene using the code below, which worked fine:

var new_line = m_obj.create_line(lineObjectName + numberOfLinesDrawn.toString());
m_scs.append_object(new_line);
m_geom.draw_line(new_line, positions);
m_mat.set_line_params(new_line, {
color: colorinput,
width: widthinput
});

Now I need to remove these lines and I can't seem to find how to do it. When I tried to get the lines by using get_object_by_name, I got 'get object xxx: not found' errors. get_all_objects() with, and without type "LINE" specified did not return any of these lines.

How do I go about removing these lines?

Thanks.
15 October 2018 10:45
not completely sure but i think you need to remeber that new_line variable and then just call remove_object with it:
scenes.remove_object(new_line)
 
Please register or log in to leave a reply.