samifox 发表于 2022-7-5 23:51:38

vlax曲线函数解释

你好
 
试图找出vlax曲线函数的工作原理,
在本例中
 

(defun C:TEST (/ int pl pt)
(setq pl (car (entsel "\nSelect pline entity\n")))
(setq pt (vlax-curve-getPointAtDist pl 200))
   (vlax-ename->vla-object pl)
   (vlax-curve-getparamatpoint pl
   (vlax-curve-getclosestpointto pl pt))
      
)

 
-在200个距离单位处获取坐标A
-得到???
-得到???
 
很抱歉我不明白
 
请帮忙?

marko_ribar 发表于 2022-7-6 00:35:38


(defun C:TEST ( / pl pt par )
(princ (setq pl (car (entsel "\nSelect pline entity")))) ;; picking curve 'ename (pline belongs to curve family entities)
(princ (setq pt (vlax-curve-getPointAtDist pl 200))) ;; calculating point at dist 200 from start point of curve if curve is larger than 200 units, or calculating end point if curve is smaller than 200 units
;;(vlax-ename->vla-object pl);; - unnecessary line (vlax-curve-xxx) functions work with both 'ename and 'vla-object, but it's better to use 'ename because it's faster approach and with less typing
(princ (setq par (vlax-curve-getparamatpoint pl (vlax-curve-getclosestpointto pl pt)))) ;; calculating parameter value of point pt on curve and if point lies on curve it should be somewhere in between (vlax-curve-getstartparam pl) and (vlax-curve-getendparam pl) and if pt is previously calculated to be exactly end point of curve - curve is smaller than 200 units => par= (vlax-curve-getendparam pl)
(princ)
)

samifox 发表于 2022-7-6 00:57:09

为什么帮助将坐标称为点,将顶点称为参数?
页: [1]
查看完整版本: vlax曲线函数解释