question

Enrique Elizaga avatar image
0 Likes"
Enrique Elizaga asked Mischa Spelt commented

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

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?

FlexSim 18.2.2
process flow instanceautomate a task
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Matthew Gillespie avatar image
3 Likes"
Matthew Gillespie answered Mischa Spelt commented

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.

· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Enrique Elizaga avatar image Enrique Elizaga commented ·

Yeah man you are awesome it worked perfectly!

0 Likes 0 ·
Rahul R avatar image Rahul R Enrique Elizaga commented ·

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

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Rahul R commented ·
@Rahul R @Mischa Spelt I've update my answer above to include the relatively new ProcessFlows property.
0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.