天龙八部 发表于 2007-7-25 17:07:00

一段代码,请各位高手帮忙看看,错误提示缺少对象

<p>代码如下:</p><p>Sub ppcolor()</p><p>'color select dialog</p><p></p><p>Dim ppentity As AcadEntity<br/>&nbsp;<br/>Dim ppset As AcadSelectionSet</p><p>Set ppset = ThisDrawing.SelectionSets.Add("mmmm")</p><p>ppset.SelectOnScreen</p><p>ppset.Delete</p><p>Set ppset = Nothing</p><p><br/>Dim xxx1 As Integer</p><p><br/>xxx1 = ThisDrawing.Utility.GetInteger("输入需要改变实体颜色的序号:")</p><p>Dim gggppp As Double</p><p>If xxx1 = 1 Then</p><p>gggppp = acRed</p><p>ElseIf xxx1 = 2 Then</p><p>gggppp = acBlue</p><p>Else<br/>gggppp = acCyan<br/>End If</p><p><br/>For Each ppentity In ppset</p><p>ppentity.color = gggppp</p><p><br/>Next ppentity</p><p><br/>End Sub</p><p></p>

天龙八部 发表于 2007-7-25 17:45:00

<p>问题自己已解决,把ppset.Delete选择集放到前面去了,一del,后面就完玩了,调试了很多,不过可能对大家有帮助,这样</p><p>大家就不会犯我的同样的错误了,</p>
页: [1]
查看完整版本: 一段代码,请各位高手帮忙看看,错误提示缺少对象