MSasu,
该代码可以工作,但有没有一种方法可以设置代码,这样我就不必手动选择它,我可以为该代码“选择上一个”吗,这就是我如何将其输入到我的代码中的方法:
-
- ;; Description: Place a HALO effect around selected multileader entities.
- ;;
- ;; Note: This works for AutoCAD shape files and not True Type Fonts.
- ;;
- ;;=============================================
- (defun c:halo ()
- (setq FLTR '( (-4 . "<OR")
- (0 . "MULTILEADER")
- (-4 . "OR>")
- )
- )
- (Princ "\nSelect Multileader to HALO (CAN NOT be a true type font)...")
- (princ "\nPress ENTER after selecting entities to process them...")
- (setq SS (ssget FLTR))
- (command "_.copy" ss "" "0,0" "0,0")
- (command "_.layer" "m" "halotext255" "c" "255" "" "lw" "2" "" "")
- (command "_.chprop" ss "" "_la" "halotext255" "p" "c" "bylayer" "")
- (if (setq ssetMLeaders (ssget "_:S" '((0 . "MULTILEADER"))))
- (progn
- (command "_EXPLODE" (ssname ssetMLeaders 0))
- (setq ssetItems (ssget "_P"))
- (repeat (setq index (sslength ssetItems))
- (setq assocItem (entget (ssname ssetItems (setq index (1- index)))))
- (if (/= (cdr (assoc 0 assocItem))
- "MTEXT")
- (entdel (cdr (assoc -1 assocItem)))
- )
- )
- )
- )
- ;(command "_.draworder" ss "" "a" "p")
- )
我认为我的代码和你的代码是两种不同的语言。当谈到lisps时,我仍然是noob,我的这段代码是类似的东西的修改版本。。。你能告诉我代码应该是什么样子吗?
有没有一个地方可以解释什么是“setq”以及所有括号的理由??我真的很想学习如何写Lisp程序。。。 |