zhouyxcs 发表于 2004-8-19 10:00:00

[LISP]

怎样用LISP来限制某些CAD功能?例如:设置好字体、标注式样、图层和线型后不容许再设置其他的字体、标注式样、图层和线型。

alin 发表于 2004-8-19 10:39:00

Attach DWS file to your drawing. Here is a sample from Internet:;;;Michael Puckett
(defun cdrs (key lst / pair rtn)
(while (setq pair (assoc key lst))
(setq rtn (cons (cdr pair) rtn)
lst (cdr (member pair lst))))
(reverse rtn));;;R. Robert Bell
(defun AddDWS (FileN / DictN eDict XRInt)
(setq DictN "AcStStandard"
eDict (cond ((cdr (assoc -1 (dictsearch (namedobjdict) DictN))))
((dictadd (namedobjdict)
DictN
(entmakex '((0 . "DICTIONARY") (100 .
"AcDbDictionary")))))))
(if (setq XRInt (cdrs 3 (entget eDict)))
(setq XRInt (1+ (apply 'max (mapcar 'atoi XRInt))))
(setq XRInt 0))
(dictadd eDict
(itoa XRInt)
(entmakex
(list '(0 . "XRECORD") '(100 . "AcDbXrecord") (cons 1 FileN)))));;Usage: (AddDWS "c:\\program files\\AutoCAD 2004\\Sample\\MKMStd.dws")
页: [1]
查看完整版本: [LISP]