我正在使用ACAD 2013。我不熟悉使用lsp文件。有没有可能结合我经常运行的3个lsp例程来为不同的软件程序准备文件?是否可以使用组合lsp例程批处理文件夹中的多个文件?是否可以修改第一个代码以自动打开新文件?
- ;changes layout to model space, appends filename, option to open new file
- (defun c:L2M ( / BASE LST OLD_DIA)
- (setq old_dia (getvar 'FILEDIA)
- base (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)))
- )
- (setvar 'FILEDIA 1)
- (setq lst (layoutlist))
- (foreach l lst
- (command "_.ctab"
- l
- "exportlayout"
- (strcat base "-" l)
- )
- )
- (setvar 'FILEDIA old_dia)
- (princ)
- )
- ;Sets linework to by layer, layers to color 7 white, detaches external references
- (defun c:set7 ()
- (setq uecho (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (command "setbylayer" "al" "" "n" "y")
- (command "-layer" "c" "7" "*")
- (command "-xref" "d" "*")
- (setvar "cmdecho" uecho)
- (princ)
- )
- ;Justify text
- (defun c:BL (justify title / ss)
- (princ (strcat "\nSelect *Text to " title " justify: "))
- (if (setq ss (ssget "_:L" '((0 . "ATTDEF,MTEXT,TEXT"))))
- (command "_.justifytext" ss "" justify)
- )
- (princ)
- )
- (defun c:JL (/) (_justifyIt "_ML" "Middle Left"))
- (defun c:JC (/) (_justifyIt "_MC" "Middle Center"))
- (defun c:JR (/) (_justifyIt "_MR" "Middle Right"))
- (defun c:BL (/) (_justifyIt "_BL" "Bottom Left"))
- (defun c:BC (/) (_justifyIt "_BC" "Bottom Center"))
- (defun c:BR (/) (_justifyIt "_BR" "Bottom Right"))
- (defun c:TL (/) (_justifyIt "_TL" "Top Left"))
- (defun c:TC (/) (_justifyIt "_TC" "Top Center"))
- (defun c:TR (/) (_justifyIt "_TR" "Top Right"))
我不知道代码作者是谁。 |