Remove all 3D-objects

Remove all 3D-objects

Skovdestudents
Not applicable
375 Views
8 Replies
Message 1 of 9

Remove all 3D-objects

Skovdestudents
Not applicable

[ FlexSim 23.0.5 ]

Hello im trying to create a processflow that:

1. Simulation starts

2. Destroys all objects (queue, processor etc.)

3. Create objects from a table (solved)


But the first run or if some changes are made in the table I need this "destroy function" to find all objects in the model and return or destroy them all without referencing to a table, specific object or name.

Any ideas on how to solve this?

Kind regards

0 Likes
Accepted solutions (1)
376 Views
8 Replies
Replies (8)
Message 2 of 9

joerg_vogel_HsH
Mentor
Mentor

I would build all object in a container. This can be a plane. Then I can destroy the content of the container node!

Message 3 of 9

Skovdestudents
Not applicable

Good idea! We have an issue with creating the object in the plane though...

We create the plane as intended but...

We create a processor like this:

createinstance(library().find("?Processor"), model());

We have also tried: createinstance(library().find("?Processor"), model().find("Plane"));
and it does not work.

We have also tried the moveobject function but no luck either..


What function can we use to move it to the plane? and if possible also move it to a specific coordinate in the plane, rather than using Vec3?


0 Likes
Message 4 of 9

moehlmann_fe
Advocate
Advocate

It's hard to know what is going wrong without access to the model.

Is the plane itself a subnode of another object? In that case you have to give the whole path or use the "?", like you do to find the processor in the library.

createinstance(..., model().find("ContainerObject/Plane");
createinstance(..., model().find("?Plane");

Once the object is inside the plane, you can use "object.setLocation" to change its location. This will use the coordinate system of its direct parent node, so in this case, the plane.

1679310743763.png

Message 5 of 9

jason_lightfoot_adsk
Autodesk
Autodesk
Object plane=Object.create("VisualTool");
Object.create("Processor").up=plane;
Message 6 of 9

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution
Table.query("DELETE  FROM Objects()")
Message 7 of 9

Skovdestudents
Not applicable
This works like a charm! Huge thanks!
0 Likes
Message 8 of 9

Skovdestudents
Not applicable
This works to some extent for us but the problem is it doesnt seem to be able to find "?Plane" in the way we createinstance (Plane), and we also dont get it to work with looking up name from table such as: "?Table(.. Thanks for the reply though, question is now answered but will upload the model for future questions in the forum.
0 Likes
Message 9 of 9

Skovdestudents
Not applicable
Thanks a lot!
0 Likes