[求助]菜鸟问题!
请教各位大侠创建一个选择集时怎么样才能避免出现错误的对话框“实时错误’-2147467259(8000405)’;方法作用于对象“IACADSELECTIONSETS”时失败”啊。谢谢啊,!Public Sub creatselectionset()<BR> <BR> Dim s1 As AcadSelectionSet<BR> <BR> Set s1 = ThisDrawing.SelectionSets.Add("newselectionset")<BR> <BR> MsgBox "新添加的选择集名称为" & selectionset1.Name, vbInformation, "selectionsets example"<BR> <BR> <BR> <BR>End Sub Public Sub creatselectionset()<BR> Dim s1 As AcadSelectionSet<BR> <BR> On Error Resume Next<BR> Set s1 = ThisDrawing.SelectionSets("newselectionset")<BR> If Err Then<BR> Err.Clear<BR> Set s1 = ThisDrawing.SelectionSets.Add("newselectionset")<BR> End If<BR> s1.Clear<BR> MsgBox "新添加的选择集名称为" & s1.Name, vbInformation, "selectionsets example"<BR>End Sub
判断选择集是否存在,存在时创建会出错。
页:
[1]