Wed, 2023-09-27 16:00
SG
Hello,
I have been trying to get process-by-flow for my functions object i.e. Top to bottom and left to right, but I fail to do so. I have been using SORT_GEOMETRIC, but I didn't get the desired output.
funcDefs = ArisData.sort(funcDefs, Constants.SORT_TYPE, Constants.SORT_GEOMETRIC, Constants.AT_NAME, g_nLoc);
where funcDefs is an array of function defination present in a model.
Can any one help me with the same ?
Thanks and Regards.
Hi,
you can only sort occs by X/Y...
Regards, Robert
Edit: this is for what to do after you fixed what Robert said (use object occurrences instead of object definitions):
SORT_GEOMETRIC only sorts occurrences by the distance between
This probably is not what you want.
What you want is to first sort them by their y-coordinate with SORT_Y.
You can imagine this like
and measuring the distance between those two lines.
Then you sort them by their x-coordinate with SORT_X
You can imagine that linke
and measuring the distance between those two lines.
In your code this would look like
Maybe the standard report "Output objects in the sequence of modeling (model graph)" can give some inspiration? The source code is open.