如何调用另一个已加载的程序
程序的作用是想分图层执行那个提取填充边界线的vlx程序,vlx程序命令为“hatch-pl”,但不知道如何调用,也查到了vlax-add-cmd命令,没搞明白。(defun TABLE (S / D R)
(while (setq D (tblnext S (null D)))
(setq R (cons (cdr (assoc 2 D)) R))
)
)
(defun cjpl () (c:hatch-pl) (princ))
(vlax-add-cmd "cjpl" 'cjpl)
(defun C:TT (/ LST N PT)
(setq LST (reverse (TABLE "LAYER")))
(foreach NAME LST
(progn
(entmake (list
'(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
'(6 . "continuous") ;线型
(CONS 62 1) ;颜色
'(70 . 0) ;图层状态
(CONS 2 (strcat "tpl-" NAME)) ;图层名
)
)
(setvar "clayer" (strcat "tpl-" NAME))
(setq mm (ssget "X" (list (cons 8 NAME) (cons 0 "HATCH"))))
;这儿添加调用hatch-pl的命令,对mm选区执行
)
)
(princ)
)
(vlax-add-cmd "hatch-pl" 'c:hatch-pl)
(command "hatch-pl" mm)
页:
[1]