question

Steven Chen avatar image
0 Likes"
Steven Chen asked Matt Long edited

Find all references of object

Hello,

Is there a possible way to find out all references to an object?

Let's say we have an object "Model/Source1", the following objects reference source1 in different ways:

By connection : Queue1.inObjects[1]

By node path : Operator1's home location "Model.find("Source1")"

By pink name : Event-Triggered Source object

How could I have a better picture to understand the relation between objects?

FlexSim 20.1.2
flexsim 20.1.2referencing
01.png (28.8 KiB)
02.png (13.6 KiB)
03.png (5.9 KiB)
· 5
5 |100000

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

tannerp avatar image tannerp commented ·

@steven.chen,

I'm not sure what your question is. You have pointed out a handful of ways to reference objects, and I think that's good. But, I'm not sure how I can answer this question. Was this perhaps meant to be a suggestion for a page in the User Manual that discusses how to reference objects? Is there a specific way that you'd like to reference an object besides connection, node path, and pointer references?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel tannerp commented ·

@tanner.p, I think, Steven wants to search recursively all pointers linked to an object in the tree. Where ever there is link he wants to count him, get the source code node path or just the name of the node.

0 Likes 0 ·
tannerp avatar image tannerp Joerg Vogel commented ·

Thanks for the clarification, Jörg. I don't know of any way to do what you've described, though. I bet you could write a script to go through the tree and find all the references, but it would be very time-intensive.

@steven.chen, what do you need to use the references for? Maybe we could determine a workaround.

0 Likes 0 ·
Show more comments

1 Answer

·
Matt Long avatar image
1 Like"
Matt Long answered Matt Long edited

FlexSim doesn't have any built in way to find all references to an object like a compiler would have. Often references are dynamically created and accessed using labels. If the references use code like

Model.find("Source1")

then you can easily search for that using the quick properties Search panel in the Tree View.

If you're looking for pointer/direct references (pink text) as shown in your process flow image, you would need to write some code to search through all nodes in the tree.

Your best bet is to avoid deleting or renaming objects that you are not fully confident about what their purpose is.

5 |100000

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

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.