所以我创建了一个lisp来分解多行文字,然后在分解之前将其对齐到之前的对齐方式。
它工作得很好,运行时间也不长,但我只是想知道是否有更好的方法来编写它。这对我来说似乎很笨拙,我相信有比我的新手尝试更好的方法。
- (defun c:XtoJ()
- (setq UserQA (getvar "QAFLAGS"))
- (setvar "QAFLAGS" 1)
- (setq topleft (ssget "_X" '((0 . "MTEXT")(71 . 1)))) ;Select TopLeft MTEXT
- (command "._explode" topleft "") ;Explode TopLeft MTEXT
- (setq middleleft (ssget "_X" '((0 . "MTEXT")(71 . 4)))) ;Select MiddleLeft MTEXT
- (command "._explode" middleleft "") ;Explode MiddleLeft MTEXT
- (setq bottomleft (ssget "_X" '((0 . "MTEXT")(71 . 7)))) ;Select BottomLeft MTEXT
- (command "._explode" bottomleft "") ;Explode BottomLeft MTEXT
- (setq lefttext (ssget "_X" '((0 . "TEXT")(72 . 0)))) ;Select All Left Justified TEXT
- (setq topright (ssget "_X" '((0 . "MTEXT")(71 . 3)))) ;TopRight Start
- (command "._explode" topright "") ;TopRight Explode
- (setq topright (ssget "_X" '((0 . "TEXT")(72 . 0))))
- (command "justifytext" topright "" "R") ;TopRight End
- (command "justifytext" lefttext "" "L") ;Fix LeftText
- (setq middleright (ssget "_X" '((0 . "MTEXT")(71 . 6)))) ;MiddleRight Start
- (command "._explode" middleright "") ;MiddleRight Explode
- (setq middleright (ssget "_X" '((0 . "TEXT")(72 . 0))))
- (command "justifytext" middleright "" "R") ;MiddleRight End
- (command "justifytext" lefttext "" "L") ;Fix LeftText
- (setq bottomright (ssget "_X" '((0 . "MTEXT")(71 . 9)))) ;BottomRight Start
- (command "._explode" bottomright "") ;BottomRight Explode
- (setq bottomright (ssget "_X" '((0 . "TEXT")(72 . 0))))
- (command "justifytext" bottomright "" "R") ;BottomRight End
- (command "justifytext" lefttext "" "L") ;Fix LeftText
- (setq topcenter (ssget "_X" '((0 . "MTEXT")(71 . 2)))) ;TopCenter Start
- (command "._explode" topcenter "") ;TopCenter Explode
- (setq topcenter (ssget "_X" '((0 . "TEXT")(72 . 0))))
- (command "justifytext" topcenter "" "C") ;TopCenter End
- (command "justifytext" lefttext "" "L") ;Fix LeftText
- (setq middlecenter (ssget "_X" '((0 . "MTEXT")(71 . 5)))) ;MiddleCenter Start
- (command "._explode" middlecenter "") ;MiddleCenter Explode
- (setq middlecenter (ssget "_X" '((0 . "TEXT")(72 . 0))))
- (command "justifytext" middlecenter "" "C") ;MiddleCenter End
- (command "justifytext" lefttext "" "L") ;Fix LeftText
- (setq bottomcenter (ssget "_X" '((0 . "MTEXT")(71 . ))) ;BottomCenter Start
- (command "._explode" bottomcenter "") ;BottomCenter Explode
- (setq bottomcenter (ssget "_X" '((0 . "TEXT")(72 . 0))))
- (command "justifytext" bottomcenter "" "C") ;BottomCenter End
- (command "justifytext" lefttext "" "L") ;Fix LeftText
- (setvar "QAFLAGS" UserQA)
- )
|