is there a way to attach an object as a process flow instance in flexscript?

is there a way to attach an object as a process flow instance in flexscript?

enrique.elizaga
Advocate Advocate
138 Views
5 Replies
Message 1 of 6

is there a way to attach an object as a process flow instance in flexscript?

enrique.elizaga
Advocate
Advocate

[ FlexSim 18.2.2 ]

Hi, when i add an object from a custom user library I want to add it to a process flow Attached Objects. I can do that on reset by checking the object class. Is there a way to this to in a flexscript block to avoid the manual task?

0 Likes
Accepted solutions (1)
139 Views
5 Replies
Replies (5)
Message 2 of 6

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

21.2 Update:

There's now a ProcessFlows property that can be used with the Object.setProperty() method.

obj.setProperty("ProcessFlows", "ObjectFlow"); // Attach obj by name reference
obj.setProperty("ProcessFlows", processFlow);  // Attach obj by node reference

*Note that this method will detach the object from any other flows it may be attached to that aren't passed into the setProperty method.

You can attach the object to multiple flows by passing in an array:

obj.setProperty("ProcessFlows", ["ObjectFlow", "ObjectFlow2"]);

You can also pass a null value to detach the object from all flows:

obj.setProperty("ProcessFlows", 0);

Original Answer:

function_s(processFlow, "attachObject", obj)

where processFlow is a pointer to your process flow object and obj is the object you want to attach.



Matthew Gillespie
FlexSim Software Developer

Message 3 of 6

enrique.elizaga
Advocate
Advocate

Yeah man you are awesome it worked perfectly!

0 Likes
Message 4 of 6

rhramac
Enthusiast
Enthusiast

@Matthew Gillespie : Is there a way to detach an object from process flow using flexscript similar to above?

0 Likes
Message 5 of 6

Matthew_Gillespie
Autodesk
Autodesk
@Rahul R @Mischa Spelt I've update my answer above to include the relatively new ProcessFlows property.


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 6 of 6

mischa_spelt
Advisor
Advisor

Nice, I didn't know about that. Deleted my comment to avoid confusion.

0 Likes