AutoLISP查询圆弧的相关属性
2011-04-11 16:59 精诚所至 金石为开 阅读(544) 评论(0) 编辑 收藏 举报AutoLISP查询圆弧的相关属性,得到圆心、半径、长度和面积,代码如下。
(defun c:arcppt ()
(setq ss (car (entsel "\n请选择所要查询的圆弧:")))
(setq ssob (vlax-ename->vla-object ss))
(Setq center (Vlax-Get ssob 'center))
(setq radius (vlax-get ssob 'radius))
(Setq len (Vlax-Get ssob 'ArcLength))
(Setq area (Vlax-Get ssob 'area))
(print (strcat "圆心:" (rtos (car center)) "," (rtos (cadr center))))
(print (strcat "半径:" (rtos radius)))
(print (strcat "长度:" (rtos len)))
(print (strcat "面积:" (rtos area)))
(princ)
)
代码完。
![](https://img2024.cnblogs.com/blog/35695/202403/35695-20240328092537879-1189167464.jpg)