- (defun c:tt()
- (defun pickset_to_enamelist(pickset / ss sslst )
- (setq ss pickset sslst '())
- (while (setq n (ssname ss 0))
- (progn
- (setq sslst (append sslst (list n)))
- (ssdel n ss)
- )
- )
- sslst
- )
- (if (null num)
- (progn
- (setq num (getint "输入等分线段数量: "))
- )
- (progn
- (princ (strcat "上次数量:" (itoa num) " "))
- (setq s (getstring "使用上次数量请输入Y:"))
- (if (not (or
- (= (strcase s) "Y")
- (= (strcase s) " ")
- ))
- (setq num (getint "输入等分线段数量: "))
- )
- )
- )
- (if (null blackname)
- (progn
- (setq blackname (vlax-get-property (vlax-ename->vla-object (car(entsel "\n选择图块:")) )'Name))
- )
- (progn
- (princ (strcat "上次图块:" blackname " "))
- (setq s (getstring "使用上次图块请输入Y:"))
- (if (not (or
- (= (strcase s) "Y")
- (= (strcase s) " ")
- ))
- (setq blackname (vlax-get-property (car(entsel "\n选择图块:")) 'Name))
- )
- )
- )
- (princ "选择需要等分的线条:")
- (setq ss(pickset_to_enamelist (ssget '((0 . "*line")))))
- (if (and ss blackname num )
- (foreach s ss
- (progn
- (vl-cmdf "DIVIDE" s "b" blackname "y" num)
- )
- )
- )
- )
|