明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1799|回复: 9

[新手求助]怎样在VBA中判断图形被选中!

[复制链接]
发表于 2007-8-30 21:40:00 | 显示全部楼层 |阅读模式
怎样在VBA中判断图形被选中,如直线,长方形,等是否被选中.先谢谢各位了.
 楼主| 发表于 2007-8-31 18:59:00 | 显示全部楼层

大家帮帮忙撒

发表于 2007-9-2 20:43:00 | 显示全部楼层

highlight显示

 楼主| 发表于 2007-9-3 21:46:00 | 显示全部楼层

谢谢版主,看了一下,但是不知道怎么用呢?怎么判断直线是被选中状态?拜求

发表于 2007-9-5 18:21:00 | 显示全部楼层
用objectname判断
 楼主| 发表于 2007-9-6 19:56:00 | 显示全部楼层

可否给段示例代码呢?麻烦

发表于 2007-9-8 14:50:00 | 显示全部楼层

if ppentity.objectname="acdbline" then

msgbox "直线选中"

ppentity.color=acred      '改变COLOR

end if

发表于 2007-9-13 23:39:00 | 显示全部楼层

alin说得对,可以highlight显示。

AcadEntity.Highlight(True)

发表于 2007-9-18 16:18:00 | 显示全部楼层

object.Highlight HighlightFlag

Object

MSITStore:D:\SMALL%20TOOLS\AutoCad%202004\help\acadauto.chm::/all_drawing_objects.htm">All Drawing Objects, MSITStore:D:\SMALL%20TOOLS\AutoCad%202004\help\acadauto.chm::/idh_selectionset_object.htm">SelectionSet, MSITStore:D:\SMALL%20TOOLS\AutoCad%202004\help\acadauto.chm::/idh_attributeref_object.htm">AttributeReference, MSITStore:D:\SMALL%20TOOLS\AutoCad%202004\help\acadauto.chm::/idh_group_object.htm">Group
The object or objects this method applies to.

HighlightFlag

Boolean; input-only

TRUE: The object is highlighted.

FALSE: The existing highlight is removed from the object.

Remarks

Once the highlight flag for an object has been set, a call to the MSITStore:D:\SMALL%20TOOLS\AutoCad%202004\help\acadauto.chm::/idh_update.htm">Update or MSITStore:D:\SMALL%20TOOLS\AutoCad%202004\help\acadauto.chm::/idh_regen.htm">Regen method is required to view the change.

Note that this function does not return the current highlight status of an object.

      可以看出highlight不行的

发表于 2007-9-18 16:22:00 | 显示全部楼层

    vba 好像实现不了这个

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-2-22 18:45 , Processed in 0.157895 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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