AutoLISP选择集操作

AutoLISP选择集操作,根据选择集中图元的类型,进行不同的操作,代码如下。

(defun c:ssope ()
    (setq ss (ssget))
    (setq i 0)
    (repeat (sslength ss)
    (setq typ (cdr (assoc 0 (entget (ssname ss i)))))
    (cond
        ((= typ "LINE")
         (print "line");操作代码
        )
        ((= typ "ARC")
         (print "arc");操作代码
        )
        ((= typ "CIRCLE")
         (print "circle");操作代码
        )
    )
    (setq i (1+ i))
    )
    (princ)
)

代码完。

作者:codee
文章千古事,得失寸心知。


原文地址:https://www.cnblogs.com/bimgoo/p/2503028.html