这是一个不适用于绿色的示例,但显示了混合颜色和真彩色以及整数和字符串的问题
- (defun c:HHatch (/ hcol pt1 clr)
- (initget 1 "Gray Blue greeN Yellow Red Magenta Orange")
- (if (and (setq hcol (getkword "\nEnter COLOR [Gray/Blue/greeN/Yellow/Red/Magenta/Orange]: "))
- (setq clr (nth (vl-position hcol '("Gray" "Blue" "greeN" "Yellow" "Red" "Magenta" "Orange")) '(252 5 "10,176,80" 3 2 1 200 30)))
- (setq pt1 (getpoint "\nSelect INTERNAL point: "))
- )
- (if (< (strlen clr) 4)
- (command "_-hatch" "Properties" "_Solid" "_COLOR" clr "" pt1 "")
- (command "_-hatch" "Properties" "_Solid" "_COLOR" "T" clr "" pt1 "")
- )
- )
- (princ)
- )
几乎没时间了需要这样做
- (defun c:HHatch (/ hcol pt1 clr)
- (initget 1 "Gray Blue greeN Yellow Red Magenta Orange")
- (if (and (setq hcol (getkword "\nEnter COLOR [Gray/Blue/greeN/Yellow/Red/Magenta/Orange]: "))
- (setq clr (nth (vl-position hcol '("Gray" "Blue" "greeN" "Yellow" "Red" "Magenta" "Orange")) '("252" "5" "10,176,80" "3" "2" "1" "200" "30")))
- (setq pt1 (getpoint "\nSelect INTERNAL point: "))
- )
- (if (< (strlen clr) 4)
- (progn
- (setq clri (atoi clr))
- (command "_-hatch" "Properties" "_Solid" "_COLOR" clri "" pt1 "")
- )
- (command "_-hatch" "Properties" "_Solid" "_COLOR" "T" clr "" pt1 "")
- )
- )
- (princ)
- )
|