PDA

View Full Version : Again on Selection Set



PeterPan9720
19th Sep 2010, 07:12 pm
Pls somebody knows if is there a limits in the number of objects selectable from the below code ?
If I reach a quote of more than 14600 is there any know limits ? later I have to modify the layer of each !.

Thanks



ThisDrawing.SelectionSets.Add ("BOM1")
Set Ssnew1 = ThisDrawing.SelectionSets("BOM1")
Ssnew1.Select acSelectionSetAll

For Each Entity1 In Ssnew1
On Error Resume Next
If Entity1.Layer = MyNome(i - 1) Then
If Entity1.Layer <> "0" Then
Entity1.Layer = MyNome(i) 'array containing the list of array.
Debug.Print Entity1.Layer, Conteggio
Conteggio = Conteggio + 1
End If
End If
Next

rocheey
22nd Sep 2010, 02:21 pm
Of the code I see, id say the max items you'd be able to select, would be NONE. I dont see any variables typed: are they all Variants? I dont see where the variable "i" is referenced, so it would be set to a value of zero, so then "MyNome(i - 1)" returns an array index of -1 ... that would error out.

also, you keep setting an error trap "On Error Resume Next" in your loop, without having the mating end of the trap (On Error Goto 0). That could give you trouble in large selection sets.

PeterPan9720
22nd Sep 2010, 02:28 pm
Thank you for your support,
The code is working well, even if it's not well commented or all variable are not defined, the main problem was concern the max num of item selectable by selection set function.

If you are sure about that there are no limits, I'll investigate more iside the code.

Regards.