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.
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
- an invisible null-point in the uppper left corner of your model
- the upper-left corner of occurrences
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
- drawing a horizontal line at the top of your model
- drawing a horizontal line at the top of your occurrence
and measuring the distance between those two lines.
Then you sort them by their x-coordinate with SORT_X
You can imagine that linke
- drawing a vertical line at the left side of your model
- drawing a vertical line at the left side of your occurrence
and measuring the distance between those two lines.
In your code this would look like
funcOccs = ArisData.sort(funcOccs, Constants.SORT_Y, Constants.SORT_X, g_nLoc);