Selection set management
BricsCad Pro 6.0.0012When using the SelectionSets.Add/SelectionSets.Erase/SelectionSets.Deletemethods in VBA I get a bit puzzled:Using the Add method I Create a selectionset named "Temp"and I fill it with a number of elements using the Select method.Now the .Erase as well as the .Delete method will erase the selected elements from my drawing, while I expect :-the .Erase method should erase the selected elements from my drawing-the .Delete method should remove the selectionset from the SelectionSets collection.So the .Delete method erases elements from the drawing but also: it does not remove the selectionset from the collection.When calling the Clear method before the Delete method will avoid the elements to be erased.How can I get rid of a selectionset after creating it?Regards,Arno van Eeuwen
Comments
-
Arno,you made a thorough and correct analysis of the current (wrong) behaviour of the SelectionSet.delete method.This code has been corrected some weeks ago now, but did not yet make it into a release build. It will be included in an upcoming build soon now. Meanwhile, as it is effectively impossible to delete a selectionset, the best thing one can do is to reuse a selectionset.The code below gives an idea how this can be done.Kind regards,Hans 'first check if a SelectionSet with this name already exists On Error GoTo addSelSet Set selSet = App.ActiveDocument.SelectionSets.Item(name) GoTo clearSelSet:addSelSet: Set selSet = App.ActiveDocument.SelectionSets.Add(name)clearSelSet: selSet.Clear
0