明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1924|回复: 3

[求助]什么原因?

[复制链接]
发表于 2003-8-16 20:05 | 显示全部楼层 |阅读模式
Sub Example_SelectOnScreen()
    ' This example adds entities to a selection set by prompting the user
    ' to select entities to add.
   
    ' Create the selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET1")
   
    ' Add entities to a selection set by prompting user to select on the screen
    ssetObj.SelectOnScreen
   
End Sub
上面的程序为什么在窗体中的按钮中调用老报错
Private Sub CommandButton1_Click()
Example_SelectOnScreen
End Sub
发表于 2003-8-16 20:23 | 显示全部楼层
SelectionSet是不允许重名的,第一次运行是不会报错的,第二次时自然不行了,
试一试 thisdrawing.selectionsets.item("TEST_SSET1").delete
 楼主| 发表于 2003-8-16 21:35 | 显示全部楼层
不是这原因,这点我知道!主要是作为模块单独运行可以,但是在按钮控件里就不行
发表于 2003-8-16 23:34 | 显示全部楼层
别做为过程,用function
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-26 09:26 , Processed in 0.572918 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表