请教如何求弧的起点及终点坐标?(已解決)
本帖最后由 lincctw_ccl 于 2011-10-17 08:47 编辑各位好!!点选弧列出弧的组码,没有关于弧的起点及终点坐标请教该如何求得? 谢谢!!
一种通过圆心、起始角、终止角、半径计算,
另一种通过vlax-curve-getStartPoint、vlax-curve-getEndPoint得到 或者用vla-get-startpoint和vla-get-endpoint ;取弧的( <起點> <中點> <終點>)
;Date 2004-05-13
;make by BDYCAD
;Example
; (SETQ POI (arc_3point (CAR(ENTSEL))))
;------((31.6306 -54.6392 0.0) (-40.8092 -61.668 0.0) (-6.44924 -38.985 0.0))
(defun arc_3point (a / cenp radius STP ENPmp arcmidpoint)
(setq cenp (cdr (assoc 10 (entget a))))
(setq radius (cdr (assoc 40 (entget a))))
(setq STP (vlax-curve-getPointAtParam A (vlax-curve-getstartparam A)))
(setq ENP (vlax-curve-getPointAtParam A (vlax-curve-getEndParam A)))
(setqarcmidpoint (polar (polar stp (angle stp enp) (/ (distance STP ENP) 2.0))
(angle cenp (polar stp (angle stp enp) (/ (distance STP ENP) 2.0)))
(- radius (distance (polar stp (angle stp enp) (/ (distance STP ENP) 2.0)) cenp))))
(list stp enp arcmidpoint)
)
;;;功能
;;;取弧的( <起點> <中點> <終點>)
;;;语法
;;;(arc_3point (CAR(ENTSEL)))
;;;返回值
;;;( <起點> <中點> <終點>)
;;;样例
; (SETQ POI (arc_3point (CAR(ENTSEL))))
;------((31.6306 -54.6392 0.0) (-40.8092 -61.668 0.0) (-6.44924 -38.985 0.0))
gbhsu 发表于 2011-10-15 20:58 static/image/common/back.gif
;取弧的( )
;Date 2004-05-13
;make by BDYCAD
謝謝各位的幫忙!!
这个论谈里有的。肯定是你想要的。
页:
[1]