乐筑天下

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

[编程交流] Another Pointless Program :P

[复制链接]

15

主题

209

帖子

121

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 13:27:18 | 显示全部楼层
OK Lee.  You need something to do in the form of a prank.  Make a reactor to move objects away from the cursor so that they can be selected...So when they invoke explode they can get any objects.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:31:58 | 显示全部楼层
Haha, nice idea Tim -
 
But the reactor would need some form of GrRead loop to track the mouse movements - which, combined with a reactor, may cause trouble
回复

使用道具 举报

4

主题

940

帖子

961

银币

初来乍到

Rank: 1

铜币
12
发表于 2022-7-6 13:36:35 | 显示全部楼层
I defer to your genius Lee... can you incorporate this?
  1. (setq SpV (vlax-create-object "Sapi.SpVoice"))     (vlax-invoke SpV "Speak" "Kaboom" 0)     (vlax-release-object SpV)
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:36:50 | 显示全部楼层
I'm no genius Larry
 
  1. (defun c:ExOn () (vl-load-com) (if (not *prank)   (setq *prank     (vlr-command-reactor nil       (list         (cons :vlr-commandWillStart 'prank))))) (princ))(defun prank (Reac Args) (if (eq "EXPLODE" (strcase (car Args)))   (progn     (setq SpV (vlax-create-object "Sapi.SpVoice"))     (vlax-invoke SpV "Speak" "Kaboom" 0)     (vlax-release-object SpV))) (princ))(defun c:ExOff () (if (and *prank (vlr-added-p *prank))   (progn     (vlr-remove *prank)     (setq *prank nil))) (princ))
回复

使用道具 举报

4

主题

940

帖子

961

银币

初来乍到

Rank: 1

铜币
12
发表于 2022-7-6 13:41:21 | 显示全部楼层
Ha! now it's truly pointless
Not really... reminded me how reactors work- Thx
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:43:23 | 显示全部楼层
No probs - Its a fun program
回复

使用道具 举报

18

主题

434

帖子

422

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
94
发表于 2022-7-6 13:49:13 | 显示全部楼层
And what if the user selects the objects *before* it starts the Explode command?
回复

使用道具 举报

4

主题

940

帖子

961

银币

初来乍到

Rank: 1

铜币
12
发表于 2022-7-6 13:51:44 | 显示全部楼层
Lee
Since you once offered to explain your stuff...
how about this?
  1. (defun c:ExOff () (if (and *exR (vlr-added-p *exR))   (progn     (vlr-remove *exR)(setq *exR nil)))
I've read Help about vlr-added-p, but how is *exR 'made' a VLR object representing the reactor?
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:53:28 | 显示全部楼层
I use the variable *exR as a global variable (not localised in any function), and bound the reactor object to it, when the user invokes the top program (ExON).
EDIT!
 
OOPs!  Forgot to change it from the last program!
 
**program updated above... nice spot Larry!
回复

使用道具 举报

4

主题

940

帖子

961

银币

初来乍到

Rank: 1

铜币
12
发表于 2022-7-6 13:57:41 | 显示全部楼层
Oh, OK... Thx
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 03:14 , Processed in 0.641250 second(s), 70 queries .

© 2020-2025 乐筑天下

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