快速填充的多选问题
本帖最后由 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)
)
(defun c:tt5 ()
(command "-color" "8")
(setq t T)
(while t
(if
(setq pt (getpoint"\n请拾取填充内部点:(***跳过则为选择填充区域填充)"))
(command "-bhatch" "O" "D" "L" "Y" pt "")
(progn
(princ "\n快捷填充,请选择填充区域")
(setq ss (ssget '((0 . "POLYLINE,LWPOLYLINE,CIRCLE,ELLIPSE"))))
(setq i -1)
(setq num (sslength ss))
(repeat num
(setq entnam (ssname ss (setq i (1+ i))))
(command "-bhatch" "O" "D" "L" "Y" "s" entnam "" "")
)
)
)
)
(princ)
) start4444 发表于 2019-3-22 10:02
(defun c:tt5 ()
(command "-color" "8")
(setq t T)
(setq t T)
(while t
这两句是什么意思?
修改了一下,搞定,谢谢!
(defun c:hh ()
(setvar "cmdecho" 0)
(command "undo" "be")
(command "-color" "8")
(if
(setq pt (getpoint"\n请拾取填充内部点:\(***跳过则为选择填充区域填充\)"))
(command "-bhatch" "O" "D" "L" "Y" pt "")
(progn
(princ "\n快捷填充,请选择填充区域")
(setq ss (ssget '((0 . "POLYLINE,LWPOLYLINE,CIRCLE,ELLIPSE"))))
(setq i -1)
(setq num (sslength ss))
(repeat num
(setq entnam (ssname ss (setq i (1+ i))))
(command "-bhatch" "O" "D" "L" "Y" "s" entnam "" "")
)
)
)
(command "undo" "e")
(princ)
)
hh: (if
(princ "\n请拾取填充内部点:(***跳过则为选择填充区域填充)")
(setq pt (getpoint))
(command "-bhatch" "O" "D" "L" "Y" pt "")
条件怎么这么多. alexmai 发表于 2019-3-22 10:27
(setq t T)
(while t
你自己对比一下就知道了,有的话可以循环选择,看需求 start4444 发表于 2019-3-22 12:01
你自己对比一下就知道了,有的话可以循环选择,看需求
很棒,就是如果不点也不选择退不出循环,怎么加上退出设置呢 试下效果!!!很好! 本帖最后由 lee50310 于 2024-8-11 09:09 编辑
muai2010 发表于 2024-8-9 22:26
很棒,就是如果不点也不选择退不出循环,怎么加上退出设置呢
;;按Q键 ==> 离开
;;左击鼠==> 填满内部点
;;按enter键,SPACE键或右击鼠==> 选择填充区域
執行指令:tt6
lee50310 发表于 2024-8-10 14:17
;;按Q键 ==> 离开
;;左击鼠==> 填满内部点
;;按enter键,SPACE键或右击鼠==> 选择填充区域
感谢解答,好像有点问题 本帖最后由 lee50310 于 2024-8-10 23:56 编辑
muai2010 发碛� 2024-8-10 21:57
感谢解答,好像有点问题
填充要有封閉的物體,
你要畫一些矩型框 或 圓型框 在執行tt6程式 點選他門
页:
[1]
2