- 积分
- 6639
- 明经币
- 个
- 注册时间
- 2010-4-10
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 alexmai 于 2019-3-22 00:35 编辑
--------------------------------------------------------------------------------------------
明经找到这个资料,但都不是我想要的,我想设置“点选”为第一步,而不是“选择”为第一步
(defun C:kh (/ s1) ;快速选择对象,填充图案
(setvar "cmdecho" 0)
(setvar "hpassoc" 1) ;控制填充图案是否关联(1:是;0:否)
(princ "\n快捷填充,请选择填充区域:(***跳过则为拾取内部点填充)")
(if (setq s1 (ssget))
(command "bhatch" "s" s1 "" "")
(progn
(princ "\n请拾取填充内部点:")
(command "bhatch" pause)
);progn
);if
(princ)
);defun
(defun C:H1 (/ s1 s2)
(setvar "cmdecho" 0)
(setvar "OSMODE" 0)
(setvar "MEASUREINIT" 1)
(setvar "MEASUREMENT" 1)
(setvar "hpassoc" 1) ;控制填充图案是否关联(1:是;0:否)
(princ
"\n快捷填充,请选择填充区域:(***跳过则为拾取内部点填充)"
)
(if (setq s1 (ssget))
(command "layer" "m" "G-SLAB-HATCH(板填充)"
"c" "11" "" "lw"
"0.13" "" "l" "Continuous"
"" "" "_.bhatch" "p"
"ANGLE,_o" "40" "45" "s"
s1 "" ""
)
(progn
(princ "\n请拾取填充内部点:")
(IF (vl-cmdf "layer" "m" "G-SLAB-HATCH(板填充)"
"c" "11" "" "lw"
"0.13" "" "l" "Continuous"
"" ""
"_.bhatch" (getpoint) "p" "ANGLE,_o" "40" "45" "")
(princ "\n请选择填充...")
)
)
)
(princ)
)
--------------------------------------------------------------------------------------------
为了方便填充,特此写了这个快捷填充,快捷填充我上次设置好的内容,
但发觉不怎么好用,不知问题出现哪里?
另外,我想多选时填充为各自独立的填充,
而不是组合为一个整体填充,如何调整?
(defun c:hh ()
(setvar "cmdecho" 0)
(command "undo" "be")
(command "-color" "8")
(if
(princ "\n请拾取填充内部点:(***跳过则为选择填充区域填充)")
(setq pt (getpoint))
(command "-bhatch" "O" "D" "L" "Y" pt "")
(progn
(princ "\n快捷填充,请选择填充区域")
(setq ss (ssget '((0 . "POLYLINE,LWPOLYLINE,CIRCLE,ELLIPSE"))))
(vl-load-com)
(setq i 0 )
(setq num (sslength ss))
(repeat num
(setq entnam (ssname ss i))
(command "-bhatch" "O" "D" "L" "Y" "s" ss "" "")
)
)
(setq i (1+ i))
)
)
(command "undo" "e")
(princ)
)
|
|