下面的提供的命令,是一个填充的刷子,里面有BHATCH的可选参数的用法
 - ;;;===================================================================================
- ;;;Hatch - Matches existing hatch and allows user to pick new object
- ;;;===================================================================================
- (defun c:mh (/ ocol olay col ent lay hat sca rot po)
- (setq ocol (getvar "cecolor"))
- (setq olay (getvar "clayer"))
- (setq oosn (getvar "osmode"))
- (setvar "osmode" 0)
- (if (setq ent (entsel "\nSelect a hatch pattern to copy."))
- (progn
- (setq ent (entget (car ent)))
- (if (= (cdr (assoc 0 ent)) "HATCH")
- (progn
- (setq lay (cdr (assoc 8 ent)))
- (setq hat (cdr (assoc 2 ent)))
- (setq sca (cdr (assoc 41 ent)))
- (setq rot (cdr (assoc 52 ent)))
- (setq rot (* rot (/ 180 pi)))
- (setq col (cdr (assoc 62 ent))) ; may return nil
- (cond
- ((or
- (= col "BYLAYER")
- (= col "BYBLOCK")
- )
- (setvar "cecolor" col)
- )
- ((= (type col) 'int)
- (setvar "cecolor" (itoa col))
- )
- )
- (command "layer" "s" lay "")
- (initget "s") ; this allows numbers to be entered
- (setq po (getpoint "\nSelect Internal Point or (S)elect Objects:"))
- (if (= (type po) 'list)
- (command "-bhatch" po "p" hat sca rot "") ;;PO是点的情况下,BHATCH用法
- (if (setq po (ssget)) ; allow one choice only
- (command "-bhatch" "s" po "" "p" hat sca rot "");;PO是选择集的情况下,BHATCH用法
- (prompt "\nNothing selected.")
- )
- )
- )
- (prompt "\nSelection was not a hatch.")
- )
- )
- (prompt "\nNothing selected.")
- )
- (setvar "clayer" olay)
- (setvar "cecolor" ocol)
- (setvar "osmode" oosn)
- (princ)
- )
|