奉献一选择集程序(vba)
<P>...............................................</P><P>On Error Resume Next<BR> ' Delete the Selection Set if it Exists<BR> If Not IsNull(ThisDrawing.SelectionSets.Item("xxx")) Then<BR> Set sset = ThisDrawing.SelectionSets.Item("xxx")<BR> sset.Delete<BR> End If<BR> <BR> Set sset = ThisDrawing.SelectionSets.Add("xxx")</P>
<P>..................................................................................</P> 抄的吧? 这是明经通道原创,三行搞掂:<BR>Function CreateSelectionSet(Optional SSetName As String = "mjtd") As AcadSelectionSet<BR> On Error Resume Next<BR> ThisDrawing.SelectionSets(SSetName).Delete<BR> Set CreateSelectionSet = ThisDrawing.SelectionSets.Add(SSetName)<BR>End Function
页:
[1]