(defun Settle (verlst / ret pre i)<BR> ;如果起点终点坐标相同,从坐标表中除去起点<BR> (if (vl-every '= (car verlst) (car (reverse verlst)))<BR> (setq verlst (cadr verlst))<BR> );if<BR> ;除去重复的结点<BR> (setq ret (list (nth 0 verlst))<BR> pre (nth 0 verlst)<BR> i 1)<BR> (while (setq cur (nth i verlst))<BR> (if (not (vl-every '= cur pre))<BR> (setq ret (append ret (list cur)))<BR> );if<BR> ;<BR> (setq i (+ i 1)<BR> pre cur)<BR> );while<BR> ret<BR>)
;返回集合对象中所有成员名称表<BR>(defun ListCollectionMemberNames(collection / itemname out)<BR> (setq out '())<BR> (vlax-for each collection<BR> (if (vlax-property-available-p each 'Name)<BR> (progn<BR> (setq itemname (vlax-get-property each 'Name)<BR> out (cons itemname out)<BR> )<BR> )<BR> )<BR> )<BR> (reverse out)<BR>)
;角度转换<BR>(defun DTR (a) (* pi (/ a 180.0)) )<BR>(defun RTD (a) (/ (* a 180.0) pi) )