How to add a 3D object to an object in the Object Process Flow using code?

How to add a 3D object to an object in the Object Process Flow using code?

214219004_nitt
Contributor Contributor
146 Views
2 Replies
Message 1 of 3

How to add a 3D object to an object in the Object Process Flow using code?

214219004_nitt
Contributor
Contributor

Hi Flexsim Team,

 

I’m working on a project where I need to create objects on reset and then add them to the Object Processflow using a code. Could you please help me with this?

 

Thanks and Regards,

 

Aniket Singh 

0 Likes
Accepted solutions (1)
147 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

Are the objects copies of an existing object that is already attached to the Process Flow (i.e. you vary the number of objects in a group)? In that case the copies will also be attached to the Process Flow. So if possible, I would use this approach.

 

If you need to attach completely new objects you can use the same code that gets executed when using the GUI. The usual caveat of no guaranteed compabitility when using the "function_s" command applies. (I also don't know what the "activedocumentnode()" that gets passed in as the fourth parameter is for. In tests it doesn't seem to be necessary)

treenode processFlow = Model.find("...");
Object obj = ...;
function_s(processFlow, "attachObject", obj, activedocumentnode());
obj.applyProperties("ProcessFlows");

  

0 Likes
Message 3 of 3

214219004_nitt
Contributor
Contributor

Thanks @moehlmann_fe  Its working.

0 Likes