Lee Mac 发表于 2022-7-5 19:25:50

我不确定你想要实现什么-
 
getpoint允许用户使用可用的对象捕捉准确指定点;然后,您可以使用所选点,使用nentselp或ssget获取位于点处的实体。
 
如果需要不准确的点规范,但需要位于选定实体上的点,请将vlax curve getclosestpointto函数与entsel返回的点和实体结合使用。这将返回选定图元上最靠近拾取框孔径中心的点。

DuanJinHui 发表于 2022-7-5 19:30:53

 
非常感谢!李,你能举个例子吗?

Lee Mac 发表于 2022-7-5 19:33:26

例如:
(if (setq sel (entsel))
   (list (car sel) (vlax-curve-getclosestpointto (car sel) (trans (cadr sel) 1 0)))
)
或:
(if (setq pnt (getpoint "\nPick a point: "))
   (if (setq sel (nentselp pnt))
       (list (car sel) (vlax-curve-getclosestpointto (car sel) (trans (cadr sel) 1 0)))
       pnt
   )
)

DuanJinHui 发表于 2022-7-5 19:36:44

 
谢谢李,非常有用!

Lee Mac 发表于 2022-7-5 19:42:35

 
不客气!
页: 1 [2]
查看完整版本: 朋友们好,需要帮助!