乐筑天下

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

[编程交流] Problems with vla-move and OSM

[复制链接]

56

主题

284

帖子

231

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
289
发表于 2022-7-6 06:58:45 | 显示全部楼层 |阅读模式
Hi there,
 
I want to use vla-move and benefit from OSMODE properties.
 
  1. (defun c:Test () ; (entmake (list '(0 . "TEXT") '(10 0 0 0) (cons 40 1) (cons 41 1) (cons 50 0) '(11 0 0 0) (cons 1 "Text") )  ) ;_ end of entmake(setq vob (vlax-ename->vla-object (entlast))  p1 (vlax-3D-point '(0 0 0)) ) ;_ end of setq(while (and vob (progn   (and (not (member (setq gr ([color=blue]grread[/color] T 15 0)  vt (cadr gr)  cd (car gr)) '(3 25)) )        (not (member vt '(13 32)) )  ) ; Enter , Spatiu  ) ;_ end of prog cond ) ;_ end of and (if (and (member cd '(3 5)) vob) (progn (setq  p2 (vlax-3D-point (cadr gr)) ) ([color=blue]vla-Move[/color] vob p1 p2) (setq p1 p2) )) ;_ end of if not) ;_ end of wh) ;_ end of defun
 
It is possible?
 
Thanks in advance.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:25:03 | 显示全部楼层
 
The grread function will pause to detect user input and will return a list of data pertaining to the type of input received [e.g. a return of (3 (123.0 456.0 0.0)) indicates that the user has left-clicked the point (123.0 456.0 0.0)]. However, whilst pausing to detect input, all standard drawing aids are disabled (e.g. Object Snap, Polar Tracking, Orthomode etc.). Hence, when calling the grread function within a while loop, such drawing aids are continuously disabled within the loop.
 
Orthomode can quite easily be imitated by manipulation of the cursor coordinates based on the X & Y values of the cursor position; however, the only way to achieve Object Snap functionality within a grread loop (that is, without resorting to ObjectARX as used by DynDraw by Alexander Rivilis), is to use the osnap AutoLISP function to continuously attempt to snap the cursor position using the active Object Snap modes, and display a grvecs/grdraw vector to imitate the Object Snap symbol on-screen.
 
Here is one example of such an imitation, and here is another.
回复

使用道具 举报

56

主题

284

帖子

231

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
289
发表于 2022-7-6 07:43:55 | 显示全部楼层
Thanks Lee.
 
What we saw in the first example, is very interesting. I think will find there what I want and something more.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:11:43 | 显示全部楼层
You're welcome.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 10:51 , Processed in 0.914673 second(s), 60 queries .

© 2020-2025 乐筑天下

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