Message 1 of 7
sort arrylist

Not applicable
05-12-2017
01:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I have an array that consists of the largest overall size and location. Now I would like to sort of smallest overall size to the largest. I can not split the array because I want to open in the next stage the parts from small to big and I need the location for this action.
So how can I sort the array so that I can open the parts from small to large.
Sub Main() ' Get the active assembly document. Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument ' Iterate through all of the documents referenced by the assembly. Dim oDoc As Document Dim laserwerklist As New ArrayList For Each oDoc In oAsmDoc.AllReferencedDocuments 'Try ' Verify that the document is a part. If oDoc.DocumentType = kPartDocumentObject Then Dim oPartDoc As PartDocument = oDoc 'Manipulate part Dim model As String = oPartDoc.FullFileName Dim emodel As String = oPartDoc.DisplayName 'emodel = emodel & ".ipt" eMuppet = Left(iProperties.Value(emodel,"summary","category"),5) 'MessageBox.Show(eMuppet, "Title") If eMuppet = "Laser" Then overmeten=iProperties.Value(emodel,"Custom", "lengte")'dit is de overmeten lengte laserwerklist.add(overmeten &" "& model ) 'laserwerk.sort() Else End If End If 'Catch 'End Try Next myComponent = InputListBox("Select one.", laserwerklist, laserwerklist.item(4), "iLogic", "List") end sub
Thanks in advance