mycad 发表于 2006-1-12 18:48:00

奉献一选择集程序(vba)

<P>...............................................</P>
<P>On Error Resume Next<BR>&nbsp;' Delete the Selection Set if it Exists<BR>&nbsp;If Not IsNull(ThisDrawing.SelectionSets.Item("xxx")) Then<BR>&nbsp;&nbsp;&nbsp; Set sset = ThisDrawing.SelectionSets.Item("xxx")<BR>&nbsp;&nbsp;&nbsp; sset.Delete<BR>&nbsp;End If<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set sset = ThisDrawing.SelectionSets.Add("xxx")</P>
<P>..................................................................................</P>

songzhi 发表于 2006-1-12 21:03:00

抄的吧?

mccad 发表于 2006-1-12 21:40:00

这是明经通道原创,三行搞掂:<BR>Function CreateSelectionSet(Optional SSetName As String = "mjtd") As AcadSelectionSet<BR>&nbsp;&nbsp;&nbsp; On Error Resume Next<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.SelectionSets(SSetName).Delete<BR>&nbsp;&nbsp;&nbsp; Set CreateSelectionSet = ThisDrawing.SelectionSets.Add(SSetName)<BR>End Function
页: [1]
查看完整版本: 奉献一选择集程序(vba)