gS7 发表于 2022-7-6 07:21:56

(Vlax曲线getdis)中的问题

嘿,伙计们。。。。。
 
在这里,我对代码没有什么混淆(Vlax Curve getdistatpoint)
 
 
我的代码
(setq mysel(entsel))
(setq object (car mysel))
(setq pt(car(cdr mysel)))
(setq mylen(vlax-curve-getdistatpoint object pt))
(princ mylen)
 
程序运行时显示为零。。。。。。
 

帮助
 
甘尼什

pBe 发表于 2022-7-6 07:48:34


(setq mysel(entsel))
(setq object (car mysel))
(setq pt(car (cdr mysel)))
(setq mylen(vlax-curve-getdistatpoint object (vlax-curve-getClosestPointTo object pt )))
(print mylen)
 

 

(setq mylen(vlax-curve-getdistatpoint object (osnap pt "nea")))
(print mylen)
 
HTH公司

gS7 发表于 2022-7-6 07:52:59

凉的正在工作。。。。
 
油箱u pbe。。。
 
我使用了(getpoint)函数,它工作正常。。。。。
 
(getpoint)&(vlax curve getClosestPointTo)函数之间的区别是什么

Lee Mac 发表于 2022-7-6 08:16:09

 
您应该考虑的不是getpoint函数和vlax curve getclosestpointto函数之间的差异,而是entsel函数返回的点的性质;如entsel上的Visual LISP IDE帮助文档所述:
 
 
因此,可以使用vlax curve getclosestpointto函数检索位于选定实体上且在选择时最接近十字准线的点。
 
注意,根据用户选择的点及其对象捕捉设置,getpoint也无需返回位于对象上的点;因此,可能需要vlax curve getclosestpointto函数来检索对象上距离用户选择的点最近的点。

pBe 发表于 2022-7-6 08:26:21

 
你也可以用它。我在上面发布的代码片段的一个优点是减少了对用户的提示。
 
 
正确的
页: [1]
查看完整版本: (Vlax曲线getdis)中的问题