明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1164|回复: 6

[提问] 请问使用(SSGET)选择的线 如何判断出 鼠标点选的座标?

[复制链接]
发表于 2018-8-8 11:42:48 | 显示全部楼层 |阅读模式
请问使用(SSGET)选择的线 如何判断出 鼠标点选的座标?
不使用getpoint
因为 选择物体 可能是块 也可能是线
所以 ssget 选择块 的时候 很方便
但是 ssget线不像getpoint 这个这么方便
最后还是想使用ssget 用其他办法补充getpoint
请问各位有什么办法 判断出 鼠标点选的位置吗?
发表于 2018-8-8 11:49:51 | 显示全部楼层
学习下ssnamex函数
发表于 2018-8-12 02:43:10 | 显示全部楼层
  1. (defun c:test ()
  2.    (setq run T)
  3.    (while (equal run T)
  4.       (setq res (grread T))
  5.       (setq code (car res))

  6.       ;; 'normal' mouse move?
  7.       (if (equal code 5)
  8.          (progn
  9.             ;; get the current cursor position
  10.             (setq pt (car (cdr res)))
  11.             ;; is there something at the
  12.             ;; current position?
  13.             (setq ss (ssget pt))
  14.             (if (/= ss nil)
  15.                ;; yes, there is something.
  16.                ;; show the grip points.
  17.                (sssetfirst nil ss)
  18.             )
  19.          )
  20.       )

  21.       ;; right mouse click?
  22.       (if (equal code 25)
  23.          (progn
  24.             ;; right mouse button clicked.
  25.             ;; exit the loop.
  26.             (princ "\nRight mouse click.\n")
  27.             (setq run nil)
  28.          )
  29.       )
  30.    )
  31. )
发表于 2018-8-13 09:14:59 | 显示全部楼层
(SSGET)
(setq o(cadr(grread 3)))
(car o)
(cadr o)
 楼主| 发表于 2018-8-14 11:17:53 | 显示全部楼层
ysq101 发表于 2018-8-11 22:51
基本功啊!!!!

那你倒是发一下啊~
 楼主| 发表于 2018-8-14 11:50:09 | 显示全部楼层
669423907 发表于 2018-8-13 09:14
(SSGET)
(setq o(cadr(grread 3)))
(car o)

3Q老铁 帮了大忙
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-19 06:15 , Processed in 0.171466 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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