乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 69|回复: 3

[编程交流] 带VBA的夹点和无夹点

[复制链接]

13

主题

26

帖子

13

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
84
发表于 2022-7-6 07:08:23 | 显示全部楼层 |阅读模式
大家好,
我认为这是一个简单的一个只是需要一点光的道路上。。。。。。
 
我想突出显示并显示活动选择集中项目的夹点,这是我的位置:

                               
登录/注册后可看大图

 
 
  1. Set sset = ThisDrawing.SelectionSets.Add("SS1")
  2.    mode = acSelectionSetLast
  3.    sset.Select mode
  4.    ThisDrawing.SendCommand ("_grips" & vbCr & "1" & vbCr)
  5.    sset.Highlight True

080828tw70oovnx7lavpbw.jpg
回复

使用道具 举报

0

主题

132

帖子

198

银币

限制会员

铜币
-21
发表于 2022-7-6 07:43:07 | 显示全部楼层
从AutoCAD帮助文件示例中:
 
  1. DisplayGrips Example [ActiveX and VBA Reference: AAR]Sub Example_DisplayGrips()     ' This example reads and modifies the preference value that controls     ' the display of selection set grips for the Stretch, Move, Rotate,     ' Scale, and Mirror grip modes.     ' When finished, this example resets the preference value back to     ' its original value.          Dim ACADPref As AcadPreferencesSelection     Dim originalValue As Variant, newValue As Variant          ' Get the selection preferences object     Set ACADPref = ThisDrawing.Application.preferences.Selection          ' Read and display the original value     originalValue = ACADPref.DisplayGrips     MsgBox "The DisplayGrips preference is set to: " & originalValue      ' Modify the DisplayGrips preference by toggling the value     ACADPref.DisplayGrips = Not (originalValue)     newValue = ACADPref.DisplayGrips     MsgBox "The DisplayGrips preference has been set to: " & newValue      ' Reset the preference back to its original value     '     ' * Note: Comment out this last section to leave the change to     '         this preference in effect     ACADPref.DisplayGrips = originalValue     MsgBox "The DisplayGrips preference was reset back to: " & originalValue End Sub   
回复

使用道具 举报

13

主题

26

帖子

13

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
84
发表于 2022-7-6 07:56:49 | 显示全部楼层
我使用示例代码>在首选项上放置手表>displaygrips值默认为“true”>尝试了这一点,然后我尝试打开和关闭它,逐行遍历代码,观察displaygrips值的变化等等,使用此示例代码仍然没有成功。有什么想法吗?
谢谢
回复

使用道具 举报

0

主题

7

帖子

7

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 08:20:49 | 显示全部楼层
要显示夹点,必须在AutoCAD提示中调用SELECT命令,然后使用Lisp handent函数从VBA传递到提示图元。
我们有一些小问题http://www.abccorsicad.it/software_autocad.html但基本上你不需要下载和安装这些插件来阅读(开源)代码:只要试试这个:
'使用夹点选择图形的所有线
公共子测试()
Dim c为收藏,obj为收藏
集合c=新集合
对于本图纸中的每个obj。模型空间
如果obj的类型为AcadLine,则
c、 添加对象
如果结束
下一个
设置选择c
末端接头
 
私有子集合选择(objs作为集合)
Dim obj
如果此图纸。选择FirstSelectionSet。然后计数>0
'只需发送任何命令即可删除夹点
此图纸。SendCommand Chr(27)
如果结束
此图纸。SendCommand“_SELECT”和Chr(13)
对于obj中的每个obj
此图纸。SendCommand“(handent”“”&obj.Handle&“”“&vbCr
下一个
此图纸。SendCommand vbCr
末端接头
 
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-8-15 15:59 , Processed in 2.309485 second(s), 64 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表