Jump to content

Again on Selection Set


Recommended Posts

Posted

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

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...