- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an iLogic rule that populates the fields shown below in our title block. The DIM. Values are strings set with H,W,L values. This works well, but I have an additional need to sort these values in ascending order, so the smallest value is first followed by the next largest and finally the largest value. (4.000x5.000x14.000). I haven't had much luck finding any information about how this can be done. I did however come across some code here that someone else was using for a similar feature.
Dim sizes As New List (Of Decimal) sizes.Add(bH) sizes.Add(bW) sizes.Add(bL) sizes.Sort() D1 = sizes(1) D2 = sizes(2) D3 = sizes(3)
This is what I have been attempting, though it does not work. I get the following error "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index". I'm not sure if my list type is correct (Decimal), but no matter what I choose it fails. The (bH,bW,bL) are the actual block dimensions pulled from the .ipt file. Once sorted I want the values of each position (1),(2),(3) to be assigned to (D1),(D2),(D3) so I can place them in my title block in the correct order.
I'm no expert with this and really appreciate any help anyone can provide. If there is a need to see the complete code and/or example files, please let me know.
Thank you,
Darek
Solved! Go to Solution.