马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;;;将一个字符串列表解析为1个具有分隔符的字符串
- ;;;==================================================================
- ;;; (xd-strunparse lst delimiter)
- ;;; 将一个字符串列表解析为1个具有分隔符的字符串
- ;;;------------------------------------------------------------------
- ;;; 参数:
- ;;; str 要连接的列表
- ;;; delimiter 使用的分隔符
- ;;;------------------------------------------------------------------
- ;;; 返回:
- ;;; 一个字符串。
- ;;; 示例:
- ;;; (setq a '("harp" "guiness" "black and tan"))
- ;;; (xd-strunparse a ",")
- ;;; 返回:
- ;;; "harp,guiness,black and tan"
- ;;;------------------------------------------------------------------
- (defun xd-string_unparse (lst delimiter / return)
- (setq return "")
- (foreach str lst
- (setq return (strcat return delimiter str))
- )
- (substr return 2)
- )
- ;;Author : eachy
- (defun xd-string_join (strlst div /)
- (vl-string-trim
- div
- (apply 'strcat (mapcar '(lambda (x) (strcat x div)) strlst))
- )
- )
- ;;应用示例
- (while (setq e0 (entsel "\n拾取删除图块<退出>: "))
- (if (and (setq el (entget (car e0)))
- (= (cdr (assoc 0 el)) "INSERT")
- (setq bn (cdr (setq b (assoc 2 el))))
- (not (member bn bln))
- )
- (progn
- (setq bln (cons bn bln))
- (redraw (car e0) 3)
- (xd-clearcset)
- (setq ss (ssget "X" (list '(0 . "INSERT") b)))
- (vla-highlight (xd-activesset) :vlax-true)
- (prompt (strcat "\n选中了""
- (setq sbln (String_Join
- (reverse bln)
- ","
- )
- )
- ""块!"
- )
- )
- )
- (princ "\n选择非图块, 重新选择!")
- )
- )
|