lincctw_ccl 发表于 2011-10-14 13:27:20

请教如何求弧的起点及终点坐标?(已解決)

本帖最后由 lincctw_ccl 于 2011-10-17 08:47 编辑

各位好!!点选弧列出弧的组码,没有关于弧的起点及终点坐标请教该如何求得? 谢谢!!

byghbcx 发表于 2011-10-14 14:09:49

一种通过圆心、起始角、终止角、半径计算,
另一种通过vlax-curve-getStartPoint、vlax-curve-getEndPoint得到

ljpnb 发表于 2011-10-14 14:41:19

或者用vla-get-startpoint和vla-get-endpoint

gbhsu 发表于 2011-10-15 20:58:30

;取弧的( <起點> <中點> <終點>)
;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))

lincctw_ccl 发表于 2011-10-15 21:10:56

gbhsu 发表于 2011-10-15 20:58 static/image/common/back.gif
;取弧的(   )
;Date 2004-05-13
;make by BDYCAD



謝謝各位的幫忙!!

nxchenjk 发表于 2011-10-15 22:03:01

这个论谈里有的。肯定是你想要的。
页: [1]
查看完整版本: 请教如何求弧的起点及终点坐标?(已解決)