• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

kill of a collection in vb.net

  • Thread starter Thread starter geogiac
  • Start date Start date

geogiac

Guest
I am trying to delete all the selectionsets of autocad from vb.net

for now I have written this, but sometimes it gives me error (? )

for each acadselect in acad.activedocument.selectionsets

acadselect.delete

next acadselect

Does anyone know why? ?
as usual
Thank you very much

Hi.
 
hi ... usually in free time, program in c# ... slightly different than vb.net as syntax ... but to manage the collections I come in mind these possibilities....(among other things I do not know with certainty whether the vba of autocad at the end is equal or not to vb.net) ... also looking at the documentation of vb.net on msdn:

1) empty all items of the collection with clear method

acad.activedocument.selectionsets.clear()

2) delete all items of the collection with the remove method and index

for as integer = acad.activedocument.selectionsets.count to 1 step -1
acad.activedocument.selectionsets.removeat(s)
next i

3) delete all items with the remove method based on the etherm
as you had set

for each acadselect in acad.activedocument.selectionsets

acad.activedocument.selectionsets.remove(acadselect)

next acadselect

the delete method in the documentation msdn does not exist ... could be a difference between vba and vb.net?!

I hope I've been helpful... let me know if you've succeeded.
greetings
tvi71
 
With the method I followed it works....only that sometimes visual studio will fit......from what I hear in the forums, it should be a vb interface bee bug with autocad...I try to find a workaround.. .
Hello and thank you
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top